linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] ASoC: wm8711: Fix wrong mask for setting input audio data bit length select
@ 2011-10-28  3:08 Axel Lin
  2011-10-28  3:12 ` [PATCH 2/2] ASoC: wm8711: Add proper mask for wm8711_set_dai_fmt Axel Lin
  2011-10-28  7:17 ` [PATCH 2/2] ASoC: Leave input audio data bit length settings untouched in wm8711_set_dai_fmt Axel Lin
  0 siblings, 2 replies; 5+ messages in thread
From: Axel Lin @ 2011-10-28  3:08 UTC (permalink / raw)
  To: linux-kernel; +Cc: Mark Brown, Dimitris Papastamos, Liam Girdwood, alsa-devel

The Input Audio Data Bit Length Select is controlled by BIT[3:2] of
WM8711_IFACE(07h) register.
Current code incorrectly masks BIT[1:0] which is for Audio Data Format Select.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
 sound/soc/codecs/wm8711.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/sound/soc/codecs/wm8711.c b/sound/soc/codecs/wm8711.c
index 8d0347c..8ba49d8 100644
--- a/sound/soc/codecs/wm8711.c
+++ b/sound/soc/codecs/wm8711.c
@@ -151,7 +151,7 @@ static int wm8711_hw_params(struct snd_pcm_substream *substream,
 {
 	struct snd_soc_codec *codec = dai->codec;
 	struct wm8711_priv *wm8711 =  snd_soc_codec_get_drvdata(codec);
-	u16 iface = snd_soc_read(codec, WM8711_IFACE) & 0xfffc;
+	u16 iface = snd_soc_read(codec, WM8711_IFACE) & 0xfff3;
 	int i = get_coeff(wm8711->sysclk, params_rate(params));
 	u16 srate = (coeff_div[i].sr << 2) |
 		(coeff_div[i].bosr << 1) | coeff_div[i].usb;
-- 
1.7.5.4




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

* [PATCH 2/2] ASoC: wm8711: Add proper mask for wm8711_set_dai_fmt
  2011-10-28  3:08 [PATCH 1/2] ASoC: wm8711: Fix wrong mask for setting input audio data bit length select Axel Lin
@ 2011-10-28  3:12 ` Axel Lin
  2011-10-28  7:15   ` Axel Lin
  2011-10-31 12:37   ` Mark Brown
  2011-10-28  7:17 ` [PATCH 2/2] ASoC: Leave input audio data bit length settings untouched in wm8711_set_dai_fmt Axel Lin
  1 sibling, 2 replies; 5+ messages in thread
From: Axel Lin @ 2011-10-28  3:12 UTC (permalink / raw)
  To: linux-kernel; +Cc: Mark Brown, Dimitris Papastamos, Liam Girdwood, alsa-devel

Add mask for BIT[3:2] (the Input Audio Data Bit Length Select)
of WM8711_IFACE(07h) register.
Otherwise, BIT[3:2] will be always set to 0b00 here.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
 sound/soc/codecs/wm8711.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/sound/soc/codecs/wm8711.c b/sound/soc/codecs/wm8711.c
index 8ba49d8..076bdb9 100644
--- a/sound/soc/codecs/wm8711.c
+++ b/sound/soc/codecs/wm8711.c
@@ -232,7 +232,7 @@ static int wm8711_set_dai_fmt(struct snd_soc_dai *codec_dai,
 		unsigned int fmt)
 {
 	struct snd_soc_codec *codec = codec_dai->codec;
-	u16 iface = 0;
+	u16 iface = snd_soc_read(codec, WM8711_IFACE) & 0x000c;
 
 	/* set master/slave audio interface */
 	switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) {
-- 
1.7.5.4




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

* Re: [PATCH 2/2] ASoC: wm8711: Add proper mask for wm8711_set_dai_fmt
  2011-10-28  3:12 ` [PATCH 2/2] ASoC: wm8711: Add proper mask for wm8711_set_dai_fmt Axel Lin
@ 2011-10-28  7:15   ` Axel Lin
  2011-10-31 12:37   ` Mark Brown
  1 sibling, 0 replies; 5+ messages in thread
From: Axel Lin @ 2011-10-28  7:15 UTC (permalink / raw)
  To: linux-kernel; +Cc: Mark Brown, Dimitris Papastamos, Liam Girdwood, alsa-devel

2011/10/28 Axel Lin <axel.lin@gmail.com>:
> Add mask for BIT[3:2] (the Input Audio Data Bit Length Select)
> of WM8711_IFACE(07h) register.
> Otherwise, BIT[3:2] will be always set to 0b00 here.
>
I think the subject line is not good.
I'll resend a patch with below subject line:
ASoC: Leave input audio data bit length settings untouched in wm8711_set_dai_fmt

Regards,
Axel

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

* [PATCH 2/2] ASoC: Leave input audio data bit length settings untouched in wm8711_set_dai_fmt
  2011-10-28  3:08 [PATCH 1/2] ASoC: wm8711: Fix wrong mask for setting input audio data bit length select Axel Lin
  2011-10-28  3:12 ` [PATCH 2/2] ASoC: wm8711: Add proper mask for wm8711_set_dai_fmt Axel Lin
@ 2011-10-28  7:17 ` Axel Lin
  1 sibling, 0 replies; 5+ messages in thread
From: Axel Lin @ 2011-10-28  7:17 UTC (permalink / raw)
  To: linux-kernel; +Cc: Mark Brown, Dimitris Papastamos, Liam Girdwood, alsa-devel

Current implementation in wm8711_set_dai_fmt always clear BIT[3:2]
(the Input Audio Data Bit Length Select) of WM8711_IFACE(07h) register.
Input Audio Data Bit Length Select bits are set by wm8711_hw_params,
we should leave BIT[3:2] untouched in wm8711_set_dai_fmt.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
 sound/soc/codecs/wm8711.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/sound/soc/codecs/wm8711.c b/sound/soc/codecs/wm8711.c
index 8ba49d8..076bdb9 100644
--- a/sound/soc/codecs/wm8711.c
+++ b/sound/soc/codecs/wm8711.c
@@ -232,7 +232,7 @@ static int wm8711_set_dai_fmt(struct snd_soc_dai *codec_dai,
 		unsigned int fmt)
 {
 	struct snd_soc_codec *codec = codec_dai->codec;
-	u16 iface = 0;
+	u16 iface = snd_soc_read(codec, WM8711_IFACE) & 0x000c;
 
 	/* set master/slave audio interface */
 	switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) {
-- 
1.7.5.4




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

* Re: [PATCH 2/2] ASoC: wm8711: Add proper mask for wm8711_set_dai_fmt
  2011-10-28  3:12 ` [PATCH 2/2] ASoC: wm8711: Add proper mask for wm8711_set_dai_fmt Axel Lin
  2011-10-28  7:15   ` Axel Lin
@ 2011-10-31 12:37   ` Mark Brown
  1 sibling, 0 replies; 5+ messages in thread
From: Mark Brown @ 2011-10-31 12:37 UTC (permalink / raw)
  To: Axel Lin; +Cc: linux-kernel, Dimitris Papastamos, Liam Girdwood, alsa-devel

On Fri, Oct 28, 2011 at 11:12:07AM +0800, Axel Lin wrote:
> Add mask for BIT[3:2] (the Input Audio Data Bit Length Select)
> of WM8711_IFACE(07h) register.
> Otherwise, BIT[3:2] will be always set to 0b00 here.

Your changelog here isn't terribly clear and doesn't really correspond
to the change well.  Here you say you're masking something but...

> -	u16 iface = 0;
> +	u16 iface = snd_soc_read(codec, WM8711_IFACE) & 0x000c;

...what you're actually doing is preserving the existing values of some
register bits.  Nevertheless the change looks good so applied.

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

end of thread, other threads:[~2011-10-31 12:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-28  3:08 [PATCH 1/2] ASoC: wm8711: Fix wrong mask for setting input audio data bit length select Axel Lin
2011-10-28  3:12 ` [PATCH 2/2] ASoC: wm8711: Add proper mask for wm8711_set_dai_fmt Axel Lin
2011-10-28  7:15   ` Axel Lin
2011-10-31 12:37   ` Mark Brown
2011-10-28  7:17 ` [PATCH 2/2] ASoC: Leave input audio data bit length settings untouched in wm8711_set_dai_fmt Axel Lin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).