summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNaga Radhesh <naga.radheshy@stericsson.com>2011-11-15 12:09:57 +0530
committerPhilippe Langlais <philippe.langlais@stericsson.com>2012-05-22 11:03:38 +0200
commit9e9b46f37032b6ac8e49bdf3ef5d9c629290126e (patch)
tree0933b82a6b60ea971ec251e41a5a1d82aa319198
parentaa7a9648269fc983f8c0035f353f83d608c3ed56 (diff)
input:db5500:Do not switch to keypad mode always
Do not switch to keypad mode always after resume,switch depending on the mode before suspend. ST-Ericsson ID: 373356 ST-Ericsson Linux next: NA ST-Ericsson FOSS-OUT ID: Trivial Signed-off-by: Naga Radhesh <naga.radheshy@stericsson.com> Change-Id: Ic0e0b6c1711145cb00839c9f8f125916f8d1aea4 Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/37740 Reviewed-by: QABUILD Reviewed-by: Naveen Kumar GADDIPATI <naveen.gaddipati@stericsson.com> Reviewed-by: Rabin VINCENT <rabin.vincent@stericsson.com>
-rw-r--r--drivers/input/keyboard/db5500_keypad.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/input/keyboard/db5500_keypad.c b/drivers/input/keyboard/db5500_keypad.c
index 45d2f652d60..729775d99e8 100644
--- a/drivers/input/keyboard/db5500_keypad.c
+++ b/drivers/input/keyboard/db5500_keypad.c
@@ -54,6 +54,7 @@
* @gpio_work : delayed work variable for reporting key event in gpio mode
* @previous_set: previous set of registers
* @enable : flag to enable the driver event
+ * @enable_on_resume: set if keypad should be enabled on resume
* @valid_key : hold the state of valid key press
* @db5500_rows : rows gpio array for db5500 keypad
* @db5500_cols : cols gpio array for db5500 keypad
@@ -73,6 +74,7 @@ struct db5500_keypad {
struct delayed_work gpio_work;
u8 previous_set[KEYPAD_MAX_ROWS];
bool enable;
+ bool enable_on_resume;
bool valid_key;
int db5500_rows[KEYPAD_MAX_ROWS];
int db5500_cols[KEYPAD_MAX_COLS];
@@ -707,6 +709,7 @@ static int db5500_keypad_suspend(struct device *dev)
cancel_delayed_work_sync(&keypad->gpio_work);
cancel_delayed_work_sync(&keypad->switch_work);
disable_irq(irq);
+ keypad->enable_on_resume = keypad->enable;
if (keypad->enable) {
db5500_mode_enable(keypad, false);
keypad->enable = false;
@@ -732,9 +735,15 @@ static int db5500_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) {
keypad->enable = true;
db5500_mode_enable(keypad, true);
+ /*
+ * Schedule the work queue to change it to GPIO mode
+ * if there is no activity keypad mode
+ */
+ schedule_delayed_work(&keypad->switch_work,
+ keypad->board->switch_delay);
}
enable_irq(irq);
}