Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 142004
b: refs/heads/master
c: 9dfd338
h: refs/heads/master
v: v3
  • Loading branch information
Mark Brown authored and Samuel Ortiz committed Apr 4, 2009
1 parent 3958fee commit a0ec288
Show file tree
Hide file tree
Showing 2 changed files with 13 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: 22e2df7d5ff50e5a62d4945b13c83525a2617ef5
refs/heads/master: 9dfd338198bec67ebc82ed363078f9d8aa74ec3e
21 changes: 12 additions & 9 deletions trunk/drivers/mfd/wm8350-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1238,25 +1238,28 @@ static int wm8350_create_cache(struct wm8350 *wm8350, int type, int mode)
}

wm8350->reg_cache =
kzalloc(sizeof(u16) * (WM8350_MAX_REGISTER + 1), GFP_KERNEL);
kmalloc(sizeof(u16) * (WM8350_MAX_REGISTER + 1), GFP_KERNEL);
if (wm8350->reg_cache == NULL)
return -ENOMEM;

/* Read the initial cache state back from the device - this is
* a PMIC so the device many not be in a virgin state and we
* can't rely on the silicon values.
*/
ret = wm8350->read_dev(wm8350, 0,
sizeof(u16) * (WM8350_MAX_REGISTER + 1),
wm8350->reg_cache);
if (ret < 0) {
dev_err(wm8350->dev,
"failed to read initial cache values\n");
goto out;
}

/* Mask out uncacheable/unreadable bits and the audio. */
for (i = 0; i < WM8350_MAX_REGISTER; i++) {
/* audio register range */
if (wm8350_reg_io_map[i].readable &&
(i < WM8350_CLOCK_CONTROL_1 || i > WM8350_AIF_TEST)) {
ret = wm8350->read_dev(wm8350, i, 2, (char *)&value);
if (ret < 0) {
dev_err(wm8350->dev,
"failed to read initial cache value\n");
goto out;
}
value = be16_to_cpu(value);
value = be16_to_cpu(wm8350->reg_cache[i]);
value &= wm8350_reg_io_map[i].readable;
value &= ~wm8350_reg_io_map[i].vol;
wm8350->reg_cache[i] = value;
Expand Down

0 comments on commit a0ec288

Please sign in to comment.