summaryrefslogtreecommitdiff
path: root/drivers/input/keyboard
diff options
context:
space:
mode:
authorJonas Aaberg <jonas.aberg@stericsson.com>2011-10-21 07:48:23 +0200
committerPhilippe Langlais <philippe.langlais@stericsson.com>2012-05-22 11:03:37 +0200
commit9e6a558425b30cf60707526e2ca371d3f9193ee1 (patch)
treefd7343516a6874f70fa7c83fb4285cb2f8c32404 /drivers/input/keyboard
parenta515797959524b3ab491e9b677c554910b4971f8 (diff)
input: keyboard: nomadik-ske: Do not always enable on suspend
The resume hook did always enable the ske driver on resume. ST-Ericsson Linux next: - ST-Ericsson ID: 369127 ST-Ericsson FOSS-OUT ID: Trivial Change-Id: I613c0d0b0d626c77a422eaa65e3060dcc866ed56 Signed-off-by: Jonas Aaberg <jonas.aberg@stericsson.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/34793 Reviewed-by: QABUILD Reviewed-by: Bengt JONSSON <bengt.g.jonsson@stericsson.com>
Diffstat (limited to 'drivers/input/keyboard')
-rw-r--r--drivers/input/keyboard/nomadik-ske-keypad.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/input/keyboard/nomadik-ske-keypad.c b/drivers/input/keyboard/nomadik-ske-keypad.c
index 9a3e7dfb605..7ab061f0124 100644
--- a/drivers/input/keyboard/nomadik-ske-keypad.c
+++ b/drivers/input/keyboard/nomadik-ske-keypad.c
@@ -67,6 +67,7 @@
* @keymap: matrix scan code table for keycodes
* @clk: clock structure pointer
* @enable: flag to enable the driver event
+ * @enable_on_resume: set if keypad should be enabled on resume
* @regulator: pointer to the regulator used for ske kyepad
* @gpio_input_irq: array for gpio irqs
* @key_pressed: hold the key state
@@ -89,6 +90,7 @@ struct ske_keypad {
struct clk *clk;
spinlock_t ske_keypad_lock;
bool enable;
+ bool enable_on_resume;
struct regulator *regulator;
int gpio_input_irq[SKE_KPD_MAX_ROWS];
int key_pressed;
@@ -790,6 +792,9 @@ static int ske_keypad_suspend(struct device *dev)
cancel_delayed_work_sync(&keypad->work);
cancel_delayed_work_sync(&keypad->scan_work);
disable_irq(irq);
+
+ keypad->enable_on_resume = keypad->enable;
+
if (keypad->enable) {
ske_mode_enable(keypad, false);
keypad->enable = false;
@@ -808,7 +813,7 @@ static int ske_keypad_resume(struct device *dev)
if (device_may_wakeup(dev))
disable_irq_wake(irq);
else {
- if (!keypad->enable) {
+ if (keypad->enable_on_resume) {
keypad->enable = true;
ske_mode_enable(keypad, true);
}