aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Gong <b38343@freescale.com>2014-06-09 23:56:49 -0400
committerRobin Gong <b38343@freescale.com>2014-06-19 00:56:09 -0400
commit93e23abbe445dbd28b76080ef9cedd3de9b04844 (patch)
tree67df50f101e33b0d4df265fd61a1c4069cce1bd6
parentb7006412fbb18260bbc3f3646d5ddbb257efc15c (diff)
ENGR00318936-1 input: keyboard: imx: add pm_stay_awake and pm_relax
There is a small window after system suspend but timer scan function didn't finish timely, in this case, system enter suspend without kpp interrupt enabled and failed to resume back if key depressed.We add pm_stay_awake and pm_relax to make sure system suspend flow abort in this case. Signed-off-by: Robin Gong <b38343@freescale.com>
-rw-r--r--drivers/input/keyboard/imx_keypad.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/input/keyboard/imx_keypad.c b/drivers/input/keyboard/imx_keypad.c
index da0cd02b3f70..6c545bf607e7 100644
--- a/drivers/input/keyboard/imx_keypad.c
+++ b/drivers/input/keyboard/imx_keypad.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * Driver for the IMX keypad port. 2 * Driver for the IMX keypad port.
3 * Copyright (C) 2009 Alberto Panizzo <maramaopercheseimorto@gmail.com> 3 * Copyright (C) 2009 Alberto Panizzo <maramaopercheseimorto@gmail.com>
4 * Copyright (C) 2013 Freescale Semiconductor, Inc. 4 * Copyright (C) 2014 Freescale Semiconductor, Inc.
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as 7 * it under the terms of the GNU General Public License version 2 as
@@ -271,6 +271,7 @@ static void imx_keypad_check_for_events(unsigned long data)
271 reg_val |= KBD_STAT_KDIE; 271 reg_val |= KBD_STAT_KDIE;
272 reg_val &= ~KBD_STAT_KRIE; 272 reg_val &= ~KBD_STAT_KRIE;
273 writew(reg_val, keypad->mmio_base + KPSR); 273 writew(reg_val, keypad->mmio_base + KPSR);
274 pm_relax(keypad->input_dev->dev.parent);
274 } else { 275 } else {
275 /* 276 /*
276 * Some keys are still pressed. Schedule a rescan in 277 * Some keys are still pressed. Schedule a rescan in
@@ -306,6 +307,7 @@ static irqreturn_t imx_keypad_irq_handler(int irq, void *dev_id)
306 writew(reg_val, keypad->mmio_base + KPSR); 307 writew(reg_val, keypad->mmio_base + KPSR);
307 308
308 if (keypad->enabled) { 309 if (keypad->enabled) {
310 pm_stay_awake(keypad->input_dev->dev.parent);
309 /* The matrix is supposed to be changed */ 311 /* The matrix is supposed to be changed */
310 keypad->stable_count = 0; 312 keypad->stable_count = 0;
311 313