Skip to content

Commit

Permalink
Input: spear_keyboard - fix clock handling during suspend/resume
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Shiraz Hashim authored and Dmitry Torokhov committed Jul 13, 2012
1 parent 9a93214 commit 53fe628
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions drivers/input/keyboard/spear-keyboard.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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);

Expand Down

0 comments on commit 53fe628

Please sign in to comment.