LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH 1/2] ASoC: atmel_ssc_dai: fix start event for I2S mode
@ 2015-01-16  7:19 Bo Shen
  2015-01-16  7:19 ` [PATCH 2/2] ASoC: atmel_ssc_dai: remove clock pin comments Bo Shen
  0 siblings, 1 reply; 4+ messages in thread
From: Bo Shen @ 2015-01-16  7:19 UTC (permalink / raw)
  To: Mark Brown
  Cc: nicolas.ferre, alsa-devel, linux-sound, linux-arm-kernel,
	linux-kernel, Bo Shen

According to the I2S specification information as following:
  - WS = 0, channel 1 (left)
  - WS = 1, channel 2 (right)
So, the start event should be TF/RF falling edge.

Reported-by: Songjun Wu <songjun.wu@atmel.com>
Signed-off-by: Bo Shen <voice.shen@atmel.com>
---

 sound/soc/atmel/atmel_ssc_dai.c | 18 ++++--------------
 1 file changed, 4 insertions(+), 14 deletions(-)

diff --git a/sound/soc/atmel/atmel_ssc_dai.c b/sound/soc/atmel/atmel_ssc_dai.c
index 99ff35e..e691aab 100644
--- a/sound/soc/atmel/atmel_ssc_dai.c
+++ b/sound/soc/atmel/atmel_ssc_dai.c
@@ -348,7 +348,6 @@ static int atmel_ssc_hw_params(struct snd_pcm_substream *substream,
 	struct atmel_pcm_dma_params *dma_params;
 	int dir, channels, bits;
 	u32 tfmr, rfmr, tcmr, rcmr;
-	int start_event;
 	int ret;
 	int fslen, fslen_ext;
 
@@ -457,19 +456,10 @@ static int atmel_ssc_hw_params(struct snd_pcm_substream *substream,
 		 * The SSC transmit clock is obtained from the BCLK signal on
 		 * on the TK line, and the SSC receive clock is
 		 * generated from the transmit clock.
-		 *
-		 *  For single channel data, one sample is transferred
-		 * on the falling edge of the LRC clock.
-		 * For two channel data, one sample is
-		 * transferred on both edges of the LRC clock.
 		 */
-		start_event = ((channels == 1)
-				? SSC_START_FALLING_RF
-				: SSC_START_EDGE_RF);
-
 		rcmr =	  SSC_BF(RCMR_PERIOD, 0)
 			| SSC_BF(RCMR_STTDLY, START_DELAY)
-			| SSC_BF(RCMR_START, start_event)
+			| SSC_BF(RCMR_START, SSC_START_FALLING_RF)
 			| SSC_BF(RCMR_CKI, SSC_CKI_RISING)
 			| SSC_BF(RCMR_CKO, SSC_CKO_NONE)
 			| SSC_BF(RCMR_CKS, ssc->clk_from_rk_pin ?
@@ -478,14 +468,14 @@ static int atmel_ssc_hw_params(struct snd_pcm_substream *substream,
 		rfmr =	  SSC_BF(RFMR_FSEDGE, SSC_FSEDGE_POSITIVE)
 			| SSC_BF(RFMR_FSOS, SSC_FSOS_NONE)
 			| SSC_BF(RFMR_FSLEN, 0)
-			| SSC_BF(RFMR_DATNB, 0)
+			| SSC_BF(RFMR_DATNB, (channels - 1))
 			| SSC_BIT(RFMR_MSBF)
 			| SSC_BF(RFMR_LOOP, 0)
 			| SSC_BF(RFMR_DATLEN, (bits - 1));
 
 		tcmr =	  SSC_BF(TCMR_PERIOD, 0)
 			| SSC_BF(TCMR_STTDLY, START_DELAY)
-			| SSC_BF(TCMR_START, start_event)
+			| SSC_BF(TCMR_START, SSC_START_FALLING_RF)
 			| SSC_BF(TCMR_CKI, SSC_CKI_FALLING)
 			| SSC_BF(TCMR_CKO, SSC_CKO_NONE)
 			| SSC_BF(TCMR_CKS, ssc->clk_from_rk_pin ?
@@ -495,7 +485,7 @@ static int atmel_ssc_hw_params(struct snd_pcm_substream *substream,
 			| SSC_BF(TFMR_FSDEN, 0)
 			| SSC_BF(TFMR_FSOS, SSC_FSOS_NONE)
 			| SSC_BF(TFMR_FSLEN, 0)
-			| SSC_BF(TFMR_DATNB, 0)
+			| SSC_BF(TFMR_DATNB, (channels - 1))
 			| SSC_BIT(TFMR_MSBF)
 			| SSC_BF(TFMR_DATDEF, 0)
 			| SSC_BF(TFMR_DATLEN, (bits - 1));
-- 
2.3.0.rc0


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

* [PATCH 2/2] ASoC: atmel_ssc_dai: remove clock pin comments
  2015-01-16  7:19 [PATCH 1/2] ASoC: atmel_ssc_dai: fix start event for I2S mode Bo Shen
@ 2015-01-16  7:19 ` Bo Shen
  2015-01-19 13:54   ` Peter Rosin
  0 siblings, 1 reply; 4+ messages in thread
From: Bo Shen @ 2015-01-16  7:19 UTC (permalink / raw)
  To: Mark Brown
  Cc: nicolas.ferre, alsa-devel, linux-sound, linux-arm-kernel,
	linux-kernel, Bo Shen

As the clock can be get from TK/RK pin, so remove the comments.

Signed-off-by: Bo Shen <voice.shen@atmel.com>
---

 sound/soc/atmel/atmel_ssc_dai.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/sound/soc/atmel/atmel_ssc_dai.c b/sound/soc/atmel/atmel_ssc_dai.c
index e691aab..198661b 100644
--- a/sound/soc/atmel/atmel_ssc_dai.c
+++ b/sound/soc/atmel/atmel_ssc_dai.c
@@ -452,10 +452,6 @@ static int atmel_ssc_hw_params(struct snd_pcm_substream *substream,
 	case SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_CBM_CFM:
 		/*
 		 * I2S format, CODEC supplies BCLK and LRC clocks.
-		 *
-		 * The SSC transmit clock is obtained from the BCLK signal on
-		 * on the TK line, and the SSC receive clock is
-		 * generated from the transmit clock.
 		 */
 		rcmr =	  SSC_BF(RCMR_PERIOD, 0)
 			| SSC_BF(RCMR_STTDLY, START_DELAY)
-- 
2.3.0.rc0


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

* Re: [PATCH 2/2] ASoC: atmel_ssc_dai: remove clock pin comments
  2015-01-16  7:19 ` [PATCH 2/2] ASoC: atmel_ssc_dai: remove clock pin comments Bo Shen
@ 2015-01-19 13:54   ` Peter Rosin
  2015-01-20  1:00     ` Bo Shen
  0 siblings, 1 reply; 4+ messages in thread
From: Peter Rosin @ 2015-01-19 13:54 UTC (permalink / raw)
  To: Bo Shen
  Cc: Mark Brown, nicolas.ferre, alsa-devel, linux-sound,
	linux-arm-kernel, linux-kernel

> As the clock can be get from TK/RK pin, so remove the comments.
> 
> Signed-off-by: Bo Shen <voice.shen@atmel.com>
> ---
>  sound/soc/atmel/atmel_ssc_dai.c | 4 ----
>  1 file changed, 4 deletions(-)
> diff --git a/sound/soc/atmel/atmel_ssc_dai.c b/sound/soc/atmel/atmel_ssc_dai.c
> index e691aab..198661b 100644
> --- a/sound/soc/atmel/atmel_ssc_dai.c
> +++ b/sound/soc/atmel/atmel_ssc_dai.c
> @@ -452,10 +452,6 @@ static int atmel_ssc_hw_params(struct snd_pcm_substream *substream,
>  	case SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_CBM_CFM:
>  		/*
>  		 * I2S format, CODEC supplies BCLK and LRC clocks.
> -		 *
> -		 * The SSC transmit clock is obtained from the BCLK signal on
> -		 * on the TK line, and the SSC receive clock is
> -		 * generated from the transmit clock.
>  		 */
>  		rcmr =	  SSC_BF(RCMR_PERIOD, 0)
>  			| SSC_BF(RCMR_STTDLY, START_DELAY)
> -- 
> 2.3.0.rc0

Hi!

You should probably remove that comment from the case with
SND_SOC_DAIFMT_DSP_A | SND_SOC_DAIFMT_CBM_CFM as well...

Cheers,
Peter


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

* Re: [PATCH 2/2] ASoC: atmel_ssc_dai: remove clock pin comments
  2015-01-19 13:54   ` Peter Rosin
@ 2015-01-20  1:00     ` Bo Shen
  0 siblings, 0 replies; 4+ messages in thread
From: Bo Shen @ 2015-01-20  1:00 UTC (permalink / raw)
  To: Peter Rosin
  Cc: Mark Brown, nicolas.ferre, alsa-devel, linux-sound,
	linux-arm-kernel, linux-kernel

Hi Peter,

On 01/19/2015 09:54 PM, Peter Rosin wrote:
>> As the clock can be get from TK/RK pin, so remove the comments.
>>
>> Signed-off-by: Bo Shen <voice.shen@atmel.com>
>> ---
>>   sound/soc/atmel/atmel_ssc_dai.c | 4 ----
>>   1 file changed, 4 deletions(-)
>> diff --git a/sound/soc/atmel/atmel_ssc_dai.c b/sound/soc/atmel/atmel_ssc_dai.c
>> index e691aab..198661b 100644
>> --- a/sound/soc/atmel/atmel_ssc_dai.c
>> +++ b/sound/soc/atmel/atmel_ssc_dai.c
>> @@ -452,10 +452,6 @@ static int atmel_ssc_hw_params(struct snd_pcm_substream *substream,
>>   	case SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_CBM_CFM:
>>   		/*
>>   		 * I2S format, CODEC supplies BCLK and LRC clocks.
>> -		 *
>> -		 * The SSC transmit clock is obtained from the BCLK signal on
>> -		 * on the TK line, and the SSC receive clock is
>> -		 * generated from the transmit clock.
>>   		 */
>>   		rcmr =	  SSC_BF(RCMR_PERIOD, 0)
>>   			| SSC_BF(RCMR_STTDLY, START_DELAY)
>> --
>> 2.3.0.rc0
>
> Hi!
>
> You should probably remove that comment from the case with
> SND_SOC_DAIFMT_DSP_A | SND_SOC_DAIFMT_CBM_CFM as well...

Thanks, I will remove it in next version.

> Cheers,
> Peter
>

Best Regards,
Bo Shen

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

end of thread, other threads:[~2015-01-20  1:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-16  7:19 [PATCH 1/2] ASoC: atmel_ssc_dai: fix start event for I2S mode Bo Shen
2015-01-16  7:19 ` [PATCH 2/2] ASoC: atmel_ssc_dai: remove clock pin comments Bo Shen
2015-01-19 13:54   ` Peter Rosin
2015-01-20  1:00     ` Bo Shen

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).