From ff8d75583487eb69bcb6f036088d979c76db3753 Mon Sep 17 00:00:00 2001 From: Jean-Jacques Hiblot Date: Thu, 29 Nov 2018 10:52:43 +0100 Subject: 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 Reviewed-by: Lukasz Majewski --- include/linux/usb/gadget.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'include/linux') diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h index 40ca2d3468..497798a32a 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 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 */ -- cgit