diff options
author | Deepak Sikri <deepak.sikri@st.com> | 2012-11-08 19:35:27 -0500 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2012-11-10 03:29:39 -0500 |
commit | 1eee4af30e9261114e6e4e3576f130780124d7be (patch) | |
tree | 3387508378038fc0d271c288bfd9e240b0eb1bb6 /drivers/input/keyboard | |
parent | d852f9597359babcc3f6b328cefc151ab6995d00 (diff) |
Input: spear-keyboard - fix for balancing the enable_irq_wake
This patch handles the fix for unbalanced irq for the cases when
enable_irq_wake fails, and a warning related to same is displayed
on the console. The workaround is handled at the driver level.
Signed-off-by: Deepak Sikri <deepak.sikri@st.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input/keyboard')
-rw-r--r-- | drivers/input/keyboard/spear-keyboard.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/input/keyboard/spear-keyboard.c b/drivers/input/keyboard/spear-keyboard.c index c7ca97f44bfb..7685b476d6c1 100644 --- a/drivers/input/keyboard/spear-keyboard.c +++ b/drivers/input/keyboard/spear-keyboard.c | |||
@@ -60,10 +60,11 @@ struct spear_kbd { | |||
60 | struct clk *clk; | 60 | struct clk *clk; |
61 | unsigned int irq; | 61 | unsigned int irq; |
62 | unsigned int mode; | 62 | unsigned int mode; |
63 | unsigned int suspended_rate; | ||
63 | unsigned short last_key; | 64 | unsigned short last_key; |
64 | unsigned short keycodes[NUM_ROWS * NUM_COLS]; | 65 | unsigned short keycodes[NUM_ROWS * NUM_COLS]; |
65 | bool rep; | 66 | bool rep; |
66 | unsigned int suspended_rate; | 67 | bool irq_wake_enabled; |
67 | u32 mode_ctl_reg; | 68 | u32 mode_ctl_reg; |
68 | }; | 69 | }; |
69 | 70 | ||
@@ -333,7 +334,8 @@ static int spear_kbd_suspend(struct device *dev) | |||
333 | mode_ctl_reg = readl_relaxed(kbd->io_base + MODE_CTL_REG); | 334 | mode_ctl_reg = readl_relaxed(kbd->io_base + MODE_CTL_REG); |
334 | 335 | ||
335 | if (device_may_wakeup(&pdev->dev)) { | 336 | if (device_may_wakeup(&pdev->dev)) { |
336 | enable_irq_wake(kbd->irq); | 337 | if (!enable_irq_wake(kbd->irq)) |
338 | kbd->irq_wake_enabled = true; | ||
337 | 339 | ||
338 | /* | 340 | /* |
339 | * reprogram the keyboard operating frequency as on some | 341 | * reprogram the keyboard operating frequency as on some |
@@ -379,7 +381,10 @@ static int spear_kbd_resume(struct device *dev) | |||
379 | mutex_lock(&input_dev->mutex); | 381 | mutex_lock(&input_dev->mutex); |
380 | 382 | ||
381 | if (device_may_wakeup(&pdev->dev)) { | 383 | if (device_may_wakeup(&pdev->dev)) { |
382 | disable_irq_wake(kbd->irq); | 384 | if (kbd->irq_wake_enabled) { |
385 | kbd->irq_wake_enabled = false; | ||
386 | disable_irq_wake(kbd->irq); | ||
387 | } | ||
383 | } else { | 388 | } else { |
384 | if (input_dev->users) | 389 | if (input_dev->users) |
385 | clk_enable(kbd->clk); | 390 | clk_enable(kbd->clk); |