summaryrefslogtreecommitdiff
path: root/drivers/usb/cdns3/cdns3-plat.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2021-04-26 11:32:23 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2021-04-26 11:32:23 -0700
commitef1244124349fea36e4a7e260ecaf156b6b6b22a (patch)
tree92bf1dd4e9fc06708898a6e78de70f7ac36f5a72 /drivers/usb/cdns3/cdns3-plat.c
parentd08410d8c9908058a2f69b55e24edfb0d19da7a1 (diff)
parentcaa93d9bd2d7ca7ffe5a23df9f003b81721c8e1b (diff)
downloadlwn-ef1244124349fea36e4a7e260ecaf156b6b6b22a.tar.gz
lwn-ef1244124349fea36e4a7e260ecaf156b6b6b22a.zip
Merge tag 'usb-5.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
Pull USB and Thunderbolt updates from Greg KH: "Here is the big set of USB and Thunderbolt driver updates for 5.13-rc1. Lots of little things in here, with loads of tiny fixes and cleanups over these drivers, as well as these "larger" changes: - thunderbolt updates and new features added - xhci driver updates and split out of a mediatek-specific xhci driver from the main xhci module to make it easier to work with (something that I have been wanting for a while). - loads of typec feature additions and updates - dwc2 driver updates - dwc3 driver updates - gadget driver fixes and minor updates - loads of usb-serial cleanups and fixes and updates - usbip documentation updates and fixes - lots of other tiny USB driver updates All of these have been in linux-next for a while with no reported issues" * tag 'usb-5.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (371 commits) usb: Fix up movement of USB core kerneldoc location usb: dwc3: gadget: Handle DEV_TXF_FLUSH_BYPASS capability usb: dwc3: Capture new capability register GHWPARAMS9 usb: gadget: prevent a ternary sign expansion bug usb: dwc3: core: Do core softreset when switch mode usb: dwc2: Get rid of useless error checks in suspend interrupt usb: dwc2: Update dwc2_handle_usb_suspend_intr function. usb: dwc2: Add exit hibernation mode before removing drive usb: dwc2: Add hibernation exiting flow by system resume usb: dwc2: Add hibernation entering flow by system suspend usb: dwc2: Allow exit hibernation in urb enqueue usb: dwc2: Move exit hibernation to dwc2_port_resume() function usb: dwc2: Move enter hibernation to dwc2_port_suspend() function usb: dwc2: Clear GINTSTS_RESTOREDONE bit after restore is generated. usb: dwc2: Clear fifo_map when resetting core. usb: dwc2: Allow exiting hibernation from gpwrdn rst detect usb: dwc2: Fix hibernation between host and device modes. usb: dwc2: Fix host mode hibernation exit with remote wakeup flow. usb: dwc2: Reset DEVADDR after exiting gadget hibernation. usb: dwc2: Update exit hibernation when port reset is asserted ...
Diffstat (limited to 'drivers/usb/cdns3/cdns3-plat.c')
-rw-r--r--drivers/usb/cdns3/cdns3-plat.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/drivers/usb/cdns3/cdns3-plat.c b/drivers/usb/cdns3/cdns3-plat.c
index 4b18e1c6a4bb..e1deeada425c 100644
--- a/drivers/usb/cdns3/cdns3-plat.c
+++ b/drivers/usb/cdns3/cdns3-plat.c
@@ -19,6 +19,7 @@
#include "core.h"
#include "gadget-export.h"
+#include "drd.h"
static int set_phy_power_on(struct cdns *cdns)
{
@@ -236,6 +237,18 @@ static int cdns3_controller_resume(struct device *dev, pm_message_t msg)
if (!cdns->in_lpm)
return 0;
+ if (cdns_power_is_lost(cdns)) {
+ phy_exit(cdns->usb2_phy);
+ ret = phy_init(cdns->usb2_phy);
+ if (ret)
+ return ret;
+
+ phy_exit(cdns->usb3_phy);
+ ret = phy_init(cdns->usb3_phy);
+ if (ret)
+ return ret;
+ }
+
ret = set_phy_power_on(cdns);
if (ret)
return ret;
@@ -270,10 +283,18 @@ static int cdns3_plat_runtime_resume(struct device *dev)
static int cdns3_plat_suspend(struct device *dev)
{
struct cdns *cdns = dev_get_drvdata(dev);
+ int ret;
cdns_suspend(cdns);
- return cdns3_controller_suspend(dev, PMSG_SUSPEND);
+ ret = cdns3_controller_suspend(dev, PMSG_SUSPEND);
+ if (ret)
+ return ret;
+
+ if (device_may_wakeup(dev) && cdns->wakeup_irq)
+ enable_irq_wake(cdns->wakeup_irq);
+
+ return ret;
}
static int cdns3_plat_resume(struct device *dev)