summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVenkat Moganty <vmoganty@nvidia.com>2010-04-30 18:02:53 +0530
committerYu-Huan Hsu <yhsu@nvidia.com>2010-05-02 18:04:56 -0700
commit39b6195af80e0a362695a9981b9b920ed5b73946 (patch)
treec25e40740789a6d6d46eb002a1c9339292e4e62d
parentfd0894b82c9ac8bc051f3291849370eabc193ca8 (diff)
tegra odm: Enable USB-VBUS detection through pmu.
Enabled USB-VBUS detection through pmu on whistler for turning off USB power rail to reduce the USB power when there is no cable connection. Bug 667912: AVDD_USB_Power is consuming 3.82mW of power in OSIdle and ULP audio playback case. Tested on Android/whistler and USB power goes to 0mW. Change-Id: Ia4bdc327b6d1b86921c296cadc48c3a4a2c35e73 Reviewed-on: http://git-master/r/1245 Tested-by: Dara Ramesh <dramesh@nvidia.com> Reviewed-by: Narendra Damahe <ndamahe@nvidia.com> Tested-by: Narendra Damahe <ndamahe@nvidia.com> Reviewed-by: Yu-Huan Hsu <yhsu@nvidia.com>
-rwxr-xr-x[-rw-r--r--]arch/arm/configs/tegra_whistler_android_defconfig3
-rwxr-xr-x[-rw-r--r--]arch/arm/mach-tegra/Kconfig5
-rwxr-xr-x[-rw-r--r--]arch/arm/mach-tegra/odm_kit/query/whistler/nvodm_query.c20
3 files changed, 21 insertions, 7 deletions
diff --git a/arch/arm/configs/tegra_whistler_android_defconfig b/arch/arm/configs/tegra_whistler_android_defconfig
index 4faae5ace8c2..d98a89f93985 100644..100755
--- a/arch/arm/configs/tegra_whistler_android_defconfig
+++ b/arch/arm/configs/tegra_whistler_android_defconfig
@@ -1,7 +1,7 @@
#
# Automatically generated make config: don't edit
# Linux kernel version: 2.6.29
-# Fri Apr 23 16:48:15 2010
+# Fri Apr 30 17:38:10 2010
#
CONFIG_ARM=y
CONFIG_SYS_SUPPORTS_APM_EMULATION=y
@@ -200,6 +200,7 @@ CONFIG_TEGRA_ODM_RFKILL=y
# CONFIG_TEGRA_NVEC is not set
CONFIG_TEGRA_ODM_VIBRATE=y
# CONFIG_TEGRA_PCI is not set
+CONFIG_TEGRA_USB_VBUS_DETECT_BY_PMU=y
# CONFIG_TEGRA_ODM_HARMONY is not set
CONFIG_TEGRA_ODM_WHISTLER=y
# CONFIG_TEGRA_ODM_CONCORDE is not set
diff --git a/arch/arm/mach-tegra/Kconfig b/arch/arm/mach-tegra/Kconfig
index 37c4a8af3bab..5106870d8385 100644..100755
--- a/arch/arm/mach-tegra/Kconfig
+++ b/arch/arm/mach-tegra/Kconfig
@@ -102,6 +102,11 @@ config TEGRA_PCI
config TEGRA_SNOR
boolean
+config TEGRA_USB_VBUS_DETECT_BY_PMU
+ boolean "VBUS detection by PMU"
+ help
+ Enables USB VBUS detection by PMU
+
source "arch/arm/mach-tegra/odm_kit/Kconfig"
endif
diff --git a/arch/arm/mach-tegra/odm_kit/query/whistler/nvodm_query.c b/arch/arm/mach-tegra/odm_kit/query/whistler/nvodm_query.c
index 865ffad93220..2391b317de33 100644..100755
--- a/arch/arm/mach-tegra/odm_kit/query/whistler/nvodm_query.c
+++ b/arch/arm/mach-tegra/odm_kit/query/whistler/nvodm_query.c
@@ -1146,7 +1146,11 @@ NvOdmQueryPinAttributes(const NvOdmPinAttrib** pPinAttributes)
NvBool NvOdmQueryGetPmuProperty(NvOdmPmuProperty* pPmuProperty)
{
+#ifdef CONFIG_TEGRA_USB_VBUS_DETECT_BY_PMU
+ pPmuProperty->IrqConnected = NV_TRUE;
+#else
pPmuProperty->IrqConnected = NV_FALSE;
+#endif
pPmuProperty->PowerGoodCount = 0x7E;
pPmuProperty->IrqPolarity = NvOdmInterruptPolarity_Low;
@@ -1202,13 +1206,17 @@ const NvOdmUsbProperty*
NvOdmQueryGetUsbProperty(NvOdmIoModule OdmIoModule,
NvU32 Instance)
{
-
+#ifdef CONFIG_TEGRA_USB_VBUS_DETECT_BY_PMU
+#define NVODM_USE_INTERNAL_PHY_VBUS_DETECTION NV_FALSE
+#else
+#define NVODM_USE_INTERNAL_PHY_VBUS_DETECTION NV_TRUE
+#endif
static const NvOdmUsbProperty Usb1Property =
{
NvOdmUsbInterfaceType_Utmi,
(NvOdmUsbChargerType_SE0 | NvOdmUsbChargerType_SE1 | NvOdmUsbChargerType_SK),
20,
- NV_TRUE,
+ NVODM_USE_INTERNAL_PHY_VBUS_DETECTION,
#ifdef CONFIG_USB_TEGRA_OTG
NvOdmUsbModeType_OTG,
#else
@@ -1224,7 +1232,7 @@ NvOdmQueryGetUsbProperty(NvOdmIoModule OdmIoModule,
NvOdmUsbInterfaceType_UlpiExternalPhy,
NvOdmUsbChargerType_UsbHost,
20,
- NV_TRUE,
+ NVODM_USE_INTERNAL_PHY_VBUS_DETECTION,
NvOdmUsbModeType_None,
NvOdmUsbIdPinType_None,
NvOdmUsbConnectorsMuxType_None,
@@ -1236,7 +1244,7 @@ NvOdmQueryGetUsbProperty(NvOdmIoModule OdmIoModule,
NvOdmUsbInterfaceType_UlpiNullPhy,
NvOdmUsbChargerType_UsbHost,
20,
- NV_TRUE,
+ NVODM_USE_INTERNAL_PHY_VBUS_DETECTION,
NvOdmUsbModeType_Host,
NvOdmUsbIdPinType_None,
NvOdmUsbConnectorsMuxType_None,
@@ -1249,7 +1257,7 @@ NvOdmQueryGetUsbProperty(NvOdmIoModule OdmIoModule,
NvOdmUsbInterfaceType_Utmi,
NvOdmUsbChargerType_UsbHost,
20,
- NV_TRUE,
+ NVODM_USE_INTERNAL_PHY_VBUS_DETECTION,
NvOdmUsbModeType_Host,
NvOdmUsbIdPinType_CableId,
NvOdmUsbConnectorsMuxType_None,
@@ -1262,7 +1270,7 @@ NvOdmQueryGetUsbProperty(NvOdmIoModule OdmIoModule,
NvOdmUsbInterfaceType_Utmi,
NvOdmUsbChargerType_UsbHost,
20,
- NV_TRUE,
+ NVODM_USE_INTERNAL_PHY_VBUS_DETECTION,
NvOdmUsbModeType_None,
NvOdmUsbIdPinType_None,
NvOdmUsbConnectorsMuxType_None,