diff options
Diffstat (limited to 'drivers/input/keyboard')
-rw-r--r-- | drivers/input/keyboard/tca6416-keypad.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/drivers/input/keyboard/tca6416-keypad.c b/drivers/input/keyboard/tca6416-keypad.c index 800fbccf1f0f..3afea3f89718 100644 --- a/drivers/input/keyboard/tca6416-keypad.c +++ b/drivers/input/keyboard/tca6416-keypad.c | |||
@@ -297,6 +297,7 @@ static int __devinit tca6416_keypad_probe(struct i2c_client *client, | |||
297 | } | 297 | } |
298 | 298 | ||
299 | i2c_set_clientdata(client, chip); | 299 | i2c_set_clientdata(client, chip); |
300 | device_init_wakeup(&client->dev, 1); | ||
300 | 301 | ||
301 | return 0; | 302 | return 0; |
302 | 303 | ||
@@ -326,10 +327,37 @@ static int __devexit tca6416_keypad_remove(struct i2c_client *client) | |||
326 | return 0; | 327 | return 0; |
327 | } | 328 | } |
328 | 329 | ||
330 | #ifdef CONFIG_PM_SLEEP | ||
331 | static int tca6416_keypad_suspend(struct device *dev) | ||
332 | { | ||
333 | struct i2c_client *client = to_i2c_client(dev); | ||
334 | struct tca6416_keypad_chip *chip = i2c_get_clientdata(client); | ||
335 | |||
336 | if (device_may_wakeup(dev)) | ||
337 | enable_irq_wake(chip->irqnum); | ||
338 | |||
339 | return 0; | ||
340 | } | ||
341 | |||
342 | static int tca6416_keypad_resume(struct device *dev) | ||
343 | { | ||
344 | struct i2c_client *client = to_i2c_client(dev); | ||
345 | struct tca6416_keypad_chip *chip = i2c_get_clientdata(client); | ||
346 | |||
347 | if (device_may_wakeup(dev)) | ||
348 | disable_irq_wake(chip->irqnum); | ||
349 | |||
350 | return 0; | ||
351 | } | ||
352 | #endif | ||
353 | |||
354 | static SIMPLE_DEV_PM_OPS(tca6416_keypad_dev_pm_ops, | ||
355 | tca6416_keypad_suspend, tca6416_keypad_resume); | ||
329 | 356 | ||
330 | static struct i2c_driver tca6416_keypad_driver = { | 357 | static struct i2c_driver tca6416_keypad_driver = { |
331 | .driver = { | 358 | .driver = { |
332 | .name = "tca6416-keypad", | 359 | .name = "tca6416-keypad", |
360 | .pm = &tca6416_keypad_dev_pm_ops, | ||
333 | }, | 361 | }, |
334 | .probe = tca6416_keypad_probe, | 362 | .probe = tca6416_keypad_probe, |
335 | .remove = __devexit_p(tca6416_keypad_remove), | 363 | .remove = __devexit_p(tca6416_keypad_remove), |