Commit 53de33fc00afd41fd0fd8fb9f5ab0d01df3a64a4

Authored by Kishon Vijay Abraham I
Committed by Marek Vasut
1 parent 57207657a1

usb: dwc3: dwc3-omap: add interrupt status API to check for interrupts

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>

Showing 2 changed files with 21 additions and 0 deletions Side-by-side Diff

drivers/usb/dwc3/dwc3-omap.c
... ... @@ -415,6 +415,26 @@
415 415 }
416 416 }
417 417  
  418 +/**
  419 + * dwc3_omap_uboot_interrupt_status - check the status of interrupt
  420 + * @index: index of this controller
  421 + *
  422 + * Checks the status of interrupts and returns true if an interrupt
  423 + * is detected or false otherwise.
  424 + *
  425 + * Generally called from board file.
  426 + */
  427 +int dwc3_omap_uboot_interrupt_status(int index)
  428 +{
  429 + struct dwc3_omap *omap = NULL;
  430 +
  431 + list_for_each_entry(omap, &dwc3_omap_list, list)
  432 + if (omap->index == index)
  433 + return dwc3_omap_interrupt(-1, omap);
  434 +
  435 + return 0;
  436 +}
  437 +
418 438 MODULE_ALIAS("platform:omap-dwc3");
419 439 MODULE_AUTHOR("Felipe Balbi <balbi@ti.com>");
420 440 MODULE_LICENSE("GPL v2");
include/dwc3-omap-uboot.h
... ... @@ -28,5 +28,6 @@
28 28  
29 29 int dwc3_omap_uboot_init(struct dwc3_omap_device *dev);
30 30 void dwc3_omap_uboot_exit(int index);
  31 +int dwc3_omap_uboot_interrupt_status(int index);
31 32 #endif /* __DWC3_OMAP_UBOOT_H_ */