diff options
author | Abhishek Aggarwal <aaggarwal@nvidia.com> | 2010-05-24 18:42:19 +0530 |
---|---|---|
committer | Gary King <gking@nvidia.com> | 2010-05-27 07:40:09 -0700 |
commit | ae3a36307f58e03f9a1e1d3d4e790a96cd4e23ef (patch) | |
tree | 2a663a1985e1b138df54f87304c08bc7d5cde7cf /arch | |
parent | 10f48922980ac0717b180e23416f6530f3152fbe (diff) |
ldk usb: usb device detection at boot-time on USB1 (OTG)
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: I66c82fe33228734dddba325a203ed54347993b1d
Bug: 682618
Reviewed-on: http://git-master/r/1541
Tested-by: Abhishek Aggarwal <aaggarwal@nvidia.com>
Reviewed-by: Hanumanth Venkateswa Moganty <vmoganty@nvidia.com>
Tested-by: Hanumanth Venkateswa Moganty <vmoganty@nvidia.com>
Reviewed-by: Gary King <gking@nvidia.com>
Diffstat (limited to 'arch')
-rw-r--r--[-rwxr-xr-x] | 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 5d2dc57f3acf..01cfb0059b8f 100755..100644 --- a/arch/arm/mach-tegra/nvddk/nvddk_usbphy.c +++ b/arch/arm/mach-tegra/nvddk/nvddk_usbphy.c @@ -705,6 +705,8 @@ NvDdkUsbPhyPowerDown( NvBool IsDpd) { NvError e = NvSuccess; + NvDdkUsbPhyIoctl_VBusStatusOutputArgs VBusStatus; + NvU32 TimeOut = USB_PHY_HW_TIMEOUT_US; NV_ASSERT(hUsbPhy); @@ -725,6 +727,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)); |