diff options
-rw-r--r-- | sound/soc/codecs/wm8580.c | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/sound/soc/codecs/wm8580.c b/sound/soc/codecs/wm8580.c index b25672709474..8212b3c8bfdd 100644 --- a/sound/soc/codecs/wm8580.c +++ b/sound/soc/codecs/wm8580.c | |||
@@ -430,8 +430,7 @@ static int wm8580_set_dai_pll(struct snd_soc_dai *codec_dai, int pll_id, | |||
430 | /* Always disable the PLL - it is not safe to leave it running | 430 | /* Always disable the PLL - it is not safe to leave it running |
431 | * while reprogramming it. | 431 | * while reprogramming it. |
432 | */ | 432 | */ |
433 | reg = snd_soc_read(codec, WM8580_PWRDN2); | 433 | snd_soc_update_bits(codec, WM8580_PWRDN2, pwr_mask, pwr_mask); |
434 | snd_soc_write(codec, WM8580_PWRDN2, reg | pwr_mask); | ||
435 | 434 | ||
436 | if (!freq_in || !freq_out) | 435 | if (!freq_in || !freq_out) |
437 | return 0; | 436 | return 0; |
@@ -449,8 +448,7 @@ static int wm8580_set_dai_pll(struct snd_soc_dai *codec_dai, int pll_id, | |||
449 | snd_soc_write(codec, WM8580_PLLA4 + offset, reg); | 448 | snd_soc_write(codec, WM8580_PLLA4 + offset, reg); |
450 | 449 | ||
451 | /* All done, turn it on */ | 450 | /* All done, turn it on */ |
452 | reg = snd_soc_read(codec, WM8580_PWRDN2); | 451 | snd_soc_update_bits(codec, WM8580_PWRDN2, pwr_mask, 0); |
453 | snd_soc_write(codec, WM8580_PWRDN2, reg & ~pwr_mask); | ||
454 | 452 | ||
455 | return 0; | 453 | return 0; |
456 | } | 454 | } |
@@ -748,7 +746,6 @@ static int wm8580_digital_mute(struct snd_soc_dai *codec_dai, int mute) | |||
748 | static int wm8580_set_bias_level(struct snd_soc_codec *codec, | 746 | static int wm8580_set_bias_level(struct snd_soc_codec *codec, |
749 | enum snd_soc_bias_level level) | 747 | enum snd_soc_bias_level level) |
750 | { | 748 | { |
751 | u16 reg; | ||
752 | switch (level) { | 749 | switch (level) { |
753 | case SND_SOC_BIAS_ON: | 750 | case SND_SOC_BIAS_ON: |
754 | case SND_SOC_BIAS_PREPARE: | 751 | case SND_SOC_BIAS_PREPARE: |
@@ -757,20 +754,19 @@ static int wm8580_set_bias_level(struct snd_soc_codec *codec, | |||
757 | case SND_SOC_BIAS_STANDBY: | 754 | case SND_SOC_BIAS_STANDBY: |
758 | if (codec->dapm.bias_level == SND_SOC_BIAS_OFF) { | 755 | if (codec->dapm.bias_level == SND_SOC_BIAS_OFF) { |
759 | /* Power up and get individual control of the DACs */ | 756 | /* Power up and get individual control of the DACs */ |
760 | reg = snd_soc_read(codec, WM8580_PWRDN1); | 757 | snd_soc_update_bits(codec, WM8580_PWRDN1, |
761 | reg &= ~(WM8580_PWRDN1_PWDN | WM8580_PWRDN1_ALLDACPD); | 758 | WM8580_PWRDN1_PWDN | |
762 | snd_soc_write(codec, WM8580_PWRDN1, reg); | 759 | WM8580_PWRDN1_ALLDACPD, 0); |
763 | 760 | ||
764 | /* Make VMID high impedance */ | 761 | /* Make VMID high impedance */ |
765 | reg = snd_soc_read(codec, WM8580_ADC_CONTROL1); | 762 | snd_soc_update_bits(codec, WM8580_ADC_CONTROL1, |
766 | reg &= ~0x100; | 763 | 0x100, 0); |
767 | snd_soc_write(codec, WM8580_ADC_CONTROL1, reg); | ||
768 | } | 764 | } |
769 | break; | 765 | break; |
770 | 766 | ||
771 | case SND_SOC_BIAS_OFF: | 767 | case SND_SOC_BIAS_OFF: |
772 | reg = snd_soc_read(codec, WM8580_PWRDN1); | 768 | snd_soc_update_bits(codec, WM8580_PWRDN1, |
773 | snd_soc_write(codec, WM8580_PWRDN1, reg | WM8580_PWRDN1_PWDN); | 769 | WM8580_PWRDN1_PWDN, WM8580_PWRDN1_PWDN); |
774 | break; | 770 | break; |
775 | } | 771 | } |
776 | codec->dapm.bias_level = level; | 772 | codec->dapm.bias_level = level; |