diff options
author | Marek Vasut | 2023-09-01 11:49:47 +0200 |
---|---|---|
committer | Marek Vasut | 2023-09-15 23:38:01 +0200 |
commit | a1fa8bbb90f4ee6da98bd14542a5170998c00444 (patch) | |
tree | 37057e9a55f7b28a0c12b36921e15efed1e038c3 /include/linux | |
parent | 2fe4b54556ea6271237b35de68dc458bfceab94c (diff) |
dm: usb: udc: Factor out plain udevice handler functions
Pull the functionality of UDC uclass that operates on plain udevice
and does not use this dev_array array into separate functions and
expose those functions, so that as much code as possible can be
switched over to these functions and the dev_array can be dropped.
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Signed-off-by: Marek Vasut <marex@denx.de>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/usb/gadget.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h index b3f4b8d134c..3ef41e89fef 100644 --- a/include/linux/usb/gadget.h +++ b/include/linux/usb/gadget.h @@ -970,6 +970,23 @@ extern void usb_ep_autoconfig_reset(struct usb_gadget *); extern int usb_gadget_handle_interrupts(int index); +/** + * udc_device_get_by_index() - Get UDC udevice by index + * @index: UDC device index + * @udev: UDC udevice matching the index (if found) + * + * Return: 0 if Ok, -ve on error + */ +int udc_device_get_by_index(int index, struct udevice **udev); + +/** + * udc_device_put() - Put UDC udevice + * @udev: UDC udevice + * + * Return: 0 if Ok, -ve on error + */ +int udc_device_put(struct udevice *udev); + #if CONFIG_IS_ENABLED(DM_USB_GADGET) int usb_gadget_initialize(int index); int usb_gadget_release(int index); |