]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
ARM: tegra: phy:Do not enable pmc during id unplug
authorRakesh Bodla <rbodla@nvidia.com>
Mon, 2 Sep 2013 05:40:03 +0000 (11:10 +0530)
committerAjay Nandakumar <anandakumarm@nvidia.com>
Tue, 1 Oct 2013 11:04:44 +0000 (16:34 +0530)
Do not enable pmc when id cable is unplugged
from the system.

Bug 1357517

Change-Id: I6e8adae9da6b15ac44987f8169d7607194983a50
Signed-off-by: Rakesh Bodla <rbodla@nvidia.com>
Reviewed-on: http://git-master/r/268916
(cherry picked from commit 19b2ee63c2b55973b7e01898d2b2feb194192851)
Reviewed-on: http://git-master/r/276614
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Venkat Moganty <vmoganty@nvidia.com>
(cherry picked from commit efae144ed3807fe41cde9b57cd23a6017f8c52a8)
Signed-off-by: Ajay Nandakumar <anandakumarm@nvidia.com>
drivers/usb/phy/tegra11x_usb_phy.c

index 5f0256b53246e9018c5796bf59f70c05ccac95fe..d78fe397e30e503859c4193334c6f7fccdcc9894 100644 (file)
@@ -861,7 +861,16 @@ static int utmi_phy_power_off(struct tegra_usb_phy *phy)
                else
                        phy->pmc_hotplug_wakeup = false;
 
-               pmc->pmc_ops->setup_pmc_wake_detect(pmc);
+               if (phy->pdata->port_otg) {
+                       bool id_present = false;
+                       val = readl(base + USB_PHY_VBUS_WAKEUP_ID);
+                       id_present = (val & USB_ID_STATUS) ? false : true;
+                       if (id_present)
+                               pmc->pmc_ops->setup_pmc_wake_detect(pmc);
+               } else {
+                       pmc->pmc_ops->setup_pmc_wake_detect(pmc);
+               }
+
                val = readl(base + UTMIP_PMC_WAKEUP0);
                val |= EVENT_INT_ENB;
                writel(val, base + UTMIP_PMC_WAKEUP0);