ARM: tegra: Enable TXFILLTUNING for all USB interfaces
Venu Byravarasu [Thu, 3 May 2012 10:21:00 +0000 (15:21 +0530)]
As per recommendation from ASIC team, Setting TXFILLTUNNING to 0x10
for all USB interfaces.

bug 974507

Change-Id: Id2ee26927e56bf500a0fed2a414b74ffab157403
Signed-off-by: Venu Byravarasu <vbyravarasu@nvidia.com>
Reviewed-on: http://git-master/r/99629
Reviewed-by: Simone Willett <swillett@nvidia.com>
Tested-by: Simone Willett <swillett@nvidia.com>

arch/arm/mach-tegra/usb_phy.c

index c3ce57a..8c36159 100644 (file)
@@ -1726,7 +1726,7 @@ static int uhsic_phy_preresume(struct tegra_usb_phy *phy, bool remote_wakeup)
        return 0;
 }
 
-static int uhsic_phy_postresume(struct tegra_usb_phy *phy, bool is_dpd)
+static int usb_phy_set_tx_fill_tuning(struct tegra_usb_phy *phy, bool is_dpd)
 {
        unsigned long val;
        void __iomem *base = phy->regs;
@@ -2404,11 +2404,7 @@ static int uhsic_phy_power_on(struct tegra_usb_phy *phy, bool is_dpd)
        val |= HOSTPC1_DEVLC_PSPD(HOSTPC1_DEVLC_PSPD_HIGH_SPEED);
        writel(val, base + HOSTPC1_DEVLC);
 #endif
-       val = readl(base + USB_TXFILLTUNING);
-       if ((val & USB_FIFO_TXFILL_MASK) != USB_FIFO_TXFILL_THRES(0x10)) {
-               val = USB_FIFO_TXFILL_THRES(0x10);
-               writel(val, base + USB_TXFILLTUNING);
-       }
+       usb_phy_set_tx_fill_tuning(phy, is_dpd);
 
        val = readl(base + USB_PORTSC1);
        val &= ~(USB_PORTSC1_WKOC | USB_PORTSC1_WKDS | USB_PORTSC1_WKCN);
@@ -2766,11 +2762,14 @@ void tegra_usb_phy_postresume(struct tegra_usb_phy *phy, bool is_dpd)
                utmi_phy_postresume,
                NULL,
                NULL,
-               uhsic_phy_postresume,
+               NULL,
        };
 
-       if (postresume[phy->usb_phy_type])
-               postresume[phy->usb_phy_type](phy, is_dpd);
+       usb_phy_set_tx_fill_tuning(phy, is_dpd);
+
+       // If Phy type is utmi, call its post resume
+       if (phy->usb_phy_type == 0)
+               utmi_phy_postresume(phy, is_dpd);
 }
 
 void tegra_ehci_pre_reset(struct tegra_usb_phy *phy, bool is_dpd)