]> git.ipfire.org Git - people/ms/u-boot.git/commitdiff
usb: dwc3: dwc3-omap: add interrupt status API to check for interrupts
authorKishon Vijay Abraham I <kishon@ti.com>
Mon, 23 Feb 2015 13:10:11 +0000 (18:40 +0530)
committerMarek Vasut <marex@denx.de>
Tue, 14 Apr 2015 03:48:10 +0000 (05:48 +0200)
Added an API to check for interrupt status. This API is generally
called from board file to check for interrupt status.

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

index c8275c79e38a5a22f2226cde17b1c9157d183b0c..46af1091411a9771819198498162a3e91dcaae2c 100644 (file)
@@ -415,6 +415,26 @@ void dwc3_omap_uboot_exit(int index)
        }
 }
 
        }
 }
 
+/**
+ * dwc3_omap_uboot_interrupt_status - check the status of interrupt
+ * @index: index of this controller
+ *
+ * Checks the status of interrupts and returns true if an interrupt
+ * is detected or false otherwise.
+ *
+ * Generally called from board file.
+ */
+int dwc3_omap_uboot_interrupt_status(int index)
+{
+       struct dwc3_omap *omap = NULL;
+
+       list_for_each_entry(omap, &dwc3_omap_list, list)
+               if (omap->index == index)
+                       return dwc3_omap_interrupt(-1, omap);
+
+       return 0;
+}
+
 MODULE_ALIAS("platform:omap-dwc3");
 MODULE_AUTHOR("Felipe Balbi <balbi@ti.com>");
 MODULE_LICENSE("GPL v2");
 MODULE_ALIAS("platform:omap-dwc3");
 MODULE_AUTHOR("Felipe Balbi <balbi@ti.com>");
 MODULE_LICENSE("GPL v2");
index 29f02f85ded913843ec871c8a680657ebc13646a..db002b9b6a996977b206350bd2938a73c5272526 100644 (file)
@@ -28,4 +28,5 @@ struct dwc3_omap_device {
 
 int dwc3_omap_uboot_init(struct dwc3_omap_device *dev);
 void dwc3_omap_uboot_exit(int index);
 
 int dwc3_omap_uboot_init(struct dwc3_omap_device *dev);
 void dwc3_omap_uboot_exit(int index);
+int dwc3_omap_uboot_interrupt_status(int index);
 #endif /* __DWC3_OMAP_UBOOT_H_ */
 #endif /* __DWC3_OMAP_UBOOT_H_ */