summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRakesh Bodla <rbodla@nvidia.com>2012-06-04 17:15:35 +0530
committerManish Tuteja <mtuteja@nvidia.com>2012-06-07 22:01:34 -0700
commite35ca19ad72b96ece75d3fd93e961a084ba4391e (patch)
tree4bb8cbf54bb8548d450e8dc5ef5198f45fdee679
parente4f591e4f7672810452dc1cdde71435f7e07fcae (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/106712 Reviewed-by: Venkat Moganty <vmoganty@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 f91a8f8f78e7..5b289b53951c 100644
--- a/drivers/usb/otg/tegra-otg.c
+++ b/drivers/usb/otg/tegra-otg.c
@@ -509,9 +509,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 */
@@ -533,8 +533,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);
@@ -548,11 +548,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__);
}