aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input
diff options
context:
space:
mode:
authorMichael Hennerich <michael.hennerich@analog.com>2008-08-15 13:53:08 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2008-09-10 12:12:26 -0400
commit108fcb42c7bfd9ee205d1b8247813548705073b7 (patch)
tree5c748af0e103912ad0ca5167e7c2bc556b67604b /drivers/input
parentd8c1f317d1b3bb5c21175550968c86acfab3ff36 (diff)
Input: bf54x-keys - add power management support
Fix Bug: does nor properply resume after suspend mem Fix for PM_SUSPEND_MEM: Save and restore peripheral base registers Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Bryan Wu <cooloney@kernel.org> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input')
-rw-r--r--drivers/input/keyboard/bf54x-keys.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/drivers/input/keyboard/bf54x-keys.c b/drivers/input/keyboard/bf54x-keys.c
index 54ed8e2e1c02..f1d20817ef29 100644
--- a/drivers/input/keyboard/bf54x-keys.c
+++ b/drivers/input/keyboard/bf54x-keys.c
@@ -8,7 +8,7 @@
8 * 8 *
9 * 9 *
10 * Modified: 10 * Modified:
11 * Copyright 2007 Analog Devices Inc. 11 * Copyright 2007-2008 Analog Devices Inc.
12 * 12 *
13 * Bugs: Enter bugs at http://blackfin.uclinux.org/ 13 * Bugs: Enter bugs at http://blackfin.uclinux.org/
14 * 14 *
@@ -82,6 +82,9 @@ struct bf54x_kpad {
82 unsigned short *keycode; 82 unsigned short *keycode;
83 struct timer_list timer; 83 struct timer_list timer;
84 unsigned int keyup_test_jiffies; 84 unsigned int keyup_test_jiffies;
85 unsigned short kpad_msel;
86 unsigned short kpad_prescale;
87 unsigned short kpad_ctl;
85}; 88};
86 89
87static inline int bfin_kpad_find_key(struct bf54x_kpad *bf54x_kpad, 90static inline int bfin_kpad_find_key(struct bf54x_kpad *bf54x_kpad,
@@ -361,6 +364,10 @@ static int bfin_kpad_suspend(struct platform_device *pdev, pm_message_t state)
361{ 364{
362 struct bf54x_kpad *bf54x_kpad = platform_get_drvdata(pdev); 365 struct bf54x_kpad *bf54x_kpad = platform_get_drvdata(pdev);
363 366
367 bf54x_kpad->kpad_msel = bfin_read_KPAD_MSEL();
368 bf54x_kpad->kpad_prescale = bfin_read_KPAD_PRESCALE();
369 bf54x_kpad->kpad_ctl = bfin_read_KPAD_CTL();
370
364 if (device_may_wakeup(&pdev->dev)) 371 if (device_may_wakeup(&pdev->dev))
365 enable_irq_wake(bf54x_kpad->irq); 372 enable_irq_wake(bf54x_kpad->irq);
366 373
@@ -371,6 +378,10 @@ static int bfin_kpad_resume(struct platform_device *pdev)
371{ 378{
372 struct bf54x_kpad *bf54x_kpad = platform_get_drvdata(pdev); 379 struct bf54x_kpad *bf54x_kpad = platform_get_drvdata(pdev);
373 380
381 bfin_write_KPAD_MSEL(bf54x_kpad->kpad_msel);
382 bfin_write_KPAD_PRESCALE(bf54x_kpad->kpad_prescale);
383 bfin_write_KPAD_CTL(bf54x_kpad->kpad_ctl);
384
374 if (device_may_wakeup(&pdev->dev)) 385 if (device_may_wakeup(&pdev->dev))
375 disable_irq_wake(bf54x_kpad->irq); 386 disable_irq_wake(bf54x_kpad->irq);
376 387