aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/input/keyboard/imx_keypad.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/input/keyboard/imx_keypad.c b/drivers/input/keyboard/imx_keypad.c
index 6c545bf607e7..12e49f17e740 100644
--- a/drivers/input/keyboard/imx_keypad.c
+++ b/drivers/input/keyboard/imx_keypad.c
@@ -285,11 +285,6 @@ static void imx_keypad_check_for_events(unsigned long data)
285 reg_val = readw(keypad->mmio_base + KPSR); 285 reg_val = readw(keypad->mmio_base + KPSR);
286 reg_val |= KBD_STAT_KPKR | KBD_STAT_KRSS; 286 reg_val |= KBD_STAT_KPKR | KBD_STAT_KRSS;
287 writew(reg_val, keypad->mmio_base + KPSR); 287 writew(reg_val, keypad->mmio_base + KPSR);
288
289 reg_val = readw(keypad->mmio_base + KPSR);
290 reg_val |= KBD_STAT_KRIE;
291 reg_val &= ~KBD_STAT_KDIE;
292 writew(reg_val, keypad->mmio_base + KPSR);
293 } 288 }
294} 289}
295 290
@@ -545,6 +540,7 @@ static int imx_kbd_suspend(struct device *dev)
545 struct platform_device *pdev = to_platform_device(dev); 540 struct platform_device *pdev = to_platform_device(dev);
546 struct imx_keypad *kbd = platform_get_drvdata(pdev); 541 struct imx_keypad *kbd = platform_get_drvdata(pdev);
547 struct input_dev *input_dev = kbd->input_dev; 542 struct input_dev *input_dev = kbd->input_dev;
543 unsigned short reg_val = readw(kbd->mmio_base + KPSR);
548 544
549 /* imx kbd can wake up system even clock is disabled */ 545 /* imx kbd can wake up system even clock is disabled */
550 mutex_lock(&input_dev->mutex); 546 mutex_lock(&input_dev->mutex);
@@ -554,8 +550,14 @@ static int imx_kbd_suspend(struct device *dev)
554 550
555 mutex_unlock(&input_dev->mutex); 551 mutex_unlock(&input_dev->mutex);
556 552
557 if (device_may_wakeup(&pdev->dev)) 553 if (device_may_wakeup(&pdev->dev)) {
554 /* make sure KDI interrupt enabled */
555 reg_val |= KBD_STAT_KDIE;
556 reg_val &= ~KBD_STAT_KRIE;
557 writew(reg_val, kbd->mmio_base + KPSR);
558
558 enable_irq_wake(kbd->irq); 559 enable_irq_wake(kbd->irq);
560 }
559 else 561 else
560 pinctrl_pm_select_sleep_state(dev); 562 pinctrl_pm_select_sleep_state(dev);
561 563