Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 199053
b: refs/heads/master
c: 8d4dee9
h: refs/heads/master
i:
  199051: ab0bdc0
v: v3
  • Loading branch information
Jean Delvare committed May 27, 2010
1 parent 82ed569 commit e8ab49a
Show file tree
Hide file tree
Showing 2 changed files with 13 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: cff37c9e82e022068840b3d33167e64c6a0ecc06
refs/heads/master: 8d4dee98b10050db9c32a449e460a2f69bb558ec
16 changes: 12 additions & 4 deletions trunk/drivers/hwmon/tmp102.c
Original file line number Diff line number Diff line change
Expand Up @@ -239,19 +239,27 @@ static int __devexit tmp102_remove(struct i2c_client *client)
static int tmp102_suspend(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);
int config;

tmp102_write_reg(client, TMP102_CONF_REG, TMP102_CONF_SD);
config = tmp102_read_reg(client, TMP102_CONF_REG);
if (config < 0)
return config;

return 0;
config |= TMP102_CONF_SD;
return tmp102_write_reg(client, TMP102_CONF_REG, config);
}

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

tmp102_write_reg(client, TMP102_CONF_REG, TMP102_CONFIG);
config = tmp102_read_reg(client, TMP102_CONF_REG);
if (config < 0)
return config;

return 0;
config &= ~TMP102_CONF_SD;
return tmp102_write_reg(client, TMP102_CONF_REG, config);
}

static const struct dev_pm_ops tmp102_dev_pm_ops = {
Expand Down

0 comments on commit e8ab49a

Please sign in to comment.