diff options
Diffstat (limited to 'drivers/input/keyboard')
-rw-r--r-- | drivers/input/keyboard/corgikbd.c | 22 | ||||
-rw-r--r-- | drivers/input/keyboard/spitzkbd.c | 40 |
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 |
262 | static int corgikbd_suspend(struct device *dev, pm_message_t state, uint32_t level) | 262 | static 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 | ||
271 | static int corgikbd_resume(struct device *dev, uint32_t level) | 270 | static 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 |
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 |