summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorPrashant Gaikwad <pgaikwad@nvidia.com>2011-03-29 19:10:04 +0530
committerVarun Colbert <vcolbert@nvidia.com>2011-04-01 19:29:40 -0700
commit8014ff69b2b8a860840f04d26ad164ae8353b04d (patch)
treede40ee36f6375477636eae5f032d5b3ab4c5b152 /arch
parentb1b863de1b1a83f8f9edd8e8e6172d3aa55f3f60 (diff)
tegra: otg: detect usb hotplug
Detect vbus and enable clock for usb otg using the interrupt received in usb phy. usb phy interrupt is configured to max8907c usb detect interrupt to get event for usb insertion when otg is suspended. Bug 806949 Change-Id: I73fb92534ce5ae8d1ea39dfe756f940b89af7d79 Reviewed-on: http://git-master/r/24684 Reviewed-by: Varun Colbert <vcolbert@nvidia.com> Tested-by: Varun Colbert <vcolbert@nvidia.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-tegra/usb_phy.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/arch/arm/mach-tegra/usb_phy.c b/arch/arm/mach-tegra/usb_phy.c
index 376142a8a546..d7bc6180f94a 100644
--- a/arch/arm/mach-tegra/usb_phy.c
+++ b/arch/arm/mach-tegra/usb_phy.c
@@ -1041,6 +1041,10 @@ static void uhsic_phy_power_off(struct tegra_usb_phy *phy)
}
+#ifdef CONFIG_USB_TEGRA_OTG
+extern void tegra_otg_check_vbus_detection(void);
+#endif
+
static irqreturn_t usb_phy_vbus_irq_thr(int irq, void *pdata)
{
struct tegra_usb_phy *phy = pdata;
@@ -1048,8 +1052,17 @@ static irqreturn_t usb_phy_vbus_irq_thr(int irq, void *pdata)
if (!phy->regulator_on) {
regulator_enable(phy->reg_vdd);
phy->regulator_on = 1;
+ /*
+ * Optimal time to get the regulator turned on
+ * before detecting vbus interrupt.
+ */
+ mdelay(15);
}
+#ifdef CONFIG_USB_TEGRA_OTG
+ tegra_otg_check_vbus_detection();
+#endif
+
return IRQ_HANDLED;
}