2021-04-28 05:14:29

by Sandeep Maheswaram

[permalink] [raw]
Subject: [PATCH v7 4/5] usb: dwc3: qcom: Configure wakeup interrupts during suspend

Configure interrupts based on hs_phy_mode to avoid triggering of
interrupts during system suspend and suspend the device successfully.

Signed-off-by: Sandeep Maheswaram <[email protected]>
Reviewed-by: Matthias Kaehlcke <[email protected]>
---
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 66183c6..82125bc 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);
}
--
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
of Code Aurora Forum, hosted by The Linux Foundation


2021-04-28 10:21:24

by Felipe Balbi

[permalink] [raw]
Subject: Re: [PATCH v7 4/5] usb: dwc3: qcom: Configure wakeup interrupts during suspend


Hi,

Sandeep Maheswaram <[email protected]> writes:
> Configure interrupts based on hs_phy_mode to avoid triggering of
> interrupts during system suspend and suspend the device successfully.
>
> Signed-off-by: Sandeep Maheswaram <[email protected]>
> Reviewed-by: Matthias Kaehlcke <[email protected]>
> ---
> 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 66183c6..82125bc 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);

and who's using this?

> 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);

or this?

--
balbi


Attachments:
signature.asc (873.00 B)