summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSuresh Mangipudi <smangipudi@nvidia.com>2010-07-22 23:22:21 -0700
committerGary King <gking@nvidia.com>2010-07-23 14:47:38 -0700
commit987c1b76cc38282538f5a6bb1d9c9b0c1a2e2aca (patch)
tree8c5a5ac056510aaf620638e3b5018ee27b992b6f
parent729e783e4f5d231996eaf754233d4d5de96f0780 (diff)
[ventana] lp0 support
Set 2 sources of wake up, for ventana 1. PWR key 2. WAKE key Added support for reading the odm option for the low power state from the odm data that is provided during nvflash. Change-Id: Ib8da228a89bb514f1bce2f4971e432c269cd80ea Reviewed-on: http://git-master/r/4187 Reviewed-by: Gary King <gking@nvidia.com> Tested-by: Gary King <gking@nvidia.com>
-rw-r--r--arch/arm/mach-tegra/odm_kit/query/ventana/nvodm_query.c39
1 files changed, 31 insertions, 8 deletions
diff --git a/arch/arm/mach-tegra/odm_kit/query/ventana/nvodm_query.c b/arch/arm/mach-tegra/odm_kit/query/ventana/nvodm_query.c
index 73a536f6ff63..e9f96403e39f 100644
--- a/arch/arm/mach-tegra/odm_kit/query/ventana/nvodm_query.c
+++ b/arch/arm/mach-tegra/odm_kit/query/ventana/nvodm_query.c
@@ -39,6 +39,12 @@
#include "nvodm_query_pins.h"
#include "nvodm_query_pins_ap20.h"
#include "nvrm_drf.h"
+#include "nvodm_keylist_reserved.h"
+
+
+#define TEGRA_DEVKIT_BCT_CUSTOPT_0_LPSTATE_RANGE 31:31
+#define TEGRA_DEVKIT_BCT_CUSTOPT_0_LPSTATE_LP0 0x0UL
+#define TEGRA_DEVKIT_BCT_CUSTOPT_0_LPSTATE_LP1 0x1UL
// Wake Events
static NvOdmWakeupPadInfo s_NvOdmWakeupPadInfo[] =
@@ -48,13 +54,13 @@ static NvOdmWakeupPadInfo s_NvOdmWakeupPadInfo[] =
{NV_FALSE, 2, NvOdmWakeupPadPolarity_High}, // Wake Event 2 - dvi_d3
{NV_FALSE, 3, NvOdmWakeupPadPolarity_Low}, // Wake Event 3 - sdio3_dat1
{NV_FALSE, 4, NvOdmWakeupPadPolarity_High}, // Wake Event 4 - hdmi_int (HDMI_HPD)
- {NV_TRUE, 5, NvOdmWakeupPadPolarity_Low}, // Wake Event 5 - vgp[6] (VI_GP6, Flash_EN2)
+ {NV_FALSE, 5, NvOdmWakeupPadPolarity_Low}, // Wake Event 5 - vgp[6] (VI_GP6, Flash_EN2)
{NV_FALSE, 6, NvOdmWakeupPadPolarity_High}, // Wake Event 6 - gp3_pu[5] (Lid On/Off)
{NV_FALSE, 7, NvOdmWakeupPadPolarity_AnyEdge}, // Wake Event 7 - gp3_pu[6] (GPS_INT, BT_IRQ)
- {NV_FALSE, 8, NvOdmWakeupPadPolarity_AnyEdge}, // Wake Event 8 - gmi_wp_n (MICRO SD_CD)
+ {NV_TRUE, 8, NvOdmWakeupPadPolarity_Low}, // Wake Event 8 - gmi_wp_n (MICRO SD_CD)
{NV_FALSE, 9, NvOdmWakeupPadPolarity_High}, // Wake Event 9 - gp3_ps[2] (KB_COL10)
{NV_FALSE, 10, NvOdmWakeupPadPolarity_High}, // Wake Event 10 - gmi_ad21 (Accelerometer_TH/TAP)
- {NV_TRUE, 11, NvOdmWakeupPadPolarity_Low}, // Wake Event 11 - spi2_cs2 (PEN_INT, AUDIO-IRQ, LOW_BAT#)
+ {NV_FALSE, 11, NvOdmWakeupPadPolarity_Low}, // Wake Event 11 - spi2_cs2 (PEN_INT, AUDIO-IRQ, LOW_BAT#)
{NV_FALSE, 12, NvOdmWakeupPadPolarity_Low}, // Wake Event 12 - spi2_cs1 (HEADSET_DET, not used)
{NV_FALSE, 13, NvOdmWakeupPadPolarity_Low}, // Wake Event 13 - sdio1_dat1
{NV_FALSE, 14, NvOdmWakeupPadPolarity_High}, // Wake Event 14 - gp3_pv[6] (WLAN_INT)
@@ -62,12 +68,12 @@ static NvOdmWakeupPadInfo s_NvOdmWakeupPadInfo[] =
{NV_FALSE, 16, NvOdmWakeupPadPolarity_High}, // Wake Event 16 - rtc_irq
{NV_FALSE, 17, NvOdmWakeupPadPolarity_High}, // Wake Event 17 - kbc_interrupt
{NV_FALSE, 18, NvOdmWakeupPadPolarity_Low}, // Wake Event 18 - pwr_int (PMIC_INT)
- {NV_TRUE, 19, NvOdmWakeupPadPolarity_High}, // Wake Event 19 - usb_vbus_wakeup[0]
+ {NV_FALSE, 19, NvOdmWakeupPadPolarity_High}, // Wake Event 19 - usb_vbus_wakeup[0]
{NV_FALSE, 20, NvOdmWakeupPadPolarity_High}, // Wake Event 20 - usb_vbus_wakeup[1]
{NV_FALSE, 21, NvOdmWakeupPadPolarity_Low}, // Wake Event 21 - usb_iddig[0]
{NV_FALSE, 22, NvOdmWakeupPadPolarity_Low}, // Wake Event 22 - usb_iddig[1]
{NV_FALSE, 23, NvOdmWakeupPadPolarity_Low}, // Wake Event 23 - gmi_iordy (HSMMC_CLK)
- {NV_FALSE, 24, NvOdmWakeupPadPolarity_High}, // Wake Event 24 - gp3_pv[2] (power key on gpio port v2)
+ {NV_TRUE, 24, NvOdmWakeupPadPolarity_Low}, // Wake Event 24 - gp3_pv[2] (power key on gpio port v2)
{NV_FALSE, 25, NvOdmWakeupPadPolarity_High}, // Wake Event 25 - gp3_ps[4] (KB_COL12)
{NV_FALSE, 26, NvOdmWakeupPadPolarity_High}, // Wake Event 26 - gp3_ps[5] (KB_COL10)
{NV_FALSE, 27, NvOdmWakeupPadPolarity_High}, // Wake Event 27 - gp3_ps[0] (KB_COL8)
@@ -406,10 +412,27 @@ NvBool NvOdmQueryGetPmuProperty(NvOdmPmuProperty* pPmuProperty)
*/
const NvOdmSocPowerStateInfo* NvOdmQueryLowestSocPowerState(void)
{
- static const NvOdmSocPowerStateInfo Info =
- { NvOdmSocPowerState_Suspend, 525 };
+ static NvOdmSocPowerStateInfo PowerStateInfo;
+ const static NvOdmSocPowerStateInfo* pPowerStateInfo = NULL;
+ NvOdmServicesKeyListHandle hKeyList;
+ NvU32 LPStateSelection = 0;
+ if (pPowerStateInfo == NULL)
+ {
- return &Info;
+ hKeyList = NvOdmServicesKeyListOpen();
+ if (hKeyList)
+ {
+ LPStateSelection = NvOdmServicesGetKeyValue(hKeyList,
+ NvOdmKeyListId_ReservedBctCustomerOption);
+ NvOdmServicesKeyListClose(hKeyList);
+ LPStateSelection = NV_DRF_VAL(TEGRA_DEVKIT, BCT_CUSTOPT, LPSTATE, LPStateSelection);
+ }
+ // Lowest power state controlled by the flashed custom option.
+ PowerStateInfo.LowestPowerState = ((LPStateSelection != TEGRA_DEVKIT_BCT_CUSTOPT_0_LPSTATE_LP1)?
+ NvOdmSocPowerState_Suspend : NvOdmSocPowerState_DeepSleep);
+ pPowerStateInfo = (const NvOdmSocPowerStateInfo*) &PowerStateInfo;
+ }
+ return (pPowerStateInfo);
}
const NvOdmUsbProperty *NvOdmQueryGetUsbProperty(