diff options
| author | Magnus Damm <damm@igel.co.jp> | 2009-04-01 10:39:20 -0400 |
|---|---|---|
| committer | Paul Mundt <lethal@linux-sh.org> | 2009-04-01 22:20:43 -0400 |
| commit | 4ba50df685e85b9d912a290d9614ffbeb4d9f060 (patch) | |
| tree | a09420574539613254621ebf33dd59e2fb212163 | |
| parent | 2dcec7a988a1895540460a0bf5603bab63d5a3ed (diff) | |
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>
| -rw-r--r-- | drivers/input/keyboard/sh_keysc.c | 17 |
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) | |||
| 259 | { | 259 | { |
| 260 | struct platform_device *pdev = to_platform_device(dev); | 260 | struct platform_device *pdev = to_platform_device(dev); |
| 261 | struct sh_keysc_priv *priv = platform_get_drvdata(pdev); | 261 | struct sh_keysc_priv *priv = platform_get_drvdata(pdev); |
| 262 | int irq = platform_get_irq(pdev, 0); | ||
| 262 | unsigned short value; | 263 | unsigned short value; |
| 263 | 264 | ||
| 264 | value = ioread16(priv->iomem_base + KYCR1_OFFS); | 265 | value = ioread16(priv->iomem_base + KYCR1_OFFS); |
| 265 | 266 | ||
| 266 | if (device_may_wakeup(dev)) | 267 | if (device_may_wakeup(dev)) { |
| 267 | value |= 0x80; | 268 | value |= 0x80; |
| 269 | enable_irq_wake(irq); | ||
| 270 | } | ||
| 268 | else | 271 | else |
| 269 | value &= ~0x80; | 272 | value &= ~0x80; |
| 270 | 273 | ||
| @@ -272,8 +275,20 @@ static int sh_keysc_suspend(struct device *dev) | |||
| 272 | return 0; | 275 | return 0; |
| 273 | } | 276 | } |
| 274 | 277 | ||
| 278 | static int sh_keysc_resume(struct device *dev) | ||
| 279 | { | ||
| 280 | struct platform_device *pdev = to_platform_device(dev); | ||
| 281 | int irq = platform_get_irq(pdev, 0); | ||
| 282 | |||
| 283 | if (device_may_wakeup(dev)) | ||
| 284 | disable_irq_wake(irq); | ||
| 285 | |||
| 286 | return 0; | ||
| 287 | } | ||
| 288 | |||
| 275 | static struct dev_pm_ops sh_keysc_dev_pm_ops = { | 289 | static struct dev_pm_ops sh_keysc_dev_pm_ops = { |
| 276 | .suspend = sh_keysc_suspend, | 290 | .suspend = sh_keysc_suspend, |
| 291 | .resume = sh_keysc_resume, | ||
| 277 | }; | 292 | }; |
| 278 | 293 | ||
| 279 | struct platform_driver sh_keysc_device_driver = { | 294 | struct platform_driver sh_keysc_device_driver = { |
