diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2010-11-11 10:03:00 +0100 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2010-11-12 07:02:57 +0100 |
commit | 10ee2ded629b1571cef1182728d6f65dbe4c7f79 (patch) | |
tree | 1e46c58792f084b7f995177b21a0ee2719134e16 /drivers/input | |
parent | Input: xpad - remove useless check in xpad_remove (diff) | |
download | linux-10ee2ded629b1571cef1182728d6f65dbe4c7f79.tar.xz linux-10ee2ded629b1571cef1182728d6f65dbe4c7f79.zip |
Input: pcf_keypad - convert to dev_op_ops
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input')
-rw-r--r-- | drivers/input/misc/pcf8574_keypad.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/drivers/input/misc/pcf8574_keypad.c b/drivers/input/misc/pcf8574_keypad.c index d1583aea1721..08be1a355956 100644 --- a/drivers/input/misc/pcf8574_keypad.c +++ b/drivers/input/misc/pcf8574_keypad.c @@ -169,19 +169,29 @@ static int __devexit pcf8574_kp_remove(struct i2c_client *client) } #ifdef CONFIG_PM -static int pcf8574_kp_resume(struct i2c_client *client) +static int pcf8574_kp_resume(struct device *dev) { + struct i2c_client *client = to_i2c_client(dev); + enable_irq(client->irq); return 0; } -static int pcf8574_kp_suspend(struct i2c_client *client, pm_message_t mesg) +static int pcf8574_kp_suspend(struct device *dev) { + struct i2c_client *client = to_i2c_client(dev); + disable_irq(client->irq); return 0; } + +static const struct dev_pm_ops pcf8574_kp_pm_ops = { + .suspend = pcf8574_kp_suspend, + .resume = pcf8574_kp_resume, +}; + #else # define pcf8574_kp_resume NULL # define pcf8574_kp_suspend NULL @@ -197,11 +207,12 @@ static struct i2c_driver pcf8574_kp_driver = { .driver = { .name = DRV_NAME, .owner = THIS_MODULE, +#ifdef CONFIG_PM + .pm = &pcf8574_kp_pm_ops, +#endif }, .probe = pcf8574_kp_probe, .remove = __devexit_p(pcf8574_kp_remove), - .suspend = pcf8574_kp_suspend, - .resume = pcf8574_kp_resume, .id_table = pcf8574_kp_id, }; |