summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorAbhishek Aggarwal <aaggarwal@nvidia.com>2010-07-10 14:41:36 +0530
committerGary King <gking@nvidia.com>2010-07-12 11:40:31 -0700
commit457ec59ccfeb9059ade4c66d39823dd76abac4a2 (patch)
tree5f0c68fb31e259823cf864b6b9137a915c6f259c /arch
parenteff952ceefefb8e1a392a0a9e1a8be674e0a9f5e (diff)
usb phy: restricting save & restore reg context to ULPI host
The save and restore register context is only required for the dedicated devices connected to host. In AP20/T20 these devices are connected over ULPI interface. Hence, restricting this feature to ULPI interface to reduce time taken during suspending and resuming device from LP0. For LP1/LP2, it is enabled for all the supported USB interfaces (UTMI and ULPI). Bug: 702910 Change-Id: Iddb4a86ec97a668c7f984a140af000eb760fc426 Reviewed-on: http://git-master/r/3200 Tested-by: Abhishek Aggarwal <aaggarwal@nvidia.com> Reviewed-by: Gary King <gking@nvidia.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-tegra/nvddk/nvddk_usbphy.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/arch/arm/mach-tegra/nvddk/nvddk_usbphy.c b/arch/arm/mach-tegra/nvddk/nvddk_usbphy.c
index 630f7623dba8..55dc3ab0e1b7 100644
--- a/arch/arm/mach-tegra/nvddk/nvddk_usbphy.c
+++ b/arch/arm/mach-tegra/nvddk/nvddk_usbphy.c
@@ -634,6 +634,7 @@ NvDdkUsbPhyPowerUp(
NvBool IsDpd)
{
NvError e = NvSuccess;
+ NvOdmSocPowerStateInfo *pLowPowerState = NvOdmQueryLowestSocPowerState();
NV_ASSERT(hUsbPhy);
@@ -668,7 +669,11 @@ NvDdkUsbPhyPowerUp(
// Power up the Phy
NV_CHECK_ERROR_CLEANUP(hUsbPhy->PowerUp(hUsbPhy));
- if (hUsbPhy->pProperty->UsbMode == NvOdmUsbModeType_Host)
+ /* Allow restoring register context for the USB host if it is a ULPI
+ interface or if the lowest power state is LP1 */
+ if ((hUsbPhy->pProperty->UsbMode == NvOdmUsbModeType_Host) &&
+ ((pLowPowerState->LowestPowerState != NvOdmSocPowerState_DeepSleep) ||
+ (hUsbPhy->pProperty->UsbInterfaceType == NvOdmUsbInterfaceType_UlpiExternalPhy)))
{
hUsbPhy->RestoreContext(hUsbPhy);
}
@@ -702,6 +707,7 @@ NvDdkUsbPhyPowerDown(
NvError e = NvSuccess;
NvDdkUsbPhyIoctl_VBusStatusOutputArgs VBusStatus;
NvU32 TimeOut = USB_PHY_HW_TIMEOUT_US;
+ NvOdmSocPowerStateInfo *pLowPowerState = NvOdmQueryLowestSocPowerState();
NV_ASSERT(hUsbPhy);
@@ -712,7 +718,11 @@ NvDdkUsbPhyPowerDown(
return e;
}
- if (hUsbPhy->pProperty->UsbMode == NvOdmUsbModeType_Host)
+ /* Allow saving register context for the USB host if it is a ULPI
+ interface or if the lowest power state is LP1 */
+ if ((hUsbPhy->pProperty->UsbMode == NvOdmUsbModeType_Host) &&
+ ((pLowPowerState->LowestPowerState != NvOdmSocPowerState_DeepSleep) ||
+ (hUsbPhy->pProperty->UsbInterfaceType == NvOdmUsbInterfaceType_UlpiExternalPhy)))
{
hUsbPhy->SaveContext(hUsbPhy);
}