dwc3: core: added an API to invoke irq handlers
authorKishon Vijay Abraham I <kishon@ti.com>
Mon, 23 Feb 2015 13:10:06 +0000 (18:40 +0530)
committerMarek Vasut <marex@denx.de>
Tue, 14 Apr 2015 03:48:10 +0000 (05:48 +0200)
Since interrupt support is not present in u-boot, added an
API to handle the interrupts in dwc3 core. This API can be
polled to handle the interrupts.

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Reviewed-by: Lukasz Majewski <l.majewski@samsung.com>
drivers/usb/dwc3/core.c
include/dwc3-uboot.h

index bd34dbd23c877e345da16daf58b73d7f31643ee1..5a8d5ea8817115316cb8b4478315d06af5e95010 100644 (file)
@@ -758,6 +758,27 @@ void dwc3_uboot_exit(int index)
        }
 }
 
+/**
+ * dwc3_uboot_handle_interrupt - handle dwc3 core interrupt
+ * @index: index of this controller
+ *
+ * Invokes dwc3 gadget interrupts.
+ *
+ * Generally called from board file.
+ */
+void dwc3_uboot_handle_interrupt(int index)
+{
+       struct dwc3 *dwc = NULL;
+
+       list_for_each_entry(dwc, &dwc3_list, list) {
+               if (dwc->index != index)
+                       continue;
+
+               dwc3_gadget_uboot_handle_interrupt(dwc);
+               break;
+       }
+}
+
 MODULE_ALIAS("platform:dwc3");
 MODULE_AUTHOR("Felipe Balbi <balbi@ti.com>");
 MODULE_LICENSE("GPL v2");
index 272a0207b37fab98514d84a7f1f13755db04f166..09ff8a74d669aae53e007c15f988af8922feb7d2 100644 (file)
@@ -38,4 +38,5 @@ struct dwc3_device {
 
 int dwc3_uboot_init(struct dwc3_device *dev);
 void dwc3_uboot_exit(int index);
+void dwc3_uboot_handle_interrupt(int index);
 #endif /* __DWC3_UBOOT_H_ */