summaryrefslogtreecommitdiff
path: root/arch/arm
diff options
context:
space:
mode:
authorBharat Nihalani <bnihalani@nvidia.com>2010-03-30 14:02:04 +0530
committerGary King <gking@nvidia.com>2010-03-30 07:17:47 -0800
commitf4353b37be8710203a4a5788e80e8aeb0233d42d (patch)
treec8444041d3cb8f4c4f2d5d374e3b368bdc4aaabb /arch/arm
parent9b203c500630642dd9c0c8ecc80376da30f7968d (diff)
tegra-nvec: Report keystroke for the key that is used to wake up.
With this change, display comes up with a single key press; but the catch is that it only works with "Windows" and "F3" keys. This limitation is posed by Android and not EC. NOTE that for other than "Windows" and "F3" key presses, the system does wake up, but an additional "Windows"/"F3" key press is still required to get the display up. Also, explicitly letting EC know that it should allow any keyboard/mouse event for wake-up. This is the default behavior, but still wanted to explicitly specify. Change-Id: I2a1e7d90fbbfd810f2334ee3832e193bfb5e45b1 Reviewed-on: http://git-master/r/986 Reviewed-by: Sachin Nikam <snikam@nvidia.com> Tested-by: Sachin Nikam <snikam@nvidia.com> Reviewed-by: Mayuresh Kulkarni <mkulkarni@nvidia.com> Reviewed-by: Gary King <gking@nvidia.com>
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/mach-tegra/include/nvec.h1
-rw-r--r--arch/arm/mach-tegra/odm_kit/platform/keyboard/nvodm_keyboard.c27
-rw-r--r--arch/arm/mach-tegra/odm_kit/platform/mouse/nvodm_mouse.c3
3 files changed, 28 insertions, 3 deletions
diff --git a/arch/arm/mach-tegra/include/nvec.h b/arch/arm/mach-tegra/include/nvec.h
index 54c5b1873ec1..4bd934f74a71 100644
--- a/arch/arm/mach-tegra/include/nvec.h
+++ b/arch/arm/mach-tegra/include/nvec.h
@@ -1026,6 +1026,7 @@ typedef struct NvEcSleepGlobalConfigureEventReportingRequestPayloadRec
typedef enum
{
NvEcKeyboardSubtype_ConfigureWake = 0x3,
+ NvEcKeyboardSubtype_ConfigureWakeKeyReport,
NvEcKeyboardSubtype_Reset = 0xff,
NvEcKeyboardSubtype_Enable = 0xf4,
diff --git a/arch/arm/mach-tegra/odm_kit/platform/keyboard/nvodm_keyboard.c b/arch/arm/mach-tegra/odm_kit/platform/keyboard/nvodm_keyboard.c
index cbbc0d8b03a2..86ba9cbc6083 100644
--- a/arch/arm/mach-tegra/odm_kit/platform/keyboard/nvodm_keyboard.c
+++ b/arch/arm/mach-tegra/odm_kit/platform/keyboard/nvodm_keyboard.c
@@ -176,16 +176,39 @@ NvBool NvOdmKeyboardInit(void)
Request.RequestType = NvEcRequestResponseType_Keyboard;
Request.RequestSubtype = (NvEcRequestResponseSubtype)
NvEcKeyboardSubtype_ConfigureWake;
- Request.NumPayloadBytes = 1;
+ Request.NumPayloadBytes = 2;
Request.Payload[0] = NVEC_KEYBOARD_WAKE_ENABLE_0_ACTION_ENABLE;
+ Request.Payload[1] = NVEC_KEYBOARD_EVENT_TYPE_0_ANY_KEY_PRESS_ENABLE;
NvStatus = NvEcSendRequest(s_NvEcHandle,
&Request,
&Response,
sizeof(Request),
sizeof(Response));
- if (NvStatus != NvError_Success)
+ if (NvStatus != NvError_Success) {
+ goto cleanup;
+ }
+
+ if (Response.Status != NvEcStatus_Success) {
goto cleanup;
+ }
+
+ /* enable key reporting on wake up */
+ Request.PacketType = NvEcPacketType_Request;
+ Request.RequestType = NvEcRequestResponseType_Keyboard;
+ Request.RequestSubtype = (NvEcRequestResponseSubtype)
+ NvEcKeyboardSubtype_ConfigureWakeKeyReport;
+ Request.NumPayloadBytes = 1;
+ Request.Payload[0] = NVEC_KEYBOARD_REPORT_WAKE_KEY_0_ACTION_ENABLE;
+
+ NvStatus = NvEcSendRequest(s_NvEcHandle,
+ &Request,
+ &Response,
+ sizeof(Request),
+ sizeof(Response));
+ if (NvStatus != NvError_Success) {
+ goto cleanup;
+ }
if (Response.Status != NvEcStatus_Success) {
goto cleanup;
diff --git a/arch/arm/mach-tegra/odm_kit/platform/mouse/nvodm_mouse.c b/arch/arm/mach-tegra/odm_kit/platform/mouse/nvodm_mouse.c
index 842564241273..a527ea540d55 100644
--- a/arch/arm/mach-tegra/odm_kit/platform/mouse/nvodm_mouse.c
+++ b/arch/arm/mach-tegra/odm_kit/platform/mouse/nvodm_mouse.c
@@ -206,8 +206,9 @@ NvOdmMouseDeviceOpen(
(NV_DRF_NUM(NVEC,SUBTYPE,AUX_PORT_ID,hMouseDev->ValidMousePorts[i]))) |
(NvEcRequestResponseSubtype)
NvEcAuxDeviceSubtype_ConfigureWake;
- Request.NumPayloadBytes = 1;
+ Request.NumPayloadBytes = 2;
Request.Payload[0] = NVEC_AUX_DEVICE_WAKE_ENABLE_0_ACTION_ENABLE;
+ Request.Payload[1] = NVEC_AUX_DEVICE_EVENT_TYPE_0_ANY_EVENT_ENABLE;
err = NvEcSendRequest(
hMouseDev->hEc,