Commit 637a935a authored by Lars-Peter Clausen's avatar Lars-Peter Clausen Committed by Mark Brown

ASoC: Fix wm8753 register cache size and initialization

Register cache space was not being allocated for the final register,
causing bugs when it was used.  Allocate space for it.

Also ensure that the final register is displayed in sysfs.

[Commit message rewritten to document actual issue. -- broonie]
Signed-off-by: default avatarLars-Peter Clausen <lars@metafoo.de>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent 0827d6ba
...@@ -79,7 +79,7 @@ static const u16 wm8753_reg[] = { ...@@ -79,7 +79,7 @@ static const u16 wm8753_reg[] = {
0x0097, 0x0097, 0x0000, 0x0004, 0x0097, 0x0097, 0x0000, 0x0004,
0x0000, 0x0083, 0x0024, 0x01ba, 0x0000, 0x0083, 0x0024, 0x01ba,
0x0000, 0x0083, 0x0024, 0x01ba, 0x0000, 0x0083, 0x0024, 0x01ba,
0x0000, 0x0000 0x0000, 0x0000, 0x0000
}; };
/* codec private data */ /* codec private data */
...@@ -1660,7 +1660,7 @@ static int wm8753_register(struct wm8753_priv *wm8753) ...@@ -1660,7 +1660,7 @@ static int wm8753_register(struct wm8753_priv *wm8753)
codec->set_bias_level = wm8753_set_bias_level; codec->set_bias_level = wm8753_set_bias_level;
codec->dai = wm8753_dai; codec->dai = wm8753_dai;
codec->num_dai = 2; codec->num_dai = 2;
codec->reg_cache_size = ARRAY_SIZE(wm8753->reg_cache); codec->reg_cache_size = ARRAY_SIZE(wm8753->reg_cache) + 1;
codec->reg_cache = &wm8753->reg_cache; codec->reg_cache = &wm8753->reg_cache;
codec->private_data = wm8753; codec->private_data = wm8753;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment