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>
This commit is contained in:
parent
9b8f5695a1
commit
500fa30ed5
1 changed files with 39 additions and 1 deletions
|
@ -2025,6 +2025,18 @@ static int wm8994_set_bias_level(struct snd_soc_codec *codec,
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SND_SOC_BIAS_PREPARE:
|
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;
|
break;
|
||||||
|
|
||||||
case SND_SOC_BIAS_STANDBY:
|
case SND_SOC_BIAS_STANDBY:
|
||||||
|
@ -2077,7 +2089,20 @@ static int wm8994_set_bias_level(struct snd_soc_codec *codec,
|
||||||
WM8994_LINEOUT2_DISCH);
|
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;
|
break;
|
||||||
|
|
||||||
case SND_SOC_BIAS_OFF:
|
case SND_SOC_BIAS_OFF:
|
||||||
|
@ -3371,6 +3396,19 @@ static int wm8994_codec_probe(struct snd_soc_codec *codec)
|
||||||
break;
|
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_update_class_w(codec);
|
||||||
|
|
||||||
wm8994_handle_pdata(wm8994);
|
wm8994_handle_pdata(wm8994);
|
||||||
|
|
Loading…
Reference in a new issue