diff options
Diffstat (limited to 'drivers/usb/dwc2/core_intr.c')
-rw-r--r-- | drivers/usb/dwc2/core_intr.c | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/drivers/usb/dwc2/core_intr.c b/drivers/usb/dwc2/core_intr.c index 8205799e6db3..c93918b70d03 100644 --- a/drivers/usb/dwc2/core_intr.c +++ b/drivers/usb/dwc2/core_intr.c | |||
@@ -72,6 +72,26 @@ static const char *dwc2_op_state_str(struct dwc2_hsotg *hsotg) | |||
72 | } | 72 | } |
73 | 73 | ||
74 | /** | 74 | /** |
75 | * dwc2_handle_usb_port_intr - handles OTG PRTINT interrupts. | ||
76 | * When the PRTINT interrupt fires, there are certain status bits in the Host | ||
77 | * Port that needs to get cleared. | ||
78 | * | ||
79 | * @hsotg: Programming view of DWC_otg controller | ||
80 | */ | ||
81 | static void dwc2_handle_usb_port_intr(struct dwc2_hsotg *hsotg) | ||
82 | { | ||
83 | u32 hprt0 = readl(hsotg->regs + HPRT0); | ||
84 | |||
85 | if (hprt0 & HPRT0_ENACHG) { | ||
86 | hprt0 &= ~HPRT0_ENA; | ||
87 | writel(hprt0, hsotg->regs + HPRT0); | ||
88 | } | ||
89 | |||
90 | /* Clear interrupt */ | ||
91 | writel(GINTSTS_PRTINT, hsotg->regs + GINTSTS); | ||
92 | } | ||
93 | |||
94 | /** | ||
75 | * dwc2_handle_mode_mismatch_intr() - Logs a mode mismatch warning message | 95 | * dwc2_handle_mode_mismatch_intr() - Logs a mode mismatch warning message |
76 | * | 96 | * |
77 | * @hsotg: Programming view of DWC_otg controller | 97 | * @hsotg: Programming view of DWC_otg controller |
@@ -479,9 +499,8 @@ irqreturn_t dwc2_handle_common_intr(int irq, void *dev) | |||
479 | if (dwc2_is_device_mode(hsotg)) { | 499 | if (dwc2_is_device_mode(hsotg)) { |
480 | dev_dbg(hsotg->dev, | 500 | dev_dbg(hsotg->dev, |
481 | " --Port interrupt received in Device mode--\n"); | 501 | " --Port interrupt received in Device mode--\n"); |
482 | gintsts = GINTSTS_PRTINT; | 502 | dwc2_handle_usb_port_intr(hsotg); |
483 | writel(gintsts, hsotg->regs + GINTSTS); | 503 | retval = IRQ_HANDLED; |
484 | retval = 1; | ||
485 | } | 504 | } |
486 | } | 505 | } |
487 | 506 | ||