summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVarun Wadekar <vwadekar@nvidia.com>2010-05-13 18:43:04 +0530
committerGary King <gking@nvidia.com>2010-05-13 13:49:04 -0700
commitdb12d594697385aeb6c7448703730d1c5781750a (patch)
tree5845dae47d2b5b110e20313e30ce11f803e3e100
parentf08aaa2cefd32204ab8c0010454756a34df06c52 (diff)
tegra nvec_keyboard: disable key scanning before exiting
Ask the Ec to disable key scanning before closing the interface. tested on harmony Change-Id: Iad099994088506d28092c77d48a893dfccadec4e Reviewed-on: http://git-master/r/1380 Tested-by: Varun Wadekar <vwadekar@nvidia.com> Reviewed-by: Gary King <gking@nvidia.com>
-rw-r--r--arch/arm/mach-tegra/odm_kit/platform/keyboard/nvodm_keyboard.c22
1 files changed, 22 insertions, 0 deletions
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 86ba9cbc6083..df5990ace3aa 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
@@ -262,6 +262,10 @@ fail:
void NvOdmKeyboardDeInit(void)
{
+ NvError NvStatus = NvError_Success;
+ NvEcRequest Request = {0};
+ NvEcResponse Response = {0};
+
#if WAKE_FROM_KEYBOARD
NvRmGpioInterruptUnregister(s_hGpioGlobal, s_hRmGlobal, hOdm->GpioIntrHandle);
hOdm->GpioIntrHandle = NULL;
@@ -271,6 +275,24 @@ void NvOdmKeyboardDeInit(void)
hOdm = NULL;
#endif
+ /* stop the keyboard scanning */
+ Request.PacketType = NvEcPacketType_Request;
+ Request.RequestType = NvEcRequestResponseType_Keyboard;
+ Request.RequestSubtype = (NvEcRequestResponseSubtype) NvEcKeyboardSubtype_Disable;
+ Request.NumPayloadBytes = 0;
+
+ NvStatus = NvEcSendRequest(s_NvEcHandle, &Request, &Response, sizeof(Request), sizeof(Response));
+ if (NvStatus != NvError_Success)
+ {
+ NvOdmOsDebugPrintf("EC keyboard scanning disable fail\n");
+ }
+
+ /* check if command passed */
+ if (Response.Status != NvEcStatus_Success)
+ {
+ NvOdmOsDebugPrintf("EC keyboard scanning disable command fail\n");;
+ }
+
(void)NvEcUnregisterForEvents(s_hEcEventRegistration);
s_hEcEventRegistration = NULL;