diff options
author | Simon Glass <sjg@chromium.org> | 2015-03-25 12:22:32 -0600 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2015-04-18 11:11:25 -0600 |
commit | fbeceb260232ae9f102af11e6cb2f3743ecc9b9a (patch) | |
tree | 1d838221dbd3a7a82833d2748ca379430905cf39 /drivers/usb/gadget | |
parent | 449230f0318da3f3c27aea1753097a8165da6fdb (diff) | |
download | u-boot-imx-fbeceb260232ae9f102af11e6cb2f3743ecc9b9a.zip u-boot-imx-fbeceb260232ae9f102af11e6cb2f3743ecc9b9a.tar.gz u-boot-imx-fbeceb260232ae9f102af11e6cb2f3743ecc9b9a.tar.bz2 |
dm: usb: Allow setting up a USB controller as a device/gadget
Some controllers support OTG (on-the-go) where they can operate as either
host or device. The gadget layer in U-Boot supports this.
While this layer does not interact with driver model, we can provide a
function which sets up the controller in the correct way. This way the code
at least builds (although it likely will not work).
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Marek Vasut <marex@denx.de>
Diffstat (limited to 'drivers/usb/gadget')
-rw-r--r-- | drivers/usb/gadget/ci_udc.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/usb/gadget/ci_udc.c b/drivers/usb/gadget/ci_udc.c index 3b7024c..22d288c 100644 --- a/drivers/usb/gadget/ci_udc.c +++ b/drivers/usb/gadget/ci_udc.c @@ -883,7 +883,11 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver) if (driver->speed != USB_SPEED_FULL && driver->speed != USB_SPEED_HIGH) return -EINVAL; +#ifdef CONFIG_DM_USB + ret = usb_setup_ehci_gadget(&controller.ctrl); +#else ret = usb_lowlevel_init(0, USB_INIT_DEVICE, (void **)&controller.ctrl); +#endif if (ret) return ret; |