summaryrefslogtreecommitdiff
path: root/drivers/input/keyboard
diff options
context:
space:
mode:
authorShiraz Hashim <shiraz.hashim@st.com>2012-07-13 00:11:10 -0700
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2012-07-13 00:13:29 -0700
commit53fe628558bab9a11050ba067a09442c92dca6bb (patch)
treec8adb4be864e62aa3e2caa6777f543deb4422056 /drivers/input/keyboard
parent9a932145f2d57bad1092ba006dee9065adc5eb39 (diff)
Input: spear_keyboard - fix clock handling during suspend/resume
SPEAr keyboard should normally disable clock during suspend and enable it during resume. For cases where it is expected to act as a wakeup source the clock can remain in the same state i.e. kept enabled if it is being used. Signed-off-by: Shiraz Hashim <shiraz.hashim@st.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input/keyboard')
-rw-r--r--drivers/input/keyboard/spear-keyboard.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/drivers/input/keyboard/spear-keyboard.c b/drivers/input/keyboard/spear-keyboard.c
index c499387d8735..617a33dc2ef3 100644
--- a/drivers/input/keyboard/spear-keyboard.c
+++ b/drivers/input/keyboard/spear-keyboard.c
@@ -320,11 +320,12 @@ static int spear_kbd_suspend(struct device *dev)
mutex_lock(&input_dev->mutex);
- if (input_dev->users)
- clk_enable(kbd->clk);
-
- if (device_may_wakeup(&pdev->dev))
+ if (device_may_wakeup(&pdev->dev)) {
enable_irq_wake(kbd->irq);
+ } else {
+ if (input_dev->users)
+ clk_disable(kbd->clk);
+ }
mutex_unlock(&input_dev->mutex);
@@ -339,11 +340,12 @@ static int spear_kbd_resume(struct device *dev)
mutex_lock(&input_dev->mutex);
- if (device_may_wakeup(&pdev->dev))
+ if (device_may_wakeup(&pdev->dev)) {
disable_irq_wake(kbd->irq);
-
- if (input_dev->users)
- clk_enable(kbd->clk);
+ } else {
+ if (input_dev->users)
+ clk_enable(kbd->clk);
+ }
mutex_unlock(&input_dev->mutex);