summaryrefslogtreecommitdiff
path: root/arch/arm/mach-tegra/tegra3_usb_phy.c
diff options
context:
space:
mode:
authorSuresh Mangipudi <smangipudi@nvidia.com>2012-08-09 13:54:57 +0530
committerSimone Willett <swillett@nvidia.com>2012-08-10 23:03:52 -0700
commitc065d9e47085fbb98924d986c3915f279e504fc8 (patch)
tree65f134d08b89de17249260bcbcab6f66b5d056f1 /arch/arm/mach-tegra/tegra3_usb_phy.c
parent6e789ddf027ae942bfb7e442cc66e218f919bb28 (diff)
arm: tegra: usb_phy: remote-wake for LS devices
Remote wakeup was not working for low speed devices. Remote wakeup interrupt is now handled properly for low speed devices. Bug 1029608 Change-Id: If224f30ccc6275b97d50120fe04d9aa53d495e2e Signed-off-by: Suresh Mangipudi <smangipudi@nvidia.com> Reviewed-on: http://git-master/r/122367 Reviewed-by: Simone Willett <swillett@nvidia.com> Tested-by: Simone Willett <swillett@nvidia.com>
Diffstat (limited to 'arch/arm/mach-tegra/tegra3_usb_phy.c')
-rw-r--r--arch/arm/mach-tegra/tegra3_usb_phy.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/arch/arm/mach-tegra/tegra3_usb_phy.c b/arch/arm/mach-tegra/tegra3_usb_phy.c
index b27c3083d36b..af9eaab782c7 100644
--- a/arch/arm/mach-tegra/tegra3_usb_phy.c
+++ b/arch/arm/mach-tegra/tegra3_usb_phy.c
@@ -1222,6 +1222,8 @@ static int utmi_phy_irq(struct tegra_usb_phy *phy)
{
void __iomem *base = phy->regs;
unsigned long val = 0;
+ bool remote_wakeup = false;
+ int irq_status = IRQ_HANDLED;
if (phy->phy_clk_on) {
DBG("%s(%d) inst:[%d]\n", __func__, __LINE__, phy->inst);
@@ -1233,8 +1235,10 @@ static int utmi_phy_irq(struct tegra_usb_phy *phy)
usb_phy_fence_read(phy);
/* check if there is any remote wake event */
- if (utmi_phy_remotewake_detected(phy))
+ if (utmi_phy_remotewake_detected(phy)) {
pr_info("%s: utmip remote wake detected\n", __func__);
+ remote_wakeup = true;
+ }
if (phy->pdata->u_data.host.hot_plug) {
val = readl(base + USB_SUSP_CTRL);
@@ -1244,17 +1248,23 @@ static int utmi_phy_irq(struct tegra_usb_phy *phy)
writel(val , (base + USB_SUSP_CTRL));
pr_info("%s: usb device plugged-in\n", __func__);
val = readl(base + USB_USBSTS);
- if (!(val & USB_USBSTS_PCI))
- return IRQ_NONE;
+ if (!(val & USB_USBSTS_PCI)) {
+ irq_status = IRQ_NONE;
+ goto exit;
+ }
val = readl(base + USB_PORTSC);
val &= ~(USB_PORTSC_WKCN | USB_PORTSC_RWC_BITS);
writel(val , (base + USB_PORTSC));
} else if (!phy->phy_clk_on) {
- return IRQ_NONE;
+ if (remote_wakeup)
+ irq_status = IRQ_HANDLED;
+ else
+ irq_status = IRQ_NONE;
+ goto exit;
}
}
-
- return IRQ_HANDLED;
+exit:
+ return irq_status;
}
static void utmi_phy_enable_obs_bus(struct tegra_usb_phy *phy)