All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] ASoC: wm8741: Fix setting interface format for DSP modes
@ 2011-10-17 12:14 ` Axel Lin
  0 siblings, 0 replies; 6+ messages in thread
From: Axel Lin @ 2011-10-17 12:14 UTC (permalink / raw)
  To: linux-kernel; +Cc: Mark Brown, Dimitris Papastamos, Liam Girdwood, alsa-devel

According to the datasheet:
Format Control (05h)
BITS[3:2]
        FMT[1:0] Audio data format selection
                00 = right justified mode
                01 = left justified mode
                10 = I2S mode
                11 = DSP mode
BIT[4]  LRP Polarity selec for LRCLK/DSP mode select
                0 = normal LRCLK poalrity/DSP mode A
                1 = inverted LRCLK poarity/DSP mode B

For SND_SOC_DAIFMT_DSP_A, we should set 0x000C instead of 0x0003.
For SND_SOC_DAIFMT_DSP_B, we should set 0x001C instead of 0x0013.

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

diff --git a/sound/soc/codecs/wm8741.c b/sound/soc/codecs/wm8741.c
index a42b282..85ebe02 100644
--- a/sound/soc/codecs/wm8741.c
+++ b/sound/soc/codecs/wm8741.c
@@ -339,10 +339,10 @@ static int wm8741_set_dai_fmt(struct snd_soc_dai *codec_dai,
 		iface |= 0x0004;
 		break;
 	case SND_SOC_DAIFMT_DSP_A:
-		iface |= 0x0003;
+		iface |= 0x000C;
 		break;
 	case SND_SOC_DAIFMT_DSP_B:
-		iface |= 0x0013;
+		iface |= 0x001C;
 		break;
 	default:
 		return -EINVAL;
-- 
1.7.5.4




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

* [PATCH 1/2] ASoC: wm8741: Fix setting interface format for DSP modes
@ 2011-10-17 12:14 ` Axel Lin
  0 siblings, 0 replies; 6+ messages in thread
From: Axel Lin @ 2011-10-17 12:14 UTC (permalink / raw)
  To: linux-kernel; +Cc: Dimitris Papastamos, alsa-devel, Mark Brown, Liam Girdwood

According to the datasheet:
Format Control (05h)
BITS[3:2]
        FMT[1:0] Audio data format selection
                00 = right justified mode
                01 = left justified mode
                10 = I2S mode
                11 = DSP mode
BIT[4]  LRP Polarity selec for LRCLK/DSP mode select
                0 = normal LRCLK poalrity/DSP mode A
                1 = inverted LRCLK poarity/DSP mode B

For SND_SOC_DAIFMT_DSP_A, we should set 0x000C instead of 0x0003.
For SND_SOC_DAIFMT_DSP_B, we should set 0x001C instead of 0x0013.

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

diff --git a/sound/soc/codecs/wm8741.c b/sound/soc/codecs/wm8741.c
index a42b282..85ebe02 100644
--- a/sound/soc/codecs/wm8741.c
+++ b/sound/soc/codecs/wm8741.c
@@ -339,10 +339,10 @@ static int wm8741_set_dai_fmt(struct snd_soc_dai *codec_dai,
 		iface |= 0x0004;
 		break;
 	case SND_SOC_DAIFMT_DSP_A:
-		iface |= 0x0003;
+		iface |= 0x000C;
 		break;
 	case SND_SOC_DAIFMT_DSP_B:
-		iface |= 0x0013;
+		iface |= 0x001C;
 		break;
 	default:
 		return -EINVAL;
-- 
1.7.5.4

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

* [PATCH 2/2] ASoC: wm8741: Use snd_soc_cache_sync to sync reg_cache with the hardware
  2011-10-17 12:14 ` Axel Lin
@ 2011-10-17 12:16   ` Axel Lin
  -1 siblings, 0 replies; 6+ messages in thread
From: Axel Lin @ 2011-10-17 12:16 UTC (permalink / raw)
  To: linux-kernel; +Cc: Mark Brown, Dimitris Papastamos, Liam Girdwood, alsa-devel

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

diff --git a/sound/soc/codecs/wm8741.c b/sound/soc/codecs/wm8741.c
index 85ebe02..57ad22a 100644
--- a/sound/soc/codecs/wm8741.c
+++ b/sound/soc/codecs/wm8741.c
@@ -404,15 +404,7 @@ static struct snd_soc_dai_driver wm8741_dai = {
 #ifdef CONFIG_PM
 static int wm8741_resume(struct snd_soc_codec *codec)
 {
-	u16 *cache = codec->reg_cache;
-	int i;
-
-	/* RESTORE REG Cache */
-	for (i = 0; i < WM8741_REGISTER_COUNT; i++) {
-		if (cache[i] == wm8741_reg_defaults[i] || WM8741_RESET == i)
-			continue;
-		snd_soc_write(codec, i, cache[i]);
-	}
+	snd_soc_cache_sync(codec);
 	return 0;
 }
 #else
-- 
1.7.5.4




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

* [PATCH 2/2] ASoC: wm8741: Use snd_soc_cache_sync to sync reg_cache with the hardware
@ 2011-10-17 12:16   ` Axel Lin
  0 siblings, 0 replies; 6+ messages in thread
From: Axel Lin @ 2011-10-17 12:16 UTC (permalink / raw)
  To: linux-kernel; +Cc: Dimitris Papastamos, alsa-devel, Mark Brown, Liam Girdwood

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

diff --git a/sound/soc/codecs/wm8741.c b/sound/soc/codecs/wm8741.c
index 85ebe02..57ad22a 100644
--- a/sound/soc/codecs/wm8741.c
+++ b/sound/soc/codecs/wm8741.c
@@ -404,15 +404,7 @@ static struct snd_soc_dai_driver wm8741_dai = {
 #ifdef CONFIG_PM
 static int wm8741_resume(struct snd_soc_codec *codec)
 {
-	u16 *cache = codec->reg_cache;
-	int i;
-
-	/* RESTORE REG Cache */
-	for (i = 0; i < WM8741_REGISTER_COUNT; i++) {
-		if (cache[i] == wm8741_reg_defaults[i] || WM8741_RESET == i)
-			continue;
-		snd_soc_write(codec, i, cache[i]);
-	}
+	snd_soc_cache_sync(codec);
 	return 0;
 }
 #else
-- 
1.7.5.4

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

* Re: [PATCH 1/2] ASoC: wm8741: Fix setting interface format for DSP modes
  2011-10-17 12:14 ` Axel Lin
  (?)
  (?)
@ 2011-10-17 12:38 ` Girdwood, Liam
  -1 siblings, 0 replies; 6+ messages in thread
From: Girdwood, Liam @ 2011-10-17 12:38 UTC (permalink / raw)
  To: Axel Lin; +Cc: Dimitris Papastamos, alsa-devel, Mark Brown, linux-kernel

On 17 October 2011 13:14, Axel Lin <axel.lin@gmail.com> wrote:

> According to the datasheet:
> Format Control (05h)
> BITS[3:2]
>        FMT[1:0] Audio data format selection
>                00 = right justified mode
>                01 = left justified mode
>                10 = I2S mode
>                11 = DSP mode
> BIT[4]  LRP Polarity selec for LRCLK/DSP mode select
>                0 = normal LRCLK poalrity/DSP mode A
>                1 = inverted LRCLK poarity/DSP mode B
>
> For SND_SOC_DAIFMT_DSP_A, we should set 0x000C instead of 0x0003.
> For SND_SOC_DAIFMT_DSP_B, we should set 0x001C instead of 0x0013.
>
> Signed-off-by: Axel Lin <axel.lin@gmail.com>
> ---
>  sound/soc/codecs/wm8741.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/sound/soc/codecs/wm8741.c b/sound/soc/codecs/wm8741.c
> index a42b282..85ebe02 100644
> --- a/sound/soc/codecs/wm8741.c
> +++ b/sound/soc/codecs/wm8741.c
> @@ -339,10 +339,10 @@ static int wm8741_set_dai_fmt(struct snd_soc_dai
> *codec_dai,
>                iface |= 0x0004;
>                break;
>        case SND_SOC_DAIFMT_DSP_A:
> -               iface |= 0x0003;
> +               iface |= 0x000C;
>                break;
>        case SND_SOC_DAIFMT_DSP_B:
> -               iface |= 0x0013;
> +               iface |= 0x001C;
>                break;
>        default:
>                return -EINVAL;
> --
> 1.7.5.4
>
>
>
>
Both

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

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

* Re: [PATCH 1/2] ASoC: wm8741: Fix setting interface format for DSP modes
  2011-10-17 12:14 ` Axel Lin
                   ` (2 preceding siblings ...)
  (?)
@ 2011-10-17 21:47 ` Mark Brown
  -1 siblings, 0 replies; 6+ messages in thread
From: Mark Brown @ 2011-10-17 21:47 UTC (permalink / raw)
  To: Axel Lin; +Cc: linux-kernel, Dimitris Papastamos, Liam Girdwood, alsa-devel

On Mon, Oct 17, 2011 at 08:14:56PM +0800, Axel Lin wrote:
> According to the datasheet:

Applied both, thanks.

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

end of thread, other threads:[~2011-10-17 21:47 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-17 12:14 [PATCH 1/2] ASoC: wm8741: Fix setting interface format for DSP modes Axel Lin
2011-10-17 12:14 ` Axel Lin
2011-10-17 12:16 ` [PATCH 2/2] ASoC: wm8741: Use snd_soc_cache_sync to sync reg_cache with the hardware Axel Lin
2011-10-17 12:16   ` Axel Lin
2011-10-17 12:38 ` [PATCH 1/2] ASoC: wm8741: Fix setting interface format for DSP modes Girdwood, Liam
2011-10-17 21:47 ` 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.