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/wm8904.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/wm8904.c')
-rw-r--r-- | sound/soc/codecs/wm8904.c | 41 |
1 files changed, 26 insertions, 15 deletions
diff --git a/sound/soc/codecs/wm8904.c b/sound/soc/codecs/wm8904.c index 17a8fe9b39b9..443ae580445c 100644 --- a/sound/soc/codecs/wm8904.c +++ b/sound/soc/codecs/wm8904.c | |||
@@ -2436,19 +2436,28 @@ static int wm8904_probe(struct snd_soc_codec *codec) | |||
2436 | } | 2436 | } |
2437 | 2437 | ||
2438 | /* Change some default settings - latch VU and enable ZC */ | 2438 | /* Change some default settings - latch VU and enable ZC */ |
2439 | reg_cache[WM8904_ADC_DIGITAL_VOLUME_LEFT] |= WM8904_ADC_VU; | 2439 | snd_soc_update_bits(codec, WM8904_ADC_DIGITAL_VOLUME_LEFT, |
2440 | reg_cache[WM8904_ADC_DIGITAL_VOLUME_RIGHT] |= WM8904_ADC_VU; | 2440 | WM8904_ADC_VU, WM8904_ADC_VU); |
2441 | reg_cache[WM8904_DAC_DIGITAL_VOLUME_LEFT] |= WM8904_DAC_VU; | 2441 | snd_soc_update_bits(codec, WM8904_ADC_DIGITAL_VOLUME_RIGHT, |
2442 | reg_cache[WM8904_DAC_DIGITAL_VOLUME_RIGHT] |= WM8904_DAC_VU; | 2442 | WM8904_ADC_VU, WM8904_ADC_VU); |
2443 | reg_cache[WM8904_ANALOGUE_OUT1_LEFT] |= WM8904_HPOUT_VU | | 2443 | snd_soc_update_bits(codec, WM8904_DAC_DIGITAL_VOLUME_LEFT, |
2444 | WM8904_HPOUTLZC; | 2444 | WM8904_DAC_VU, WM8904_DAC_VU); |
2445 | reg_cache[WM8904_ANALOGUE_OUT1_RIGHT] |= WM8904_HPOUT_VU | | 2445 | snd_soc_update_bits(codec, WM8904_DAC_DIGITAL_VOLUME_RIGHT, |
2446 | WM8904_HPOUTRZC; | 2446 | WM8904_DAC_VU, WM8904_DAC_VU); |
2447 | reg_cache[WM8904_ANALOGUE_OUT2_LEFT] |= WM8904_LINEOUT_VU | | 2447 | snd_soc_update_bits(codec, WM8904_ANALOGUE_OUT1_LEFT, |
2448 | WM8904_LINEOUTLZC; | 2448 | WM8904_HPOUT_VU | WM8904_HPOUTLZC, |
2449 | reg_cache[WM8904_ANALOGUE_OUT2_RIGHT] |= WM8904_LINEOUT_VU | | 2449 | WM8904_HPOUT_VU | WM8904_HPOUTLZC); |
2450 | WM8904_LINEOUTRZC; | 2450 | snd_soc_update_bits(codec, WM8904_ANALOGUE_OUT1_RIGHT, |
2451 | reg_cache[WM8904_CLOCK_RATES_0] &= ~WM8904_SR_MODE; | 2451 | WM8904_HPOUT_VU | WM8904_HPOUTRZC, |
2452 | WM8904_HPOUT_VU | WM8904_HPOUTRZC); | ||
2453 | snd_soc_update_bits(codec, WM8904_ANALOGUE_OUT2_LEFT, | ||
2454 | WM8904_LINEOUT_VU | WM8904_LINEOUTLZC, | ||
2455 | WM8904_LINEOUT_VU | WM8904_LINEOUTLZC); | ||
2456 | snd_soc_update_bits(codec, WM8904_ANALOGUE_OUT2_RIGHT, | ||
2457 | WM8904_LINEOUT_VU | WM8904_LINEOUTRZC, | ||
2458 | WM8904_LINEOUT_VU | WM8904_LINEOUTRZC); | ||
2459 | snd_soc_update_bits(codec, WM8904_CLOCK_RATES_0, | ||
2460 | WM8904_SR_MODE, 0); | ||
2452 | 2461 | ||
2453 | /* Apply configuration from the platform data. */ | 2462 | /* Apply configuration from the platform data. */ |
2454 | if (wm8904->pdata) { | 2463 | if (wm8904->pdata) { |
@@ -2469,10 +2478,12 @@ static int wm8904_probe(struct snd_soc_codec *codec) | |||
2469 | /* Set Class W by default - this will be managed by the Class | 2478 | /* Set Class W by default - this will be managed by the Class |
2470 | * G widget at runtime where bypass paths are available. | 2479 | * G widget at runtime where bypass paths are available. |
2471 | */ | 2480 | */ |
2472 | reg_cache[WM8904_CLASS_W_0] |= WM8904_CP_DYN_PWR; | 2481 | snd_soc_update_bits(codec, WM8904_CLASS_W_0, |
2482 | WM8904_CP_DYN_PWR, WM8904_CP_DYN_PWR); | ||
2473 | 2483 | ||
2474 | /* Use normal bias source */ | 2484 | /* Use normal bias source */ |
2475 | reg_cache[WM8904_BIAS_CONTROL_0] &= ~WM8904_POBCTRL; | 2485 | snd_soc_update_bits(codec, WM8904_BIAS_CONTROL_0, |
2486 | WM8904_POBCTRL, 0); | ||
2476 | 2487 | ||
2477 | wm8904_set_bias_level(codec, SND_SOC_BIAS_STANDBY); | 2488 | wm8904_set_bias_level(codec, SND_SOC_BIAS_STANDBY); |
2478 | 2489 | ||