diff options
Diffstat (limited to 'drivers/input/keyboard/spitzkbd.c')
-rw-r--r-- | drivers/input/keyboard/spitzkbd.c | 40 |
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 |
312 | static int spitzkbd_suspend(struct device *dev, pm_message_t state, uint32_t level) | 312 | static 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 | ||
327 | static int spitzkbd_resume(struct device *dev, uint32_t level) | 326 | static 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 |