usb: host: tegra: disable pmc before going to LP0
Rohith Seelaboyina [Thu, 16 May 2013 06:43:49 +0000 (11:43 +0530)]
disable pmc before going to LP0

Bug 1279228
Bug 1279501

Change-Id: Ib59cff3f164262a80aa35a6ab58af792783cc5fb
Signed-off-by: Rohith Seelaboyina <rseelaboyina@nvidia.com>
Reviewed-on: http://git-master/r/228905
Reviewed-by: Automatic_Commit_Validation_User
Tested-by: Harry Hong <hhong@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Venkat Moganty <vmoganty@nvidia.com>

drivers/usb/host/ehci-tegra.c

index d3cbf33..bc96f91 100644 (file)
@@ -653,15 +653,19 @@ static int tegra_ehci_resume(struct platform_device *pdev)
 static int tegra_ehci_suspend(struct platform_device *pdev, pm_message_t state)
 {
        struct tegra_ehci_hcd *tegra = platform_get_drvdata(pdev);
-       int err;
        struct tegra_usb_platform_data *pdata = dev_get_platdata(&pdev->dev);
+       int err;
+
        /* bus suspend could have failed because of remote wakeup resume */
        if (tegra->bus_suspended_fail)
                return -EBUSY;
        else {
                err = tegra_usb_phy_power_off(tegra->phy);
-               if (pdata->u_data.host.turn_off_vbus_on_lp0 && pdata->port_otg)
+               if (pdata->u_data.host.turn_off_vbus_on_lp0 &&
+                       pdata->port_otg) {
                        tegra_usb_enable_vbus(tegra->phy, false);
+                       tegra_usb_phy_pmc_disable(tegra->phy);
+               }
                return err;
        }
 }