summaryrefslogtreecommitdiffstats
path: root/drivers/input/keyboard
diff options
context:
space:
mode:
authorMagnus Damm <damm@igel.co.jp>2009-04-01 14:39:20 +0000
committerPaul Mundt <lethal@linux-sh.org>2009-04-02 11:20:43 +0900
commit4ba50df685e85b9d912a290d9614ffbeb4d9f060 (patch)
treea09420574539613254621ebf33dd59e2fb212163 /drivers/input/keyboard
parent2dcec7a988a1895540460a0bf5603bab63d5a3ed (diff)
downloadblackbird-obmc-linux-4ba50df685e85b9d912a290d9614ffbeb4d9f060.tar.gz
blackbird-obmc-linux-4ba50df685e85b9d912a290d9614ffbeb4d9f060.zip
input: sh_keysc: use enable/disable_irq_wake()
Modify the sh_keysc driver to use enable/disable_irq_wake() during suspend and resume. These functions are used to enable the sh_keysc interrupt in the interrupt controller so the keypad can be used to wakeup the system from suspend. Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'drivers/input/keyboard')
-rw-r--r--drivers/input/keyboard/sh_keysc.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/drivers/input/keyboard/sh_keysc.c b/drivers/input/keyboard/sh_keysc.c
index e1480fb11de3..cea70e6a1031 100644
--- a/drivers/input/keyboard/sh_keysc.c
+++ b/drivers/input/keyboard/sh_keysc.c
@@ -259,12 +259,15 @@ static int sh_keysc_suspend(struct device *dev)
{
struct platform_device *pdev = to_platform_device(dev);
struct sh_keysc_priv *priv = platform_get_drvdata(pdev);
+ int irq = platform_get_irq(pdev, 0);
unsigned short value;
value = ioread16(priv->iomem_base + KYCR1_OFFS);
- if (device_may_wakeup(dev))
+ if (device_may_wakeup(dev)) {
value |= 0x80;
+ enable_irq_wake(irq);
+ }
else
value &= ~0x80;
@@ -272,8 +275,20 @@ static int sh_keysc_suspend(struct device *dev)
return 0;
}
+static int sh_keysc_resume(struct device *dev)
+{
+ struct platform_device *pdev = to_platform_device(dev);
+ int irq = platform_get_irq(pdev, 0);
+
+ if (device_may_wakeup(dev))
+ disable_irq_wake(irq);
+
+ return 0;
+}
+
static struct dev_pm_ops sh_keysc_dev_pm_ops = {
.suspend = sh_keysc_suspend,
+ .resume = sh_keysc_resume,
};
struct platform_driver sh_keysc_device_driver = {
OpenPOWER on IntegriCloud