All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: imx-ssi: Fix DAI hardware signal inversions
@ 2015-09-17 15:46 Benoît Thébaudeau
  2015-09-17 17:59 ` Nicolin Chen
  2015-09-30 19:32 ` Applied "ASoC: imx-ssi: Fix DAI hardware signal inversions" to the asoc tree Mark Brown
  0 siblings, 2 replies; 7+ messages in thread
From: Benoît Thébaudeau @ 2015-09-17 15:46 UTC (permalink / raw)
  To: alsa-devel
  Cc: Nicolin Chen, Timur Tabi, Benoît Thébaudeau, Xiubo Li

SND_SOC_DAIFMT_{IB|NB}_{IF|NF} are defined as inverting or not BCLK or
FRM relatively to what is standard for the specified DAI hardware audio
format. Consequently, the absolute polarities of these signals cannot be
derived only from these settings as this driver did. The format has to
be taken into account too.

This fixes inverted left/right channels in I²S mode.

Signed-off-by: Benoît Thébaudeau <benoit@wsystem.com>
---
 sound/soc/fsl/imx-ssi.c | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)

diff --git a/sound/soc/fsl/imx-ssi.c b/sound/soc/fsl/imx-ssi.c
index 48b2d24..b95132e 100644
--- a/sound/soc/fsl/imx-ssi.c
+++ b/sound/soc/fsl/imx-ssi.c
@@ -95,7 +95,8 @@ static int imx_ssi_set_dai_fmt(struct snd_soc_dai *cpu_dai, unsigned int fmt)
 	switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
 	case SND_SOC_DAIFMT_I2S:
 		/* data on rising edge of bclk, frame low 1clk before data */
-		strcr |= SSI_STCR_TFSI | SSI_STCR_TEFS | SSI_STCR_TXBIT0;
+		strcr |= SSI_STCR_TXBIT0 | SSI_STCR_TSCKP | SSI_STCR_TFSI |
+			SSI_STCR_TEFS;
 		scr |= SSI_SCR_NET;
 		if (ssi->flags & IMX_SSI_USE_I2S_SLAVE) {
 			scr &= ~SSI_I2S_MODE_MASK;
@@ -104,33 +105,31 @@ static int imx_ssi_set_dai_fmt(struct snd_soc_dai *cpu_dai, unsigned int fmt)
 		break;
 	case SND_SOC_DAIFMT_LEFT_J:
 		/* data on rising edge of bclk, frame high with data */
-		strcr |= SSI_STCR_TXBIT0;
+		strcr |= SSI_STCR_TXBIT0 | SSI_STCR_TSCKP;
 		break;
 	case SND_SOC_DAIFMT_DSP_B:
 		/* data on rising edge of bclk, frame high with data */
-		strcr |= SSI_STCR_TFSL | SSI_STCR_TXBIT0;
+		strcr |= SSI_STCR_TXBIT0 | SSI_STCR_TSCKP | SSI_STCR_TFSL;
 		break;
 	case SND_SOC_DAIFMT_DSP_A:
 		/* data on rising edge of bclk, frame high 1clk before data */
-		strcr |= SSI_STCR_TFSL | SSI_STCR_TXBIT0 | SSI_STCR_TEFS;
+		strcr |= SSI_STCR_TXBIT0 | SSI_STCR_TSCKP | SSI_STCR_TFSL |
+			SSI_STCR_TEFS;
 		break;
 	}
 
 	/* DAI clock inversion */
 	switch (fmt & SND_SOC_DAIFMT_INV_MASK) {
 	case SND_SOC_DAIFMT_IB_IF:
-		strcr |= SSI_STCR_TFSI;
-		strcr &= ~SSI_STCR_TSCKP;
+		strcr ^= SSI_STCR_TSCKP | SSI_STCR_TFSI;
 		break;
 	case SND_SOC_DAIFMT_IB_NF:
-		strcr &= ~(SSI_STCR_TSCKP | SSI_STCR_TFSI);
+		strcr ^= SSI_STCR_TSCKP;
 		break;
 	case SND_SOC_DAIFMT_NB_IF:
-		strcr |= SSI_STCR_TFSI | SSI_STCR_TSCKP;
+		strcr ^= SSI_STCR_TFSI;
 		break;
 	case SND_SOC_DAIFMT_NB_NF:
-		strcr &= ~SSI_STCR_TFSI;
-		strcr |= SSI_STCR_TSCKP;
 		break;
 	}
 
-- 
2.1.4

_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

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

* Re: [PATCH] ASoC: imx-ssi: Fix DAI hardware signal inversions
  2015-09-17 15:46 [PATCH] ASoC: imx-ssi: Fix DAI hardware signal inversions Benoît Thébaudeau
@ 2015-09-17 17:59 ` Nicolin Chen
  2015-09-19  0:51   ` undefined
  2015-09-28 19:36   ` Benoît Thébaudeau
  2015-09-30 19:32 ` Applied "ASoC: imx-ssi: Fix DAI hardware signal inversions" to the asoc tree Mark Brown
  1 sibling, 2 replies; 7+ messages in thread
From: Nicolin Chen @ 2015-09-17 17:59 UTC (permalink / raw)
  To: Benoît Thébaudeau; +Cc: alsa-devel, Timur Tabi, Xiubo Li

On Thu, Sep 17, 2015 at 05:46:54PM +0200, Benoît Thébaudeau wrote:
> SND_SOC_DAIFMT_{IB|NB}_{IF|NF} are defined as inverting or not BCLK or
> FRM relatively to what is standard for the specified DAI hardware audio
> format. Consequently, the absolute polarities of these signals cannot be
> derived only from these settings as this driver did. The format has to
> be taken into account too.
> 
> This fixes inverted left/right channels in I²S mode.
> 
> Signed-off-by: Benoît Thébaudeau <benoit@wsystem.com>

Looks like the same configurations of fsl_ssi, so it should be fine:

Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>

> ---
>  sound/soc/fsl/imx-ssi.c | 19 +++++++++----------
>  1 file changed, 9 insertions(+), 10 deletions(-)
> 
> diff --git a/sound/soc/fsl/imx-ssi.c b/sound/soc/fsl/imx-ssi.c
> index 48b2d24..b95132e 100644
> --- a/sound/soc/fsl/imx-ssi.c
> +++ b/sound/soc/fsl/imx-ssi.c
> @@ -95,7 +95,8 @@ static int imx_ssi_set_dai_fmt(struct snd_soc_dai *cpu_dai, unsigned int fmt)
>  	switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
>  	case SND_SOC_DAIFMT_I2S:
>  		/* data on rising edge of bclk, frame low 1clk before data */
> -		strcr |= SSI_STCR_TFSI | SSI_STCR_TEFS | SSI_STCR_TXBIT0;
> +		strcr |= SSI_STCR_TXBIT0 | SSI_STCR_TSCKP | SSI_STCR_TFSI |
> +			SSI_STCR_TEFS;
>  		scr |= SSI_SCR_NET;
>  		if (ssi->flags & IMX_SSI_USE_I2S_SLAVE) {
>  			scr &= ~SSI_I2S_MODE_MASK;
> @@ -104,33 +105,31 @@ static int imx_ssi_set_dai_fmt(struct snd_soc_dai *cpu_dai, unsigned int fmt)
>  		break;
>  	case SND_SOC_DAIFMT_LEFT_J:
>  		/* data on rising edge of bclk, frame high with data */
> -		strcr |= SSI_STCR_TXBIT0;
> +		strcr |= SSI_STCR_TXBIT0 | SSI_STCR_TSCKP;
>  		break;
>  	case SND_SOC_DAIFMT_DSP_B:
>  		/* data on rising edge of bclk, frame high with data */
> -		strcr |= SSI_STCR_TFSL | SSI_STCR_TXBIT0;
> +		strcr |= SSI_STCR_TXBIT0 | SSI_STCR_TSCKP | SSI_STCR_TFSL;
>  		break;
>  	case SND_SOC_DAIFMT_DSP_A:
>  		/* data on rising edge of bclk, frame high 1clk before data */
> -		strcr |= SSI_STCR_TFSL | SSI_STCR_TXBIT0 | SSI_STCR_TEFS;
> +		strcr |= SSI_STCR_TXBIT0 | SSI_STCR_TSCKP | SSI_STCR_TFSL |
> +			SSI_STCR_TEFS;
>  		break;
>  	}
>  
>  	/* DAI clock inversion */
>  	switch (fmt & SND_SOC_DAIFMT_INV_MASK) {
>  	case SND_SOC_DAIFMT_IB_IF:
> -		strcr |= SSI_STCR_TFSI;
> -		strcr &= ~SSI_STCR_TSCKP;
> +		strcr ^= SSI_STCR_TSCKP | SSI_STCR_TFSI;
>  		break;
>  	case SND_SOC_DAIFMT_IB_NF:
> -		strcr &= ~(SSI_STCR_TSCKP | SSI_STCR_TFSI);
> +		strcr ^= SSI_STCR_TSCKP;
>  		break;
>  	case SND_SOC_DAIFMT_NB_IF:
> -		strcr |= SSI_STCR_TFSI | SSI_STCR_TSCKP;
> +		strcr ^= SSI_STCR_TFSI;
>  		break;
>  	case SND_SOC_DAIFMT_NB_NF:
> -		strcr &= ~SSI_STCR_TFSI;
> -		strcr |= SSI_STCR_TSCKP;
>  		break;
>  	}
>  
> -- 
> 2.1.4
> 

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

* Re: [PATCH] ASoC: imx-ssi: Fix DAI hardware signal inversions
  2015-09-17 17:59 ` Nicolin Chen
@ 2015-09-19  0:51   ` undefined
  2015-09-28 19:36   ` Benoît Thébaudeau
  1 sibling, 0 replies; 7+ messages in thread
From: undefined @ 2015-09-19  0:51 UTC (permalink / raw)
  To: Nicolin Chen, Benoît Thébaudeau; +Cc: alsa-devel, Xiubo Li

Nicolin Chen wrote:
> Looks like the same configurations of fsl_ssi, so it should be fine:

I'm so glad I ignored the IMX driver when I wrote fsl_ssi.c. :-)

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

* Re: [PATCH] ASoC: imx-ssi: Fix DAI hardware signal inversions
  2015-09-17 17:59 ` Nicolin Chen
  2015-09-19  0:51   ` undefined
@ 2015-09-28 19:36   ` Benoît Thébaudeau
  2015-09-29 15:35     ` Mark Brown
  1 sibling, 1 reply; 7+ messages in thread
From: Benoît Thébaudeau @ 2015-09-28 19:36 UTC (permalink / raw)
  To: Nicolin Chen
  Cc: Alsa-devel, Xiubo Li, Liam Girdwood, Timur Tabi, Mark Brown,
	Benoît Thébaudeau

Hi all,

On Thu, Sep 17, 2015 at 7:59 PM, Nicolin Chen <nicoleotsuka@gmail.com> wrote:
> On Thu, Sep 17, 2015 at 05:46:54PM +0200, Benoît Thébaudeau wrote:
>> SND_SOC_DAIFMT_{IB|NB}_{IF|NF} are defined as inverting or not BCLK or
>> FRM relatively to what is standard for the specified DAI hardware audio
>> format. Consequently, the absolute polarities of these signals cannot be
>> derived only from these settings as this driver did. The format has to
>> be taken into account too.
>>
>> This fixes inverted left/right channels in I²S mode.
>>
>> Signed-off-by: Benoît Thébaudeau <benoit@wsystem.com>
>
> Looks like the same configurations of fsl_ssi, so it should be fine:
>
> Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
>
>> ---
>>  sound/soc/fsl/imx-ssi.c | 19 +++++++++----------
>>  1 file changed, 9 insertions(+), 10 deletions(-)
>>
>> diff --git a/sound/soc/fsl/imx-ssi.c b/sound/soc/fsl/imx-ssi.c
>> index 48b2d24..b95132e 100644
>> --- a/sound/soc/fsl/imx-ssi.c
>> +++ b/sound/soc/fsl/imx-ssi.c
>> @@ -95,7 +95,8 @@ static int imx_ssi_set_dai_fmt(struct snd_soc_dai *cpu_dai, unsigned int fmt)
>>       switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
>>       case SND_SOC_DAIFMT_I2S:
>>               /* data on rising edge of bclk, frame low 1clk before data */
>> -             strcr |= SSI_STCR_TFSI | SSI_STCR_TEFS | SSI_STCR_TXBIT0;
>> +             strcr |= SSI_STCR_TXBIT0 | SSI_STCR_TSCKP | SSI_STCR_TFSI |
>> +                     SSI_STCR_TEFS;
>>               scr |= SSI_SCR_NET;
>>               if (ssi->flags & IMX_SSI_USE_I2S_SLAVE) {
>>                       scr &= ~SSI_I2S_MODE_MASK;
>> @@ -104,33 +105,31 @@ static int imx_ssi_set_dai_fmt(struct snd_soc_dai *cpu_dai, unsigned int fmt)
>>               break;
>>       case SND_SOC_DAIFMT_LEFT_J:
>>               /* data on rising edge of bclk, frame high with data */
>> -             strcr |= SSI_STCR_TXBIT0;
>> +             strcr |= SSI_STCR_TXBIT0 | SSI_STCR_TSCKP;
>>               break;
>>       case SND_SOC_DAIFMT_DSP_B:
>>               /* data on rising edge of bclk, frame high with data */
>> -             strcr |= SSI_STCR_TFSL | SSI_STCR_TXBIT0;
>> +             strcr |= SSI_STCR_TXBIT0 | SSI_STCR_TSCKP | SSI_STCR_TFSL;
>>               break;
>>       case SND_SOC_DAIFMT_DSP_A:
>>               /* data on rising edge of bclk, frame high 1clk before data */
>> -             strcr |= SSI_STCR_TFSL | SSI_STCR_TXBIT0 | SSI_STCR_TEFS;
>> +             strcr |= SSI_STCR_TXBIT0 | SSI_STCR_TSCKP | SSI_STCR_TFSL |
>> +                     SSI_STCR_TEFS;
>>               break;
>>       }
>>
>>       /* DAI clock inversion */
>>       switch (fmt & SND_SOC_DAIFMT_INV_MASK) {
>>       case SND_SOC_DAIFMT_IB_IF:
>> -             strcr |= SSI_STCR_TFSI;
>> -             strcr &= ~SSI_STCR_TSCKP;
>> +             strcr ^= SSI_STCR_TSCKP | SSI_STCR_TFSI;
>>               break;
>>       case SND_SOC_DAIFMT_IB_NF:
>> -             strcr &= ~(SSI_STCR_TSCKP | SSI_STCR_TFSI);
>> +             strcr ^= SSI_STCR_TSCKP;
>>               break;
>>       case SND_SOC_DAIFMT_NB_IF:
>> -             strcr |= SSI_STCR_TFSI | SSI_STCR_TSCKP;
>> +             strcr ^= SSI_STCR_TFSI;
>>               break;
>>       case SND_SOC_DAIFMT_NB_NF:
>> -             strcr &= ~SSI_STCR_TFSI;
>> -             strcr |= SSI_STCR_TSCKP;
>>               break;
>>       }
>>
>> --
>> 2.1.4
>>

Adding the ASoC maintainers to the Cc list.

Best regards,
Benoît
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

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

* Re: [PATCH] ASoC: imx-ssi: Fix DAI hardware signal inversions
  2015-09-28 19:36   ` Benoît Thébaudeau
@ 2015-09-29 15:35     ` Mark Brown
  2015-09-29 15:59       ` [PATCH][RESEND] " Benoît Thébaudeau
  0 siblings, 1 reply; 7+ messages in thread
From: Mark Brown @ 2015-09-29 15:35 UTC (permalink / raw)
  To: Benoît Thébaudeau
  Cc: Alsa-devel, Xiubo Li, Liam Girdwood, Timur Tabi, Nicolin Chen,
	Benoît Thébaudeau


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

On Mon, Sep 28, 2015 at 09:36:49PM +0200, Benoît Thébaudeau wrote:

> >>       case SND_SOC_DAIFMT_NB_NF:
> >> -             strcr &= ~SSI_STCR_TFSI;
> >> -             strcr |= SSI_STCR_TSCKP;
> >>               break;
> >>       }

> Adding the ASoC maintainers to the Cc list.

Please send patches directly to maintainers as covered in SubmittingPatches,
I can't do anything with a quoted reply to an e-mail.

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

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



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

* [PATCH][RESEND] ASoC: imx-ssi: Fix DAI hardware signal inversions
  2015-09-29 15:35     ` Mark Brown
@ 2015-09-29 15:59       ` Benoît Thébaudeau
  0 siblings, 0 replies; 7+ messages in thread
From: Benoît Thébaudeau @ 2015-09-29 15:59 UTC (permalink / raw)
  To: alsa-devel
  Cc: Xiubo Li, Liam Girdwood, Timur Tabi, Nicolin Chen, Mark Brown,
	Benoît Thébaudeau

SND_SOC_DAIFMT_{IB|NB}_{IF|NF} are defined as inverting or not BCLK or
FRM relatively to what is standard for the specified DAI hardware audio
format. Consequently, the absolute polarities of these signals cannot be
derived only from these settings as this driver did. The format has to
be taken into account too.

This fixes inverted left/right channels in I²S mode.

Signed-off-by: Benoît Thébaudeau <benoit@wsystem.com>
Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
---
 sound/soc/fsl/imx-ssi.c | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)

diff --git a/sound/soc/fsl/imx-ssi.c b/sound/soc/fsl/imx-ssi.c
index 48b2d24..b95132e 100644
--- a/sound/soc/fsl/imx-ssi.c
+++ b/sound/soc/fsl/imx-ssi.c
@@ -95,7 +95,8 @@ static int imx_ssi_set_dai_fmt(struct snd_soc_dai *cpu_dai, unsigned int fmt)
 	switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
 	case SND_SOC_DAIFMT_I2S:
 		/* data on rising edge of bclk, frame low 1clk before data */
-		strcr |= SSI_STCR_TFSI | SSI_STCR_TEFS | SSI_STCR_TXBIT0;
+		strcr |= SSI_STCR_TXBIT0 | SSI_STCR_TSCKP | SSI_STCR_TFSI |
+			SSI_STCR_TEFS;
 		scr |= SSI_SCR_NET;
 		if (ssi->flags & IMX_SSI_USE_I2S_SLAVE) {
 			scr &= ~SSI_I2S_MODE_MASK;
@@ -104,33 +105,31 @@ static int imx_ssi_set_dai_fmt(struct snd_soc_dai *cpu_dai, unsigned int fmt)
 		break;
 	case SND_SOC_DAIFMT_LEFT_J:
 		/* data on rising edge of bclk, frame high with data */
-		strcr |= SSI_STCR_TXBIT0;
+		strcr |= SSI_STCR_TXBIT0 | SSI_STCR_TSCKP;
 		break;
 	case SND_SOC_DAIFMT_DSP_B:
 		/* data on rising edge of bclk, frame high with data */
-		strcr |= SSI_STCR_TFSL | SSI_STCR_TXBIT0;
+		strcr |= SSI_STCR_TXBIT0 | SSI_STCR_TSCKP | SSI_STCR_TFSL;
 		break;
 	case SND_SOC_DAIFMT_DSP_A:
 		/* data on rising edge of bclk, frame high 1clk before data */
-		strcr |= SSI_STCR_TFSL | SSI_STCR_TXBIT0 | SSI_STCR_TEFS;
+		strcr |= SSI_STCR_TXBIT0 | SSI_STCR_TSCKP | SSI_STCR_TFSL |
+			SSI_STCR_TEFS;
 		break;
 	}
 
 	/* DAI clock inversion */
 	switch (fmt & SND_SOC_DAIFMT_INV_MASK) {
 	case SND_SOC_DAIFMT_IB_IF:
-		strcr |= SSI_STCR_TFSI;
-		strcr &= ~SSI_STCR_TSCKP;
+		strcr ^= SSI_STCR_TSCKP | SSI_STCR_TFSI;
 		break;
 	case SND_SOC_DAIFMT_IB_NF:
-		strcr &= ~(SSI_STCR_TSCKP | SSI_STCR_TFSI);
+		strcr ^= SSI_STCR_TSCKP;
 		break;
 	case SND_SOC_DAIFMT_NB_IF:
-		strcr |= SSI_STCR_TFSI | SSI_STCR_TSCKP;
+		strcr ^= SSI_STCR_TFSI;
 		break;
 	case SND_SOC_DAIFMT_NB_NF:
-		strcr &= ~SSI_STCR_TFSI;
-		strcr |= SSI_STCR_TSCKP;
 		break;
 	}
 
-- 
2.1.4

_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

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

* Applied "ASoC: imx-ssi: Fix DAI hardware signal inversions" to the asoc tree
  2015-09-17 15:46 [PATCH] ASoC: imx-ssi: Fix DAI hardware signal inversions Benoît Thébaudeau
  2015-09-17 17:59 ` Nicolin Chen
@ 2015-09-30 19:32 ` Mark Brown
  1 sibling, 0 replies; 7+ messages in thread
From: Mark Brown @ 2015-09-30 19:32 UTC (permalink / raw)
  To: Nicolin Chen, Mark Brown; +Cc: alsa-devel

[-- Attachment #1: Type: text/plain, Size: 3819 bytes --]

The patch

   ASoC: imx-ssi: Fix DAI hardware signal inversions

has been applied to the asoc tree at

   git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From b7b01d345b83602a42b6ff02cacb9d9ada5ecd0a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Beno=C3=AEt=20Th=C3=A9baudeau?= <benoit@wsystem.com>
Date: Tue, 29 Sep 2015 17:59:14 +0200
Subject: [PATCH] ASoC: imx-ssi: Fix DAI hardware signal inversions
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

SND_SOC_DAIFMT_{IB|NB}_{IF|NF} are defined as inverting or not BCLK or
FRM relatively to what is standard for the specified DAI hardware audio
format. Consequently, the absolute polarities of these signals cannot be
derived only from these settings as this driver did. The format has to
be taken into account too.

This fixes inverted left/right channels in I²S mode.

Signed-off-by: Benoît Thébaudeau <benoit@wsystem.com>
Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/fsl/imx-ssi.c | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)

diff --git a/sound/soc/fsl/imx-ssi.c b/sound/soc/fsl/imx-ssi.c
index 48b2d24..b95132e 100644
--- a/sound/soc/fsl/imx-ssi.c
+++ b/sound/soc/fsl/imx-ssi.c
@@ -95,7 +95,8 @@ static int imx_ssi_set_dai_fmt(struct snd_soc_dai *cpu_dai, unsigned int fmt)
 	switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
 	case SND_SOC_DAIFMT_I2S:
 		/* data on rising edge of bclk, frame low 1clk before data */
-		strcr |= SSI_STCR_TFSI | SSI_STCR_TEFS | SSI_STCR_TXBIT0;
+		strcr |= SSI_STCR_TXBIT0 | SSI_STCR_TSCKP | SSI_STCR_TFSI |
+			SSI_STCR_TEFS;
 		scr |= SSI_SCR_NET;
 		if (ssi->flags & IMX_SSI_USE_I2S_SLAVE) {
 			scr &= ~SSI_I2S_MODE_MASK;
@@ -104,33 +105,31 @@ static int imx_ssi_set_dai_fmt(struct snd_soc_dai *cpu_dai, unsigned int fmt)
 		break;
 	case SND_SOC_DAIFMT_LEFT_J:
 		/* data on rising edge of bclk, frame high with data */
-		strcr |= SSI_STCR_TXBIT0;
+		strcr |= SSI_STCR_TXBIT0 | SSI_STCR_TSCKP;
 		break;
 	case SND_SOC_DAIFMT_DSP_B:
 		/* data on rising edge of bclk, frame high with data */
-		strcr |= SSI_STCR_TFSL | SSI_STCR_TXBIT0;
+		strcr |= SSI_STCR_TXBIT0 | SSI_STCR_TSCKP | SSI_STCR_TFSL;
 		break;
 	case SND_SOC_DAIFMT_DSP_A:
 		/* data on rising edge of bclk, frame high 1clk before data */
-		strcr |= SSI_STCR_TFSL | SSI_STCR_TXBIT0 | SSI_STCR_TEFS;
+		strcr |= SSI_STCR_TXBIT0 | SSI_STCR_TSCKP | SSI_STCR_TFSL |
+			SSI_STCR_TEFS;
 		break;
 	}
 
 	/* DAI clock inversion */
 	switch (fmt & SND_SOC_DAIFMT_INV_MASK) {
 	case SND_SOC_DAIFMT_IB_IF:
-		strcr |= SSI_STCR_TFSI;
-		strcr &= ~SSI_STCR_TSCKP;
+		strcr ^= SSI_STCR_TSCKP | SSI_STCR_TFSI;
 		break;
 	case SND_SOC_DAIFMT_IB_NF:
-		strcr &= ~(SSI_STCR_TSCKP | SSI_STCR_TFSI);
+		strcr ^= SSI_STCR_TSCKP;
 		break;
 	case SND_SOC_DAIFMT_NB_IF:
-		strcr |= SSI_STCR_TFSI | SSI_STCR_TSCKP;
+		strcr ^= SSI_STCR_TFSI;
 		break;
 	case SND_SOC_DAIFMT_NB_NF:
-		strcr &= ~SSI_STCR_TFSI;
-		strcr |= SSI_STCR_TSCKP;
 		break;
 	}
 
-- 
2.5.0


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



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

end of thread, other threads:[~2015-09-30 19:32 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-17 15:46 [PATCH] ASoC: imx-ssi: Fix DAI hardware signal inversions Benoît Thébaudeau
2015-09-17 17:59 ` Nicolin Chen
2015-09-19  0:51   ` undefined
2015-09-28 19:36   ` Benoît Thébaudeau
2015-09-29 15:35     ` Mark Brown
2015-09-29 15:59       ` [PATCH][RESEND] " Benoît Thébaudeau
2015-09-30 19:32 ` Applied "ASoC: imx-ssi: Fix DAI hardware signal inversions" to the asoc tree 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.