diff mbox

[U-Boot,u-boot,28/40] usb: dwc3: dwc3-omap: add interrupt status API to check for interrupts

Message ID 1423212497-11970-29-git-send-email-kishon@ti.com
State Accepted
Delegated to: Łukasz Majewski
Headers show

Commit Message

Kishon Vijay Abraham I Feb. 6, 2015, 8:48 a.m. UTC
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>
---
 drivers/usb/dwc3/dwc3-omap.c |   20 ++++++++++++++++++++
 include/dwc3-omap-uboot.h    |    1 +
 2 files changed, 21 insertions(+)

Comments

Łukasz Majewski Feb. 16, 2015, 11:07 a.m. UTC | #1
Hi Kishon,

> 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>
> ---
>  drivers/usb/dwc3/dwc3-omap.c |   20 ++++++++++++++++++++
>  include/dwc3-omap-uboot.h    |    1 +
>  2 files changed, 21 insertions(+)
> 
> diff --git a/drivers/usb/dwc3/dwc3-omap.c
> b/drivers/usb/dwc3/dwc3-omap.c index c8275c7..46af109 100644
> --- a/drivers/usb/dwc3/dwc3-omap.c
> +++ b/drivers/usb/dwc3/dwc3-omap.c
> @@ -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");
> diff --git a/include/dwc3-omap-uboot.h b/include/dwc3-omap-uboot.h
> index 29f02f8..db002b9 100644
> --- a/include/dwc3-omap-uboot.h
> +++ b/include/dwc3-omap-uboot.h
> @@ -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_interrupt_status(int index);
>  #endif /* __DWC3_OMAP_UBOOT_H_ */

Reviewed-by: Lukasz Majewski <l.majewski@samsung.com>
diff mbox

Patch

diff --git a/drivers/usb/dwc3/dwc3-omap.c b/drivers/usb/dwc3/dwc3-omap.c
index c8275c7..46af109 100644
--- a/drivers/usb/dwc3/dwc3-omap.c
+++ b/drivers/usb/dwc3/dwc3-omap.c
@@ -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");
diff --git a/include/dwc3-omap-uboot.h b/include/dwc3-omap-uboot.h
index 29f02f8..db002b9 100644
--- a/include/dwc3-omap-uboot.h
+++ b/include/dwc3-omap-uboot.h
@@ -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_interrupt_status(int index);
 #endif /* __DWC3_OMAP_UBOOT_H_ */