[PATCH 08/10] staging: dwc2: add dwc2_disable_common_interrupts function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This function disables all "common interrupts", i.e., those that are
handled by the common interrupt handler.

Signed-off-by: Matthijs Kooijman <matthijs@xxxxxxxx>
---
 drivers/staging/dwc2/core.c      | 14 ++++++++++++++
 drivers/staging/dwc2/core.h      |  6 ++++++
 drivers/staging/dwc2/core_intr.c |  5 -----
 3 files changed, 20 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/dwc2/core.c b/drivers/staging/dwc2/core.c
index 8882270..09b6d19 100644
--- a/drivers/staging/dwc2/core.c
+++ b/drivers/staging/dwc2/core.c
@@ -81,6 +81,20 @@ static void dwc2_enable_common_interrupts(struct dwc2_hsotg *hsotg)
 	writel(intmsk, hsotg->regs + GINTMSK);
 }
 
+/**
+ * dwc2_disable_common_interrupts() - Disables the common interrupts
+ *
+ * @hsotg: Programming view of DWC_otg controller
+ */
+void dwc2_disable_common_interrupts(struct dwc2_hsotg *hsotg)
+{
+	u32 intmsk = readl(hsotg->regs + GINTMSK);
+
+	/* Disable common interrupts without disturbing host mode interrupts */
+	intmsk &= ~GINTMSK_COMMON;
+	writel(intmsk, hsotg->regs + GINTMSK);
+}
+
 /*
  * Initializes the FSLSPClkSel field of the HCFG register depending on the
  * PHY type
diff --git a/drivers/staging/dwc2/core.h b/drivers/staging/dwc2/core.h
index cc2f360..a243615 100644
--- a/drivers/staging/dwc2/core.h
+++ b/drivers/staging/dwc2/core.h
@@ -452,6 +452,7 @@ extern void dwc2_flush_rx_fifo(struct dwc2_hsotg *hsotg);
 extern int dwc2_core_init(struct dwc2_hsotg *hsotg, bool select_phy, int irq);
 extern void dwc2_enable_global_interrupts(struct dwc2_hsotg *hcd);
 extern void dwc2_disable_global_interrupts(struct dwc2_hsotg *hcd);
+extern void dwc2_disable_common_interrupts(struct dwc2_hsotg *hsotg);
 
 /* This function should be called on every hardware interrupt. */
 extern irqreturn_t dwc2_handle_common_intr(int irq, void *dev);
@@ -663,4 +664,9 @@ extern u16 dwc2_get_otg_version(struct dwc2_hsotg *hsotg);
 			 GINTSTS_I2CINT | GINTSTS_PRTINT | GINTSTS_HCHINT | \
 			 GINTSTS_PTXFEMP)
 
+#define GINTMSK_COMMON	(GINTSTS_WKUPINT | GINTSTS_SESSREQINT | \
+			 GINTSTS_CONIDSTSCHNG | GINTSTS_OTGINT | \
+			 GINTSTS_MODEMIS | GINTSTS_DISCONNINT | \
+			 GINTSTS_USBSUSP | GINTSTS_RESTOREDONE)
+
 #endif /* __DWC2_CORE_H__ */
diff --git a/drivers/staging/dwc2/core_intr.c b/drivers/staging/dwc2/core_intr.c
index 1f3947d..617937e 100644
--- a/drivers/staging/dwc2/core_intr.c
+++ b/drivers/staging/dwc2/core_intr.c
@@ -400,11 +400,6 @@ static void dwc2_handle_usb_suspend_intr(struct dwc2_hsotg *hsotg)
 	writel(GINTSTS_USBSUSP, hsotg->regs + GINTSTS);
 }
 
-#define GINTMSK_COMMON	(GINTSTS_WKUPINT | GINTSTS_SESSREQINT |		\
-			 GINTSTS_CONIDSTSCHNG | GINTSTS_OTGINT |	\
-			 GINTSTS_MODEMIS | GINTSTS_DISCONNINT |		\
-			 GINTSTS_USBSUSP | GINTSTS_RESTOREDONE)
-
 /*
  * This function returns the Core Interrupt register
  */
-- 
1.8.0

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux