ASoC: Avoid direct register cache access when setting defaults
Directly accessing the register cache means that we can't use anything except a flat register cache so use snd_soc_update_bits(). Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
This commit is contained in:
@@ -421,7 +421,6 @@ static int wm8741_resume(struct snd_soc_codec *codec)
|
||||
static int wm8741_probe(struct snd_soc_codec *codec)
|
||||
{
|
||||
struct wm8741_priv *wm8741 = snd_soc_codec_get_drvdata(codec);
|
||||
u16 *reg_cache = codec->reg_cache;
|
||||
int ret = 0;
|
||||
|
||||
ret = snd_soc_codec_set_cache_io(codec, 7, 9, wm8741->control_type);
|
||||
@@ -437,10 +436,14 @@ static int wm8741_probe(struct snd_soc_codec *codec)
|
||||
}
|
||||
|
||||
/* Change some default settings - latch VU */
|
||||
reg_cache[WM8741_DACLLSB_ATTENUATION] |= WM8741_UPDATELL;
|
||||
reg_cache[WM8741_DACLMSB_ATTENUATION] |= WM8741_UPDATELM;
|
||||
reg_cache[WM8741_DACRLSB_ATTENUATION] |= WM8741_UPDATERL;
|
||||
reg_cache[WM8741_DACRLSB_ATTENUATION] |= WM8741_UPDATERM;
|
||||
snd_soc_update_bits(codec, WM8741_DACLLSB_ATTENUATION,
|
||||
WM8741_UPDATELL, WM8741_UPDATELL);
|
||||
snd_soc_update_bits(codec, WM8741_DACLMSB_ATTENUATION,
|
||||
WM8741_UPDATELM, WM8741_UPDATELM);
|
||||
snd_soc_update_bits(codec, WM8741_DACRLSB_ATTENUATION,
|
||||
WM8741_UPDATERL, WM8741_UPDATERL);
|
||||
snd_soc_update_bits(codec, WM8741_DACRLSB_ATTENUATION,
|
||||
WM8741_UPDATERM, WM8741_UPDATERM);
|
||||
|
||||
snd_soc_add_controls(codec, wm8741_snd_controls,
|
||||
ARRAY_SIZE(wm8741_snd_controls));
|
||||
|
Reference in New Issue
Block a user