aboutsummaryrefslogtreecommitdiff
path: root/include/linux/usb
diff options
context:
space:
mode:
authorJean-Jacques Hiblot <jjhiblot@ti.com>2018-11-29 10:52:43 +0100
committerMarek Vasut <marex@denx.de>2018-12-07 16:31:45 +0100
commitff8d75583487eb69bcb6f036088d979c76db3753 (patch)
tree942df5b32b69a83c7b297b6eb372c1fbbec328c9 /include/linux/usb
parent687ab54560809e01a10652ef82dbac6ae72deb91 (diff)
downloadu-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 'include/linux/usb')
-rw-r--r--include/linux/usb/gadget.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h
index 40ca2d3..497798a 100644
--- a/include/linux/usb/gadget.h
+++ b/include/linux/usb/gadget.h
@@ -927,6 +927,12 @@ extern void usb_ep_autoconfig_reset(struct usb_gadget *);
extern int usb_gadget_handle_interrupts(int index);
+#if CONFIG_IS_ENABLED(DM_USB_GADGET)
+int usb_gadget_initialize(int index);
+int usb_gadget_release(int index);
+int dm_usb_gadget_handle_interrupts(struct udevice *dev);
+#else
+#include <usb.h>
static inline int usb_gadget_initialize(int index)
{
return board_usb_init(index, USB_INIT_DEVICE);
@@ -936,4 +942,6 @@ static inline int usb_gadget_release(int index)
{
return board_usb_cleanup(index, USB_INIT_DEVICE);
}
+#endif
+
#endif /* __LINUX_USB_GADGET_H */