Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 298558
b: refs/heads/master
c: 52f30f7
h: refs/heads/master
v: v3
  • Loading branch information
Mark Brown authored and Guenter Roeck committed Apr 1, 2012
1 parent 96f9001 commit 103b985
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 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: be45d422d96ba22ecd0e34690644099d172e9c6d
refs/heads/master: 52f30f77171f934cb9562908cb279178b890a048
15 changes: 11 additions & 4 deletions trunk/drivers/hwmon/max6639.c
Original file line number Diff line number Diff line change
Expand Up @@ -596,8 +596,10 @@ static int max6639_remove(struct i2c_client *client)
return 0;
}

static int max6639_suspend(struct i2c_client *client, pm_message_t mesg)
#ifdef CONFIG_PM_SLEEP
static int max6639_suspend(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);
int data = i2c_smbus_read_byte_data(client, MAX6639_REG_GCONFIG);
if (data < 0)
return data;
Expand All @@ -606,15 +608,17 @@ static int max6639_suspend(struct i2c_client *client, pm_message_t mesg)
MAX6639_REG_GCONFIG, data | MAX6639_GCONFIG_STANDBY);
}

static int max6639_resume(struct i2c_client *client)
static int max6639_resume(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);
int data = i2c_smbus_read_byte_data(client, MAX6639_REG_GCONFIG);
if (data < 0)
return data;

return i2c_smbus_write_byte_data(client,
MAX6639_REG_GCONFIG, data & ~MAX6639_GCONFIG_STANDBY);
}
#endif /* CONFIG_PM_SLEEP */

static const struct i2c_device_id max6639_id[] = {
{"max6639", 0},
Expand All @@ -623,15 +627,18 @@ static const struct i2c_device_id max6639_id[] = {

MODULE_DEVICE_TABLE(i2c, max6639_id);

static const struct dev_pm_ops max6639_pm_ops = {
SET_SYSTEM_SLEEP_PM_OPS(max6639_suspend, max6639_resume)
};

static struct i2c_driver max6639_driver = {
.class = I2C_CLASS_HWMON,
.driver = {
.name = "max6639",
.pm = &max6639_pm_ops,
},
.probe = max6639_probe,
.remove = max6639_remove,
.suspend = max6639_suspend,
.resume = max6639_resume,
.id_table = max6639_id,
.detect = max6639_detect,
.address_list = normal_i2c,
Expand Down

0 comments on commit 103b985

Please sign in to comment.