Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 144653
b: refs/heads/master
c: 74614f8
h: refs/heads/master
i:
  144651: 958f0ca
v: v3
  • Loading branch information
Daniel Mack authored and Linus Torvalds committed May 6, 2009
1 parent 3513cd3 commit 0931544
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 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: 57226e7898076f864d6ce41ddeff4bbc772b950c
refs/heads/master: 74614f8d9d4141a3752fc1c38706859b63f4842b
9 changes: 7 additions & 2 deletions trunk/drivers/misc/isl29003.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ struct isl29003_data {
struct i2c_client *client;
struct mutex lock;
u8 reg_cache[ISL29003_NUM_CACHABLE_REGS];
u8 power_state_before_suspend;
};

static int gain_range[] = {
Expand Down Expand Up @@ -411,6 +412,9 @@ static int __devexit isl29003_remove(struct i2c_client *client)
#ifdef CONFIG_PM
static int isl29003_suspend(struct i2c_client *client, pm_message_t mesg)
{
struct isl29003_data *data = i2c_get_clientdata(client);

data->power_state_before_suspend = isl29003_get_power_state(client);
return isl29003_set_power_state(client, 0);
}

Expand All @@ -421,10 +425,11 @@ static int isl29003_resume(struct i2c_client *client)

/* restore registers from cache */
for (i = 0; i < ARRAY_SIZE(data->reg_cache); i++)
if (!i2c_smbus_write_byte_data(client, i, data->reg_cache[i]))
if (i2c_smbus_write_byte_data(client, i, data->reg_cache[i]))
return -EIO;

return 0;
return isl29003_set_power_state(client,
data->power_state_before_suspend);
}

#else
Expand Down

0 comments on commit 0931544

Please sign in to comment.