Skip to contentSkip to conversation

ASoC: pxa-ssp.c handle the I2S and LEFT_J cases.

PATCH In review Daniel Ribeiro 3 participants 4 messages Jun 16, 2009 – Jun 17, 2009

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

PATCH 3/3 ASoC: pxa-ssp.c handle the I2S and LEFT_J cases.

Handles I2S and LEFT_J cases, if the user does _not_ call set_tdm_slot we assume that the codec is I2S compliant, and that we can use frame_width = sample_width * channels.

If the user calls set_tdm_slot then we assume that the wire is _not_ networked, and that the user wants to set a non-standard frame format instead, in this case we set the frame duration (the LRCLK falling edge) to be half of the wire frame width.

eg.
* standard 2*[16|24|32|..] bits I2S/LEFT_J doesn't need to call set_tdm_slot
* to use 2*16bits I2S/LEFTJ on 64bits frames, with the LRCLK falling edge at the 32nd bitclk (+1 for I2S) needs to set_tdm_slot(5, 5, 4, 16) (4 slots of 16 bits, first and third RX/TX slots active). This should work even if pxa is slave of SFRM.

---
 arch/arm/mach-pxa/include/mach/regs-ssp.h |   14 ++--
 sound/soc/pxa/pxa-ssp.c                   |  121 +++++++++++++---------------
 2 files changed, 63 insertions(+), 72 deletions(-)
arch/arm/mach-pxa/include/mach/regs-ssp.h +7 -7
index 6a2ed35..060e23b 100644
@@ -108,21 +108,21 @@
 #define SSSR_TINT		(1 << 19)	/* Receiver Time-out Interrupt */
 #define SSSR_PINT		(1 << 18)	/* Peripheral Trailing Byte Interrupt */
 
-#if defined(CONFIG_PXA3xx)
-#define SSPSP_EDMYSTOP(x)	((x) << 28)     /* Extended Dummy Stop */
-#define SSPSP_EDMYSTRT(x)	((x) << 26)     /* Extended Dummy Start */
-#endif
-
 #define SSPSP_FSRT		(1 << 25)	/* Frame Sync Relative Timing */
-#define SSPSP_DMYSTOP(x)	((x) << 23)	/* Dummy Stop */
 #define SSPSP_SFRMWDTH(x)	((x) << 16)	/* Serial Frame Width */
 #define SSPSP_SFRMDLY(x)	((x) << 9)	/* Serial Frame Delay */
-#define SSPSP_DMYSTRT(x)	((x) << 7)	/* Dummy Start */
 #define SSPSP_STRTDLY(x)	((x) << 4)	/* Start Delay */
 #define SSPSP_ETDS		(1 << 3)	/* End of Transfer data State */
 #define SSPSP_SFRMP		(1 << 2)	/* Serial Frame Polarity */
 #define SSPSP_SCMODE(x)		((x) << 0)	/* Serial Bit Rate Clock Mode */
 
+/* NOTE: PXA3xx extends the bit number of dummy start and stop, the macros
+ * below are compatible with PXA25x/27x as long as the parameter is within
+ * the correct limits, driver code has to take care of this.
+ */
+#define SSPSP_DMYSTRT(x)       ((((x) & 3) << 7)  | ((((x) >> 2) & 3) << 26))
+#define SSPSP_DMYSTOP(x)       ((((x) & 3) << 23) | ((((x) >> 2) & 7) << 28))
+
 #define SSACD_SCDB		(1 << 3)	/* SSPSYSCLK Divider Bypass */
 #define SSACD_ACPS(x)		((x) << 4)	/* Audio clock PLL select */
 #define SSACD_ACDS(x)		((x) << 0)	/* Audio clock divider select */
sound/soc/pxa/pxa-ssp.c +56 -65

150 lines not on this page · raw message

Signature · 4 lines
tg: (119677b..) asoc/leftj-and-i2s (depends on: asoc/ssp-internals)

-- 
Daniel Ribeiro

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

#1 lore raw
Quoted 1 line · Daniel Ribeiro
 arch/arm/mach-pxa/include/mach/regs-ssp.h |   14 ++--

Eric, are you happy for this change to go via ALSA? It seems reasonable enough.

I'm happy with these changes from a code review point of view, though as well as Eric's ack I'll do some more testing before I apply them. Thanks a lot for doing this work.

#2 lore raw
Quoted 10 lines · Mark Brown
Quoted 1 line · Daniel Ribeiro
 arch/arm/mach-pxa/include/mach/regs-ssp.h |   14 ++--

Eric, are you happy for this change to go via ALSA? It seems reasonable enough.

I'm happy with these changes from a code review point of view, though as well as Eric's ack I'll do some more testing before I apply them. Thanks a lot for doing this work.

OK, I'll take some time to verify that on PXA3xx.

#3 lore raw
Quoted 7 lines · Eric Miao
Quoted 3 lines · Mark Brown

I'm happy with these changes from a code review point of view, though as well as Eric's ack I'll do some more testing before I apply them. Thanks a lot for doing this work.

OK, I'll take some time to verify that on PXA3xx.

If you could cover PXA32x that'd be really helpful - I have PXA300 here. They should be identical but more coverage is always better.