summaryrefslogtreecommitdiff
path: root/drivers/usb/gadget/udc/udc-core.c
diff options
context:
space:
mode:
authorJean-Jacques Hiblot <jjhiblot@ti.com>2018-11-29 10:52:46 +0100
committerMarek Vasut <marex@denx.de>2018-12-07 16:31:45 +0100
commit0131162439508801b9f8a330fa731f04273c9337 (patch)
tree5d94343d01e2ce401774516cd7783d527f4b5941 /drivers/usb/gadget/udc/udc-core.c
parentd648a50c0a27452a5439e7982b23b97c64820430 (diff)
dm: usb: create a new UCLASS ID for USB gadget devices
UCLASS_USB_DEV_GENERIC was meant for USB devices connected to host controllers, not gadget devices. Adding a new UCLASS for gadget devices alone. Also move the generic DM code for USB gadgets in a separate file for clarity. Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Diffstat (limited to 'drivers/usb/gadget/udc/udc-core.c')
-rw-r--r--drivers/usb/gadget/udc/udc-core.c41
1 files changed, 0 insertions, 41 deletions
diff --git a/drivers/usb/gadget/udc/udc-core.c b/drivers/usb/gadget/udc/udc-core.c
index 34bea27ad8..62b47781dd 100644
--- a/drivers/usb/gadget/udc/udc-core.c
+++ b/drivers/usb/gadget/udc/udc-core.c
@@ -352,44 +352,3 @@ EXPORT_SYMBOL_GPL(usb_gadget_unregister_driver);
MODULE_DESCRIPTION("UDC Framework");
MODULE_AUTHOR("Felipe Balbi <balbi@ti.com>");
MODULE_LICENSE("GPL v2");
-
-#if CONFIG_IS_ENABLED(DM_USB_GADGET)
-#define MAX_UDC_DEVICES 4
-static struct udevice *dev_array[MAX_UDC_DEVICES];
-int usb_gadget_initialize(int index)
-{
- int ret;
- struct udevice *dev = NULL;
-
- if (index < 0 || index >= ARRAY_SIZE(dev_array))
- return -EINVAL;
- if (dev_array[index])
- return 0;
- ret = uclass_get_device(UCLASS_USB_DEV_GENERIC, index, &dev);
- if (!dev || ret) {
- pr_err("No USB device found\n");
- return -ENODEV;
- }
- dev_array[index] = dev;
- return 0;
-}
-
-int usb_gadget_release(int index)
-{
- int ret;
-
- if (index < 0 || index >= ARRAY_SIZE(dev_array))
- return -EINVAL;
- ret = device_remove(dev_array[index], DM_REMOVE_NORMAL);
- if (!ret)
- dev_array[index] = NULL;
- return ret;
-}
-
-int usb_gadget_handle_interrupts(int index)
-{
- if (index < 0 || index >= ARRAY_SIZE(dev_array))
- return -EINVAL;
- return dm_usb_gadget_handle_interrupts(dev_array[index]);
-}
-#endif