summaryrefslogtreecommitdiff
path: root/drivers/usb
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2011-01-09 19:20:14 -0800
committerColin Cross <ccross@android.com>2011-01-09 19:20:14 -0800
commitb99662a653ac3d90bfada1bfc326d3138229860c (patch)
tree024b0706480e7caae913130288512a6d2a4053cf /drivers/usb
parentc07aee9df0e40fe9621db66ec00857228090e46c (diff)
parent962feda6df4542dfae908df64504c8e8046db1d4 (diff)
Merge branch 'linux-tegra-2.6.36' into android-tegra-2.6.36
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/host/ehci-tegra.c40
1 files changed, 25 insertions, 15 deletions
diff --git a/drivers/usb/host/ehci-tegra.c b/drivers/usb/host/ehci-tegra.c
index 262bbb01228b..2341904808bc 100644
--- a/drivers/usb/host/ehci-tegra.c
+++ b/drivers/usb/host/ehci-tegra.c
@@ -151,11 +151,7 @@ static int tegra_ehci_hub_control(
tegra_usb_phy_preresume(tegra->phy);
- /* reschedule root hub polling during resume signaling */
ehci->reset_done[wIndex-1] = jiffies + msecs_to_jiffies(25);
- /* check the port again */
- mod_timer(&ehci_to_hcd(ehci)->rh_timer,
- ehci->reset_done[wIndex-1]);
temp &= ~(PORT_RWC_BITS | PORT_WAKE_BITS);
/* start resume signalling */
@@ -173,6 +169,8 @@ static int tegra_ehci_hub_control(
if (handshake(ehci, status_reg, PORT_SUSPEND, 0, 2000))
pr_err("%s: timeout waiting for PORT_SUSPEND\n", __func__);
+ ehci->reset_done[wIndex-1] = 0;
+
tegra->port_resuming = 1;
goto done;
}
@@ -255,6 +253,7 @@ static int tegra_usb_resume(struct usb_hcd *hcd)
struct tegra_ehci_context *context = &tegra->context;
struct ehci_regs __iomem *hw = tegra->ehci->regs;
unsigned long val;
+ int lp0_resume = 0;
set_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);
tegra_ehci_power_up(ehci_to_hcd(tegra->ehci));
@@ -266,6 +265,13 @@ static int tegra_usb_resume(struct usb_hcd *hcd)
goto restart;
}
+ tegra_ehci_phy_restore_start(tegra->phy);
+
+ /* Check if the phy resume from LP0. When the phy resume from LP0
+ * USB register will be reset. */
+ if (!readl(&hw->async_next))
+ lp0_resume = 1;
+
/* Restore register context */
writel(TEGRA_USB_USBMODE_HOST, &hw->reserved[19]);
writel(context->otgsc, &hw->reserved[18]);
@@ -280,17 +286,19 @@ static int tegra_usb_resume(struct usb_hcd *hcd)
writel(val, &hw->port_status[0]);
udelay(10);
- /* Program the field PTC in PORTSC based on the saved speed mode */
- val = readl(&hw->port_status[0]);
- val &= ~(TEGRA_USB_PORTSC1_PTC(~0));
- if (context->port_speed == TEGRA_USB_PHY_PORT_HIGH)
- val |= TEGRA_USB_PORTSC1_PTC(5);
- else if (context->port_speed == TEGRA_USB_PHY_PORT_SPEED_FULL)
- val |= TEGRA_USB_PORTSC1_PTC(6);
- else if (context->port_speed == TEGRA_USB_PHY_PORT_SPEED_LOW)
- val |= TEGRA_USB_PORTSC1_PTC(7);
- writel(val, &hw->port_status[0]);
- udelay(10);
+ if (lp0_resume) {
+ /* Program the field PTC in PORTSC based on the saved speed mode */
+ val = readl(&hw->port_status[0]);
+ val &= ~(TEGRA_USB_PORTSC1_PTC(~0));
+ if (context->port_speed == TEGRA_USB_PHY_PORT_HIGH)
+ val |= TEGRA_USB_PORTSC1_PTC(5);
+ else if (context->port_speed == TEGRA_USB_PHY_PORT_SPEED_FULL)
+ val |= TEGRA_USB_PORTSC1_PTC(6);
+ else if (context->port_speed == TEGRA_USB_PHY_PORT_SPEED_LOW)
+ val |= TEGRA_USB_PORTSC1_PTC(7);
+ writel(val, &hw->port_status[0]);
+ udelay(10);
+ }
/* Disable test mode by setting PTC field to NORMAL_OP */
val = readl(&hw->port_status[0]);
@@ -332,9 +340,11 @@ static int tegra_usb_resume(struct usb_hcd *hcd)
}
}
+ tegra_ehci_phy_restore_end(tegra->phy);
return 0;
restart:
+ tegra_ehci_phy_restore_end(tegra->phy);
tegra_ehci_restart(hcd);
return 0;
}