return dm_scan_fdt_dev(dev);
}
+static int dwc3_meson_gxl_child_pre_probe(struct udevice *dev)
+{
+ if (ofnode_device_is_compatible(dev_ofnode(dev), "amlogic,meson-g12a-usb"))
+ return dwc3_meson_gxl_force_mode(dev->parent, USB_DR_MODE_PERIPHERAL);
+
+ return 0;
+}
+
+static int dwc3_meson_gxl_child_post_remove(struct udevice *dev)
+{
+ if (ofnode_device_is_compatible(dev_ofnode(dev), "amlogic,meson-g12a-usb"))
+ return dwc3_meson_gxl_force_mode(dev->parent, USB_DR_MODE_HOST);
+
+ return 0;
+}
+
static const struct udevice_id dwc3_meson_gxl_ids[] = {
{ .compatible = "amlogic,meson-axg-usb-ctrl" },
{ .compatible = "amlogic,meson-gxl-usb-ctrl" },
.of_match = dwc3_meson_gxl_ids,
.probe = dwc3_meson_gxl_probe,
.remove = dwc3_meson_gxl_remove,
+ .child_pre_probe = dwc3_meson_gxl_child_pre_probe,
+ .child_post_remove = dwc3_meson_gxl_child_post_remove,
.plat_auto = sizeof(struct dwc3_meson_gxl),
};