summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBadhri Jagan Sridharan <badhri@google.com>2014-10-25 23:34:12 -0700
committerBadhri Jagan Sridharan <badhri@google.com>2014-10-27 11:01:50 -0700
commit07fc5e68183d42ce7f1ba7b4f9a870183bc28383 (patch)
treefa6cc8b7b918309264cfb86496e5a55c1addf198
parentf270c21d420aeb61838c1be96756e2e169d4c329 (diff)
downloadtegra-07fc5e68183d42ce7f1ba7b4f9a870183bc28383.tar.gz
usb: gadget: tegra_udc: power on/off phy during suspendandroid-5.0.0_r0.3
phy seems to be left in a inconsistent state if device suspends while connected to DCP. Turn off phy and turn it back on when system resumes Bug: 17888454 Change-Id: I04d404c26b791522b21551074b04e42c97816dcd Signed-off-by: Badhri Jagan Sridharan <badhri@google.com>
-rw-r--r--drivers/usb/gadget/tegra_udc.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/usb/gadget/tegra_udc.c b/drivers/usb/gadget/tegra_udc.c
index 6f91a8f2324d..48a9587eea2d 100644
--- a/drivers/usb/gadget/tegra_udc.c
+++ b/drivers/usb/gadget/tegra_udc.c
@@ -3160,8 +3160,11 @@ static int tegra_udc_suspend(struct platform_device *pdev, pm_message_t state)
udc->connect_type_lp0 = udc->connect_type;
/* If the controller is in otg mode, return */
- if (udc->transceiver)
+ if (udc->transceiver) {
+ if (udc->vbus_active)
+ tegra_usb_phy_power_off(udc->phy);
return 0;
+ }
if (udc->irq) {
err = enable_irq_wake(udc->irq);
@@ -3220,8 +3223,11 @@ static int tegra_udc_resume(struct platform_device *pdev)
}
}
- if (udc->transceiver)
+ if (udc->transceiver) {
+ if (udc->vbus_active)
+ tegra_usb_phy_power_on(udc->phy);
return 0;
+ }
if (udc->irq) {
err = disable_irq_wake(udc->irq);