aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/keyboard/spitzkbd.c
diff options
context:
space:
mode:
authorRussell King <rmk@arm.linux.org.uk>2005-10-28 12:52:56 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2005-10-28 12:52:56 -0400
commit9480e307cd88ef09ec9294c7d97ebec18e6d2221 (patch)
tree967e26d3a23c24dd52b114d672312c207714308c /drivers/input/keyboard/spitzkbd.c
parenta3a3395e487abc4c1371fe319a8ecbb3913a70a4 (diff)
[PATCH] DRIVER MODEL: Get rid of the obsolete tri-level suspend/resume callbacks
In PM v1, all devices were called at SUSPEND_DISABLE level. Then all devices were called at SUSPEND_SAVE_STATE level, and finally SUSPEND_POWER_DOWN level. However, with PM v2, to maintain compatibility for platform devices, I arranged for the PM v2 suspend/resume callbacks to call the old PM v1 suspend/resume callbacks three times with each level in order so that existing drivers continued to work. Since this is obsolete infrastructure which is no longer necessary, we can remove it. Here's an (untested) patch to do exactly that. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/input/keyboard/spitzkbd.c')
-rw-r--r--drivers/input/keyboard/spitzkbd.c40
1 files changed, 19 insertions, 21 deletions
diff --git a/drivers/input/keyboard/spitzkbd.c b/drivers/input/keyboard/spitzkbd.c
index 732fb310e487..cee9c734a048 100644
--- a/drivers/input/keyboard/spitzkbd.c
+++ b/drivers/input/keyboard/spitzkbd.c
@@ -309,34 +309,32 @@ static void spitzkbd_hinge_timer(unsigned long data)
309} 309}
310 310
311#ifdef CONFIG_PM 311#ifdef CONFIG_PM
312static int spitzkbd_suspend(struct device *dev, pm_message_t state, uint32_t level) 312static int spitzkbd_suspend(struct device *dev, pm_message_t state)
313{ 313{
314 if (level == SUSPEND_POWER_DOWN) { 314 int i;
315 int i; 315 struct spitzkbd *spitzkbd = dev_get_drvdata(dev);
316 struct spitzkbd *spitzkbd = dev_get_drvdata(dev); 316 spitzkbd->suspended = 1;
317 spitzkbd->suspended = 1; 317
318 318 /* Set Strobe lines as inputs - *except* strobe line 0 leave this
319 /* Set Strobe lines as inputs - *except* strobe line 0 leave this 319 enabled so we can detect a power button press for resume */
320 enabled so we can detect a power button press for resume */ 320 for (i = 1; i < SPITZ_KEY_STROBE_NUM; i++)
321 for (i = 1; i < SPITZ_KEY_STROBE_NUM; i++) 321 pxa_gpio_mode(spitz_strobes[i] | GPIO_IN);
322 pxa_gpio_mode(spitz_strobes[i] | GPIO_IN); 322
323 }
324 return 0; 323 return 0;
325} 324}
326 325
327static int spitzkbd_resume(struct device *dev, uint32_t level) 326static int spitzkbd_resume(struct device *dev)
328{ 327{
329 if (level == RESUME_POWER_ON) { 328 int i;
330 int i; 329 struct spitzkbd *spitzkbd = dev_get_drvdata(dev);
331 struct spitzkbd *spitzkbd = dev_get_drvdata(dev); 330
331 for (i = 0; i < SPITZ_KEY_STROBE_NUM; i++)
332 pxa_gpio_mode(spitz_strobes[i] | GPIO_OUT | GPIO_DFLT_HIGH);
332 333
333 for (i = 0; i < SPITZ_KEY_STROBE_NUM; i++) 334 /* Upon resume, ignore the suspend key for a short while */
334 pxa_gpio_mode(spitz_strobes[i] | GPIO_OUT | GPIO_DFLT_HIGH); 335 spitzkbd->suspend_jiffies = jiffies;
336 spitzkbd->suspended = 0;
335 337
336 /* Upon resume, ignore the suspend key for a short while */
337 spitzkbd->suspend_jiffies = jiffies;
338 spitzkbd->suspended = 0;
339 }
340 return 0; 338 return 0;
341} 339}
342#else 340#else