diff mbox

[2/7] input/nomadik-ske: suspend and resume support

Message ID 1336913027-10047-1-git-send-email-linus.walleij@stericsson.com
State Rejected, archived
Headers show

Commit Message

Linus Walleij May 13, 2012, 12:43 p.m. UTC
From: Naveen Kumar Gaddipati <naveen.gaddipati@stericsson.com>

Suspend and resume support for ske keypad by using disable or
enable of keypad.

Signed-off-by: Naveen Kumar Gaddipati <naveen.gaddipati@stericsson.com>
Reviewed-by: Srinidhi Kasagar <srinidhi.kasagar@stericsson.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
 drivers/input/keyboard/nomadik-ske-keypad.c |   12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
diff mbox

Patch

diff --git a/drivers/input/keyboard/nomadik-ske-keypad.c b/drivers/input/keyboard/nomadik-ske-keypad.c
index 61c1537..0df47e5 100644
--- a/drivers/input/keyboard/nomadik-ske-keypad.c
+++ b/drivers/input/keyboard/nomadik-ske-keypad.c
@@ -368,8 +368,11 @@  static int ske_keypad_suspend(struct device *dev)
 
 	if (device_may_wakeup(dev))
 		enable_irq_wake(irq);
-	else
+	else {
+		disable_irq(keypad->irq);
 		ske_keypad_set_bits(keypad, SKE_IMSC, ~SKE_KPIMA, 0x0);
+		clk_disable(keypad->clk);
+	}
 
 	return 0;
 }
@@ -382,8 +385,11 @@  static int ske_keypad_resume(struct device *dev)
 
 	if (device_may_wakeup(dev))
 		disable_irq_wake(irq);
-	else
-		ske_keypad_set_bits(keypad, SKE_IMSC, 0x0, SKE_KPIMA);
+	else {
+		clk_enable(keypad->clk);
+		enable_irq(keypad->irq);
+		ske_keypad_chip_init(keypad);
+	}
 
 	return 0;
 }