diff options
author | Jean-Jacques Hiblot <jjhiblot@ti.com> | 2018-11-29 10:52:41 +0100 |
---|---|---|
committer | Marek Vasut <marex@denx.de> | 2018-12-07 16:31:45 +0100 |
commit | a06955ae1ef2a942f18025d4fefceea2c638a76f (patch) | |
tree | 2796cd005202d59118724ce82b10f348b52e9654 /include | |
parent | 57dbc151437b36cc1105857d222df28b095236d7 (diff) |
usb: gadget: Do not call board_usb_xxx() directly in USB gadget drivers
Add 2 functions to wrap the calls to board_usb_init() and
board_usb_cleanup().
This is a preparatory work for DM support for UDC drivers (DM_USB_GADGET).
Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Reviewed-by: Lukasz Majewski <lukma@denx.de>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/usb/gadget.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h index b824f13477..40ca2d3468 100644 --- a/include/linux/usb/gadget.h +++ b/include/linux/usb/gadget.h @@ -19,6 +19,7 @@ #define __LINUX_USB_GADGET_H #include <errno.h> +#include <usb.h> #include <linux/compat.h> #include <linux/list.h> @@ -926,4 +927,13 @@ extern void usb_ep_autoconfig_reset(struct usb_gadget *); extern int usb_gadget_handle_interrupts(int index); +static inline int usb_gadget_initialize(int index) +{ + return board_usb_init(index, USB_INIT_DEVICE); +} + +static inline int usb_gadget_release(int index) +{ + return board_usb_cleanup(index, USB_INIT_DEVICE); +} #endif /* __LINUX_USB_GADGET_H */ |