diff options
author | Abhishek Aggarwal <aaggarwal@nvidia.com> | 2010-05-24 18:42:19 +0530 |
---|---|---|
committer | Gary King <gking@nvidia.com> | 2010-05-28 17:50:44 -0700 |
commit | 547de0b298e7113b4e5a8b63d56396b478163007 (patch) | |
tree | 25a1c26c01fa8750648bb95abb969de48a20bcb6 /arch/arm/mach-tegra | |
parent | 1f8151757685553dd859d1e4c9d00d3f9c006d6c (diff) |
ehci-tegra: fix OTG state detection at boot-time on USB1
The USB device connected to USB1(OTG) port was not getting detected at
boot time. Reason being that on phy power down (host mode), there was
some delay in VBUS getting disabled. Because of this the OTG state was
getting set to "peripheral" instead of "host".
Fixed this by waiting for VBUS to be disabled in phy power down with a
max wait time of phy hardware time out (1 sec).
Change-Id: I78e561e28d942fa9931dfb88656281b02264859f
Reviewed-on: http://git-master/r/1837
Reviewed-by: Gary King <gking@nvidia.com>
Tested-by: Gary King <gking@nvidia.com>
Diffstat (limited to 'arch/arm/mach-tegra')
-rw-r--r-- | arch/arm/mach-tegra/nvddk/nvddk_usbphy.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/arch/arm/mach-tegra/nvddk/nvddk_usbphy.c b/arch/arm/mach-tegra/nvddk/nvddk_usbphy.c index a3d53f4807cf..630f7623dba8 100644 --- a/arch/arm/mach-tegra/nvddk/nvddk_usbphy.c +++ b/arch/arm/mach-tegra/nvddk/nvddk_usbphy.c @@ -700,6 +700,8 @@ NvDdkUsbPhyPowerDown( NvBool IsDpd) { NvError e = NvSuccess; + NvDdkUsbPhyIoctl_VBusStatusOutputArgs VBusStatus; + NvU32 TimeOut = USB_PHY_HW_TIMEOUT_US; NV_ASSERT(hUsbPhy); @@ -720,6 +722,16 @@ NvDdkUsbPhyPowerDown( if (IsHostMode) { UsbPrivEnableVbus(hUsbPhy, NV_FALSE); + /* Wait till Vbus is turned off */ + do + { + NvOsWaitUS(1000); + TimeOut -= 1000; + e = hUsbPhy->Ioctl(hUsbPhy, + NvDdkUsbPhyIoctlType_VBusStatus, + NULL, + &VBusStatus); + } while (VBusStatus.VBusDetected && TimeOut); } // Power down the USB Phy NV_CHECK_ERROR_CLEANUP(hUsbPhy->PowerDown(hUsbPhy)); |