public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sound/soc/atmel: Add slave mode support to SSC in DSP Mode A
@ 2013-02-20 16:31 Zoltan Puskas
  2013-02-20 16:47 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Zoltan Puskas @ 2013-02-20 16:31 UTC (permalink / raw)
  To: Bo Shen, Mark Brown; +Cc: linux-kernel

From: Zoltan Puskas <zpuskas@dension.com>

Add previously unsupported slave mode to the SSC peripheral when using
DSP/PCM Mode A format on the Atmel ARM platform.


Signed-off-by: Zoltan Puskas <zpuskas@dension.com>
---
The code was tested using WM8804 and WM8731 digital sound chips,
using 3.7.9 and 3.3.1 kernels on a system with AT91SAM9261 CPU
on board.

--- linux-3.7.9/sound/soc/atmel/atmel_ssc_dai.c.orig	2013-02-19 15:43:43.070980604 +0100
+++ linux-3.7.9/sound/soc/atmel/atmel_ssc_dai.c	2013-02-19 15:50:07.613586313 +0100
@@ -543,6 +543,49 @@ static int atmel_ssc_hw_params(struct sn
 		break;
 
 	case SND_SOC_DAIFMT_DSP_A | SND_SOC_DAIFMT_CBM_CFM:
+		/*
+		 * DSP/PCM Mode A 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.
+		 *
+		 * Data is transferred on first BCLK after LRC pulse rising
+		 * edge.If stereo, the right channel data is contiguous with
+		 * the left channel data.
+		 */
+		rcmr =	  SSC_BF(RCMR_PERIOD, 0)
+			| SSC_BF(RCMR_STTDLY, START_DELAY)
+			| SSC_BF(RCMR_START, SSC_START_RISING_RF)
+			| SSC_BF(RCMR_CKI, SSC_CKI_RISING)
+			| SSC_BF(RCMR_CKO, SSC_CKO_NONE)
+			| SSC_BF(RCMR_CKS, SSC_CKS_PIN);
+
+		rfmr =	  SSC_BF(RFMR_FSEDGE, SSC_FSEDGE_POSITIVE)
+			| SSC_BF(RFMR_FSOS, SSC_FSOS_NONE)
+			| SSC_BF(RFMR_FSLEN, 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, SSC_START_RISING_RF)
+			| SSC_BF(TCMR_CKI, SSC_CKI_FALLING)
+			| SSC_BF(TCMR_CKO, SSC_CKO_NONE)
+			| SSC_BF(TCMR_CKS, SSC_CKS_PIN);
+
+		tfmr =	  SSC_BF(TFMR_FSEDGE, SSC_FSEDGE_POSITIVE)
+			| SSC_BF(TFMR_FSDEN, 0)
+			| SSC_BF(TFMR_FSOS, SSC_FSOS_NONE)
+			| SSC_BF(TFMR_FSLEN, 0)
+			| SSC_BF(TFMR_DATNB, (channels - 1))
+			| SSC_BIT(TFMR_MSBF)
+			| SSC_BF(TFMR_DATDEF, 0)
+			| SSC_BF(TFMR_DATLEN, (bits - 1));
+		break;
+
 	default:
 		printk(KERN_WARNING "atmel_ssc_dai: unsupported DAI format 0x%x\n",
 			ssc_p->daifmt);



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

* Re: [PATCH] sound/soc/atmel: Add slave mode support to SSC in DSP Mode A
  2013-02-20 16:31 [PATCH] sound/soc/atmel: Add slave mode support to SSC in DSP Mode A Zoltan Puskas
@ 2013-02-20 16:47 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2013-02-20 16:47 UTC (permalink / raw)
  To: Zoltan Puskas; +Cc: Bo Shen, linux-kernel

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

On Wed, Feb 20, 2013 at 05:31:35PM +0100, Zoltan Puskas wrote:
> From: Zoltan Puskas <zpuskas@dension.com>
> 
> Add previously unsupported slave mode to the SSC peripheral when using
> DSP/PCM Mode A format on the Atmel ARM platform.

Applied, but please always use subject lines appropriate for the
subsystem.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

end of thread, other threads:[~2013-02-20 16:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-20 16:31 [PATCH] sound/soc/atmel: Add slave mode support to SSC in DSP Mode A Zoltan Puskas
2013-02-20 16:47 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox