aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/keyboard
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
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')
-rw-r--r--drivers/input/keyboard/corgikbd.c22
-rw-r--r--drivers/input/keyboard/spitzkbd.c40
2 files changed, 29 insertions, 33 deletions
diff --git a/drivers/input/keyboard/corgikbd.c b/drivers/input/keyboard/corgikbd.c
index 564bb365f6fc..3210d298b3bc 100644
--- a/drivers/input/keyboard/corgikbd.c
+++ b/drivers/input/keyboard/corgikbd.c
@@ -259,24 +259,22 @@ static void corgikbd_hinge_timer(unsigned long data)
259} 259}
260 260
261#ifdef CONFIG_PM 261#ifdef CONFIG_PM
262static int corgikbd_suspend(struct device *dev, pm_message_t state, uint32_t level) 262static int corgikbd_suspend(struct device *dev, pm_message_t state)
263{ 263{
264 if (level == SUSPEND_POWER_DOWN) { 264 struct corgikbd *corgikbd = dev_get_drvdata(dev);
265 struct corgikbd *corgikbd = dev_get_drvdata(dev); 265 corgikbd->suspended = 1;
266 corgikbd->suspended = 1; 266
267 }
268 return 0; 267 return 0;
269} 268}
270 269
271static int corgikbd_resume(struct device *dev, uint32_t level) 270static int corgikbd_resume(struct device *dev)
272{ 271{
273 if (level == RESUME_POWER_ON) { 272 struct corgikbd *corgikbd = dev_get_drvdata(dev);
274 struct corgikbd *corgikbd = dev_get_drvdata(dev); 273
274 /* Upon resume, ignore the suspend key for a short while */
275 corgikbd->suspend_jiffies=jiffies;
276 corgikbd->suspended = 0;
275 277
276 /* Upon resume, ignore the suspend key for a short while */
277 corgikbd->suspend_jiffies=jiffies;
278 corgikbd->suspended = 0;
279 }
280 return 0; 278 return 0;
281} 279}
282#else 280#else
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