提交 39ab9dde 编写于 作者: E Eric Miao 提交者: Dmitry Torokhov

Input: pxa27x_keypad - add wakeup support

Signed-off-by: NEric Miao <eric.miao@marvell.com>
Acked-by: NRussell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: NDmitry Torokhov <dtor@mail.ru>
上级 e8ef4347
...@@ -105,6 +105,8 @@ struct pxa27x_keypad { ...@@ -105,6 +105,8 @@ struct pxa27x_keypad {
struct input_dev *input_dev; struct input_dev *input_dev;
void __iomem *mmio_base; void __iomem *mmio_base;
int irq;
/* matrix key code map */ /* matrix key code map */
unsigned int matrix_keycodes[MAX_MATRIX_KEY_NUM]; unsigned int matrix_keycodes[MAX_MATRIX_KEY_NUM];
...@@ -385,6 +387,10 @@ static int pxa27x_keypad_suspend(struct platform_device *pdev, pm_message_t stat ...@@ -385,6 +387,10 @@ static int pxa27x_keypad_suspend(struct platform_device *pdev, pm_message_t stat
struct pxa27x_keypad *keypad = platform_get_drvdata(pdev); struct pxa27x_keypad *keypad = platform_get_drvdata(pdev);
clk_disable(keypad->clk); clk_disable(keypad->clk);
if (device_may_wakeup(&pdev->dev))
enable_irq_wake(keypad->irq);
return 0; return 0;
} }
...@@ -393,6 +399,9 @@ static int pxa27x_keypad_resume(struct platform_device *pdev) ...@@ -393,6 +399,9 @@ static int pxa27x_keypad_resume(struct platform_device *pdev)
struct pxa27x_keypad *keypad = platform_get_drvdata(pdev); struct pxa27x_keypad *keypad = platform_get_drvdata(pdev);
struct input_dev *input_dev = keypad->input_dev; struct input_dev *input_dev = keypad->input_dev;
if (device_may_wakeup(&pdev->dev))
disable_irq_wake(keypad->irq);
mutex_lock(&input_dev->mutex); mutex_lock(&input_dev->mutex);
if (input_dev->users) { if (input_dev->users) {
...@@ -497,6 +506,8 @@ static int __devinit pxa27x_keypad_probe(struct platform_device *pdev) ...@@ -497,6 +506,8 @@ static int __devinit pxa27x_keypad_probe(struct platform_device *pdev)
goto failed_free_dev; goto failed_free_dev;
} }
keypad->irq = irq;
/* Register the input device */ /* Register the input device */
error = input_register_device(input_dev); error = input_register_device(input_dev);
if (error) { if (error) {
...@@ -504,6 +515,8 @@ static int __devinit pxa27x_keypad_probe(struct platform_device *pdev) ...@@ -504,6 +515,8 @@ static int __devinit pxa27x_keypad_probe(struct platform_device *pdev)
goto failed_free_irq; goto failed_free_irq;
} }
device_init_wakeup(&pdev->dev, 1);
return 0; return 0;
failed_free_irq: failed_free_irq:
...@@ -527,7 +540,7 @@ static int __devexit pxa27x_keypad_remove(struct platform_device *pdev) ...@@ -527,7 +540,7 @@ static int __devexit pxa27x_keypad_remove(struct platform_device *pdev)
struct pxa27x_keypad *keypad = platform_get_drvdata(pdev); struct pxa27x_keypad *keypad = platform_get_drvdata(pdev);
struct resource *res; struct resource *res;
free_irq(platform_get_irq(pdev, 0), pdev); free_irq(keypad->irq, pdev);
clk_disable(keypad->clk); clk_disable(keypad->clk);
clk_put(keypad->clk); clk_put(keypad->clk);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册