diff mbox series

[3/5] ASoC: atmel_ssc_dai: implement left-justified data mode

Message ID ca3d0b124cdf6e2d0ec158a7948f08dd8abfd3b7.1563819483.git.mirq-linux@rere.qmqm.pl (mailing list archive)
State New, archived
Headers show
Series ASoC: atmel: extend SSC support | expand

Commit Message

Michał Mirosław July 22, 2019, 6:27 p.m. UTC
Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
---
 sound/soc/atmel/atmel_ssc_dai.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

Comments

Codrin Ciubotariu July 25, 2019, 1:15 p.m. UTC | #1
On 22.07.2019 21:27, Michał Mirosław wrote:
> External E-Mail
> 
> 
> Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
> ---
>   sound/soc/atmel/atmel_ssc_dai.c | 13 +++++++++++++
>   1 file changed, 13 insertions(+)
> 
> diff --git a/sound/soc/atmel/atmel_ssc_dai.c b/sound/soc/atmel/atmel_ssc_dai.c
> index b2992496e52f..04541d7c33fe 100644
> --- a/sound/soc/atmel/atmel_ssc_dai.c
> +++ b/sound/soc/atmel/atmel_ssc_dai.c
> @@ -564,7 +564,20 @@ static int atmel_ssc_hw_params(struct snd_pcm_substream *substream,
>   
>   	switch (ssc_p->daifmt & SND_SOC_DAIFMT_FORMAT_MASK) {
>   
> +	case SND_SOC_DAIFMT_LEFT_J:
> +		/* left-justified format */
> +		fs_osync = SSC_FSOS_POSITIVE;
> +
> +		rcmr =	  SSC_BF(RCMR_STTDLY, 0)
> +			| SSC_BF(RCMR_START, SSC_START_RISING_RF);
> +
> +		tcmr =	  SSC_BF(TCMR_STTDLY, 0)
> +			| SSC_BF(TCMR_START, SSC_START_RISING_RF);
> +
> +		break;
> +
>   	case SND_SOC_DAIFMT_I2S:
> +		/* I2S format = left-justified with start bit and inverted LRCLK */
>   		fs_osync = SSC_FSOS_NEGATIVE;
>   
>   		rcmr =	  SSC_BF(RCMR_STTDLY, 1)
> 

Reviewed-by: Codrin Ciubotariu <codrin.ciubotariu@microchip.com>

Thanks and best regards,
Codrin
diff mbox series

Patch

diff --git a/sound/soc/atmel/atmel_ssc_dai.c b/sound/soc/atmel/atmel_ssc_dai.c
index b2992496e52f..04541d7c33fe 100644
--- a/sound/soc/atmel/atmel_ssc_dai.c
+++ b/sound/soc/atmel/atmel_ssc_dai.c
@@ -564,7 +564,20 @@  static int atmel_ssc_hw_params(struct snd_pcm_substream *substream,
 
 	switch (ssc_p->daifmt & SND_SOC_DAIFMT_FORMAT_MASK) {
 
+	case SND_SOC_DAIFMT_LEFT_J:
+		/* left-justified format */
+		fs_osync = SSC_FSOS_POSITIVE;
+
+		rcmr =	  SSC_BF(RCMR_STTDLY, 0)
+			| SSC_BF(RCMR_START, SSC_START_RISING_RF);
+
+		tcmr =	  SSC_BF(TCMR_STTDLY, 0)
+			| SSC_BF(TCMR_START, SSC_START_RISING_RF);
+
+		break;
+
 	case SND_SOC_DAIFMT_I2S:
+		/* I2S format = left-justified with start bit and inverted LRCLK */
 		fs_osync = SSC_FSOS_NEGATIVE;
 
 		rcmr =	  SSC_BF(RCMR_STTDLY, 1)