2 * MISC driver for TI MUSB Glue.
5 * Texas Instruments Incorporated, <www.ti.com>
7 * SPDX-License-Identifier: GPL-2.0+
13 #include <linux/usb/otg.h>
14 #include <dm/device-internal.h>
17 DECLARE_GLOBAL_DATA_PTR;
21 static int ti_musb_wrapper_bind(struct udevice *parent)
23 const void *fdt = gd->fdt_blob;
27 for (node = fdt_first_subnode(fdt, parent->of_offset); node > 0;
28 node = fdt_next_subnode(fdt, node)) {
30 const char *name = fdt_get_name(fdt, node, NULL);
31 enum usb_dr_mode dr_mode;
34 if (strncmp(name, "usb@", 4))
37 dr_mode = usb_get_dr_mode(node);
39 case USB_DR_MODE_PERIPHERAL:
40 /* Bind MUSB device */
42 case USB_DR_MODE_HOST:
52 static const struct udevice_id ti_musb_ids[] = {
53 { .compatible = "ti,am33xx-usb" },
57 U_BOOT_DRIVER(ti_musb_wrapper) = {
58 .name = "ti-musb-wrapper",
60 .of_match = ti_musb_ids,
61 .bind = ti_musb_wrapper_bind,
64 #endif /* CONFIG_DM_USB */