Skip to content

Commit

Permalink
Input: max7359 - convert to dev_pm_ops
Browse files Browse the repository at this point in the history
There is a general move to convert drivers to use dev_pm_ops rather than
bus specific ops to facilitate core work. Do this conversion for max7359.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
  • Loading branch information
Mark Brown authored and Dmitry Torokhov committed Feb 21, 2011
1 parent 65b0c03 commit 76e2c68
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions drivers/input/keyboard/max7359_keypad.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include <linux/i2c.h>
#include <linux/slab.h>
#include <linux/interrupt.h>
#include <linux/pm.h>
#include <linux/input.h>
#include <linux/input/matrix_keypad.h>

Expand Down Expand Up @@ -271,8 +272,10 @@ static int __devexit max7359_remove(struct i2c_client *client)
}

#ifdef CONFIG_PM
static int max7359_suspend(struct i2c_client *client, pm_message_t mesg)
static int max7359_suspend(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);

max7359_fall_deepsleep(client);

if (device_may_wakeup(&client->dev))
Expand All @@ -281,8 +284,10 @@ static int max7359_suspend(struct i2c_client *client, pm_message_t mesg)
return 0;
}

static int max7359_resume(struct i2c_client *client)
static int max7359_resume(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);

if (device_may_wakeup(&client->dev))
disable_irq_wake(client->irq);

Expand All @@ -291,11 +296,10 @@ static int max7359_resume(struct i2c_client *client)

return 0;
}
#else
#define max7359_suspend NULL
#define max7359_resume NULL
#endif

static SIMPLE_DEV_PM_OPS(max7359_pm, max7359_suspend, max7359_resume);

static const struct i2c_device_id max7359_ids[] = {
{ "max7359", 0 },
{ }
Expand All @@ -305,11 +309,10 @@ MODULE_DEVICE_TABLE(i2c, max7359_ids);
static struct i2c_driver max7359_i2c_driver = {
.driver = {
.name = "max7359",
.pm = &max7359_pm,
},
.probe = max7359_probe,
.remove = __devexit_p(max7359_remove),
.suspend = max7359_suspend,
.resume = max7359_resume,
.id_table = max7359_ids,
};

Expand Down

0 comments on commit 76e2c68

Please sign in to comment.