summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVarun Wadekar <vwadekar@nvidia.com>2010-04-19 11:53:44 +0530
committerGary King <gking@nvidia.com>2010-04-22 21:35:14 -0700
commit68a3877a1eca418ff2ae26346d5990c300a67eca (patch)
treea9ea127bebdbcd78d9847d5b213b20d97aceb082
parentfcfcd9683b9b96474f3796f6b38a003a8923ae76 (diff)
tegra keyboard: do not disable key scanning in EC during suspend
Removed the support to disable key scanning from the EC based keyboard driver when the system enters suspend state. This way any key press in suspend state is recognised by the EC which in turn wakes up the AP. reviewed by nobody tested on Harmony For Bug 673371 Change-Id: Ie28c4f135b0ba2fcfb95667d015802fea0cb2001 Reviewed-on: http://git-master/r/1146 Tested-by: Varun Wadekar <vwadekar@nvidia.com> Reviewed-by: Phillip Smith <psmith@nvidia.com> Reviewed-by: Mayuresh Kulkarni <mkulkarni@nvidia.com> Reviewed-by: Gary King <gking@nvidia.com>
-rw-r--r--drivers/input/keyboard/tegra-nvec.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/drivers/input/keyboard/tegra-nvec.c b/drivers/input/keyboard/tegra-nvec.c
index 5f0cdbb6793f..09022289a219 100644
--- a/drivers/input/keyboard/tegra-nvec.c
+++ b/drivers/input/keyboard/tegra-nvec.c
@@ -41,6 +41,7 @@ MODULE_DESCRIPTION(DRIVER_DESC);
MODULE_LICENSE(DRIVER_LICENSE);
#define NVEC_PAYLOAD 32
+#define KEYBOARD_SCANNING_DISABLED_IN_SUSPEND 0
/* The total number of scan codes will be (first - last) */
#define EC_FIRST_CODE 0x00
@@ -410,17 +411,20 @@ static int nvec_keyboard_remove(struct nvec_device *dev)
static int nvec_keyboard_suspend(struct nvec_device *pdev, pm_message_t state)
{
+#if KEYBOARD_SCANNING_DISABLED_IN_SUSPEND
NvEcRequest Request = {0};
NvEcResponse Response = {0};
+ NvError err = NvError_Success;
+#endif
struct input_dev *input_dev = nvec_get_drvdata(pdev);
struct nvec_keyboard *keyboard = input_get_drvdata(input_dev);
- NvError err = NvError_Success;
if (!keyboard) {
printk("%s: device handle is NULL\n", __func__);
return -1;
}
+#if KEYBOARD_SCANNING_DISABLED_IN_SUSPEND
/* disable keyboard scanning */
Request.PacketType = NvEcPacketType_Request;
Request.RequestType = NvEcRequestResponseType_Keyboard;
@@ -443,7 +447,7 @@ static int nvec_keyboard_suspend(struct nvec_device *pdev, pm_message_t state)
printk("%s: scanning could not be disabled\n", __func__);
return -1;
}
-
+#endif
/* power down hardware */
if (!NvOdmKeyboardPowerHandler(NV_TRUE)) {
printk("%s: hardware power down fail\n", __func__);
@@ -455,11 +459,13 @@ static int nvec_keyboard_suspend(struct nvec_device *pdev, pm_message_t state)
static int nvec_keyboard_resume(struct nvec_device *pdev)
{
+#if KEYBOARD_SCANNING_DISABLED_IN_SUSPEND
NvEcRequest Request = {0};
NvEcResponse Response = {0};
+ NvError err = NvError_Success;
+#endif
struct input_dev *input_dev = nvec_get_drvdata(pdev);
struct nvec_keyboard *keyboard = input_get_drvdata(input_dev);
- NvError err = NvError_Success;
if (!keyboard) {
printk("%s: device handle is NULL\n", __func__);
@@ -472,6 +478,7 @@ static int nvec_keyboard_resume(struct nvec_device *pdev)
return -1;
}
+#if KEYBOARD_SCANNING_DISABLED_IN_SUSPEND
/* re-enable keyboard scanning */
Request.PacketType = NvEcPacketType_Request;
Request.RequestType = NvEcRequestResponseType_Keyboard;
@@ -480,11 +487,11 @@ static int nvec_keyboard_resume(struct nvec_device *pdev)
Request.NumPayloadBytes = 0;
err = NvEcSendRequest(
- keyboard->hNvec,
- &Request,
- &Response,
- sizeof(Request),
- sizeof(Response));
+ keyboard->hNvec,
+ &Request,
+ &Response,
+ sizeof(Request),
+ sizeof(Response));
if (err != NvError_Success) {
printk("%s: scanning enable request send fail\n", __func__);
return -1;
@@ -494,6 +501,7 @@ static int nvec_keyboard_resume(struct nvec_device *pdev)
printk("%s: scanning could not be enabled\n", __func__);
return -1;
}
+#endif
return 0;
}