aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/wm8994.c
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2011-11-29 14:58:19 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2011-11-29 14:59:18 -0500
commit500fa30ed5795a1d8e8539d0cd81f73b34f831a3 (patch)
treeab929bcca2f1bd0a5c8f3440899ff62279244e0a /sound/soc/codecs/wm8994.c
parent9b8f5695a155308a4e0355a29747961bec9757c0 (diff)
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/soc/codecs/wm8994.c')
-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 0a16de743dd8..207bccd156f1 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,
2025 break; 2025 break;
2026 2026
2027 case SND_SOC_BIAS_PREPARE: 2027 case SND_SOC_BIAS_PREPARE:
2028 /* MICBIAS into regulating mode */
2029 switch (control->type) {
2030 case WM8958:
2031 case WM1811:
2032 snd_soc_update_bits(codec, WM8958_MICBIAS1,
2033 WM8958_MICB1_MODE, 0);
2034 snd_soc_update_bits(codec, WM8958_MICBIAS2,
2035 WM8958_MICB2_MODE, 0);
2036 break;
2037 default:
2038 break;
2039 }
2028 break; 2040 break;
2029 2041
2030 case SND_SOC_BIAS_STANDBY: 2042 case SND_SOC_BIAS_STANDBY:
@@ -2077,7 +2089,20 @@ static int wm8994_set_bias_level(struct snd_soc_codec *codec,
2077 WM8994_LINEOUT2_DISCH); 2089 WM8994_LINEOUT2_DISCH);
2078 } 2090 }
2079 2091
2080 2092 /* MICBIAS into bypass mode on newer devices */
2093 switch (control->type) {
2094 case WM8958:
2095 case WM1811:
2096 snd_soc_update_bits(codec, WM8958_MICBIAS1,
2097 WM8958_MICB1_MODE,
2098 WM8958_MICB1_MODE);
2099 snd_soc_update_bits(codec, WM8958_MICBIAS2,
2100 WM8958_MICB2_MODE,
2101 WM8958_MICB2_MODE);
2102 break;
2103 default:
2104 break;
2105 }
2081 break; 2106 break;
2082 2107
2083 case SND_SOC_BIAS_OFF: 2108 case SND_SOC_BIAS_OFF:
@@ -3371,6 +3396,19 @@ static int wm8994_codec_probe(struct snd_soc_codec *codec)
3371 break; 3396 break;
3372 } 3397 }
3373 3398
3399 /* Put MICBIAS into bypass mode by default on newer devices */
3400 switch (control->type) {
3401 case WM8958:
3402 case WM1811:
3403 snd_soc_update_bits(codec, WM8958_MICBIAS1,
3404 WM8958_MICB1_MODE, WM8958_MICB1_MODE);
3405 snd_soc_update_bits(codec, WM8958_MICBIAS2,
3406 WM8958_MICB2_MODE, WM8958_MICB2_MODE);
3407 break;
3408 default:
3409 break;
3410 }
3411
3374 wm8994_update_class_w(codec); 3412 wm8994_update_class_w(codec);
3375 3413
3376 wm8994_handle_pdata(wm8994); 3414 wm8994_handle_pdata(wm8994);