Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 367505
b: refs/heads/master
c: 43cf454
h: refs/heads/master
i:
  367503: ac9931b
v: v3
  • Loading branch information
Lars-Peter Clausen authored and Anton Vorontsov committed Apr 1, 2013
1 parent 26f2107 commit fd18d05
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: cc6616f6902fe96287585664cbad082d0c431206
refs/heads/master: 43cf454aba2516799d571472fa69425e1e15c4bc
20 changes: 11 additions & 9 deletions trunk/drivers/power/max17040_battery.c
Original file line number Diff line number Diff line change
Expand Up @@ -246,31 +246,34 @@ static int max17040_remove(struct i2c_client *client)
return 0;
}

#ifdef CONFIG_PM
#ifdef CONFIG_PM_SLEEP

static int max17040_suspend(struct i2c_client *client,
pm_message_t state)
static int max17040_suspend(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);
struct max17040_chip *chip = i2c_get_clientdata(client);

cancel_delayed_work(&chip->work);
return 0;
}

static int max17040_resume(struct i2c_client *client)
static int max17040_resume(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);
struct max17040_chip *chip = i2c_get_clientdata(client);

schedule_delayed_work(&chip->work, MAX17040_DELAY);
return 0;
}

static SIMPLE_DEV_PM_OPS(max17040_pm_ops, max17040_suspend, max17040_resume);
#define MAX17040_PM_OPS (&max17040_pm_ops)

#else

#define max17040_suspend NULL
#define max17040_resume NULL
#define MAX17040_PM_OPS NULL

#endif /* CONFIG_PM */
#endif /* CONFIG_PM_SLEEP */

static const struct i2c_device_id max17040_id[] = {
{ "max17040", 0 },
Expand All @@ -281,11 +284,10 @@ MODULE_DEVICE_TABLE(i2c, max17040_id);
static struct i2c_driver max17040_i2c_driver = {
.driver = {
.name = "max17040",
.pm = MAX17040_PM_OPS,
},
.probe = max17040_probe,
.remove = max17040_remove,
.suspend = max17040_suspend,
.resume = max17040_resume,
.id_table = max17040_id,
};
module_i2c_driver(max17040_i2c_driver);
Expand Down

0 comments on commit fd18d05

Please sign in to comment.