All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: sgtl5000: fix power on/off of MIC bias
@ 2012-03-28  7:30 ` Shawn Guo
  0 siblings, 0 replies; 18+ messages in thread
From: Shawn Guo @ 2012-03-28  7:30 UTC (permalink / raw)
  To: alsa-devel
  Cc: Lionel Xu, Mark Brown, Zeng, Zhaoming, Shawn Guo, Lionel Xu,
	linux-arm-kernel

From: Lionel Xu <Lionel.Xu@freescale.com>

There is no sound in the recorded wav, to enable recording, the VAG
should be powered up, and the mic bias resistor should be set up with
proper value.

Signed-off-by: Lionel Xu <lionel.xu@freescale.com>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Cc: Zeng Zhaoming <zengzm.kernel@gmail.com>
---
 sound/soc/codecs/sgtl5000.c |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/sound/soc/codecs/sgtl5000.c b/sound/soc/codecs/sgtl5000.c
index d192626..a24299c 100644
--- a/sound/soc/codecs/sgtl5000.c
+++ b/sound/soc/codecs/sgtl5000.c
@@ -132,11 +132,18 @@ static int mic_bias_event(struct snd_soc_dapm_widget *w,
 		snd_soc_update_bits(w->codec, SGTL5000_CHIP_MIC_CTRL,
 				SGTL5000_BIAS_R_MASK,
 				SGTL5000_BIAS_R_4k << SGTL5000_BIAS_R_SHIFT);
+
+		snd_soc_update_bits(w->codec, SGTL5000_CHIP_ANA_POWER,
+				SGTL5000_VAG_POWERUP, SGTL5000_VAG_POWERUP);
 		break;
 
 	case SND_SOC_DAPM_PRE_PMD:
 		snd_soc_update_bits(w->codec, SGTL5000_CHIP_MIC_CTRL,
-				SGTL5000_BIAS_R_MASK, 0);
+				SGTL5000_BIAS_R_MASK,
+				SGTL5000_BIAS_R_off << SGTL5000_BIAS_R_SHIFT);
+
+		snd_soc_update_bits(w->codec, SGTL5000_CHIP_ANA_POWER,
+				SGTL5000_VAG_POWERUP, 0);
 		break;
 	}
 	return 0;
@@ -197,7 +204,7 @@ static const struct snd_soc_dapm_widget sgtl5000_dapm_widgets[] = {
 	SND_SOC_DAPM_OUTPUT("HP_OUT"),
 	SND_SOC_DAPM_OUTPUT("LINE_OUT"),
 
-	SND_SOC_DAPM_MICBIAS_E("Mic Bias", SGTL5000_CHIP_MIC_CTRL, 8, 0,
+	SND_SOC_DAPM_MICBIAS_E("Mic Bias", SND_SOC_NOPM, 0, 0,
 				mic_bias_event,
 				SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD),
 
@@ -229,7 +236,8 @@ static const struct snd_soc_dapm_widget sgtl5000_dapm_widgets[] = {
 /* routes for sgtl5000 */
 static const struct snd_soc_dapm_route sgtl5000_dapm_routes[] = {
 	{"Capture Mux", "LINE_IN", "LINE_IN"},	/* line_in --> adc_mux */
-	{"Capture Mux", "MIC_IN", "MIC_IN"},	/* mic_in --> adc_mux */
+	{"Mic Bias", NULL, "MIC_IN"},		/* mic_in --> mic bias */
+	{"Capture Mux", "MIC_IN", "Mic Bias"},	/* mic bias --> adc_mux */
 
 	{"ADC", NULL, "Capture Mux"},		/* adc_mux --> adc */
 	{"AIFOUT", NULL, "ADC"},		/* adc --> i2s_out */
-- 
1.7.4.1

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH] ASoC: sgtl5000: fix power on/off of MIC bias
@ 2012-03-28  7:30 ` Shawn Guo
  0 siblings, 0 replies; 18+ messages in thread
From: Shawn Guo @ 2012-03-28  7:30 UTC (permalink / raw)
  To: linux-arm-kernel

From: Lionel Xu <Lionel.Xu@freescale.com>

There is no sound in the recorded wav, to enable recording, the VAG
should be powered up, and the mic bias resistor should be set up with
proper value.

Signed-off-by: Lionel Xu <lionel.xu@freescale.com>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Cc: Zeng Zhaoming <zengzm.kernel@gmail.com>
---
 sound/soc/codecs/sgtl5000.c |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/sound/soc/codecs/sgtl5000.c b/sound/soc/codecs/sgtl5000.c
index d192626..a24299c 100644
--- a/sound/soc/codecs/sgtl5000.c
+++ b/sound/soc/codecs/sgtl5000.c
@@ -132,11 +132,18 @@ static int mic_bias_event(struct snd_soc_dapm_widget *w,
 		snd_soc_update_bits(w->codec, SGTL5000_CHIP_MIC_CTRL,
 				SGTL5000_BIAS_R_MASK,
 				SGTL5000_BIAS_R_4k << SGTL5000_BIAS_R_SHIFT);
+
+		snd_soc_update_bits(w->codec, SGTL5000_CHIP_ANA_POWER,
+				SGTL5000_VAG_POWERUP, SGTL5000_VAG_POWERUP);
 		break;
 
 	case SND_SOC_DAPM_PRE_PMD:
 		snd_soc_update_bits(w->codec, SGTL5000_CHIP_MIC_CTRL,
-				SGTL5000_BIAS_R_MASK, 0);
+				SGTL5000_BIAS_R_MASK,
+				SGTL5000_BIAS_R_off << SGTL5000_BIAS_R_SHIFT);
+
+		snd_soc_update_bits(w->codec, SGTL5000_CHIP_ANA_POWER,
+				SGTL5000_VAG_POWERUP, 0);
 		break;
 	}
 	return 0;
@@ -197,7 +204,7 @@ static const struct snd_soc_dapm_widget sgtl5000_dapm_widgets[] = {
 	SND_SOC_DAPM_OUTPUT("HP_OUT"),
 	SND_SOC_DAPM_OUTPUT("LINE_OUT"),
 
-	SND_SOC_DAPM_MICBIAS_E("Mic Bias", SGTL5000_CHIP_MIC_CTRL, 8, 0,
+	SND_SOC_DAPM_MICBIAS_E("Mic Bias", SND_SOC_NOPM, 0, 0,
 				mic_bias_event,
 				SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD),
 
@@ -229,7 +236,8 @@ static const struct snd_soc_dapm_widget sgtl5000_dapm_widgets[] = {
 /* routes for sgtl5000 */
 static const struct snd_soc_dapm_route sgtl5000_dapm_routes[] = {
 	{"Capture Mux", "LINE_IN", "LINE_IN"},	/* line_in --> adc_mux */
-	{"Capture Mux", "MIC_IN", "MIC_IN"},	/* mic_in --> adc_mux */
+	{"Mic Bias", NULL, "MIC_IN"},		/* mic_in --> mic bias */
+	{"Capture Mux", "MIC_IN", "Mic Bias"},	/* mic bias --> adc_mux */
 
 	{"ADC", NULL, "Capture Mux"},		/* adc_mux --> adc */
 	{"AIFOUT", NULL, "ADC"},		/* adc --> i2s_out */
-- 
1.7.4.1

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* Re: [PATCH] ASoC: sgtl5000: fix power on/off of MIC bias
  2012-03-28  7:30 ` Shawn Guo
@ 2012-03-28  9:05   ` Zeng Zhaoming
  -1 siblings, 0 replies; 18+ messages in thread
From: Zeng Zhaoming @ 2012-03-28  9:05 UTC (permalink / raw)
  To: Shawn Guo; +Cc: alsa-devel, Mark Brown, Lionel Xu, linux-arm-kernel

It is OK to me, Thanks.

Acked-by: Zeng Zhaoming <zengzm.kernel@gmail.com>

On Wed 2012-03-28 15:30:33, Shawn Guo wrote:
> From: Lionel Xu <Lionel.Xu@freescale.com>
> 
> There is no sound in the recorded wav, to enable recording, the VAG
> should be powered up, and the mic bias resistor should be set up with
> proper value.
> 
> Signed-off-by: Lionel Xu <lionel.xu@freescale.com>
> Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
> Cc: Zeng Zhaoming <zengzm.kernel@gmail.com>
> ---
>  sound/soc/codecs/sgtl5000.c |   14 +++++++++++---
>  1 files changed, 11 insertions(+), 3 deletions(-)
> 
> diff --git a/sound/soc/codecs/sgtl5000.c b/sound/soc/codecs/sgtl5000.c
> index d192626..a24299c 100644
> --- a/sound/soc/codecs/sgtl5000.c
> +++ b/sound/soc/codecs/sgtl5000.c
> @@ -132,11 +132,18 @@ static int mic_bias_event(struct snd_soc_dapm_widget *w,
>  		snd_soc_update_bits(w->codec, SGTL5000_CHIP_MIC_CTRL,
>  				SGTL5000_BIAS_R_MASK,
>  				SGTL5000_BIAS_R_4k << SGTL5000_BIAS_R_SHIFT);
> +
> +		snd_soc_update_bits(w->codec, SGTL5000_CHIP_ANA_POWER,
> +				SGTL5000_VAG_POWERUP, SGTL5000_VAG_POWERUP);
>  		break;
>  
>  	case SND_SOC_DAPM_PRE_PMD:
>  		snd_soc_update_bits(w->codec, SGTL5000_CHIP_MIC_CTRL,
> -				SGTL5000_BIAS_R_MASK, 0);
> +				SGTL5000_BIAS_R_MASK,
> +				SGTL5000_BIAS_R_off << SGTL5000_BIAS_R_SHIFT);
> +
> +		snd_soc_update_bits(w->codec, SGTL5000_CHIP_ANA_POWER,
> +				SGTL5000_VAG_POWERUP, 0);
>  		break;
>  	}
>  	return 0;
> @@ -197,7 +204,7 @@ static const struct snd_soc_dapm_widget sgtl5000_dapm_widgets[] = {
>  	SND_SOC_DAPM_OUTPUT("HP_OUT"),
>  	SND_SOC_DAPM_OUTPUT("LINE_OUT"),
>  
> -	SND_SOC_DAPM_MICBIAS_E("Mic Bias", SGTL5000_CHIP_MIC_CTRL, 8, 0,
> +	SND_SOC_DAPM_MICBIAS_E("Mic Bias", SND_SOC_NOPM, 0, 0,
>  				mic_bias_event,
>  				SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD),
>  
> @@ -229,7 +236,8 @@ static const struct snd_soc_dapm_widget sgtl5000_dapm_widgets[] = {
>  /* routes for sgtl5000 */
>  static const struct snd_soc_dapm_route sgtl5000_dapm_routes[] = {
>  	{"Capture Mux", "LINE_IN", "LINE_IN"},	/* line_in --> adc_mux */
> -	{"Capture Mux", "MIC_IN", "MIC_IN"},	/* mic_in --> adc_mux */
> +	{"Mic Bias", NULL, "MIC_IN"},		/* mic_in --> mic bias */
> +	{"Capture Mux", "MIC_IN", "Mic Bias"},	/* mic bias --> adc_mux */
>  
>  	{"ADC", NULL, "Capture Mux"},		/* adc_mux --> adc */
>  	{"AIFOUT", NULL, "ADC"},		/* adc --> i2s_out */
> -- 
> 1.7.4.1

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH] ASoC: sgtl5000: fix power on/off of MIC bias
@ 2012-03-28  9:05   ` Zeng Zhaoming
  0 siblings, 0 replies; 18+ messages in thread
From: Zeng Zhaoming @ 2012-03-28  9:05 UTC (permalink / raw)
  To: linux-arm-kernel

It is OK to me, Thanks.

Acked-by: Zeng Zhaoming <zengzm.kernel@gmail.com>

On Wed 2012-03-28 15:30:33, Shawn Guo wrote:
> From: Lionel Xu <Lionel.Xu@freescale.com>
> 
> There is no sound in the recorded wav, to enable recording, the VAG
> should be powered up, and the mic bias resistor should be set up with
> proper value.
> 
> Signed-off-by: Lionel Xu <lionel.xu@freescale.com>
> Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
> Cc: Zeng Zhaoming <zengzm.kernel@gmail.com>
> ---
>  sound/soc/codecs/sgtl5000.c |   14 +++++++++++---
>  1 files changed, 11 insertions(+), 3 deletions(-)
> 
> diff --git a/sound/soc/codecs/sgtl5000.c b/sound/soc/codecs/sgtl5000.c
> index d192626..a24299c 100644
> --- a/sound/soc/codecs/sgtl5000.c
> +++ b/sound/soc/codecs/sgtl5000.c
> @@ -132,11 +132,18 @@ static int mic_bias_event(struct snd_soc_dapm_widget *w,
>  		snd_soc_update_bits(w->codec, SGTL5000_CHIP_MIC_CTRL,
>  				SGTL5000_BIAS_R_MASK,
>  				SGTL5000_BIAS_R_4k << SGTL5000_BIAS_R_SHIFT);
> +
> +		snd_soc_update_bits(w->codec, SGTL5000_CHIP_ANA_POWER,
> +				SGTL5000_VAG_POWERUP, SGTL5000_VAG_POWERUP);
>  		break;
>  
>  	case SND_SOC_DAPM_PRE_PMD:
>  		snd_soc_update_bits(w->codec, SGTL5000_CHIP_MIC_CTRL,
> -				SGTL5000_BIAS_R_MASK, 0);
> +				SGTL5000_BIAS_R_MASK,
> +				SGTL5000_BIAS_R_off << SGTL5000_BIAS_R_SHIFT);
> +
> +		snd_soc_update_bits(w->codec, SGTL5000_CHIP_ANA_POWER,
> +				SGTL5000_VAG_POWERUP, 0);
>  		break;
>  	}
>  	return 0;
> @@ -197,7 +204,7 @@ static const struct snd_soc_dapm_widget sgtl5000_dapm_widgets[] = {
>  	SND_SOC_DAPM_OUTPUT("HP_OUT"),
>  	SND_SOC_DAPM_OUTPUT("LINE_OUT"),
>  
> -	SND_SOC_DAPM_MICBIAS_E("Mic Bias", SGTL5000_CHIP_MIC_CTRL, 8, 0,
> +	SND_SOC_DAPM_MICBIAS_E("Mic Bias", SND_SOC_NOPM, 0, 0,
>  				mic_bias_event,
>  				SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD),
>  
> @@ -229,7 +236,8 @@ static const struct snd_soc_dapm_widget sgtl5000_dapm_widgets[] = {
>  /* routes for sgtl5000 */
>  static const struct snd_soc_dapm_route sgtl5000_dapm_routes[] = {
>  	{"Capture Mux", "LINE_IN", "LINE_IN"},	/* line_in --> adc_mux */
> -	{"Capture Mux", "MIC_IN", "MIC_IN"},	/* mic_in --> adc_mux */
> +	{"Mic Bias", NULL, "MIC_IN"},		/* mic_in --> mic bias */
> +	{"Capture Mux", "MIC_IN", "Mic Bias"},	/* mic bias --> adc_mux */
>  
>  	{"ADC", NULL, "Capture Mux"},		/* adc_mux --> adc */
>  	{"AIFOUT", NULL, "ADC"},		/* adc --> i2s_out */
> -- 
> 1.7.4.1

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH] ASoC: sgtl5000: fix power on/off of MIC bias
  2012-03-28  7:30 ` Shawn Guo
@ 2012-03-28  9:52   ` Dong Aisheng-B29396
  -1 siblings, 0 replies; 18+ messages in thread
From: Dong Aisheng-B29396 @ 2012-03-28  9:52 UTC (permalink / raw)
  To: Shawn Guo, alsa-devel
  Cc: Zeng, Xu Lionel-R63889, Mark Brown, linux-arm-kernel, Zhaoming

> -----Original Message-----
> From: alsa-devel-bounces@alsa-project.org [mailto:alsa-devel-
> bounces@alsa-project.org] On Behalf Of Shawn Guo
> Sent: Wednesday, March 28, 2012 3:31 PM
> To: alsa-devel@alsa-project.org
> Cc: Xu Lionel-R63889; Mark Brown; Zeng@alsa-project.org; Zhaoming; Shawn
> Guo; Xu Lionel-R63889; linux-arm-kernel@lists.infradead.org
> Subject: [alsa-devel] [PATCH] ASoC: sgtl5000: fix power on/off of MIC
> bias
> 
> From: Lionel Xu <Lionel.Xu@freescale.com>
> 
> There is no sound in the recorded wav, to enable recording, the VAG
> should be powered up, and the mic bias resistor should be set up with
> proper value.
> 
> Signed-off-by: Lionel Xu <lionel.xu@freescale.com>
> Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
> Cc: Zeng Zhaoming <zengzm.kernel@gmail.com>
> ---
>  sound/soc/codecs/sgtl5000.c |   14 +++++++++++---
>  1 files changed, 11 insertions(+), 3 deletions(-)
> 
> diff --git a/sound/soc/codecs/sgtl5000.c b/sound/soc/codecs/sgtl5000.c
> index d192626..a24299c 100644
> --- a/sound/soc/codecs/sgtl5000.c
> +++ b/sound/soc/codecs/sgtl5000.c
> @@ -132,11 +132,18 @@ static int mic_bias_event(struct
> snd_soc_dapm_widget *w,
>  		snd_soc_update_bits(w->codec, SGTL5000_CHIP_MIC_CTRL,
>  				SGTL5000_BIAS_R_MASK,
>  				SGTL5000_BIAS_R_4k << SGTL5000_BIAS_R_SHIFT);
> +
> +		snd_soc_update_bits(w->codec, SGTL5000_CHIP_ANA_POWER,
> +				SGTL5000_VAG_POWERUP, SGTL5000_VAG_POWERUP);
Did you test line-in record?
IIRC for line-in record, it may also need VAG_POWER up.
Then only enable VAG_POWER for mic_bias_event may not be sufficient.
Will verify it latter when I'm free.

Regards
Dong Aisheng

>  		break;
> 
>  	case SND_SOC_DAPM_PRE_PMD:
>  		snd_soc_update_bits(w->codec, SGTL5000_CHIP_MIC_CTRL,
> -				SGTL5000_BIAS_R_MASK, 0);
> +				SGTL5000_BIAS_R_MASK,
> +				SGTL5000_BIAS_R_off << SGTL5000_BIAS_R_SHIFT);
> +
> +		snd_soc_update_bits(w->codec, SGTL5000_CHIP_ANA_POWER,
> +				SGTL5000_VAG_POWERUP, 0);
>  		break;
>  	}
>  	return 0;
> @@ -197,7 +204,7 @@ static const struct snd_soc_dapm_widget
> sgtl5000_dapm_widgets[] = {
>  	SND_SOC_DAPM_OUTPUT("HP_OUT"),
>  	SND_SOC_DAPM_OUTPUT("LINE_OUT"),
> 
> -	SND_SOC_DAPM_MICBIAS_E("Mic Bias", SGTL5000_CHIP_MIC_CTRL, 8, 0,
> +	SND_SOC_DAPM_MICBIAS_E("Mic Bias", SND_SOC_NOPM, 0, 0,
>  				mic_bias_event,
>  				SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD),
> 
> @@ -229,7 +236,8 @@ static const struct snd_soc_dapm_widget
> sgtl5000_dapm_widgets[] = {
>  /* routes for sgtl5000 */
>  static const struct snd_soc_dapm_route sgtl5000_dapm_routes[] = {
>  	{"Capture Mux", "LINE_IN", "LINE_IN"},	/* line_in --> adc_mux */
> -	{"Capture Mux", "MIC_IN", "MIC_IN"},	/* mic_in --> adc_mux */
> +	{"Mic Bias", NULL, "MIC_IN"},		/* mic_in --> mic bias */
> +	{"Capture Mux", "MIC_IN", "Mic Bias"},	/* mic bias --> adc_mux
> */
> 
>  	{"ADC", NULL, "Capture Mux"},		/* adc_mux --> adc */
>  	{"AIFOUT", NULL, "ADC"},		/* adc --> i2s_out */
> --
> 1.7.4.1
> 
> 
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [alsa-devel] [PATCH] ASoC: sgtl5000: fix power on/off of MIC bias
@ 2012-03-28  9:52   ` Dong Aisheng-B29396
  0 siblings, 0 replies; 18+ messages in thread
From: Dong Aisheng-B29396 @ 2012-03-28  9:52 UTC (permalink / raw)
  To: linux-arm-kernel

> -----Original Message-----
> From: alsa-devel-bounces at alsa-project.org [mailto:alsa-devel-
> bounces at alsa-project.org] On Behalf Of Shawn Guo
> Sent: Wednesday, March 28, 2012 3:31 PM
> To: alsa-devel at alsa-project.org
> Cc: Xu Lionel-R63889; Mark Brown; Zeng at alsa-project.org; Zhaoming; Shawn
> Guo; Xu Lionel-R63889; linux-arm-kernel at lists.infradead.org
> Subject: [alsa-devel] [PATCH] ASoC: sgtl5000: fix power on/off of MIC
> bias
> 
> From: Lionel Xu <Lionel.Xu@freescale.com>
> 
> There is no sound in the recorded wav, to enable recording, the VAG
> should be powered up, and the mic bias resistor should be set up with
> proper value.
> 
> Signed-off-by: Lionel Xu <lionel.xu@freescale.com>
> Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
> Cc: Zeng Zhaoming <zengzm.kernel@gmail.com>
> ---
>  sound/soc/codecs/sgtl5000.c |   14 +++++++++++---
>  1 files changed, 11 insertions(+), 3 deletions(-)
> 
> diff --git a/sound/soc/codecs/sgtl5000.c b/sound/soc/codecs/sgtl5000.c
> index d192626..a24299c 100644
> --- a/sound/soc/codecs/sgtl5000.c
> +++ b/sound/soc/codecs/sgtl5000.c
> @@ -132,11 +132,18 @@ static int mic_bias_event(struct
> snd_soc_dapm_widget *w,
>  		snd_soc_update_bits(w->codec, SGTL5000_CHIP_MIC_CTRL,
>  				SGTL5000_BIAS_R_MASK,
>  				SGTL5000_BIAS_R_4k << SGTL5000_BIAS_R_SHIFT);
> +
> +		snd_soc_update_bits(w->codec, SGTL5000_CHIP_ANA_POWER,
> +				SGTL5000_VAG_POWERUP, SGTL5000_VAG_POWERUP);
Did you test line-in record?
IIRC for line-in record, it may also need VAG_POWER up.
Then only enable VAG_POWER for mic_bias_event may not be sufficient.
Will verify it latter when I'm free.

Regards
Dong Aisheng

>  		break;
> 
>  	case SND_SOC_DAPM_PRE_PMD:
>  		snd_soc_update_bits(w->codec, SGTL5000_CHIP_MIC_CTRL,
> -				SGTL5000_BIAS_R_MASK, 0);
> +				SGTL5000_BIAS_R_MASK,
> +				SGTL5000_BIAS_R_off << SGTL5000_BIAS_R_SHIFT);
> +
> +		snd_soc_update_bits(w->codec, SGTL5000_CHIP_ANA_POWER,
> +				SGTL5000_VAG_POWERUP, 0);
>  		break;
>  	}
>  	return 0;
> @@ -197,7 +204,7 @@ static const struct snd_soc_dapm_widget
> sgtl5000_dapm_widgets[] = {
>  	SND_SOC_DAPM_OUTPUT("HP_OUT"),
>  	SND_SOC_DAPM_OUTPUT("LINE_OUT"),
> 
> -	SND_SOC_DAPM_MICBIAS_E("Mic Bias", SGTL5000_CHIP_MIC_CTRL, 8, 0,
> +	SND_SOC_DAPM_MICBIAS_E("Mic Bias", SND_SOC_NOPM, 0, 0,
>  				mic_bias_event,
>  				SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD),
> 
> @@ -229,7 +236,8 @@ static const struct snd_soc_dapm_widget
> sgtl5000_dapm_widgets[] = {
>  /* routes for sgtl5000 */
>  static const struct snd_soc_dapm_route sgtl5000_dapm_routes[] = {
>  	{"Capture Mux", "LINE_IN", "LINE_IN"},	/* line_in --> adc_mux */
> -	{"Capture Mux", "MIC_IN", "MIC_IN"},	/* mic_in --> adc_mux */
> +	{"Mic Bias", NULL, "MIC_IN"},		/* mic_in --> mic bias */
> +	{"Capture Mux", "MIC_IN", "Mic Bias"},	/* mic bias --> adc_mux
> */
> 
>  	{"ADC", NULL, "Capture Mux"},		/* adc_mux --> adc */
>  	{"AIFOUT", NULL, "ADC"},		/* adc --> i2s_out */
> --
> 1.7.4.1
> 
> 
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel at alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH] ASoC: sgtl5000: fix power on/off of MIC bias
  2012-03-28  7:30 ` Shawn Guo
@ 2012-03-28  9:58   ` Dong Aisheng
  -1 siblings, 0 replies; 18+ messages in thread
From: Dong Aisheng @ 2012-03-28  9:58 UTC (permalink / raw)
  To: Shawn Guo
  Cc: Zeng, alsa-devel, Lionel Xu, Brown, Mark, Zhaoming, linux-arm-kernel

On Wed, Mar 28, 2012 at 03:30:33PM +0800, Shawn Guo wrote:
> From: Lionel Xu <Lionel.Xu@freescale.com>
> 
> There is no sound in the recorded wav, to enable recording, the VAG
> should be powered up, and the mic bias resistor should be set up with
> proper value.
> 
> Signed-off-by: Lionel Xu <lionel.xu@freescale.com>
> Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
> Cc: Zeng Zhaoming <zengzm.kernel@gmail.com>
> ---
>  sound/soc/codecs/sgtl5000.c |   14 +++++++++++---
>  1 files changed, 11 insertions(+), 3 deletions(-)
> 
> diff --git a/sound/soc/codecs/sgtl5000.c b/sound/soc/codecs/sgtl5000.c
> index d192626..a24299c 100644
> --- a/sound/soc/codecs/sgtl5000.c
> +++ b/sound/soc/codecs/sgtl5000.c
> @@ -132,11 +132,18 @@ static int mic_bias_event(struct snd_soc_dapm_widget *w,
>  		snd_soc_update_bits(w->codec, SGTL5000_CHIP_MIC_CTRL,
>  				SGTL5000_BIAS_R_MASK,
>  				SGTL5000_BIAS_R_4k << SGTL5000_BIAS_R_SHIFT);
> +
> +		snd_soc_update_bits(w->codec, SGTL5000_CHIP_ANA_POWER,
> +				SGTL5000_VAG_POWERUP, SGTL5000_VAG_POWERUP);
Only enable SGTL5000_VAG_POWERUP for mic bias_event may not be sufficient.
IIRC for line-in record, we also need to enable VAG_POWER.
Will verify it later when i'm free.

Regards
Dong Aisheng
>  		break;
>  
>  	case SND_SOC_DAPM_PRE_PMD:
>  		snd_soc_update_bits(w->codec, SGTL5000_CHIP_MIC_CTRL,
> -				SGTL5000_BIAS_R_MASK, 0);
> +				SGTL5000_BIAS_R_MASK,
> +				SGTL5000_BIAS_R_off << SGTL5000_BIAS_R_SHIFT);
> +
> +		snd_soc_update_bits(w->codec, SGTL5000_CHIP_ANA_POWER,
> +				SGTL5000_VAG_POWERUP, 0);
>  		break;
>  	}
>  	return 0;
> @@ -197,7 +204,7 @@ static const struct snd_soc_dapm_widget sgtl5000_dapm_widgets[] = {
>  	SND_SOC_DAPM_OUTPUT("HP_OUT"),
>  	SND_SOC_DAPM_OUTPUT("LINE_OUT"),
>  
> -	SND_SOC_DAPM_MICBIAS_E("Mic Bias", SGTL5000_CHIP_MIC_CTRL, 8, 0,
> +	SND_SOC_DAPM_MICBIAS_E("Mic Bias", SND_SOC_NOPM, 0, 0,
>  				mic_bias_event,
>  				SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD),
>  
> @@ -229,7 +236,8 @@ static const struct snd_soc_dapm_widget sgtl5000_dapm_widgets[] = {
>  /* routes for sgtl5000 */
>  static const struct snd_soc_dapm_route sgtl5000_dapm_routes[] = {
>  	{"Capture Mux", "LINE_IN", "LINE_IN"},	/* line_in --> adc_mux */
> -	{"Capture Mux", "MIC_IN", "MIC_IN"},	/* mic_in --> adc_mux */
> +	{"Mic Bias", NULL, "MIC_IN"},		/* mic_in --> mic bias */
> +	{"Capture Mux", "MIC_IN", "Mic Bias"},	/* mic bias --> adc_mux */
>  
>  	{"ADC", NULL, "Capture Mux"},		/* adc_mux --> adc */
>  	{"AIFOUT", NULL, "ADC"},		/* adc --> i2s_out */
> -- 
> 1.7.4.1
> 
> 
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
> 

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [alsa-devel] [PATCH] ASoC: sgtl5000: fix power on/off of MIC bias
@ 2012-03-28  9:58   ` Dong Aisheng
  0 siblings, 0 replies; 18+ messages in thread
From: Dong Aisheng @ 2012-03-28  9:58 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Mar 28, 2012 at 03:30:33PM +0800, Shawn Guo wrote:
> From: Lionel Xu <Lionel.Xu@freescale.com>
> 
> There is no sound in the recorded wav, to enable recording, the VAG
> should be powered up, and the mic bias resistor should be set up with
> proper value.
> 
> Signed-off-by: Lionel Xu <lionel.xu@freescale.com>
> Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
> Cc: Zeng Zhaoming <zengzm.kernel@gmail.com>
> ---
>  sound/soc/codecs/sgtl5000.c |   14 +++++++++++---
>  1 files changed, 11 insertions(+), 3 deletions(-)
> 
> diff --git a/sound/soc/codecs/sgtl5000.c b/sound/soc/codecs/sgtl5000.c
> index d192626..a24299c 100644
> --- a/sound/soc/codecs/sgtl5000.c
> +++ b/sound/soc/codecs/sgtl5000.c
> @@ -132,11 +132,18 @@ static int mic_bias_event(struct snd_soc_dapm_widget *w,
>  		snd_soc_update_bits(w->codec, SGTL5000_CHIP_MIC_CTRL,
>  				SGTL5000_BIAS_R_MASK,
>  				SGTL5000_BIAS_R_4k << SGTL5000_BIAS_R_SHIFT);
> +
> +		snd_soc_update_bits(w->codec, SGTL5000_CHIP_ANA_POWER,
> +				SGTL5000_VAG_POWERUP, SGTL5000_VAG_POWERUP);
Only enable SGTL5000_VAG_POWERUP for mic bias_event may not be sufficient.
IIRC for line-in record, we also need to enable VAG_POWER.
Will verify it later when i'm free.

Regards
Dong Aisheng
>  		break;
>  
>  	case SND_SOC_DAPM_PRE_PMD:
>  		snd_soc_update_bits(w->codec, SGTL5000_CHIP_MIC_CTRL,
> -				SGTL5000_BIAS_R_MASK, 0);
> +				SGTL5000_BIAS_R_MASK,
> +				SGTL5000_BIAS_R_off << SGTL5000_BIAS_R_SHIFT);
> +
> +		snd_soc_update_bits(w->codec, SGTL5000_CHIP_ANA_POWER,
> +				SGTL5000_VAG_POWERUP, 0);
>  		break;
>  	}
>  	return 0;
> @@ -197,7 +204,7 @@ static const struct snd_soc_dapm_widget sgtl5000_dapm_widgets[] = {
>  	SND_SOC_DAPM_OUTPUT("HP_OUT"),
>  	SND_SOC_DAPM_OUTPUT("LINE_OUT"),
>  
> -	SND_SOC_DAPM_MICBIAS_E("Mic Bias", SGTL5000_CHIP_MIC_CTRL, 8, 0,
> +	SND_SOC_DAPM_MICBIAS_E("Mic Bias", SND_SOC_NOPM, 0, 0,
>  				mic_bias_event,
>  				SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD),
>  
> @@ -229,7 +236,8 @@ static const struct snd_soc_dapm_widget sgtl5000_dapm_widgets[] = {
>  /* routes for sgtl5000 */
>  static const struct snd_soc_dapm_route sgtl5000_dapm_routes[] = {
>  	{"Capture Mux", "LINE_IN", "LINE_IN"},	/* line_in --> adc_mux */
> -	{"Capture Mux", "MIC_IN", "MIC_IN"},	/* mic_in --> adc_mux */
> +	{"Mic Bias", NULL, "MIC_IN"},		/* mic_in --> mic bias */
> +	{"Capture Mux", "MIC_IN", "Mic Bias"},	/* mic bias --> adc_mux */
>  
>  	{"ADC", NULL, "Capture Mux"},		/* adc_mux --> adc */
>  	{"AIFOUT", NULL, "ADC"},		/* adc --> i2s_out */
> -- 
> 1.7.4.1
> 
> 
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel at alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
> 

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [alsa-devel] [PATCH] ASoC: sgtl5000: fix power on/off of MIC bias
  2012-03-28  9:52   ` [alsa-devel] " Dong Aisheng-B29396
@ 2012-03-28 10:11     ` Zeng Zhaoming
  -1 siblings, 0 replies; 18+ messages in thread
From: Zeng Zhaoming @ 2012-03-28 10:11 UTC (permalink / raw)
  To: Dong Aisheng-B29396
  Cc: Zeng, Xu Lionel-R63889, alsa-devel, Mark Brown, Shawn Guo,
	linux-arm-kernel

On Wed 2012-03-28 09:52:15, Dong Aisheng-B29396 wrote:
> > -----Original Message-----
> > From: alsa-devel-bounces@alsa-project.org [mailto:alsa-devel-
> > bounces@alsa-project.org] On Behalf Of Shawn Guo
> > Sent: Wednesday, March 28, 2012 3:31 PM
> > To: alsa-devel@alsa-project.org
> > Cc: Xu Lionel-R63889; Mark Brown; Zeng@alsa-project.org; Zhaoming; Shawn
> > Guo; Xu Lionel-R63889; linux-arm-kernel@lists.infradead.org
> > Subject: [alsa-devel] [PATCH] ASoC: sgtl5000: fix power on/off of MIC
> > bias
> > 
> > From: Lionel Xu <Lionel.Xu@freescale.com>
> > 
> > There is no sound in the recorded wav, to enable recording, the VAG
> > should be powered up, and the mic bias resistor should be set up with
> > proper value.
> > 
> > Signed-off-by: Lionel Xu <lionel.xu@freescale.com>
> > Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
> > Cc: Zeng Zhaoming <zengzm.kernel@gmail.com>
> > ---
> >  sound/soc/codecs/sgtl5000.c |   14 +++++++++++---
> >  1 files changed, 11 insertions(+), 3 deletions(-)
> > 
> > diff --git a/sound/soc/codecs/sgtl5000.c b/sound/soc/codecs/sgtl5000.c
> > index d192626..a24299c 100644
> > --- a/sound/soc/codecs/sgtl5000.c
> > +++ b/sound/soc/codecs/sgtl5000.c
> > @@ -132,11 +132,18 @@ static int mic_bias_event(struct
> > snd_soc_dapm_widget *w,
> >  		snd_soc_update_bits(w->codec, SGTL5000_CHIP_MIC_CTRL,
> >  				SGTL5000_BIAS_R_MASK,
> >  				SGTL5000_BIAS_R_4k << SGTL5000_BIAS_R_SHIFT);
> > +
> > +		snd_soc_update_bits(w->codec, SGTL5000_CHIP_ANA_POWER,
> > +				SGTL5000_VAG_POWERUP, SGTL5000_VAG_POWERUP);
> Did you test line-in record?
> IIRC for line-in record, it may also need VAG_POWER up.
> Then only enable VAG_POWER for mic_bias_event may not be sufficient.
> Will verify it latter when I'm free.
> 
Yes, if mic bias needs VAG powerup, LINE-IN capture has the same issue.
But I remember Line-out test passed in mx28, it there any defect I ignored?

Thanks.
Zeng Zhaoming

> Regards
> Dong Aisheng
> 
> >  		break;
> > 
> >  	case SND_SOC_DAPM_PRE_PMD:
> >  		snd_soc_update_bits(w->codec, SGTL5000_CHIP_MIC_CTRL,
> > -				SGTL5000_BIAS_R_MASK, 0);
> > +				SGTL5000_BIAS_R_MASK,
> > +				SGTL5000_BIAS_R_off << SGTL5000_BIAS_R_SHIFT);
> > +
> > +		snd_soc_update_bits(w->codec, SGTL5000_CHIP_ANA_POWER,
> > +				SGTL5000_VAG_POWERUP, 0);
> >  		break;
> >  	}
> >  	return 0;
> > @@ -197,7 +204,7 @@ static const struct snd_soc_dapm_widget
> > sgtl5000_dapm_widgets[] = {
> >  	SND_SOC_DAPM_OUTPUT("HP_OUT"),
> >  	SND_SOC_DAPM_OUTPUT("LINE_OUT"),
> > 
> > -	SND_SOC_DAPM_MICBIAS_E("Mic Bias", SGTL5000_CHIP_MIC_CTRL, 8, 0,
> > +	SND_SOC_DAPM_MICBIAS_E("Mic Bias", SND_SOC_NOPM, 0, 0,
> >  				mic_bias_event,
> >  				SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD),
> > 
> > @@ -229,7 +236,8 @@ static const struct snd_soc_dapm_widget
> > sgtl5000_dapm_widgets[] = {
> >  /* routes for sgtl5000 */
> >  static const struct snd_soc_dapm_route sgtl5000_dapm_routes[] = {
> >  	{"Capture Mux", "LINE_IN", "LINE_IN"},	/* line_in --> adc_mux */
> > -	{"Capture Mux", "MIC_IN", "MIC_IN"},	/* mic_in --> adc_mux */
> > +	{"Mic Bias", NULL, "MIC_IN"},		/* mic_in --> mic bias */
> > +	{"Capture Mux", "MIC_IN", "Mic Bias"},	/* mic bias --> adc_mux
> > */
> > 
> >  	{"ADC", NULL, "Capture Mux"},		/* adc_mux --> adc */
> >  	{"AIFOUT", NULL, "ADC"},		/* adc --> i2s_out */
> > --
> > 1.7.4.1
> > 
> > 
> > _______________________________________________
> > Alsa-devel mailing list
> > Alsa-devel@alsa-project.org
> > http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [alsa-devel] [PATCH] ASoC: sgtl5000: fix power on/off of MIC bias
@ 2012-03-28 10:11     ` Zeng Zhaoming
  0 siblings, 0 replies; 18+ messages in thread
From: Zeng Zhaoming @ 2012-03-28 10:11 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed 2012-03-28 09:52:15, Dong Aisheng-B29396 wrote:
> > -----Original Message-----
> > From: alsa-devel-bounces at alsa-project.org [mailto:alsa-devel-
> > bounces at alsa-project.org] On Behalf Of Shawn Guo
> > Sent: Wednesday, March 28, 2012 3:31 PM
> > To: alsa-devel at alsa-project.org
> > Cc: Xu Lionel-R63889; Mark Brown; Zeng at alsa-project.org; Zhaoming; Shawn
> > Guo; Xu Lionel-R63889; linux-arm-kernel at lists.infradead.org
> > Subject: [alsa-devel] [PATCH] ASoC: sgtl5000: fix power on/off of MIC
> > bias
> > 
> > From: Lionel Xu <Lionel.Xu@freescale.com>
> > 
> > There is no sound in the recorded wav, to enable recording, the VAG
> > should be powered up, and the mic bias resistor should be set up with
> > proper value.
> > 
> > Signed-off-by: Lionel Xu <lionel.xu@freescale.com>
> > Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
> > Cc: Zeng Zhaoming <zengzm.kernel@gmail.com>
> > ---
> >  sound/soc/codecs/sgtl5000.c |   14 +++++++++++---
> >  1 files changed, 11 insertions(+), 3 deletions(-)
> > 
> > diff --git a/sound/soc/codecs/sgtl5000.c b/sound/soc/codecs/sgtl5000.c
> > index d192626..a24299c 100644
> > --- a/sound/soc/codecs/sgtl5000.c
> > +++ b/sound/soc/codecs/sgtl5000.c
> > @@ -132,11 +132,18 @@ static int mic_bias_event(struct
> > snd_soc_dapm_widget *w,
> >  		snd_soc_update_bits(w->codec, SGTL5000_CHIP_MIC_CTRL,
> >  				SGTL5000_BIAS_R_MASK,
> >  				SGTL5000_BIAS_R_4k << SGTL5000_BIAS_R_SHIFT);
> > +
> > +		snd_soc_update_bits(w->codec, SGTL5000_CHIP_ANA_POWER,
> > +				SGTL5000_VAG_POWERUP, SGTL5000_VAG_POWERUP);
> Did you test line-in record?
> IIRC for line-in record, it may also need VAG_POWER up.
> Then only enable VAG_POWER for mic_bias_event may not be sufficient.
> Will verify it latter when I'm free.
> 
Yes, if mic bias needs VAG powerup, LINE-IN capture has the same issue.
But I remember Line-out test passed in mx28, it there any defect I ignored?

Thanks.
Zeng Zhaoming

> Regards
> Dong Aisheng
> 
> >  		break;
> > 
> >  	case SND_SOC_DAPM_PRE_PMD:
> >  		snd_soc_update_bits(w->codec, SGTL5000_CHIP_MIC_CTRL,
> > -				SGTL5000_BIAS_R_MASK, 0);
> > +				SGTL5000_BIAS_R_MASK,
> > +				SGTL5000_BIAS_R_off << SGTL5000_BIAS_R_SHIFT);
> > +
> > +		snd_soc_update_bits(w->codec, SGTL5000_CHIP_ANA_POWER,
> > +				SGTL5000_VAG_POWERUP, 0);
> >  		break;
> >  	}
> >  	return 0;
> > @@ -197,7 +204,7 @@ static const struct snd_soc_dapm_widget
> > sgtl5000_dapm_widgets[] = {
> >  	SND_SOC_DAPM_OUTPUT("HP_OUT"),
> >  	SND_SOC_DAPM_OUTPUT("LINE_OUT"),
> > 
> > -	SND_SOC_DAPM_MICBIAS_E("Mic Bias", SGTL5000_CHIP_MIC_CTRL, 8, 0,
> > +	SND_SOC_DAPM_MICBIAS_E("Mic Bias", SND_SOC_NOPM, 0, 0,
> >  				mic_bias_event,
> >  				SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD),
> > 
> > @@ -229,7 +236,8 @@ static const struct snd_soc_dapm_widget
> > sgtl5000_dapm_widgets[] = {
> >  /* routes for sgtl5000 */
> >  static const struct snd_soc_dapm_route sgtl5000_dapm_routes[] = {
> >  	{"Capture Mux", "LINE_IN", "LINE_IN"},	/* line_in --> adc_mux */
> > -	{"Capture Mux", "MIC_IN", "MIC_IN"},	/* mic_in --> adc_mux */
> > +	{"Mic Bias", NULL, "MIC_IN"},		/* mic_in --> mic bias */
> > +	{"Capture Mux", "MIC_IN", "Mic Bias"},	/* mic bias --> adc_mux
> > */
> > 
> >  	{"ADC", NULL, "Capture Mux"},		/* adc_mux --> adc */
> >  	{"AIFOUT", NULL, "ADC"},		/* adc --> i2s_out */
> > --
> > 1.7.4.1
> > 
> > 
> > _______________________________________________
> > Alsa-devel mailing list
> > Alsa-devel at alsa-project.org
> > http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

^ permalink raw reply	[flat|nested] 18+ messages in thread

* RE: [alsa-devel] [PATCH] ASoC: sgtl5000: fix power on/off of MIC bias
  2012-03-28 10:11     ` Zeng Zhaoming
@ 2012-03-28 11:17       ` Xu Lionel-R63889
  -1 siblings, 0 replies; 18+ messages in thread
From: Xu Lionel-R63889 @ 2012-03-28 11:17 UTC (permalink / raw)
  To: Zeng Zhaoming, Dong Aisheng-B29396
  Cc: Zeng, alsa-devel, Shawn Guo, linux-arm-kernel, Mark Brown

Yes, theoretically it should be added to line-in record too, 
I check the mx53smd board just now, found the line-in port is connected to a connector,
I am afraid we did not check the line-in record before. 

-----Original Message-----
From: Zeng Zhaoming [mailto:zengzm.kernel@gmail.com] 
Sent: Wednesday, March 28, 2012 6:11 PM
To: Dong Aisheng-B29396
Cc: Shawn Guo; alsa-devel@alsa-project.org; Xu Lionel-R63889; Mark Brown; Zeng@alsa-project.org; linux-arm-kernel@lists.infradead.org
Subject: Re: [alsa-devel] [PATCH] ASoC: sgtl5000: fix power on/off of MIC bias

On Wed 2012-03-28 09:52:15, Dong Aisheng-B29396 wrote:
> > -----Original Message-----
> > From: alsa-devel-bounces@alsa-project.org [mailto:alsa-devel- 
> > bounces@alsa-project.org] On Behalf Of Shawn Guo
> > Sent: Wednesday, March 28, 2012 3:31 PM
> > To: alsa-devel@alsa-project.org
> > Cc: Xu Lionel-R63889; Mark Brown; Zeng@alsa-project.org; Zhaoming; 
> > Shawn Guo; Xu Lionel-R63889; linux-arm-kernel@lists.infradead.org
> > Subject: [alsa-devel] [PATCH] ASoC: sgtl5000: fix power on/off of 
> > MIC bias
> > 
> > From: Lionel Xu <Lionel.Xu@freescale.com>
> > 
> > There is no sound in the recorded wav, to enable recording, the VAG 
> > should be powered up, and the mic bias resistor should be set up 
> > with proper value.
> > 
> > Signed-off-by: Lionel Xu <lionel.xu@freescale.com>
> > Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
> > Cc: Zeng Zhaoming <zengzm.kernel@gmail.com>
> > ---
> >  sound/soc/codecs/sgtl5000.c |   14 +++++++++++---
> >  1 files changed, 11 insertions(+), 3 deletions(-)
> > 
> > diff --git a/sound/soc/codecs/sgtl5000.c 
> > b/sound/soc/codecs/sgtl5000.c index d192626..a24299c 100644
> > --- a/sound/soc/codecs/sgtl5000.c
> > +++ b/sound/soc/codecs/sgtl5000.c
> > @@ -132,11 +132,18 @@ static int mic_bias_event(struct 
> > snd_soc_dapm_widget *w,
> >  		snd_soc_update_bits(w->codec, SGTL5000_CHIP_MIC_CTRL,
> >  				SGTL5000_BIAS_R_MASK,
> >  				SGTL5000_BIAS_R_4k << SGTL5000_BIAS_R_SHIFT);
> > +
> > +		snd_soc_update_bits(w->codec, SGTL5000_CHIP_ANA_POWER,
> > +				SGTL5000_VAG_POWERUP, SGTL5000_VAG_POWERUP);
> Did you test line-in record?
> IIRC for line-in record, it may also need VAG_POWER up.
> Then only enable VAG_POWER for mic_bias_event may not be sufficient.
> Will verify it latter when I'm free.
> 
Yes, if mic bias needs VAG powerup, LINE-IN capture has the same issue.
But I remember Line-out test passed in mx28, it there any defect I ignored?

Thanks.
Zeng Zhaoming

> Regards
> Dong Aisheng
> 
> >  		break;
> > 
> >  	case SND_SOC_DAPM_PRE_PMD:
> >  		snd_soc_update_bits(w->codec, SGTL5000_CHIP_MIC_CTRL,
> > -				SGTL5000_BIAS_R_MASK, 0);
> > +				SGTL5000_BIAS_R_MASK,
> > +				SGTL5000_BIAS_R_off << SGTL5000_BIAS_R_SHIFT);
> > +
> > +		snd_soc_update_bits(w->codec, SGTL5000_CHIP_ANA_POWER,
> > +				SGTL5000_VAG_POWERUP, 0);
> >  		break;
> >  	}
> >  	return 0;
> > @@ -197,7 +204,7 @@ static const struct snd_soc_dapm_widget 
> > sgtl5000_dapm_widgets[] = {
> >  	SND_SOC_DAPM_OUTPUT("HP_OUT"),
> >  	SND_SOC_DAPM_OUTPUT("LINE_OUT"),
> > 
> > -	SND_SOC_DAPM_MICBIAS_E("Mic Bias", SGTL5000_CHIP_MIC_CTRL, 8, 0,
> > +	SND_SOC_DAPM_MICBIAS_E("Mic Bias", SND_SOC_NOPM, 0, 0,
> >  				mic_bias_event,
> >  				SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD),
> > 
> > @@ -229,7 +236,8 @@ static const struct snd_soc_dapm_widget 
> > sgtl5000_dapm_widgets[] = {
> >  /* routes for sgtl5000 */
> >  static const struct snd_soc_dapm_route sgtl5000_dapm_routes[] = {
> >  	{"Capture Mux", "LINE_IN", "LINE_IN"},	/* line_in --> adc_mux */
> > -	{"Capture Mux", "MIC_IN", "MIC_IN"},	/* mic_in --> adc_mux */
> > +	{"Mic Bias", NULL, "MIC_IN"},		/* mic_in --> mic bias */
> > +	{"Capture Mux", "MIC_IN", "Mic Bias"},	/* mic bias --> adc_mux
> > */
> > 
> >  	{"ADC", NULL, "Capture Mux"},		/* adc_mux --> adc */
> >  	{"AIFOUT", NULL, "ADC"},		/* adc --> i2s_out */
> > --
> > 1.7.4.1
> > 
> > 
> > _______________________________________________
> > Alsa-devel mailing list
> > Alsa-devel@alsa-project.org
> > http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [alsa-devel] [PATCH] ASoC: sgtl5000: fix power on/off of MIC bias
@ 2012-03-28 11:17       ` Xu Lionel-R63889
  0 siblings, 0 replies; 18+ messages in thread
From: Xu Lionel-R63889 @ 2012-03-28 11:17 UTC (permalink / raw)
  To: linux-arm-kernel

Yes, theoretically it should be added to line-in record too, 
I check the mx53smd board just now, found the line-in port is connected to a connector,
I am afraid we did not check the line-in record before. 

-----Original Message-----
From: Zeng Zhaoming [mailto:zengzm.kernel at gmail.com] 
Sent: Wednesday, March 28, 2012 6:11 PM
To: Dong Aisheng-B29396
Cc: Shawn Guo; alsa-devel at alsa-project.org; Xu Lionel-R63889; Mark Brown; Zeng at alsa-project.org; linux-arm-kernel at lists.infradead.org
Subject: Re: [alsa-devel] [PATCH] ASoC: sgtl5000: fix power on/off of MIC bias

On Wed 2012-03-28 09:52:15, Dong Aisheng-B29396 wrote:
> > -----Original Message-----
> > From: alsa-devel-bounces at alsa-project.org [mailto:alsa-devel- 
> > bounces at alsa-project.org] On Behalf Of Shawn Guo
> > Sent: Wednesday, March 28, 2012 3:31 PM
> > To: alsa-devel at alsa-project.org
> > Cc: Xu Lionel-R63889; Mark Brown; Zeng at alsa-project.org; Zhaoming; 
> > Shawn Guo; Xu Lionel-R63889; linux-arm-kernel at lists.infradead.org
> > Subject: [alsa-devel] [PATCH] ASoC: sgtl5000: fix power on/off of 
> > MIC bias
> > 
> > From: Lionel Xu <Lionel.Xu@freescale.com>
> > 
> > There is no sound in the recorded wav, to enable recording, the VAG 
> > should be powered up, and the mic bias resistor should be set up 
> > with proper value.
> > 
> > Signed-off-by: Lionel Xu <lionel.xu@freescale.com>
> > Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
> > Cc: Zeng Zhaoming <zengzm.kernel@gmail.com>
> > ---
> >  sound/soc/codecs/sgtl5000.c |   14 +++++++++++---
> >  1 files changed, 11 insertions(+), 3 deletions(-)
> > 
> > diff --git a/sound/soc/codecs/sgtl5000.c 
> > b/sound/soc/codecs/sgtl5000.c index d192626..a24299c 100644
> > --- a/sound/soc/codecs/sgtl5000.c
> > +++ b/sound/soc/codecs/sgtl5000.c
> > @@ -132,11 +132,18 @@ static int mic_bias_event(struct 
> > snd_soc_dapm_widget *w,
> >  		snd_soc_update_bits(w->codec, SGTL5000_CHIP_MIC_CTRL,
> >  				SGTL5000_BIAS_R_MASK,
> >  				SGTL5000_BIAS_R_4k << SGTL5000_BIAS_R_SHIFT);
> > +
> > +		snd_soc_update_bits(w->codec, SGTL5000_CHIP_ANA_POWER,
> > +				SGTL5000_VAG_POWERUP, SGTL5000_VAG_POWERUP);
> Did you test line-in record?
> IIRC for line-in record, it may also need VAG_POWER up.
> Then only enable VAG_POWER for mic_bias_event may not be sufficient.
> Will verify it latter when I'm free.
> 
Yes, if mic bias needs VAG powerup, LINE-IN capture has the same issue.
But I remember Line-out test passed in mx28, it there any defect I ignored?

Thanks.
Zeng Zhaoming

> Regards
> Dong Aisheng
> 
> >  		break;
> > 
> >  	case SND_SOC_DAPM_PRE_PMD:
> >  		snd_soc_update_bits(w->codec, SGTL5000_CHIP_MIC_CTRL,
> > -				SGTL5000_BIAS_R_MASK, 0);
> > +				SGTL5000_BIAS_R_MASK,
> > +				SGTL5000_BIAS_R_off << SGTL5000_BIAS_R_SHIFT);
> > +
> > +		snd_soc_update_bits(w->codec, SGTL5000_CHIP_ANA_POWER,
> > +				SGTL5000_VAG_POWERUP, 0);
> >  		break;
> >  	}
> >  	return 0;
> > @@ -197,7 +204,7 @@ static const struct snd_soc_dapm_widget 
> > sgtl5000_dapm_widgets[] = {
> >  	SND_SOC_DAPM_OUTPUT("HP_OUT"),
> >  	SND_SOC_DAPM_OUTPUT("LINE_OUT"),
> > 
> > -	SND_SOC_DAPM_MICBIAS_E("Mic Bias", SGTL5000_CHIP_MIC_CTRL, 8, 0,
> > +	SND_SOC_DAPM_MICBIAS_E("Mic Bias", SND_SOC_NOPM, 0, 0,
> >  				mic_bias_event,
> >  				SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD),
> > 
> > @@ -229,7 +236,8 @@ static const struct snd_soc_dapm_widget 
> > sgtl5000_dapm_widgets[] = {
> >  /* routes for sgtl5000 */
> >  static const struct snd_soc_dapm_route sgtl5000_dapm_routes[] = {
> >  	{"Capture Mux", "LINE_IN", "LINE_IN"},	/* line_in --> adc_mux */
> > -	{"Capture Mux", "MIC_IN", "MIC_IN"},	/* mic_in --> adc_mux */
> > +	{"Mic Bias", NULL, "MIC_IN"},		/* mic_in --> mic bias */
> > +	{"Capture Mux", "MIC_IN", "Mic Bias"},	/* mic bias --> adc_mux
> > */
> > 
> >  	{"ADC", NULL, "Capture Mux"},		/* adc_mux --> adc */
> >  	{"AIFOUT", NULL, "ADC"},		/* adc --> i2s_out */
> > --
> > 1.7.4.1
> > 
> > 
> > _______________________________________________
> > Alsa-devel mailing list
> > Alsa-devel at alsa-project.org
> > http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH] ASoC: sgtl5000: fix power on/off of MIC bias
  2012-03-28  9:52   ` [alsa-devel] " Dong Aisheng-B29396
@ 2012-03-28 14:18     ` Shawn Guo
  -1 siblings, 0 replies; 18+ messages in thread
From: Shawn Guo @ 2012-03-28 14:18 UTC (permalink / raw)
  To: Dong Aisheng-B29396
  Cc: Zeng, Xu Lionel-R63889, alsa-devel, Mark Brown, Zhaoming,
	linux-arm-kernel

On Wed, Mar 28, 2012 at 09:52:15AM +0000, Dong Aisheng-B29396 wrote:
> Did you test line-in record?

No, I did not.  I'm playing imx51 babbage board which has no LINE-IN
routed.

> IIRC for line-in record, it may also need VAG_POWER up.
> Then only enable VAG_POWER for mic_bias_event may not be sufficient.
> Will verify it latter when I'm free.
> 
This patch only fixes MIC.  I think you can submit another patch after
you confirm LINE-IN has the same issue.

-- 
Regards,
Shawn

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [alsa-devel] [PATCH] ASoC: sgtl5000: fix power on/off of MIC bias
@ 2012-03-28 14:18     ` Shawn Guo
  0 siblings, 0 replies; 18+ messages in thread
From: Shawn Guo @ 2012-03-28 14:18 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Mar 28, 2012 at 09:52:15AM +0000, Dong Aisheng-B29396 wrote:
> Did you test line-in record?

No, I did not.  I'm playing imx51 babbage board which has no LINE-IN
routed.

> IIRC for line-in record, it may also need VAG_POWER up.
> Then only enable VAG_POWER for mic_bias_event may not be sufficient.
> Will verify it latter when I'm free.
> 
This patch only fixes MIC.  I think you can submit another patch after
you confirm LINE-IN has the same issue.

-- 
Regards,
Shawn

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH] ASoC: sgtl5000: fix power on/off of MIC bias
  2012-03-28 14:18     ` [alsa-devel] " Shawn Guo
@ 2012-03-28 14:36       ` Mark Brown
  -1 siblings, 0 replies; 18+ messages in thread
From: Mark Brown @ 2012-03-28 14:36 UTC (permalink / raw)
  To: Shawn Guo
  Cc: Zeng, Xu Lionel-R63889, alsa-devel, Zhaoming,
	Dong Aisheng-B29396, linux-arm-kernel


[-- Attachment #1.1: Type: text/plain, Size: 567 bytes --]

On Wed, Mar 28, 2012 at 10:18:14PM +0800, Shawn Guo wrote:
> On Wed, Mar 28, 2012 at 09:52:15AM +0000, Dong Aisheng-B29396 wrote:

> > IIRC for line-in record, it may also need VAG_POWER up.
> > Then only enable VAG_POWER for mic_bias_event may not be sufficient.
> > Will verify it latter when I'm free.

> This patch only fixes MIC.  I think you can submit another patch after
> you confirm LINE-IN has the same issue.

I think this is a sensible approach, two patches fixing two issues seems
reasonable (and I'd not expect line input to need the mic bias itself).

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 18+ messages in thread

* [alsa-devel] [PATCH] ASoC: sgtl5000: fix power on/off of MIC bias
@ 2012-03-28 14:36       ` Mark Brown
  0 siblings, 0 replies; 18+ messages in thread
From: Mark Brown @ 2012-03-28 14:36 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Mar 28, 2012 at 10:18:14PM +0800, Shawn Guo wrote:
> On Wed, Mar 28, 2012 at 09:52:15AM +0000, Dong Aisheng-B29396 wrote:

> > IIRC for line-in record, it may also need VAG_POWER up.
> > Then only enable VAG_POWER for mic_bias_event may not be sufficient.
> > Will verify it latter when I'm free.

> This patch only fixes MIC.  I think you can submit another patch after
> you confirm LINE-IN has the same issue.

I think this is a sensible approach, two patches fixing two issues seems
reasonable (and I'd not expect line input to need the mic bias itself).
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20120328/2c19f2ec/attachment.sig>

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH] ASoC: sgtl5000: fix power on/off of MIC bias
  2012-03-28  7:30 ` Shawn Guo
@ 2012-03-29  5:56   ` Shawn Guo
  -1 siblings, 0 replies; 18+ messages in thread
From: Shawn Guo @ 2012-03-29  5:56 UTC (permalink / raw)
  To: alsa-devel; +Cc: Lionel Xu, Mark Brown, Zeng Zhaoming, linux-arm-kernel

On Wed, Mar 28, 2012 at 03:30:33PM +0800, Shawn Guo wrote:
> From: Lionel Xu <Lionel.Xu@freescale.com>
> 
> There is no sound in the recorded wav, to enable recording, the VAG
> should be powered up, and the mic bias resistor should be set up with
> proper value.
> 
> Signed-off-by: Lionel Xu <lionel.xu@freescale.com>
> Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
> Cc: Zeng Zhaoming <zengzm.kernel@gmail.com>

Mark, I just send a patch authored by Zeng Zhaoming, which fixes the
problem in a more sensible way.  So please ignore this one.

-- 
Regards,
Shawn

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH] ASoC: sgtl5000: fix power on/off of MIC bias
@ 2012-03-29  5:56   ` Shawn Guo
  0 siblings, 0 replies; 18+ messages in thread
From: Shawn Guo @ 2012-03-29  5:56 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Mar 28, 2012 at 03:30:33PM +0800, Shawn Guo wrote:
> From: Lionel Xu <Lionel.Xu@freescale.com>
> 
> There is no sound in the recorded wav, to enable recording, the VAG
> should be powered up, and the mic bias resistor should be set up with
> proper value.
> 
> Signed-off-by: Lionel Xu <lionel.xu@freescale.com>
> Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
> Cc: Zeng Zhaoming <zengzm.kernel@gmail.com>

Mark, I just send a patch authored by Zeng Zhaoming, which fixes the
problem in a more sensible way.  So please ignore this one.

-- 
Regards,
Shawn

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2012-03-29  5:56 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-28  7:30 [PATCH] ASoC: sgtl5000: fix power on/off of MIC bias Shawn Guo
2012-03-28  7:30 ` Shawn Guo
2012-03-28  9:05 ` Zeng Zhaoming
2012-03-28  9:05   ` Zeng Zhaoming
2012-03-28  9:52 ` Dong Aisheng-B29396
2012-03-28  9:52   ` [alsa-devel] " Dong Aisheng-B29396
2012-03-28 10:11   ` Zeng Zhaoming
2012-03-28 10:11     ` Zeng Zhaoming
2012-03-28 11:17     ` Xu Lionel-R63889
2012-03-28 11:17       ` Xu Lionel-R63889
2012-03-28 14:18   ` Shawn Guo
2012-03-28 14:18     ` [alsa-devel] " Shawn Guo
2012-03-28 14:36     ` Mark Brown
2012-03-28 14:36       ` [alsa-devel] " Mark Brown
2012-03-28  9:58 ` Dong Aisheng
2012-03-28  9:58   ` [alsa-devel] " Dong Aisheng
2012-03-29  5:56 ` Shawn Guo
2012-03-29  5:56   ` Shawn Guo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.