Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 373206
b: refs/heads/master
c: c6cc25f
h: refs/heads/master
v: v3
  • Loading branch information
Lars-Peter Clausen authored and Samuel Ortiz committed Apr 8, 2013
1 parent b65e0f0 commit 8a0378f
Show file tree
Hide file tree
Showing 2 changed files with 7 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: 7aa3d7c8d5ca941e70183b8a7c980beff6edf534
refs/heads/master: c6cc25fda58da8685ecef3f179adc7b99c8253b2
8 changes: 6 additions & 2 deletions trunk/drivers/mfd/adp5520.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ struct adp5520_chip {
struct blocking_notifier_head notifier_list;
int irq;
unsigned long id;
uint8_t mode;
};

static int __adp5520_read(struct i2c_client *client,
Expand Down Expand Up @@ -326,7 +327,10 @@ static int adp5520_suspend(struct device *dev)
struct i2c_client *client = to_i2c_client(dev);
struct adp5520_chip *chip = dev_get_drvdata(&client->dev);

adp5520_clr_bits(chip->dev, ADP5520_MODE_STATUS, ADP5520_nSTNBY);
adp5520_read(chip->dev, ADP5520_MODE_STATUS, &chip->mode);
/* All other bits are W1C */
chip->mode &= ADP5520_BL_EN | ADP5520_DIM_EN | ADP5520_nSTNBY;
adp5520_write(chip->dev, ADP5520_MODE_STATUS, 0);
return 0;
}

Expand All @@ -335,7 +339,7 @@ static int adp5520_resume(struct device *dev)
struct i2c_client *client = to_i2c_client(dev);
struct adp5520_chip *chip = dev_get_drvdata(&client->dev);

adp5520_set_bits(chip->dev, ADP5520_MODE_STATUS, ADP5520_nSTNBY);
adp5520_write(chip->dev, ADP5520_MODE_STATUS, chip->mode);
return 0;
}
#endif
Expand Down

0 comments on commit 8a0378f

Please sign in to comment.