diff options
Diffstat (limited to 'drivers/input')
-rw-r--r-- | drivers/input/keyboard/corgikbd.c | 22 | ||||
-rw-r--r-- | drivers/input/keyboard/spitzkbd.c | 40 | ||||
-rw-r--r-- | drivers/input/serio/i8042.c | 13 | ||||
-rw-r--r-- | drivers/input/touchscreen/corgi_ts.c | 38 |
4 files changed, 51 insertions, 62 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 |
diff --git a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c index 40d451ce07ff..4bc40f159996 100644 --- a/drivers/input/serio/i8042.c +++ b/drivers/input/serio/i8042.c | |||
@@ -911,12 +911,10 @@ static long i8042_panic_blink(long count) | |||
911 | * Here we try to restore the original BIOS settings | 911 | * Here we try to restore the original BIOS settings |
912 | */ | 912 | */ |
913 | 913 | ||
914 | static int i8042_suspend(struct device *dev, pm_message_t state, u32 level) | 914 | static int i8042_suspend(struct device *dev, pm_message_t state) |
915 | { | 915 | { |
916 | if (level == SUSPEND_DISABLE) { | 916 | del_timer_sync(&i8042_timer); |
917 | del_timer_sync(&i8042_timer); | 917 | i8042_controller_reset(); |
918 | i8042_controller_reset(); | ||
919 | } | ||
920 | 918 | ||
921 | return 0; | 919 | return 0; |
922 | } | 920 | } |
@@ -926,13 +924,10 @@ static int i8042_suspend(struct device *dev, pm_message_t state, u32 level) | |||
926 | * Here we try to reset everything back to a state in which suspended | 924 | * Here we try to reset everything back to a state in which suspended |
927 | */ | 925 | */ |
928 | 926 | ||
929 | static int i8042_resume(struct device *dev, u32 level) | 927 | static int i8042_resume(struct device *dev) |
930 | { | 928 | { |
931 | int i; | 929 | int i; |
932 | 930 | ||
933 | if (level != RESUME_ENABLE) | ||
934 | return 0; | ||
935 | |||
936 | if (i8042_ctl_test()) | 931 | if (i8042_ctl_test()) |
937 | return -1; | 932 | return -1; |
938 | 933 | ||
diff --git a/drivers/input/touchscreen/corgi_ts.c b/drivers/input/touchscreen/corgi_ts.c index 40ae183ba1cd..0ba3e6562bff 100644 --- a/drivers/input/touchscreen/corgi_ts.c +++ b/drivers/input/touchscreen/corgi_ts.c | |||
@@ -231,34 +231,32 @@ static irqreturn_t ts_interrupt(int irq, void *dev_id, struct pt_regs *regs) | |||
231 | } | 231 | } |
232 | 232 | ||
233 | #ifdef CONFIG_PM | 233 | #ifdef CONFIG_PM |
234 | static int corgits_suspend(struct device *dev, pm_message_t state, uint32_t level) | 234 | static int corgits_suspend(struct device *dev, pm_message_t state) |
235 | { | 235 | { |
236 | if (level == SUSPEND_POWER_DOWN) { | 236 | struct corgi_ts *corgi_ts = dev_get_drvdata(dev); |
237 | struct corgi_ts *corgi_ts = dev_get_drvdata(dev); | ||
238 | |||
239 | if (corgi_ts->pendown) { | ||
240 | del_timer_sync(&corgi_ts->timer); | ||
241 | corgi_ts->tc.pressure = 0; | ||
242 | new_data(corgi_ts, NULL); | ||
243 | corgi_ts->pendown = 0; | ||
244 | } | ||
245 | corgi_ts->power_mode = PWR_MODE_SUSPEND; | ||
246 | 237 | ||
247 | corgi_ssp_ads7846_putget((1u << ADSCTRL_ADR_SH) | ADSCTRL_STS); | 238 | if (corgi_ts->pendown) { |
239 | del_timer_sync(&corgi_ts->timer); | ||
240 | corgi_ts->tc.pressure = 0; | ||
241 | new_data(corgi_ts, NULL); | ||
242 | corgi_ts->pendown = 0; | ||
248 | } | 243 | } |
244 | corgi_ts->power_mode = PWR_MODE_SUSPEND; | ||
245 | |||
246 | corgi_ssp_ads7846_putget((1u << ADSCTRL_ADR_SH) | ADSCTRL_STS); | ||
247 | |||
249 | return 0; | 248 | return 0; |
250 | } | 249 | } |
251 | 250 | ||
252 | static int corgits_resume(struct device *dev, uint32_t level) | 251 | static int corgits_resume(struct device *dev) |
253 | { | 252 | { |
254 | if (level == RESUME_POWER_ON) { | 253 | struct corgi_ts *corgi_ts = dev_get_drvdata(dev); |
255 | struct corgi_ts *corgi_ts = dev_get_drvdata(dev); | 254 | |
255 | corgi_ssp_ads7846_putget((4u << ADSCTRL_ADR_SH) | ADSCTRL_STS); | ||
256 | /* Enable Falling Edge */ | ||
257 | set_irq_type(corgi_ts->irq_gpio, IRQT_FALLING); | ||
258 | corgi_ts->power_mode = PWR_MODE_ACTIVE; | ||
256 | 259 | ||
257 | corgi_ssp_ads7846_putget((4u << ADSCTRL_ADR_SH) | ADSCTRL_STS); | ||
258 | /* Enable Falling Edge */ | ||
259 | set_irq_type(corgi_ts->irq_gpio, IRQT_FALLING); | ||
260 | corgi_ts->power_mode = PWR_MODE_ACTIVE; | ||
261 | } | ||
262 | return 0; | 260 | return 0; |
263 | } | 261 | } |
264 | #else | 262 | #else |