summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRakesh Bodla <rbodla@nvidia.com>2012-06-04 17:15:35 +0530
committerSimone Willett <swillett@nvidia.com>2012-06-06 17:12:38 -0700
commit93d719048d06bf3cddff7ee6cdd46b42160101a9 (patch)
tree5762b8e1a25b58794856620a1405b7cee7ac4486
parent333dd36a0c2f725abc41f2420420ec89538b9a04 (diff)
usb: otg: tegra: Enable ID_WAKEUP in otg suspend
Disabling the ID_WAKEUP in the suspend causing the otg state to change to host, so disabling it in otg suspend. Also, renaming the readl calls to otg_readl call. Bug 993390 Change-Id: I2789ea31fefe4425eb63b6be3e70d794bddcfd83 Signed-off-by: Rakesh Bodla <rbodla@nvidia.com> Reviewed-on: http://git-master/r/106177 Reviewed-by: Simone Willett <swillett@nvidia.com> Tested-by: Simone Willett <swillett@nvidia.com>
-rw-r--r--drivers/usb/otg/tegra-otg.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/drivers/usb/otg/tegra-otg.c b/drivers/usb/otg/tegra-otg.c
index 2719a62f873d..3bb43c6a9799 100644
--- a/drivers/usb/otg/tegra-otg.c
+++ b/drivers/usb/otg/tegra-otg.c
@@ -507,9 +507,9 @@ static int tegra_otg_suspend(struct device *dev)
tegra_state_name(otg->state));
clk_enable(tegra->clk);
- val = readl(tegra->regs + USB_PHY_WAKEUP);
- val &= ~USB_INT_EN;
- writel(val, tegra->regs + USB_PHY_WAKEUP);
+ val = otg_readl(tegra, USB_PHY_WAKEUP);
+ val &= ~(USB_ID_INT_EN | USB_VBUS_INT_EN);
+ otg_writel(tegra, val, USB_PHY_WAKEUP);
clk_disable(tegra->clk);
/* Suspend peripheral mode, host mode is taken care by host driver */
@@ -531,8 +531,8 @@ static void tegra_otg_resume(struct device *dev)
/* Clear pending interrupts */
clk_enable(tegra->clk);
- val = readl(tegra->regs + USB_PHY_WAKEUP);
- writel(val, tegra->regs + USB_PHY_WAKEUP);
+ val = otg_readl(tegra, USB_PHY_WAKEUP);
+ otg_writel(tegra, val, USB_PHY_WAKEUP);
DBG("%s(%d) PHY WAKEUP register : 0x%x\n", __func__, __LINE__, val);
clk_disable(tegra->clk);
@@ -546,11 +546,7 @@ static void tegra_otg_resume(struct device *dev)
spin_unlock_irqrestore(&tegra->lock, flags);
irq_work(&tegra->work);
- clk_enable(tegra->clk);
- val = readl(tegra->regs + USB_PHY_WAKEUP);
- val |= USB_INT_EN;
- writel(val, tegra->regs + USB_PHY_WAKEUP);
- clk_disable(tegra->clk);
+ enable_interrupt(tegra, true);
DBG("%s(%d) END\n", __func__, __LINE__);
}