Revert "ARM: tegra: usb: powerdown OTG circuit if not needed"
Rohith Seelaboyina [Fri, 24 May 2013 10:46:24 +0000 (15:46 +0530)]
This reverts commit fc4f513adba751c4726b8bc5fadac5407354788d.

Change-Id: I5208d56f89df2a0f479540c9b5afc0c6826b575a
Signed-off-by: Rohith Seelaboyina <rseelaboyina@nvidia.com>
Reviewed-on: http://git-master/r/232567
Reviewed-by: Venkat Moganty <vmoganty@nvidia.com>

arch/arm/mach-tegra/include/mach/tegra_usb_pad_ctrl.h
arch/arm/mach-tegra/tegra11x_usb_phy.c
arch/arm/mach-tegra/tegra_usb_pad_ctrl.c
drivers/usb/host/xhci-tegra.c

index fae416e..4303284 100644 (file)
@@ -26,7 +26,7 @@
 #define   UTMIP_HSDISCON_LEVEL(x)      (((x) & 0x3) << 2)
 #define   UTMIP_HSDISCON_LEVEL_MSB     (1 << 24)
 
-int utmi_phy_pad_disable(bool disableOTG);
-int utmi_phy_pad_enable(bool enableOTG);
+int utmi_phy_pad_disable(void);
+int utmi_phy_pad_enable(void);
 int utmi_phy_iddq_override(bool set);
 #endif
index 1cd4f8a..b12867e 100644 (file)
@@ -1012,7 +1012,7 @@ static int utmi_phy_power_off(struct tegra_usb_phy *phy)
                writel(val, base + USB_SUSP_CTRL);
        }
 
-       utmi_phy_pad_disable(1);
+       utmi_phy_pad_disable();
        utmi_phy_iddq_override(true);
        phy->phy_clk_on = false;
        phy->hw_accessible = false;
@@ -1089,7 +1089,7 @@ static int utmi_phy_power_on(struct tegra_usb_phy *phy)
                writel(val, base + UTMIP_BAT_CHRG_CFG0);
        }
 
-       utmi_phy_pad_enable(1);
+       utmi_phy_pad_enable();
 
        val = readl(base + UTMIP_XCVR_CFG0);
        val &= ~(UTMIP_XCVR_LSBIAS_SEL | UTMIP_FORCE_PD_POWERDOWN |
index 25e5cbc..3055fe6 100644 (file)
@@ -44,7 +44,7 @@ out1:
 }
 EXPORT_SYMBOL_GPL(utmi_phy_iddq_override);
 
-int utmi_phy_pad_enable(bool enableOTG)
+int utmi_phy_pad_enable(void)
 {
        unsigned long val, flags;
        void __iomem *pad_base =  IO_ADDRESS(TEGRA_USB_BASE);
@@ -58,9 +58,7 @@ int utmi_phy_pad_enable(bool enableOTG)
        utmip_pad_count++;
 
        val = readl(pad_base + UTMIP_BIAS_CFG0);
-       if (enableOTG)
-               val &= ~UTMIP_OTGPD;
-       val &= ~UTMIP_BIASPD;
+       val &= ~(UTMIP_OTGPD | UTMIP_BIASPD);
        val |= UTMIP_HSSQUELCH_LEVEL(0x2) | UTMIP_HSDISCON_LEVEL(0x1) |
                UTMIP_HSDISCON_LEVEL_MSB;
        writel(val, pad_base + UTMIP_BIAS_CFG0);
@@ -73,7 +71,7 @@ int utmi_phy_pad_enable(bool enableOTG)
 }
 EXPORT_SYMBOL_GPL(utmi_phy_pad_enable);
 
-int utmi_phy_pad_disable(bool disableOTG)
+int utmi_phy_pad_disable(void)
 {
        unsigned long val, flags;
        void __iomem *pad_base =  IO_ADDRESS(TEGRA_USB_BASE);
@@ -94,10 +92,6 @@ int utmi_phy_pad_disable(bool disableOTG)
                val &= ~(UTMIP_HSSQUELCH_LEVEL(~0) | UTMIP_HSDISCON_LEVEL(~0) |
                        UTMIP_HSDISCON_LEVEL_MSB);
                writel(val, pad_base + UTMIP_BIAS_CFG0);
-       } else if (disableOTG) {
-               val = readl(pad_base + UTMIP_BIAS_CFG0);
-               val |= UTMIP_OTGPD;
-               writel(val, pad_base + UTMIP_BIAS_CFG0);
        }
 out:
        spin_unlock_irqrestore(&utmip_pad_lock, flags);
index f094e74..3044af0 100644 (file)
@@ -2263,7 +2263,7 @@ done:
        /* pads are disabled only if usb2 root hub in xusb is idle */
        /* pads will actually be disabled only when all usb2 ports are idle */
        if (xhci->main_hcd == hcd) {
-               utmi_phy_pad_disable(0);
+               utmi_phy_pad_disable();
                utmi_phy_iddq_override(true);
        } else if (xhci->shared_hcd == hcd) {
                /* save leakage power when SS not in use.
@@ -2309,7 +2309,7 @@ static int tegra_xhci_bus_resume(struct usb_hcd *hcd)
        /* pads are disabled only if usb2 root hub in xusb is idle */
        /* pads will actually be disabled only when all usb2 ports are idle */
        if (xhci->main_hcd == hcd && tegra->usb2_rh_suspend) {
-               utmi_phy_pad_enable(0);
+               utmi_phy_pad_enable();
                utmi_phy_iddq_override(false);
        } else if (xhci->shared_hcd == hcd && tegra->usb3_rh_suspend) {
                /* clear ovrd bits */
@@ -2826,7 +2826,7 @@ static int tegra_xhci_probe(struct platform_device *pdev)
        writel(pmc_reg, tegra->pmc_base + PMC_UTMIP_UHSIC_SLEEP_CFG_0);
 
        tegra_xhci_debug_read_pads(tegra);
-       utmi_phy_pad_enable(0);
+       utmi_phy_pad_enable();
        utmi_phy_iddq_override(false);
 
        return 0;
@@ -2878,7 +2878,7 @@ static int tegra_xhci_remove(struct platform_device *pdev)
        tegra_usb2_clocks_deinit(tegra);
        if (!tegra->hc_in_elpg)
                tegra_xusb_partitions_clk_deinit(tegra);
-       utmi_phy_pad_disable(0);
+       utmi_phy_pad_disable();
        utmi_phy_iddq_override(true);
 
        return 0;