tegra: usb: otg: Clear only interrupt enabling bits in suspend
Joshua Cha [Mon, 16 Apr 2012 14:39:19 +0000 (23:39 +0900)]
In resuming from LP1, USB HOST is wrongly detected in Tegra2.
In that time, adb connection doesn't work also.
So clear only interrupt enabling bits to fix this problem.

Bug 960254
Bug 970012

Change-Id: I2f8e891ab2abcf8552526ff305d6f3a148076edd
Signed-off-by: Joshua Cha <joshuac@nvidia.com>
Reviewed-on: http://git-master/r/96769
Reviewed-by: Simone Willett <swillett@nvidia.com>
Tested-by: Simone Willett <swillett@nvidia.com>

drivers/usb/otg/tegra-otg.c

index 35dea5a..ecb88ac 100644 (file)
@@ -545,10 +545,13 @@ static int tegra_otg_suspend(struct device *dev)
        struct tegra_otg_data *tegra_otg = platform_get_drvdata(pdev);
        struct otg_transceiver *otg = &tegra_otg->otg;
        enum usb_otg_state from = otg->state;
+       unsigned int val;
+
        /* store the interupt enable for cable ID and VBUS */
        clk_enable(tegra_otg->clk);
        tegra_otg->intr_reg_data = readl(tegra_otg->regs + USB_PHY_WAKEUP);
-       writel(0, (tegra_otg->regs + USB_PHY_WAKEUP));
+       val = tegra_otg->intr_reg_data & ~(USB_ID_INT_EN | USB_VBUS_INT_EN);
+       writel(val, (tegra_otg->regs + USB_PHY_WAKEUP));
        clk_disable(tegra_otg->clk);
 
        if (from == OTG_STATE_B_PERIPHERAL && otg->gadget) {