tegra: usb: remove WAR for PORTSC.SUSP before bus goes to suspend
Suresh Mangipudi [Tue, 5 Jun 2012 10:10:22 +0000 (15:10 +0530)]
USB controller asserts PORTSC.SUSP bit before the bus goes to suspend,
the s/w WAR is no longer need for t114.

Bug 969265

Change-Id: I7682cd1d7e291b37e2303bf5d03b2bb5e5640d0f
Signed-off-by: Suresh Mangipudi <smangipudi@nvidia.com>
Reviewed-on: http://git-master/r/106437
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Krishna Yarlagadda <kyarlagadda@nvidia.com>
Tested-by: Krishna Yarlagadda <kyarlagadda@nvidia.com>
Reviewed-by: Rohan Somvanshi <rsomvanshi@nvidia.com>

arch/arm/mach-tegra/tegra2_usb_phy.c
arch/arm/mach-tegra/tegra3_usb_phy.c
drivers/usb/host/ehci-tegra.c

index 06ce162..0c1f141 100644 (file)
@@ -609,6 +609,13 @@ static int utmi_phy_irq(struct tegra_usb_phy *phy)
        return IRQ_HANDLED;
 }
 
+static void phy_post_suspend(struct tegra_usb_phy *phy)
+{
+
+       DBG("%s(%d) inst:[%d]\n", __func__, __LINE__, phy->inst);
+       /* Need a 4ms delay for controller to suspend */
+       mdelay(4);
+}
 
 static int utmi_phy_post_resume(struct tegra_usb_phy *phy)
 {
@@ -1741,6 +1748,7 @@ static struct tegra_usb_phy_ops utmi_phy_ops = {
        .resume = utmi_phy_resume,
        .post_resume    = utmi_phy_post_resume,
        .charger_detect = utmi_phy_charger_detect,
+       .post_suspend   = phy_post_suspend,
 };
 
 static struct tegra_usb_phy_ops uhsic_phy_ops = {
@@ -1753,6 +1761,7 @@ static struct tegra_usb_phy_ops uhsic_phy_ops = {
        .post_resume    = uhsic_phy_post_resume,
        .port_power     = uhsic_phy_bus_port_power,
        .bus_reset      = uhsic_phy_bus_reset,
+       .post_suspend   = phy_post_suspend,
 };
 
 static struct tegra_usb_phy_ops ulpi_link_phy_ops = {
@@ -1762,6 +1771,7 @@ static struct tegra_usb_phy_ops ulpi_link_phy_ops = {
        .power_on       = ulpi_link_phy_power_on,
        .power_off      = ulpi_link_phy_power_off,
        .resume         = ulpi_link_phy_resume,
+       .post_suspend   = phy_post_suspend,
 };
 
 static struct tegra_usb_phy_ops ulpi_null_phy_ops = {
@@ -1770,6 +1780,7 @@ static struct tegra_usb_phy_ops ulpi_null_phy_ops = {
        .power_off      = ulpi_null_phy_power_off,
        .pre_resume = ulpi_null_phy_pre_resume,
        .resume = ulpi_null_phy_resume,
+       .post_suspend   = phy_post_suspend,
 };
 
 static struct tegra_usb_phy_ops icusb_phy_ops;
index ceecfbd..9207477 100644 (file)
@@ -1340,6 +1340,15 @@ static int utmi_phy_post_resume(struct tegra_usb_phy *phy)
        return 0;
 }
 
+static void phy_post_suspend(struct tegra_usb_phy *phy)
+{
+
+       DBG("%s(%d) inst:[%d]\n", __func__, __LINE__, phy->inst);
+       /* Need a 4ms delay for controller to suspend */
+       mdelay(4);
+
+}
+
 static int utmi_phy_pre_resume(struct tegra_usb_phy *phy, bool remote_wakeup)
 {
        unsigned long val;
@@ -2434,6 +2443,7 @@ static struct tegra_usb_phy_ops utmi_phy_ops = {
        .resume = utmi_phy_resume,
        .post_resume    = utmi_phy_post_resume,
        .charger_detect = utmi_phy_charger_detect,
+       .post_suspend   = phy_post_suspend,
 };
 
 static struct tegra_usb_phy_ops uhsic_phy_ops = {
@@ -2446,6 +2456,7 @@ static struct tegra_usb_phy_ops uhsic_phy_ops = {
        .post_resume = uhsic_phy_post_resume,
        .port_power = uhsic_phy_bus_port_power,
        .bus_reset      = uhsic_phy_bus_reset,
+       .post_suspend   = phy_post_suspend,
 };
 
 static struct tegra_usb_phy_ops ulpi_null_phy_ops = {
@@ -2456,6 +2467,7 @@ static struct tegra_usb_phy_ops ulpi_null_phy_ops = {
        .pre_resume = ulpi_null_phy_pre_resume,
        .resume = ulpi_null_phy_resume,
        .reset          = ulpi_null_phy_cmd_reset,
+       .post_suspend   = phy_post_suspend,
 };
 
 static struct tegra_usb_phy_ops ulpi_link_phy_ops;
index be302d9..5d45ab4 100644 (file)
@@ -269,8 +269,6 @@ static int tegra_ehci_hub_control(
                switch (typeReq) {
                case SetPortFeature:
                        if (wValue == USB_PORT_FEAT_SUSPEND) {
-                               /* Need a 4ms delay for controller to suspend */
-                               mdelay(4);
                                tegra_usb_phy_post_suspend(tegra->phy);
                        } else if (wValue == USB_PORT_FEAT_RESET) {
                                if (ehci->reset_done[0] && wIndex == 0)