tegra: usb: otg: Clear only interrupt enabling bits in suspend
Joshua Cha [Mon, 23 Apr 2012 09:15:59 +0000 (14:15 +0530)]
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>

Conflicts:

drivers/usb/otg/tegra-otg.c

Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>

drivers/usb/otg/tegra-otg.c

index 4c138f1..e918683 100644 (file)
@@ -535,10 +535,13 @@ static int tegra_otg_suspend(struct device *dev)
        struct tegra_otg_data *tegra_otg = platform_get_drvdata(pdev);
        struct usb_phy *phy = &tegra_otg->phy;
        enum usb_otg_state from = phy->otg->phy->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 && phy->otg->gadget) {