All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nicolas Ferre <nicolas.ferre@atmel.com>
To: Mark Brown <broonie@opensource.wolfsonmicro.com>, lrg@ti.com
Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] ASoC: wm8731: set the ACTIVE bit if bias ON entered
Date: Tue, 05 Jul 2011 09:58:30 +0200	[thread overview]
Message-ID: <4E12C426.8050501@atmel.com> (raw)
In-Reply-To: <20110704172856.GF28726@opensource.wolfsonmicro.com>

Le 04/07/2011 19:29, Mark Brown :
> On Mon, Jul 04, 2011 at 11:46:30AM +0200, Nicolas Ferre wrote:
> 
>> Ah, ok... but I fear that I do not know the whole system enough for this
>> addition ;-(
>> Do you think you can code this modification, I will be happy to test it,
>> if you want...
> 
> It's pretty trivial - try the below (Liam, are you OK with this if it
> tests OK?):
> 
>>From 1dd054eb530641dadbf71525ee517c847f19e161 Mon Sep 17 00:00:00 2001
> From: Mark Brown <broonie@opensource.wolfsonmicro.com>
> Date: Mon, 4 Jul 2011 10:27:51 -0700
> Subject: [PATCH] ASoC: Manage WM8731 ACTIVE bit as a supply widget
> 
> Now we have supply widgets there's no need to open code the handling of
> the ACTIVE bit.
> 
> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
> ---
>  sound/soc/codecs/wm8731.c |   29 +++--------------------------
>  1 files changed, 3 insertions(+), 26 deletions(-)
> 
> diff --git a/sound/soc/codecs/wm8731.c b/sound/soc/codecs/wm8731.c
> index 2dc964b..59d9e59 100644
> --- a/sound/soc/codecs/wm8731.c
> +++ b/sound/soc/codecs/wm8731.c
> @@ -175,6 +175,7 @@ static const struct snd_kcontrol_new wm8731_input_mux_controls =
>  SOC_DAPM_ENUM("Input Select", wm8731_insel_enum);
>  
>  static const struct snd_soc_dapm_widget wm8731_dapm_widgets[] = {
> +SND_SOC_DAPM_SUPPLY("Active",WM8731_ACTIVE, 0, 0, NULL, 0),

------------------------^^^^^^^
I have replaced this with ACTIVE to match the route declaration.

*With this modification* it works, so you can add my:

Tested-by: Nicolas Ferre <nicolas.ferre@atmel.com>


>  SND_SOC_DAPM_SUPPLY("OSC", WM8731_PWR, 5, 1, NULL, 0),
>  SND_SOC_DAPM_MIXER("Output Mixer", WM8731_PWR, 4, 1,
>  	&wm8731_output_mixer_controls[0],
> @@ -204,6 +205,8 @@ static int wm8731_check_osc(struct snd_soc_dapm_widget *source,
>  static const struct snd_soc_dapm_route wm8731_intercon[] = {
>  	{"DAC", NULL, "OSC", wm8731_check_osc},
>  	{"ADC", NULL, "OSC", wm8731_check_osc},
> +	{"DAC", NULL, "ACTIVE"},
> +	{"ADC", NULL, "ACTIVE"},
>  
>  	/* output mixer */
>  	{"Output Mixer", "Line Bypass Switch", "Line Input"},
> @@ -315,29 +318,6 @@ static int wm8731_hw_params(struct snd_pcm_substream *substream,
>  	return 0;
>  }
>  
> -static int wm8731_pcm_prepare(struct snd_pcm_substream *substream,
> -			      struct snd_soc_dai *dai)
> -{
> -	struct snd_soc_codec *codec = dai->codec;
> -
> -	/* set active */
> -	snd_soc_write(codec, WM8731_ACTIVE, 0x0001);
> -
> -	return 0;
> -}
> -
> -static void wm8731_shutdown(struct snd_pcm_substream *substream,
> -			    struct snd_soc_dai *dai)
> -{
> -	struct snd_soc_codec *codec = dai->codec;
> -
> -	/* deactivate */
> -	if (!codec->active) {
> -		udelay(50);
> -		snd_soc_write(codec, WM8731_ACTIVE, 0x0);
> -	}
> -}
> -
>  static int wm8731_mute(struct snd_soc_dai *dai, int mute)
>  {
>  	struct snd_soc_codec *codec = dai->codec;
> @@ -480,7 +460,6 @@ static int wm8731_set_bias_level(struct snd_soc_codec *codec,
>  		snd_soc_write(codec, WM8731_PWR, reg | 0x0040);
>  		break;
>  	case SND_SOC_BIAS_OFF:
> -		snd_soc_write(codec, WM8731_ACTIVE, 0x0);
>  		snd_soc_write(codec, WM8731_PWR, 0xffff);
>  		regulator_bulk_disable(ARRAY_SIZE(wm8731->supplies),
>  				       wm8731->supplies);
> @@ -496,9 +475,7 @@ static int wm8731_set_bias_level(struct snd_soc_codec *codec,
>  	SNDRV_PCM_FMTBIT_S24_LE)
>  
>  static struct snd_soc_dai_ops wm8731_dai_ops = {
> -	.prepare	= wm8731_pcm_prepare,
>  	.hw_params	= wm8731_hw_params,
> -	.shutdown	= wm8731_shutdown,
>  	.digital_mute	= wm8731_mute,
>  	.set_sysclk	= wm8731_set_dai_sysclk,
>  	.set_fmt	= wm8731_set_dai_fmt,


-- 
Nicolas Ferre

WARNING: multiple messages have this Message-ID (diff)
From: nicolas.ferre@atmel.com (Nicolas Ferre)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ASoC: wm8731: set the ACTIVE bit if bias ON entered
Date: Tue, 05 Jul 2011 09:58:30 +0200	[thread overview]
Message-ID: <4E12C426.8050501@atmel.com> (raw)
In-Reply-To: <20110704172856.GF28726@opensource.wolfsonmicro.com>

Le 04/07/2011 19:29, Mark Brown :
> On Mon, Jul 04, 2011 at 11:46:30AM +0200, Nicolas Ferre wrote:
> 
>> Ah, ok... but I fear that I do not know the whole system enough for this
>> addition ;-(
>> Do you think you can code this modification, I will be happy to test it,
>> if you want...
> 
> It's pretty trivial - try the below (Liam, are you OK with this if it
> tests OK?):
> 
>>From 1dd054eb530641dadbf71525ee517c847f19e161 Mon Sep 17 00:00:00 2001
> From: Mark Brown <broonie@opensource.wolfsonmicro.com>
> Date: Mon, 4 Jul 2011 10:27:51 -0700
> Subject: [PATCH] ASoC: Manage WM8731 ACTIVE bit as a supply widget
> 
> Now we have supply widgets there's no need to open code the handling of
> the ACTIVE bit.
> 
> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
> ---
>  sound/soc/codecs/wm8731.c |   29 +++--------------------------
>  1 files changed, 3 insertions(+), 26 deletions(-)
> 
> diff --git a/sound/soc/codecs/wm8731.c b/sound/soc/codecs/wm8731.c
> index 2dc964b..59d9e59 100644
> --- a/sound/soc/codecs/wm8731.c
> +++ b/sound/soc/codecs/wm8731.c
> @@ -175,6 +175,7 @@ static const struct snd_kcontrol_new wm8731_input_mux_controls =
>  SOC_DAPM_ENUM("Input Select", wm8731_insel_enum);
>  
>  static const struct snd_soc_dapm_widget wm8731_dapm_widgets[] = {
> +SND_SOC_DAPM_SUPPLY("Active",WM8731_ACTIVE, 0, 0, NULL, 0),

------------------------^^^^^^^
I have replaced this with ACTIVE to match the route declaration.

*With this modification* it works, so you can add my:

Tested-by: Nicolas Ferre <nicolas.ferre@atmel.com>


>  SND_SOC_DAPM_SUPPLY("OSC", WM8731_PWR, 5, 1, NULL, 0),
>  SND_SOC_DAPM_MIXER("Output Mixer", WM8731_PWR, 4, 1,
>  	&wm8731_output_mixer_controls[0],
> @@ -204,6 +205,8 @@ static int wm8731_check_osc(struct snd_soc_dapm_widget *source,
>  static const struct snd_soc_dapm_route wm8731_intercon[] = {
>  	{"DAC", NULL, "OSC", wm8731_check_osc},
>  	{"ADC", NULL, "OSC", wm8731_check_osc},
> +	{"DAC", NULL, "ACTIVE"},
> +	{"ADC", NULL, "ACTIVE"},
>  
>  	/* output mixer */
>  	{"Output Mixer", "Line Bypass Switch", "Line Input"},
> @@ -315,29 +318,6 @@ static int wm8731_hw_params(struct snd_pcm_substream *substream,
>  	return 0;
>  }
>  
> -static int wm8731_pcm_prepare(struct snd_pcm_substream *substream,
> -			      struct snd_soc_dai *dai)
> -{
> -	struct snd_soc_codec *codec = dai->codec;
> -
> -	/* set active */
> -	snd_soc_write(codec, WM8731_ACTIVE, 0x0001);
> -
> -	return 0;
> -}
> -
> -static void wm8731_shutdown(struct snd_pcm_substream *substream,
> -			    struct snd_soc_dai *dai)
> -{
> -	struct snd_soc_codec *codec = dai->codec;
> -
> -	/* deactivate */
> -	if (!codec->active) {
> -		udelay(50);
> -		snd_soc_write(codec, WM8731_ACTIVE, 0x0);
> -	}
> -}
> -
>  static int wm8731_mute(struct snd_soc_dai *dai, int mute)
>  {
>  	struct snd_soc_codec *codec = dai->codec;
> @@ -480,7 +460,6 @@ static int wm8731_set_bias_level(struct snd_soc_codec *codec,
>  		snd_soc_write(codec, WM8731_PWR, reg | 0x0040);
>  		break;
>  	case SND_SOC_BIAS_OFF:
> -		snd_soc_write(codec, WM8731_ACTIVE, 0x0);
>  		snd_soc_write(codec, WM8731_PWR, 0xffff);
>  		regulator_bulk_disable(ARRAY_SIZE(wm8731->supplies),
>  				       wm8731->supplies);
> @@ -496,9 +475,7 @@ static int wm8731_set_bias_level(struct snd_soc_codec *codec,
>  	SNDRV_PCM_FMTBIT_S24_LE)
>  
>  static struct snd_soc_dai_ops wm8731_dai_ops = {
> -	.prepare	= wm8731_pcm_prepare,
>  	.hw_params	= wm8731_hw_params,
> -	.shutdown	= wm8731_shutdown,
>  	.digital_mute	= wm8731_mute,
>  	.set_sysclk	= wm8731_set_dai_sysclk,
>  	.set_fmt	= wm8731_set_dai_fmt,


-- 
Nicolas Ferre

WARNING: multiple messages have this Message-ID (diff)
From: Nicolas Ferre <nicolas.ferre@atmel.com>
To: Mark Brown <broonie@opensource.wolfsonmicro.com>, lrg@ti.com
Cc: alsa-devel@alsa-project.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ASoC: wm8731: set the ACTIVE bit if bias ON entered
Date: Tue, 05 Jul 2011 09:58:30 +0200	[thread overview]
Message-ID: <4E12C426.8050501@atmel.com> (raw)
In-Reply-To: <20110704172856.GF28726@opensource.wolfsonmicro.com>

Le 04/07/2011 19:29, Mark Brown :
> On Mon, Jul 04, 2011 at 11:46:30AM +0200, Nicolas Ferre wrote:
> 
>> Ah, ok... but I fear that I do not know the whole system enough for this
>> addition ;-(
>> Do you think you can code this modification, I will be happy to test it,
>> if you want...
> 
> It's pretty trivial - try the below (Liam, are you OK with this if it
> tests OK?):
> 
>>From 1dd054eb530641dadbf71525ee517c847f19e161 Mon Sep 17 00:00:00 2001
> From: Mark Brown <broonie@opensource.wolfsonmicro.com>
> Date: Mon, 4 Jul 2011 10:27:51 -0700
> Subject: [PATCH] ASoC: Manage WM8731 ACTIVE bit as a supply widget
> 
> Now we have supply widgets there's no need to open code the handling of
> the ACTIVE bit.
> 
> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
> ---
>  sound/soc/codecs/wm8731.c |   29 +++--------------------------
>  1 files changed, 3 insertions(+), 26 deletions(-)
> 
> diff --git a/sound/soc/codecs/wm8731.c b/sound/soc/codecs/wm8731.c
> index 2dc964b..59d9e59 100644
> --- a/sound/soc/codecs/wm8731.c
> +++ b/sound/soc/codecs/wm8731.c
> @@ -175,6 +175,7 @@ static const struct snd_kcontrol_new wm8731_input_mux_controls =
>  SOC_DAPM_ENUM("Input Select", wm8731_insel_enum);
>  
>  static const struct snd_soc_dapm_widget wm8731_dapm_widgets[] = {
> +SND_SOC_DAPM_SUPPLY("Active",WM8731_ACTIVE, 0, 0, NULL, 0),

------------------------^^^^^^^
I have replaced this with ACTIVE to match the route declaration.

*With this modification* it works, so you can add my:

Tested-by: Nicolas Ferre <nicolas.ferre@atmel.com>


>  SND_SOC_DAPM_SUPPLY("OSC", WM8731_PWR, 5, 1, NULL, 0),
>  SND_SOC_DAPM_MIXER("Output Mixer", WM8731_PWR, 4, 1,
>  	&wm8731_output_mixer_controls[0],
> @@ -204,6 +205,8 @@ static int wm8731_check_osc(struct snd_soc_dapm_widget *source,
>  static const struct snd_soc_dapm_route wm8731_intercon[] = {
>  	{"DAC", NULL, "OSC", wm8731_check_osc},
>  	{"ADC", NULL, "OSC", wm8731_check_osc},
> +	{"DAC", NULL, "ACTIVE"},
> +	{"ADC", NULL, "ACTIVE"},
>  
>  	/* output mixer */
>  	{"Output Mixer", "Line Bypass Switch", "Line Input"},
> @@ -315,29 +318,6 @@ static int wm8731_hw_params(struct snd_pcm_substream *substream,
>  	return 0;
>  }
>  
> -static int wm8731_pcm_prepare(struct snd_pcm_substream *substream,
> -			      struct snd_soc_dai *dai)
> -{
> -	struct snd_soc_codec *codec = dai->codec;
> -
> -	/* set active */
> -	snd_soc_write(codec, WM8731_ACTIVE, 0x0001);
> -
> -	return 0;
> -}
> -
> -static void wm8731_shutdown(struct snd_pcm_substream *substream,
> -			    struct snd_soc_dai *dai)
> -{
> -	struct snd_soc_codec *codec = dai->codec;
> -
> -	/* deactivate */
> -	if (!codec->active) {
> -		udelay(50);
> -		snd_soc_write(codec, WM8731_ACTIVE, 0x0);
> -	}
> -}
> -
>  static int wm8731_mute(struct snd_soc_dai *dai, int mute)
>  {
>  	struct snd_soc_codec *codec = dai->codec;
> @@ -480,7 +460,6 @@ static int wm8731_set_bias_level(struct snd_soc_codec *codec,
>  		snd_soc_write(codec, WM8731_PWR, reg | 0x0040);
>  		break;
>  	case SND_SOC_BIAS_OFF:
> -		snd_soc_write(codec, WM8731_ACTIVE, 0x0);
>  		snd_soc_write(codec, WM8731_PWR, 0xffff);
>  		regulator_bulk_disable(ARRAY_SIZE(wm8731->supplies),
>  				       wm8731->supplies);
> @@ -496,9 +475,7 @@ static int wm8731_set_bias_level(struct snd_soc_codec *codec,
>  	SNDRV_PCM_FMTBIT_S24_LE)
>  
>  static struct snd_soc_dai_ops wm8731_dai_ops = {
> -	.prepare	= wm8731_pcm_prepare,
>  	.hw_params	= wm8731_hw_params,
> -	.shutdown	= wm8731_shutdown,
>  	.digital_mute	= wm8731_mute,
>  	.set_sysclk	= wm8731_set_dai_sysclk,
>  	.set_fmt	= wm8731_set_dai_fmt,


-- 
Nicolas Ferre


  parent reply	other threads:[~2011-07-05  7:59 UTC|newest]

Thread overview: 62+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-29 18:00 use dmaengine for atmel ssc/pcm dai drivers Nicolas Ferre
2011-06-29 18:00 ` Nicolas Ferre
2011-06-29 18:00 ` Nicolas Ferre
2011-06-29 18:00 ` [PATCH 1/5] ASoC: wm8731: rework power management Nicolas Ferre
2011-06-29 18:00   ` Nicolas Ferre
2011-06-29 18:00   ` Nicolas Ferre
2011-06-29 17:11   ` Mark Brown
2011-06-29 17:11     ` Mark Brown
2011-06-29 17:11     ` Mark Brown
2011-06-30 13:57     ` Nicolas Ferre
2011-06-30 13:57       ` Nicolas Ferre
2011-06-30 13:57       ` Nicolas Ferre
2011-06-30 15:04       ` [alsa-devel] " Nicolas Ferre
2011-06-30 15:04         ` Nicolas Ferre
2011-06-30 15:04         ` Nicolas Ferre
2011-06-30 15:22       ` Mark Brown
2011-06-30 15:22         ` Mark Brown
2011-06-30 15:22         ` Mark Brown
2011-07-01  9:31         ` Nicolas Ferre
2011-07-01  9:31           ` Nicolas Ferre
2011-07-01  9:31           ` Nicolas Ferre
2011-06-29 18:00   ` [PATCH 2/5] ASoC: atmel-ssc: add phybase in device structure Nicolas Ferre
2011-06-29 18:00     ` Nicolas Ferre
2011-06-29 17:48     ` Mark Brown
2011-06-29 17:48       ` Mark Brown
2011-07-01 14:46       ` [PATCH V2 " Nicolas Ferre
2011-07-01 14:46         ` Nicolas Ferre
2011-07-01 14:46         ` Nicolas Ferre
2011-06-29 18:00   ` [PATCH 3/5] ASoC: atmel-ssc: dmaengine usage switch depending on cpu Nicolas Ferre
2011-06-29 18:00     ` Nicolas Ferre
2011-06-29 18:00   ` [PATCH 4/5] ASoC: atmel_ssc_dai/atmel-pcm: adapt to dmaengine usage Nicolas Ferre
2011-06-29 18:00     ` Nicolas Ferre
2011-06-29 17:59     ` Mark Brown
2011-06-29 17:59       ` Mark Brown
2011-06-29 17:59       ` Mark Brown
2011-06-30  0:54     ` Koul, Vinod
2011-06-30  0:54       ` Koul, Vinod
2011-06-30  0:54       ` Koul, Vinod
2011-06-29 18:00   ` [PATCH 5/5] ASoC: atmel_ssc_dai: PM: actually stopping clock on suspend/resume Nicolas Ferre
2011-06-29 18:00     ` Nicolas Ferre
2011-07-01 10:43   ` [PATCH] ASoC: wm8731: set the ACTIVE bit if bias ON entered Nicolas Ferre
2011-07-01 10:43     ` Nicolas Ferre
2011-07-01 10:43     ` Nicolas Ferre
2011-07-01 14:18     ` Liam Girdwood
2011-07-01 14:18       ` Liam Girdwood
2011-07-01 14:18       ` Liam Girdwood
2011-07-01 16:15     ` Mark Brown
2011-07-01 16:15       ` Mark Brown
2011-07-04  9:46       ` Nicolas Ferre
2011-07-04  9:46         ` Nicolas Ferre
2011-07-04  9:46         ` Nicolas Ferre
2011-07-04 17:29         ` Mark Brown
2011-07-04 17:29           ` Mark Brown
2011-07-04 17:29           ` Mark Brown
2011-07-04 17:34           ` Liam Girdwood
2011-07-04 17:34             ` Liam Girdwood
2011-07-04 17:34             ` Liam Girdwood
2011-07-05  7:58           ` Nicolas Ferre [this message]
2011-07-05  7:58             ` Nicolas Ferre
2011-07-05  7:58             ` Nicolas Ferre
2011-07-05 20:27             ` [alsa-devel] " Mark Brown
2011-07-05 20:27               ` Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4E12C426.8050501@atmel.com \
    --to=nicolas.ferre@atmel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lrg@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.