lkml.org 
[lkml]   [2022]   [May]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[v16 4/5] usb: dwc3: qcom: Configure wakeup interrupts during suspend
Date
From: Sandeep Maheswaram <quic_c_sanm@quicinc.com>

Configure DP/DM interrupts to detect line state changes based on
hs_phy_mode. Enable the triggers opposite of what the current
DP, DM levels. For HS/FS mode enable DM interrupt and for LS enable DP
interrupt.

Signed-off-by: Sandeep Maheswaram <quic_c_sanm@quicinc.com>
Reviewed-by: Matthias Kaehlcke <mka@chromium.org>
Signed-off-by: Krishna Kurapati <quic_kriskura@quicinc.com>
---
drivers/usb/dwc3/dwc3-qcom.c | 26 ++++++++++++++++++++------
1 file changed, 20 insertions(+), 6 deletions(-)

diff --git a/drivers/usb/dwc3/dwc3-qcom.c b/drivers/usb/dwc3/dwc3-qcom.c
index 7352124..9804a19 100644
--- a/drivers/usb/dwc3/dwc3-qcom.c
+++ b/drivers/usb/dwc3/dwc3-qcom.c
@@ -316,22 +316,36 @@ static void dwc3_qcom_disable_wakeup_irq(int irq)

static void dwc3_qcom_disable_interrupts(struct dwc3_qcom *qcom)
{
- dwc3_qcom_disable_wakeup_irq(qcom->hs_phy_irq);
+ struct dwc3 *dwc = platform_get_drvdata(qcom->dwc3);

- dwc3_qcom_disable_wakeup_irq(qcom->dp_hs_phy_irq);
+ dwc3_qcom_disable_wakeup_irq(qcom->hs_phy_irq);

- dwc3_qcom_disable_wakeup_irq(qcom->dm_hs_phy_irq);
+ if (dwc->hs_phy_mode & PHY_MODE_USB_HOST_LS) {
+ dwc3_qcom_disable_wakeup_irq(qcom->dp_hs_phy_irq);
+ } else if (dwc->hs_phy_mode & PHY_MODE_USB_HOST_HS) {
+ dwc3_qcom_disable_wakeup_irq(qcom->dm_hs_phy_irq);
+ } else {
+ dwc3_qcom_disable_wakeup_irq(qcom->dp_hs_phy_irq);
+ dwc3_qcom_disable_wakeup_irq(qcom->dm_hs_phy_irq);
+ }

dwc3_qcom_disable_wakeup_irq(qcom->ss_phy_irq);
}

static void dwc3_qcom_enable_interrupts(struct dwc3_qcom *qcom)
{
- dwc3_qcom_enable_wakeup_irq(qcom->hs_phy_irq);
+ struct dwc3 *dwc = platform_get_drvdata(qcom->dwc3);

- dwc3_qcom_enable_wakeup_irq(qcom->dp_hs_phy_irq);
+ dwc3_qcom_enable_wakeup_irq(qcom->hs_phy_irq);

- dwc3_qcom_enable_wakeup_irq(qcom->dm_hs_phy_irq);
+ if (dwc->hs_phy_mode & PHY_MODE_USB_HOST_LS) {
+ dwc3_qcom_enable_wakeup_irq(qcom->dp_hs_phy_irq);
+ } else if (dwc->hs_phy_mode & PHY_MODE_USB_HOST_HS) {
+ dwc3_qcom_enable_wakeup_irq(qcom->dm_hs_phy_irq);
+ } else {
+ dwc3_qcom_enable_wakeup_irq(qcom->dp_hs_phy_irq);
+ dwc3_qcom_enable_wakeup_irq(qcom->dm_hs_phy_irq);
+ }

dwc3_qcom_enable_wakeup_irq(qcom->ss_phy_irq);
}
--
2.7.4
\
 
 \ /
  Last update: 2022-05-12 20:24    [W:1.284 / U:0.172 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site