On 1/27/26 12:03 PM, Markus Schneider-Pargmann (TI.com) wrote:

[...]

+static int ti_musb_host_bind(struct udevice *dev)
+{
+       enum usb_dr_mode dr_mode = usb_get_dr_mode(dev_ofnode(dev));
+
+       if (dr_mode != USB_DR_MODE_HOST && dr_mode != USB_DR_MODE_OTG)
+               return -ENODEV;
+
+       return 0;
+}

[...]

  #if CONFIG_IS_ENABLED(OF_CONTROL)
+static int ti_musb_peripheral_bind(struct udevice *dev)
+{
+       enum usb_dr_mode dr_mode = usb_get_dr_mode(dev_ofnode(dev));
+
+       if (dr_mode != USB_DR_MODE_PERIPHERAL)
+               return -ENODEV;
How do you handle USB_DR_MODE_UNKNOWN , host or peripheral ?

Reply via email to