| From 95c70e19ec812538c750c0a08c1f2f33eeefd7b5 Mon Sep 17 00:00:00 2001 |
| From: Sandeep Maheswaram <sanm@codeaurora.org> |
| Date: Thu, 9 Jul 2020 00:40:16 +0530 |
| Subject: [PATCH] BACKPORT: FROMLIST: usb: dwc3: qcom: Configure wakeup |
| interrupts and set genpd active wakeup flag |
| |
| configure interrupts based on hs_phy_flag. Set genpd active wakeup flag |
| for usb gdsc if wakeup capable devices are connected. |
| |
| Signed-off-by: Sandeep Maheswaram <sanm@codeaurora.org> |
| (am from https://patchwork.kernel.org/patch/11652263/) |
| (also found at https://lore.kernel.org/r/1594235417-23066-3-git-send-email-sanm@codeaurora.org) |
| |
| Conflicts: |
| drivers/usb/dwc3/dwc3-qcom.c |
| trivial context delta due to interconnect support in CrOS tree |
| |
| BUG=b:147457041, b:145023729 |
| TEST=on trogdor: |
| PP3300_HUB consumes ~17 mW in S3 |
| clicking USB mouse during S3 wakes the DUT up |
| |
| Signed-off-by: Matthias Kaehlcke <mka@chromium.org> |
| Change-Id: I684ceca5c62120fb90ad2d67ad4f6d27cc487977 |
| Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/2352634 |
| Reviewed-by: Stephen Boyd <swboyd@chromium.org> |
| [rebase510(groeck): |
| Squashed: |
| FIXUP: FROMLIST: usb: dwc3: qcom: Configure wakeup interrupts and set genpd active wakeup flag |
| ] |
| Signed-off-by: Guenter Roeck <groeck@chromium.org> |
| --- |
| drivers/usb/dwc3/dwc3-qcom.c | 13 +++++++++++++ |
| 1 file changed, 13 insertions(+) |
| |
| diff --git a/drivers/usb/dwc3/dwc3-qcom.c b/drivers/usb/dwc3/dwc3-qcom.c |
| index c5e482f53e9d..ae18aecae98d 100644 |
| --- a/drivers/usb/dwc3/dwc3-qcom.c |
| +++ b/drivers/usb/dwc3/dwc3-qcom.c |
| @@ -391,6 +391,14 @@ static int dwc3_qcom_suspend(struct dwc3_qcom *qcom) |
| { |
| u32 val; |
| int i, ret; |
| + struct dwc3 *dwc = platform_get_drvdata(qcom->dwc3); |
| + struct usb_hcd *hcd = platform_get_drvdata(dwc->xhci); |
| + struct generic_pm_domain *genpd; |
| + |
| + genpd = pd_to_genpd(qcom->dev->pm_domain); |
| + |
| + if (genpd && usb_wakeup_enabled_descendants(hcd->self.root_hub)) |
| + genpd->flags |= GENPD_FLAG_ACTIVE_WAKEUP; |
| |
| if (qcom->is_suspended) |
| return 0; |
| @@ -420,6 +428,11 @@ static int dwc3_qcom_resume(struct dwc3_qcom *qcom) |
| { |
| int ret; |
| int i; |
| + struct generic_pm_domain *genpd; |
| + |
| + genpd = pd_to_genpd(qcom->dev->pm_domain); |
| + if (genpd) |
| + genpd->flags &= ~GENPD_FLAG_ACTIVE_WAKEUP; |
| |
| if (!qcom->is_suspended) |
| return 0; |
| -- |
| 2.37.1.595.g718a3a8f04-goog |
| |