diff options
author | Jean-Jacques Hiblot <jjhiblot@ti.com> | 2018-11-29 10:52:43 +0100 |
---|---|---|
committer | Marek Vasut <marex@denx.de> | 2018-12-07 16:31:45 +0100 |
commit | ff8d75583487eb69bcb6f036088d979c76db3753 (patch) | |
tree | 942df5b32b69a83c7b297b6eb372c1fbbec328c9 /drivers/usb/dwc3 | |
parent | 687ab54560809e01a10652ef82dbac6ae72deb91 (diff) | |
download | u-boot-ff8d75583487eb69bcb6f036088d979c76db3753.zip u-boot-ff8d75583487eb69bcb6f036088d979c76db3753.tar.gz u-boot-ff8d75583487eb69bcb6f036088d979c76db3753.tar.bz2 |
usb: udc: implement DM versions of usb_gadget_initialize()/_release()/_handle_interrupt()
When DM_USB_GADGET the platform code for the USB device must be replaced by
calls to a USB device driver.
usb_gadget_initialize() probes the USB device driver.
usb_gadget_release() removes the USB device driver.
Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Reviewed-by: Lukasz Majewski <lukma@denx.de>
Diffstat (limited to 'drivers/usb/dwc3')
-rw-r--r-- | drivers/usb/dwc3/dwc3-generic.c | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/drivers/usb/dwc3/dwc3-generic.c b/drivers/usb/dwc3/dwc3-generic.c index ad3a116..47cc140 100644 --- a/drivers/usb/dwc3/dwc3-generic.c +++ b/drivers/usb/dwc3/dwc3-generic.c @@ -22,19 +22,9 @@ #include "linux-compat.h" #if CONFIG_IS_ENABLED(DM_USB_GADGET) -int usb_gadget_handle_interrupts(int index) +int dm_usb_gadget_handle_interrupts(struct udevice *dev) { - struct dwc3 *priv; - struct udevice *dev; - int ret; - - ret = uclass_first_device(UCLASS_USB_DEV_GENERIC, &dev); - if (!dev || ret) { - pr_err("No USB device found\n"); - return -ENODEV; - } - - priv = dev_get_priv(dev); + struct dwc3 *priv = dev_get_priv(dev); dwc3_gadget_uboot_handle_interrupt(priv); |