diff mbox series

[v2,2/2] ASoC: msm8916-wcd-analog: Add MIC BIAS Internal3

Message ID 20200114181229.42302-2-stephan@gerhold.net (mailing list archive)
State Accepted
Commit 00d852326e524214f046a5e1301eee84535a6863
Headers show
Series [v2,1/2] ASoC: msm8916-wcd-analog: Simplify MIC BIAS Internal | expand

Commit Message

Stephan Gerhold Jan. 14, 2020, 6:12 p.m. UTC
PM8916 has three TX inputs that each have an (optional) internal
RBIAS resistor. MIC BIAS Internal1/2 (for TX1/2) are already supported.
TX3 does not have its own MIC BIAS supply, instead it is also supplied
from MIC_BIAS1.

Now that we have simplified the MIC BIAS Internal* implementation
we can easily add support for it:

Add a MIC BIAS Internal3 supply that enables the internal RBIAS
resistor on TX3, and make sure to also enable the MIC_BIAS1 supply.

Tested-by: Nikita Travkin <nikitos.tr@gmail.com> # longcheer-l8150
Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
---
v1: https://lore.kernel.org/alsa-devel/20200111164006.43074-5-stephan@gerhold.net/
Changes in v2:
  - Update for changes in previous patch
    (Use new "MIC_BIAS1" supply instead of "MIC BIAS External1")
---
 sound/soc/codecs/msm8916-wcd-analog.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Srinivas Kandagatla Jan. 14, 2020, 6:25 p.m. UTC | #1
On 14/01/2020 18:12, Stephan Gerhold wrote:
> PM8916 has three TX inputs that each have an (optional) internal
> RBIAS resistor. MIC BIAS Internal1/2 (for TX1/2) are already supported.
> TX3 does not have its own MIC BIAS supply, instead it is also supplied
> from MIC_BIAS1.
> 
> Now that we have simplified the MIC BIAS Internal* implementation
> we can easily add support for it:
> 
> Add a MIC BIAS Internal3 supply that enables the internal RBIAS
> resistor on TX3, and make sure to also enable the MIC_BIAS1 supply.
> 
> Tested-by: Nikita Travkin <nikitos.tr@gmail.com> # longcheer-l8150
> Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
> Signed-off-by: Stephan Gerhold <stephan@gerhold.net>

Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>

> ---
> v1: https://lore.kernel.org/alsa-devel/20200111164006.43074-5-stephan@gerhold.net/
> Changes in v2:
>    - Update for changes in previous patch
>      (Use new "MIC_BIAS1" supply instead of "MIC BIAS External1")
> ---
>   sound/soc/codecs/msm8916-wcd-analog.c | 4 ++++
>   1 file changed, 4 insertions(+)
> 
> diff --git a/sound/soc/codecs/msm8916-wcd-analog.c b/sound/soc/codecs/msm8916-wcd-analog.c
> index d6d727f5bae5..85bc7ae4d267 100644
> --- a/sound/soc/codecs/msm8916-wcd-analog.c
> +++ b/sound/soc/codecs/msm8916-wcd-analog.c
> @@ -856,6 +856,7 @@ static const struct snd_soc_dapm_route pm8916_wcd_analog_audio_map[] = {
>   	{"MIC BIAS Internal1", NULL, "MIC_BIAS1"},
>   	{"MIC BIAS External2", NULL, "MIC_BIAS2"},
>   	{"MIC BIAS Internal2", NULL, "MIC_BIAS2"},
> +	{"MIC BIAS Internal3", NULL, "MIC_BIAS1"},
>   };
>   
>   static const struct snd_soc_dapm_widget pm8916_wcd_analog_dapm_widgets[] = {
> @@ -924,6 +925,9 @@ static const struct snd_soc_dapm_widget pm8916_wcd_analog_dapm_widgets[] = {
>   			    pm8916_wcd_analog_enable_micbias_int2,
>   			    SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU |
>   			    SND_SOC_DAPM_POST_PMD),
> +	SND_SOC_DAPM_SUPPLY("MIC BIAS Internal3", CDC_A_MICB_1_INT_RBIAS, 1, 0,
> +			    pm8916_wcd_analog_enable_micbias_int,
> +			    SND_SOC_DAPM_PRE_PMU),
>   
>   	SND_SOC_DAPM_ADC_E("ADC1", NULL, CDC_A_TX_1_EN, 7, 0,
>   			   pm8916_wcd_analog_enable_adc,
>
diff mbox series

Patch

diff --git a/sound/soc/codecs/msm8916-wcd-analog.c b/sound/soc/codecs/msm8916-wcd-analog.c
index d6d727f5bae5..85bc7ae4d267 100644
--- a/sound/soc/codecs/msm8916-wcd-analog.c
+++ b/sound/soc/codecs/msm8916-wcd-analog.c
@@ -856,6 +856,7 @@  static const struct snd_soc_dapm_route pm8916_wcd_analog_audio_map[] = {
 	{"MIC BIAS Internal1", NULL, "MIC_BIAS1"},
 	{"MIC BIAS External2", NULL, "MIC_BIAS2"},
 	{"MIC BIAS Internal2", NULL, "MIC_BIAS2"},
+	{"MIC BIAS Internal3", NULL, "MIC_BIAS1"},
 };
 
 static const struct snd_soc_dapm_widget pm8916_wcd_analog_dapm_widgets[] = {
@@ -924,6 +925,9 @@  static const struct snd_soc_dapm_widget pm8916_wcd_analog_dapm_widgets[] = {
 			    pm8916_wcd_analog_enable_micbias_int2,
 			    SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU |
 			    SND_SOC_DAPM_POST_PMD),
+	SND_SOC_DAPM_SUPPLY("MIC BIAS Internal3", CDC_A_MICB_1_INT_RBIAS, 1, 0,
+			    pm8916_wcd_analog_enable_micbias_int,
+			    SND_SOC_DAPM_PRE_PMU),
 
 	SND_SOC_DAPM_ADC_E("ADC1", NULL, CDC_A_TX_1_EN, 7, 0,
 			   pm8916_wcd_analog_enable_adc,