diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2010-12-24 11:59:30 -0500 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-01-17 08:59:39 -0500 |
commit | a1b3b5eeeebac8acfa7838ef90f5a00a6f9188a0 (patch) | |
tree | 494c5f242fe497729c0b57929319305f2a3ebc29 /sound/soc/codecs/wm8741.c | |
parent | 203db220718c735dcb959fddc64e94fff3b52f73 (diff) |
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>
Diffstat (limited to 'sound/soc/codecs/wm8741.c')
-rw-r--r-- | sound/soc/codecs/wm8741.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/sound/soc/codecs/wm8741.c b/sound/soc/codecs/wm8741.c index 494f2d31d75b..25af901fe813 100644 --- a/sound/soc/codecs/wm8741.c +++ b/sound/soc/codecs/wm8741.c | |||
@@ -421,7 +421,6 @@ static int wm8741_resume(struct snd_soc_codec *codec) | |||
421 | static int wm8741_probe(struct snd_soc_codec *codec) | 421 | static int wm8741_probe(struct snd_soc_codec *codec) |
422 | { | 422 | { |
423 | struct wm8741_priv *wm8741 = snd_soc_codec_get_drvdata(codec); | 423 | struct wm8741_priv *wm8741 = snd_soc_codec_get_drvdata(codec); |
424 | u16 *reg_cache = codec->reg_cache; | ||
425 | int ret = 0; | 424 | int ret = 0; |
426 | 425 | ||
427 | ret = snd_soc_codec_set_cache_io(codec, 7, 9, wm8741->control_type); | 426 | 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) | |||
437 | } | 436 | } |
438 | 437 | ||
439 | /* Change some default settings - latch VU */ | 438 | /* Change some default settings - latch VU */ |
440 | reg_cache[WM8741_DACLLSB_ATTENUATION] |= WM8741_UPDATELL; | 439 | snd_soc_update_bits(codec, WM8741_DACLLSB_ATTENUATION, |
441 | reg_cache[WM8741_DACLMSB_ATTENUATION] |= WM8741_UPDATELM; | 440 | WM8741_UPDATELL, WM8741_UPDATELL); |
442 | reg_cache[WM8741_DACRLSB_ATTENUATION] |= WM8741_UPDATERL; | 441 | snd_soc_update_bits(codec, WM8741_DACLMSB_ATTENUATION, |
443 | reg_cache[WM8741_DACRLSB_ATTENUATION] |= WM8741_UPDATERM; | 442 | WM8741_UPDATELM, WM8741_UPDATELM); |
443 | snd_soc_update_bits(codec, WM8741_DACRLSB_ATTENUATION, | ||
444 | WM8741_UPDATERL, WM8741_UPDATERL); | ||
445 | snd_soc_update_bits(codec, WM8741_DACRLSB_ATTENUATION, | ||
446 | WM8741_UPDATERM, WM8741_UPDATERM); | ||
444 | 447 | ||
445 | snd_soc_add_controls(codec, wm8741_snd_controls, | 448 | snd_soc_add_controls(codec, wm8741_snd_controls, |
446 | ARRAY_SIZE(wm8741_snd_controls)); | 449 | ARRAY_SIZE(wm8741_snd_controls)); |