From 873a30edbac4017af82525c1e2385d2b743f436e Mon Sep 17 00:00:00 2001 From: sgadagottu Date: Sat, 20 Mar 2010 01:57:00 +0530 Subject: tegra usb: Switching of USB busy hints, when no active USB tranfers are happening though a device connection on host port. Currently for harmony, an intergrated SMSC hub present on USB3. Because of this device connection is present on USB3 and USB power busy hints are always on. To avoid this, for host by default busy hints are off and USB busy hints will be on for : 1.Bulk and isochronus transfers 2.Interrupts transfers with buffer length >= 256. Busy hint will be on for pre-defined amount of time and after that busy hints will be off automatically. With this in idle state power is reduced. Tested on : Harmony Enumeartion is happening fine. LAN and USB HID devices are working fine Change-Id: Ifd653bebfb52c7702f7d24bf11ccf93e62ea0f66 Reviewed-on: http://git-master/r/915 Reviewed-by: Gary King Tested-by: Gary King --- arch/arm/mach-tegra/nvddk/nvddk_usbphy.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'arch/arm/mach-tegra/nvddk/nvddk_usbphy.c') diff --git a/arch/arm/mach-tegra/nvddk/nvddk_usbphy.c b/arch/arm/mach-tegra/nvddk/nvddk_usbphy.c index 7a9da42cdf7c..2ec63f3eae91 100644 --- a/arch/arm/mach-tegra/nvddk/nvddk_usbphy.c +++ b/arch/arm/mach-tegra/nvddk/nvddk_usbphy.c @@ -404,8 +404,11 @@ NvDdkUsbPhyHelperThread( /* wait for the signal to turn on/off the busy hints and vbus */ NvOsSemaphoreWaitTimeout(hUsbPhy->HelperThreadSema, NV_WAIT_INFINITE); - /* Turn on/off the USB busy hints */ - UsbPhyDfsBusyHint(hUsbPhy, hUsbPhy->IsPhyPoweredUp, NV_WAIT_INFINITE); + if (!(hUsbPhy->IsPhyPoweredUp && hUsbPhy->IsHostMode)) + { + /* Turn on/off the USB busy hints */ + UsbPhyDfsBusyHint(hUsbPhy, hUsbPhy->IsPhyPoweredUp, NV_WAIT_INFINITE); + } /* Turn on/off the vbus for host mode */ if (hUsbPhy->IsHostMode) { @@ -557,9 +560,12 @@ NvDdkUsbPhyOpen( // Open the H/W interface UsbPhyOpenHwInterface(pUsbPhy); - /* enable the busy hints for USB */ - UsbPhyDfsBusyHint(pUsbPhy, NV_TRUE, NV_WAIT_INFINITE); - + /* Enable the busy hints for USB device mode, for host mode * + * transaction based busy hints are on/off mechanism is present */ + if (pUsbPhy->pProperty->UsbMode != NvOdmUsbModeType_Host) + { + UsbPhyDfsBusyHint(pUsbPhy, NV_TRUE, NV_WAIT_INFINITE); + } // Initialize the USB Phy NV_CHECK_ERROR_CLEANUP(UsbPhyInitialize(pUsbPhy)); } -- cgit v1.2.3