diff options
author | Shiraz Hashim <shiraz.hashim@st.com> | 2012-07-13 03:11:10 -0400 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2012-07-13 03:13:29 -0400 |
commit | 53fe628558bab9a11050ba067a09442c92dca6bb (patch) | |
tree | c8adb4be864e62aa3e2caa6777f543deb4422056 /drivers/input | |
parent | 9a932145f2d57bad1092ba006dee9065adc5eb39 (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')
-rw-r--r-- | drivers/input/keyboard/spear-keyboard.c | 18 |
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) | |||
320 | 320 | ||
321 | mutex_lock(&input_dev->mutex); | 321 | mutex_lock(&input_dev->mutex); |
322 | 322 | ||
323 | if (input_dev->users) | 323 | if (device_may_wakeup(&pdev->dev)) { |
324 | clk_enable(kbd->clk); | ||
325 | |||
326 | if (device_may_wakeup(&pdev->dev)) | ||
327 | enable_irq_wake(kbd->irq); | 324 | enable_irq_wake(kbd->irq); |
325 | } else { | ||
326 | if (input_dev->users) | ||
327 | clk_disable(kbd->clk); | ||
328 | } | ||
328 | 329 | ||
329 | mutex_unlock(&input_dev->mutex); | 330 | mutex_unlock(&input_dev->mutex); |
330 | 331 | ||
@@ -339,11 +340,12 @@ static int spear_kbd_resume(struct device *dev) | |||
339 | 340 | ||
340 | mutex_lock(&input_dev->mutex); | 341 | mutex_lock(&input_dev->mutex); |
341 | 342 | ||
342 | if (device_may_wakeup(&pdev->dev)) | 343 | if (device_may_wakeup(&pdev->dev)) { |
343 | disable_irq_wake(kbd->irq); | 344 | disable_irq_wake(kbd->irq); |
344 | 345 | } else { | |
345 | if (input_dev->users) | 346 | if (input_dev->users) |
346 | clk_enable(kbd->clk); | 347 | clk_enable(kbd->clk); |
348 | } | ||
347 | 349 | ||
348 | mutex_unlock(&input_dev->mutex); | 350 | mutex_unlock(&input_dev->mutex); |
349 | 351 | ||