All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: sgtl5000: Fix wrong mask in some snd_soc_update_bits calls
@ 2011-10-21  1:54 ` Axel Lin
  0 siblings, 0 replies; 8+ messages in thread
From: Axel Lin @ 2011-10-21  1:54 UTC (permalink / raw)
  To: linux-kernel
  Cc: Dong Aisheng, Wolfram Sang, Liam Girdwood, Mark Brown, alsa-devel

Ensure all mask bits are clear before setting new value.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
I don't have this hardware, I'd appreciate if someone can test this patch.

Thanks,
Axel
 sound/soc/codecs/sgtl5000.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/sound/soc/codecs/sgtl5000.c b/sound/soc/codecs/sgtl5000.c
index 32b5bbd..d15695d 100644
--- a/sound/soc/codecs/sgtl5000.c
+++ b/sound/soc/codecs/sgtl5000.c
@@ -723,7 +723,9 @@ static int sgtl5000_pcm_hw_params(struct snd_pcm_substream *substream,
 		return -EINVAL;
 	}
 
-	snd_soc_update_bits(codec, SGTL5000_CHIP_I2S_CTRL, i2s_ctl, i2s_ctl);
+	snd_soc_update_bits(codec, SGTL5000_CHIP_I2S_CTRL,
+			    SGTL5000_I2S_DLEN_MASK | SGTL5000_I2S_SCLKFREQ_MASK,
+			    i2s_ctl);
 
 	return 0;
 }
@@ -1146,8 +1148,7 @@ static int sgtl5000_set_power_regs(struct snd_soc_codec *codec)
 		vag = (vag - SGTL5000_ANA_GND_BASE) / SGTL5000_ANA_GND_STP;
 
 	snd_soc_update_bits(codec, SGTL5000_CHIP_REF_CTRL,
-			vag << SGTL5000_ANA_GND_SHIFT,
-			vag << SGTL5000_ANA_GND_SHIFT);
+			SGTL5000_ANA_GND_MASK, vag << SGTL5000_ANA_GND_SHIFT);
 
 	/* set line out VAG to vddio / 2, in range (0.8v, 1.675v) */
 	vag = vddio / 2;
@@ -1161,9 +1162,8 @@ static int sgtl5000_set_power_regs(struct snd_soc_codec *codec)
 		    SGTL5000_LINE_OUT_GND_STP;
 
 	snd_soc_update_bits(codec, SGTL5000_CHIP_LINE_OUT_CTRL,
-			vag << SGTL5000_LINE_OUT_GND_SHIFT |
-			SGTL5000_LINE_OUT_CURRENT_360u <<
-				SGTL5000_LINE_OUT_CURRENT_SHIFT,
+			SGTL5000_LINE_OUT_CURRENT_MASK |
+			SGTL5000_LINE_OUT_GND_MASK,
 			vag << SGTL5000_LINE_OUT_GND_SHIFT |
 			SGTL5000_LINE_OUT_CURRENT_360u <<
 				SGTL5000_LINE_OUT_CURRENT_SHIFT);
-- 
1.7.5.4




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

* [PATCH] ASoC: sgtl5000: Fix wrong mask in some snd_soc_update_bits calls
@ 2011-10-21  1:54 ` Axel Lin
  0 siblings, 0 replies; 8+ messages in thread
From: Axel Lin @ 2011-10-21  1:54 UTC (permalink / raw)
  To: linux-kernel
  Cc: alsa-devel, Mark Brown, Dong Aisheng, Wolfram Sang, Liam Girdwood

Ensure all mask bits are clear before setting new value.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
I don't have this hardware, I'd appreciate if someone can test this patch.

Thanks,
Axel
 sound/soc/codecs/sgtl5000.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/sound/soc/codecs/sgtl5000.c b/sound/soc/codecs/sgtl5000.c
index 32b5bbd..d15695d 100644
--- a/sound/soc/codecs/sgtl5000.c
+++ b/sound/soc/codecs/sgtl5000.c
@@ -723,7 +723,9 @@ static int sgtl5000_pcm_hw_params(struct snd_pcm_substream *substream,
 		return -EINVAL;
 	}
 
-	snd_soc_update_bits(codec, SGTL5000_CHIP_I2S_CTRL, i2s_ctl, i2s_ctl);
+	snd_soc_update_bits(codec, SGTL5000_CHIP_I2S_CTRL,
+			    SGTL5000_I2S_DLEN_MASK | SGTL5000_I2S_SCLKFREQ_MASK,
+			    i2s_ctl);
 
 	return 0;
 }
@@ -1146,8 +1148,7 @@ static int sgtl5000_set_power_regs(struct snd_soc_codec *codec)
 		vag = (vag - SGTL5000_ANA_GND_BASE) / SGTL5000_ANA_GND_STP;
 
 	snd_soc_update_bits(codec, SGTL5000_CHIP_REF_CTRL,
-			vag << SGTL5000_ANA_GND_SHIFT,
-			vag << SGTL5000_ANA_GND_SHIFT);
+			SGTL5000_ANA_GND_MASK, vag << SGTL5000_ANA_GND_SHIFT);
 
 	/* set line out VAG to vddio / 2, in range (0.8v, 1.675v) */
 	vag = vddio / 2;
@@ -1161,9 +1162,8 @@ static int sgtl5000_set_power_regs(struct snd_soc_codec *codec)
 		    SGTL5000_LINE_OUT_GND_STP;
 
 	snd_soc_update_bits(codec, SGTL5000_CHIP_LINE_OUT_CTRL,
-			vag << SGTL5000_LINE_OUT_GND_SHIFT |
-			SGTL5000_LINE_OUT_CURRENT_360u <<
-				SGTL5000_LINE_OUT_CURRENT_SHIFT,
+			SGTL5000_LINE_OUT_CURRENT_MASK |
+			SGTL5000_LINE_OUT_GND_MASK,
 			vag << SGTL5000_LINE_OUT_GND_SHIFT |
 			SGTL5000_LINE_OUT_CURRENT_360u <<
 				SGTL5000_LINE_OUT_CURRENT_SHIFT);
-- 
1.7.5.4

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

* RE: [PATCH] ASoC: sgtl5000: Fix wrong mask in some snd_soc_update_bits calls
  2011-10-21  1:54 ` Axel Lin
@ 2011-10-21  7:36   ` Dong Aisheng-B29396
  -1 siblings, 0 replies; 8+ messages in thread
From: Dong Aisheng-B29396 @ 2011-10-21  7:36 UTC (permalink / raw)
  To: Axel Lin, linux-kernel
  Cc: Wolfram Sang, Liam Girdwood, Mark Brown, alsa-devel

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 2718 bytes --]

> -----Original Message-----
> From: linux-kernel-owner@vger.kernel.org [mailto:linux-kernel-
> owner@vger.kernel.org] On Behalf Of Axel Lin
> Sent: Friday, October 21, 2011 9:55 AM
> To: linux-kernel@vger.kernel.org
> Cc: Dong Aisheng-B29396; Wolfram Sang; Liam Girdwood; Mark Brown; alsa-
> devel@alsa-project.org
> Subject: [PATCH] ASoC: sgtl5000: Fix wrong mask in some
> snd_soc_update_bits calls
> 
> Ensure all mask bits are clear before setting new value.
> 
> Signed-off-by: Axel Lin <axel.lin@gmail.com>
> ---
> I don't have this hardware, I'd appreciate if someone can test this patch.
> 
> Thanks,
> Axel
>  sound/soc/codecs/sgtl5000.c |   12 ++++++------
>  1 files changed, 6 insertions(+), 6 deletions(-)

It runs ok at my side.
Acked-by: Dong Aisheng <b29396@freescale.com>

> diff --git a/sound/soc/codecs/sgtl5000.c b/sound/soc/codecs/sgtl5000.c
> index 32b5bbd..d15695d 100644
> --- a/sound/soc/codecs/sgtl5000.c
> +++ b/sound/soc/codecs/sgtl5000.c
> @@ -723,7 +723,9 @@ static int sgtl5000_pcm_hw_params(struct
> snd_pcm_substream *substream,
>  		return -EINVAL;
>  	}
> 
> -	snd_soc_update_bits(codec, SGTL5000_CHIP_I2S_CTRL, i2s_ctl,
> i2s_ctl);
> +	snd_soc_update_bits(codec, SGTL5000_CHIP_I2S_CTRL,
> +			    SGTL5000_I2S_DLEN_MASK | SGTL5000_I2S_SCLKFREQ_MASK,
> +			    i2s_ctl);
> 
>  	return 0;
>  }
> @@ -1146,8 +1148,7 @@ static int sgtl5000_set_power_regs(struct
> snd_soc_codec *codec)
>  		vag = (vag - SGTL5000_ANA_GND_BASE) / SGTL5000_ANA_GND_STP;
> 
>  	snd_soc_update_bits(codec, SGTL5000_CHIP_REF_CTRL,
> -			vag << SGTL5000_ANA_GND_SHIFT,
> -			vag << SGTL5000_ANA_GND_SHIFT);
> +			SGTL5000_ANA_GND_MASK, vag << SGTL5000_ANA_GND_SHIFT);
> 
>  	/* set line out VAG to vddio / 2, in range (0.8v, 1.675v) */
>  	vag = vddio / 2;
> @@ -1161,9 +1162,8 @@ static int sgtl5000_set_power_regs(struct
> snd_soc_codec *codec)
>  		    SGTL5000_LINE_OUT_GND_STP;
> 
>  	snd_soc_update_bits(codec, SGTL5000_CHIP_LINE_OUT_CTRL,
> -			vag << SGTL5000_LINE_OUT_GND_SHIFT |
> -			SGTL5000_LINE_OUT_CURRENT_360u <<
> -				SGTL5000_LINE_OUT_CURRENT_SHIFT,
> +			SGTL5000_LINE_OUT_CURRENT_MASK |
> +			SGTL5000_LINE_OUT_GND_MASK,
>  			vag << SGTL5000_LINE_OUT_GND_SHIFT |
>  			SGTL5000_LINE_OUT_CURRENT_360u <<
>  				SGTL5000_LINE_OUT_CURRENT_SHIFT);
> --
> 1.7.5.4
> 
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel"
> in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

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

* Re: [PATCH] ASoC: sgtl5000: Fix wrong mask in some snd_soc_update_bits calls
@ 2011-10-21  7:36   ` Dong Aisheng-B29396
  0 siblings, 0 replies; 8+ messages in thread
From: Dong Aisheng-B29396 @ 2011-10-21  7:36 UTC (permalink / raw)
  To: Axel Lin, linux-kernel
  Cc: alsa-devel, Mark, Brown, Wolfram Sang, Liam Girdwood

> -----Original Message-----
> From: linux-kernel-owner@vger.kernel.org [mailto:linux-kernel-
> owner@vger.kernel.org] On Behalf Of Axel Lin
> Sent: Friday, October 21, 2011 9:55 AM
> To: linux-kernel@vger.kernel.org
> Cc: Dong Aisheng-B29396; Wolfram Sang; Liam Girdwood; Mark Brown; alsa-
> devel@alsa-project.org
> Subject: [PATCH] ASoC: sgtl5000: Fix wrong mask in some
> snd_soc_update_bits calls
> 
> Ensure all mask bits are clear before setting new value.
> 
> Signed-off-by: Axel Lin <axel.lin@gmail.com>
> ---
> I don't have this hardware, I'd appreciate if someone can test this patch.
> 
> Thanks,
> Axel
>  sound/soc/codecs/sgtl5000.c |   12 ++++++------
>  1 files changed, 6 insertions(+), 6 deletions(-)

It runs ok at my side.
Acked-by: Dong Aisheng <b29396@freescale.com>

> diff --git a/sound/soc/codecs/sgtl5000.c b/sound/soc/codecs/sgtl5000.c
> index 32b5bbd..d15695d 100644
> --- a/sound/soc/codecs/sgtl5000.c
> +++ b/sound/soc/codecs/sgtl5000.c
> @@ -723,7 +723,9 @@ static int sgtl5000_pcm_hw_params(struct
> snd_pcm_substream *substream,
>  		return -EINVAL;
>  	}
> 
> -	snd_soc_update_bits(codec, SGTL5000_CHIP_I2S_CTRL, i2s_ctl,
> i2s_ctl);
> +	snd_soc_update_bits(codec, SGTL5000_CHIP_I2S_CTRL,
> +			    SGTL5000_I2S_DLEN_MASK | SGTL5000_I2S_SCLKFREQ_MASK,
> +			    i2s_ctl);
> 
>  	return 0;
>  }
> @@ -1146,8 +1148,7 @@ static int sgtl5000_set_power_regs(struct
> snd_soc_codec *codec)
>  		vag = (vag - SGTL5000_ANA_GND_BASE) / SGTL5000_ANA_GND_STP;
> 
>  	snd_soc_update_bits(codec, SGTL5000_CHIP_REF_CTRL,
> -			vag << SGTL5000_ANA_GND_SHIFT,
> -			vag << SGTL5000_ANA_GND_SHIFT);
> +			SGTL5000_ANA_GND_MASK, vag << SGTL5000_ANA_GND_SHIFT);
> 
>  	/* set line out VAG to vddio / 2, in range (0.8v, 1.675v) */
>  	vag = vddio / 2;
> @@ -1161,9 +1162,8 @@ static int sgtl5000_set_power_regs(struct
> snd_soc_codec *codec)
>  		    SGTL5000_LINE_OUT_GND_STP;
> 
>  	snd_soc_update_bits(codec, SGTL5000_CHIP_LINE_OUT_CTRL,
> -			vag << SGTL5000_LINE_OUT_GND_SHIFT |
> -			SGTL5000_LINE_OUT_CURRENT_360u <<
> -				SGTL5000_LINE_OUT_CURRENT_SHIFT,
> +			SGTL5000_LINE_OUT_CURRENT_MASK |
> +			SGTL5000_LINE_OUT_GND_MASK,
>  			vag << SGTL5000_LINE_OUT_GND_SHIFT |
>  			SGTL5000_LINE_OUT_CURRENT_360u <<
>  				SGTL5000_LINE_OUT_CURRENT_SHIFT);
> --
> 1.7.5.4
> 
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel"
> in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

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

* Re: [PATCH] ASoC: sgtl5000: Fix wrong mask in some snd_soc_update_bits calls
  2011-10-21  7:36   ` Dong Aisheng-B29396
@ 2011-10-21 16:52     ` Girdwood, Liam
  -1 siblings, 0 replies; 8+ messages in thread
From: Girdwood, Liam @ 2011-10-21 16:52 UTC (permalink / raw)
  To: Dong Aisheng-B29396
  Cc: Axel Lin, linux-kernel, Wolfram Sang, Mark Brown, alsa-devel

On 21 October 2011 08:36, Dong Aisheng-B29396 <B29396@freescale.com> wrote:
>> -----Original Message-----
>> From: linux-kernel-owner@vger.kernel.org [mailto:linux-kernel-
>> owner@vger.kernel.org] On Behalf Of Axel Lin
>> Sent: Friday, October 21, 2011 9:55 AM
>> To: linux-kernel@vger.kernel.org
>> Cc: Dong Aisheng-B29396; Wolfram Sang; Liam Girdwood; Mark Brown; alsa-
>> devel@alsa-project.org
>> Subject: [PATCH] ASoC: sgtl5000: Fix wrong mask in some
>> snd_soc_update_bits calls
>>
>> Ensure all mask bits are clear before setting new value.
>>
>> Signed-off-by: Axel Lin <axel.lin@gmail.com>
>> ---
>> I don't have this hardware, I'd appreciate if someone can test this patch.
>>
>> Thanks,
>> Axel
>>  sound/soc/codecs/sgtl5000.c |   12 ++++++------
>>  1 files changed, 6 insertions(+), 6 deletions(-)
>
> It runs ok at my side.
> Acked-by: Dong Aisheng <b29396@freescale.com>
>

Acked-by: Liam Girdwood <lrg@ti.com>

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

* Re: [PATCH] ASoC: sgtl5000: Fix wrong mask in some snd_soc_update_bits calls
@ 2011-10-21 16:52     ` Girdwood, Liam
  0 siblings, 0 replies; 8+ messages in thread
From: Girdwood, Liam @ 2011-10-21 16:52 UTC (permalink / raw)
  To: Dong Aisheng-B29396
  Cc: Axel Lin, Mark Brown, linux-kernel, alsa-devel, Wolfram Sang

On 21 October 2011 08:36, Dong Aisheng-B29396 <B29396@freescale.com> wrote:
>> -----Original Message-----
>> From: linux-kernel-owner@vger.kernel.org [mailto:linux-kernel-
>> owner@vger.kernel.org] On Behalf Of Axel Lin
>> Sent: Friday, October 21, 2011 9:55 AM
>> To: linux-kernel@vger.kernel.org
>> Cc: Dong Aisheng-B29396; Wolfram Sang; Liam Girdwood; Mark Brown; alsa-
>> devel@alsa-project.org
>> Subject: [PATCH] ASoC: sgtl5000: Fix wrong mask in some
>> snd_soc_update_bits calls
>>
>> Ensure all mask bits are clear before setting new value.
>>
>> Signed-off-by: Axel Lin <axel.lin@gmail.com>
>> ---
>> I don't have this hardware, I'd appreciate if someone can test this patch.
>>
>> Thanks,
>> Axel
>>  sound/soc/codecs/sgtl5000.c |   12 ++++++------
>>  1 files changed, 6 insertions(+), 6 deletions(-)
>
> It runs ok at my side.
> Acked-by: Dong Aisheng <b29396@freescale.com>
>

Acked-by: Liam Girdwood <lrg@ti.com>
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

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

* Re: [PATCH] ASoC: sgtl5000: Fix wrong mask in some snd_soc_update_bits calls
  2011-10-21  1:54 ` Axel Lin
@ 2011-10-22  9:36   ` Mark Brown
  -1 siblings, 0 replies; 8+ messages in thread
From: Mark Brown @ 2011-10-22  9:36 UTC (permalink / raw)
  To: Axel Lin
  Cc: linux-kernel, Dong Aisheng, Wolfram Sang, Liam Girdwood, alsa-devel

On Fri, Oct 21, 2011 at 09:54:43AM +0800, Axel Lin wrote:
> Ensure all mask bits are clear before setting new value.

Applied, thanks.

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

* Re: [PATCH] ASoC: sgtl5000: Fix wrong mask in some snd_soc_update_bits calls
@ 2011-10-22  9:36   ` Mark Brown
  0 siblings, 0 replies; 8+ messages in thread
From: Mark Brown @ 2011-10-22  9:36 UTC (permalink / raw)
  To: Axel Lin
  Cc: alsa-devel, Liam Girdwood, Dong Aisheng, linux-kernel, Wolfram Sang

On Fri, Oct 21, 2011 at 09:54:43AM +0800, Axel Lin wrote:
> Ensure all mask bits are clear before setting new value.

Applied, thanks.

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

end of thread, other threads:[~2011-10-22  9:36 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-21  1:54 [PATCH] ASoC: sgtl5000: Fix wrong mask in some snd_soc_update_bits calls Axel Lin
2011-10-21  1:54 ` Axel Lin
2011-10-21  7:36 ` Dong Aisheng-B29396
2011-10-21  7:36   ` Dong Aisheng-B29396
2011-10-21 16:52   ` Girdwood, Liam
2011-10-21 16:52     ` Girdwood, Liam
2011-10-22  9:36 ` Mark Brown
2011-10-22  9:36   ` Mark Brown

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.