usb: otg: tegra: Avoid spurious interrupts
Rakesh Bodla [Fri, 8 Mar 2013 09:25:55 +0000 (14:25 +0530)]
Disable vbus interrupt if cable is detected through PMU.
This is to avoid spurious interrupts.

Bug 1242710

Change-Id: Ie17ffd043df674c8f93ecd8145759187f2b879b6
Signed-off-by: Rakesh Bodla <rbodla@nvidia.com>
Reviewed-on: http://git-master/r/207503
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Venkat Moganty <vmoganty@nvidia.com>

drivers/usb/otg/tegra-otg.c

index ef10256..e0db213 100644 (file)
@@ -139,12 +139,17 @@ static unsigned long enable_interrupt(struct tegra_otg_data *tegra, bool en)
        val = otg_readl(tegra, USB_PHY_WAKEUP);
        if (en) {
                if (tegra->builtin_host)
-                       val |= USB_INT_EN;
+                       val |= USB_ID_INT_EN | USB_ID_PIN_WAKEUP_EN;
                else
-                       val |= USB_VBUS_INT_EN | USB_VBUS_WAKEUP_EN | USB_ID_PIN_WAKEUP_EN;
+                       val |= USB_ID_PIN_WAKEUP_EN;
+
+               /* Enable vbus interrupt if cable is not detected through PMU */
+               if (!tegra->support_pmu_vbus)
+                       val |= USB_VBUS_INT_EN | USB_VBUS_WAKEUP_EN;
        }
        else
                val &= ~USB_INT_EN;
+
        otg_writel(tegra, val, USB_PHY_WAKEUP);
        /* Add delay to make sure register is updated */
        udelay(1);