aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2011-11-29 19:58:19 +0000
committerAndreas Blaesius <skate4life@gmx.de>2016-04-30 11:03:44 +0200
commit7032106a31ce54065fef93065216f63c64c675b3 (patch)
treee3856e2869799715230f1348566e1baff2be54a5 /sound
parentb586517d4f7b4844a53e88e05e3005c7c772a065 (diff)
downloadkernel_samsung_espresso10-7032106a31ce54065fef93065216f63c64c675b3.zip
kernel_samsung_espresso10-7032106a31ce54065fef93065216f63c64c675b3.tar.gz
kernel_samsung_espresso10-7032106a31ce54065fef93065216f63c64c675b3.tar.bz2
ASoC: Put WM8958 and WM1811 MICBIAS into bypass mode when no audio
When we don't have any active audio we can put the microphone biases into bypass mode to save power at the expense of performance. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/codecs/wm8994.c40
1 files changed, 39 insertions, 1 deletions
diff --git a/sound/soc/codecs/wm8994.c b/sound/soc/codecs/wm8994.c
index 109ed19..8815566 100644
--- a/sound/soc/codecs/wm8994.c
+++ b/sound/soc/codecs/wm8994.c
@@ -2025,6 +2025,18 @@ static int wm8994_set_bias_level(struct snd_soc_codec *codec,
break;
case SND_SOC_BIAS_PREPARE:
+ /* MICBIAS into regulating mode */
+ switch (control->type) {
+ case WM8958:
+ case WM1811:
+ snd_soc_update_bits(codec, WM8958_MICBIAS1,
+ WM8958_MICB1_MODE, 0);
+ snd_soc_update_bits(codec, WM8958_MICBIAS2,
+ WM8958_MICB2_MODE, 0);
+ break;
+ default:
+ break;
+ }
break;
case SND_SOC_BIAS_STANDBY:
@@ -2077,7 +2089,20 @@ static int wm8994_set_bias_level(struct snd_soc_codec *codec,
WM8994_LINEOUT2_DISCH);
}
-
+ /* MICBIAS into bypass mode on newer devices */
+ switch (control->type) {
+ case WM8958:
+ case WM1811:
+ snd_soc_update_bits(codec, WM8958_MICBIAS1,
+ WM8958_MICB1_MODE,
+ WM8958_MICB1_MODE);
+ snd_soc_update_bits(codec, WM8958_MICBIAS2,
+ WM8958_MICB2_MODE,
+ WM8958_MICB2_MODE);
+ break;
+ default:
+ break;
+ }
break;
case SND_SOC_BIAS_OFF:
@@ -3338,6 +3363,19 @@ static int wm8994_codec_probe(struct snd_soc_codec *codec)
break;
}
+ /* Put MICBIAS into bypass mode by default on newer devices */
+ switch (control->type) {
+ case WM8958:
+ case WM1811:
+ snd_soc_update_bits(codec, WM8958_MICBIAS1,
+ WM8958_MICB1_MODE, WM8958_MICB1_MODE);
+ snd_soc_update_bits(codec, WM8958_MICBIAS2,
+ WM8958_MICB2_MODE, WM8958_MICB2_MODE);
+ break;
+ default:
+ break;
+ }
+
wm8994_update_class_w(codec);
wm8994_handle_pdata(wm8994);