Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOliver Neukum <oneukum@suse.com>2019-10-01 15:23:01 +0200
committerOliver Neukum <oneukum@suse.com>2019-10-01 15:23:01 +0200
commit7222054e46e30ddd0a542d5e2e5acc6d2a78f2b1 (patch)
treecc703e04cc958fa14004665667252d48a168ce06
parentbe2b13f0e36d5d865cf9d07f395b072e600b0f74 (diff)
usb: dwc3: meson-g12a: fix suspend resume regulator unbalanced
disables (bsc#1152489). suse-commit: f417fe76aed9d9ef195708f1b4b7a4dbe0ca4ed5
-rw-r--r--drivers/usb/dwc3/dwc3-meson-g12a.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/drivers/usb/dwc3/dwc3-meson-g12a.c b/drivers/usb/dwc3/dwc3-meson-g12a.c
index bca7e92a10e9..12dda04b004d 100644
--- a/drivers/usb/dwc3/dwc3-meson-g12a.c
+++ b/drivers/usb/dwc3/dwc3-meson-g12a.c
@@ -564,7 +564,13 @@ static int __maybe_unused dwc3_meson_g12a_runtime_resume(struct device *dev)
static int __maybe_unused dwc3_meson_g12a_suspend(struct device *dev)
{
struct dwc3_meson_g12a *priv = dev_get_drvdata(dev);
- int i;
+ int i, ret;
+
+ if (priv->vbus && priv->otg_phy_mode == PHY_MODE_USB_HOST) {
+ ret = regulator_disable(priv->vbus);
+ if (ret)
+ return ret;
+ }
for (i = 0 ; i < PHY_COUNT ; ++i) {
phy_power_off(priv->phys[i]);
@@ -599,6 +605,12 @@ static int __maybe_unused dwc3_meson_g12a_resume(struct device *dev)
return ret;
}
+ if (priv->vbus && priv->otg_phy_mode == PHY_MODE_USB_HOST) {
+ ret = regulator_enable(priv->vbus);
+ if (ret)
+ return ret;
+ }
+
return 0;
}