diff options
author | b02247 <b02247@freescale.com> | 2012-07-04 14:56:46 +0800 |
---|---|---|
committer | b02247 <b02247@freescale.com> | 2012-07-04 15:28:10 +0800 |
commit | dba56b23388deba7686e0ac28e542bb566eb1d7c (patch) | |
tree | d5868b31ca789587ee38174c9d0e7d9608663aae /drivers/input/keyboard | |
parent | 641e97a8026abf6d0dabcf1c4abf228b0813686b (diff) |
ENGR00215740 enable the keypad as wake up source
enable the keypad as wake up source
Signed-off-by: b02247 <b02247@freescale.com>
Diffstat (limited to 'drivers/input/keyboard')
-rw-r--r-- | drivers/input/keyboard/imx_keypad.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/drivers/input/keyboard/imx_keypad.c b/drivers/input/keyboard/imx_keypad.c index d92c15c39e68..37f61efba838 100644 --- a/drivers/input/keyboard/imx_keypad.c +++ b/drivers/input/keyboard/imx_keypad.c @@ -567,10 +567,42 @@ static int __devexit imx_keypad_remove(struct platform_device *pdev) return 0; } +#ifdef CONFIG_PM +static int imx_keypad_suspend(struct device *dev) +{ + struct platform_device *pdev = to_platform_device(dev); + struct imx_keypad *keypad = platform_get_drvdata(pdev); + + if (device_may_wakeup(&pdev->dev)) + enable_irq_wake(keypad->irq); + + return 0; +} + +static int imx_keypad_resume(struct device *dev) +{ + struct platform_device *pdev = to_platform_device(dev); + struct imx_keypad *keypad = platform_get_drvdata(pdev); + + if (device_may_wakeup(&pdev->dev)) + disable_irq_wake(keypad->irq); + + return 0; +} + +static const struct dev_pm_ops imx_keypad_pm_ops = { + .suspend = imx_keypad_suspend, + .resume = imx_keypad_resume, +}; +#endif + static struct platform_driver imx_keypad_driver = { .driver = { .name = "imx-keypad", .owner = THIS_MODULE, +#ifdef CONFIG_PM + .pm = &imx_keypad_pm_ops, +#endif }, .probe = imx_keypad_probe, .remove = __devexit_p(imx_keypad_remove), |