From f43faf95ec2fc139a48743dfbabe26eaa189727c Mon Sep 17 00:00:00 2001 From: Anson Huang Date: Thu, 15 Dec 2016 21:54:30 +0800 Subject: [PATCH] MLK-13614 input: keyboard: imx: make sure keypad interrupts are enabled in suspend Change the suspend/resume callback to suspend_noirq/resume_noirq callback to make sure keypad interrupts are enabled during suspend, as when there is keypad interrupt coming after suspend callback is called, the interrupt handler will still be called and it will disable keypad interrupts, it will cause keypad can NOT generate interrupts to wake up system from suspend. Signed-off-by: Anson Huang --- drivers/input/keyboard/imx_keypad.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/input/keyboard/imx_keypad.c b/drivers/input/keyboard/imx_keypad.c index a2a1630f65bd..9b14cab768d5 100644 --- a/drivers/input/keyboard/imx_keypad.c +++ b/drivers/input/keyboard/imx_keypad.c @@ -528,7 +528,7 @@ static int imx_keypad_probe(struct platform_device *pdev) return 0; } -static int __maybe_unused imx_kbd_suspend(struct device *dev) +static int __maybe_unused imx_kbd_suspend_noirq(struct device *dev) { struct platform_device *pdev = to_platform_device(dev); struct imx_keypad *kbd = platform_get_drvdata(pdev); @@ -556,7 +556,7 @@ static int __maybe_unused imx_kbd_suspend(struct device *dev) return 0; } -static int __maybe_unused imx_kbd_resume(struct device *dev) +static int __maybe_unused imx_kbd_resume_noirq(struct device *dev) { struct platform_device *pdev = to_platform_device(dev); struct imx_keypad *kbd = platform_get_drvdata(pdev); @@ -580,7 +580,10 @@ err_clk: return ret; } -static SIMPLE_DEV_PM_OPS(imx_kbd_pm_ops, imx_kbd_suspend, imx_kbd_resume); +static const struct dev_pm_ops imx_kbd_pm_ops = { + .suspend_noirq = imx_kbd_suspend_noirq, + .resume_noirq = imx_kbd_resume_noirq, +}; static struct platform_driver imx_keypad_driver = { .driver = {