summaryrefslogtreecommitdiff
path: root/firmware/target/arm/rk27xx
diff options
context:
space:
mode:
authorMarcin Bukat <marcin.bukat@gmail.com>2011-10-13 07:09:44 +0000
committerMarcin Bukat <marcin.bukat@gmail.com>2011-10-13 07:09:44 +0000
commit0dc76136ca3fcf46b9a9993b75e7e7ed1e76816c (patch)
tree3f9eff1c6a052489b46e7cab5f0651dd3cf14970 /firmware/target/arm/rk27xx
parente8e06f81f986de8dc73d64e16524be1f8a42a3ba (diff)
rk27xx - add support for i2s in master mode. Based on patch by Andrew Ryabinin
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30746 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm/rk27xx')
-rw-r--r--firmware/target/arm/rk27xx/pcm-rk27xx.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/firmware/target/arm/rk27xx/pcm-rk27xx.c b/firmware/target/arm/rk27xx/pcm-rk27xx.c
index 87830f47b4..b8ae56adaf 100644
--- a/firmware/target/arm/rk27xx/pcm-rk27xx.c
+++ b/firmware/target/arm/rk27xx/pcm-rk27xx.c
@@ -130,7 +130,7 @@ static void i2s_init(void)
{
#if defined(HAVE_RK27XX_CODEC)
/* iomux I2S internal */
- SCU_IOMUXA_CON &= ~(1<<18); /* i2s external bit */
+ SCU_IOMUXA_CON &= ~(1<<19); /* i2s external bit */
SCU_IOMUXB_CON &= ~((1<<4) | /* i2s_mclk */
(1<<3) | /* i2s_sdo */
(1<<2) | /* i2s_sdi */
@@ -138,7 +138,7 @@ static void i2s_init(void)
(1<<0)); /* i2s_bck */
#else
/* iomux I2S external */
- SCU_IOMUXA_CON |= (1<<18); /* i2s external bit */
+ SCU_IOMUXA_CON |= (1<<19); /* i2s external bit */
SCU_IOMUXB_CON |= ((1<<4) | /* i2s_mclk */
(1<<3) | /* i2s_sdo */
(1<<2) | /* i2s_sdi */
@@ -152,14 +152,18 @@ static void i2s_init(void)
/* configure I2S module */
I2S_IER = 0; /* disable all i2s interrupts */
-
+
I2S_TXCTL = (1<<16) | /* LRCK/SCLK = 64 */
(4<<8) | /* MCLK/SCLK = 4 */
(1<<4) | /* 16bit samples */
(0<<3) | /* stereo */
(0<<1) | /* I2S IF */
+#ifdef CODEC_SLAVE
+ (1<<0); /* master mode */
+#else
(0<<0); /* slave mode */
-
+#endif
+
/* the fifo is 16x32bits according to my tests
* while the docs state 32x32bits
*/
@@ -173,8 +177,13 @@ static void i2s_init(void)
(0<<4) | /* Req1 for Tx fifo */
(1<<3) | /* Req2 for Rx fifo */
(0<<2) | /* normal operation */
- (0<<1) | /* start Tx (in master mode) */
- (0<<0); /* start Rx (in master mode) */
+#ifdef CODEC_SLAVE
+ (1<<1) | /* start Tx (master mode) */
+ (1<<0); /* start Rx (master mode) */
+#else
+ (0<<1) | /* not used in slave mode */
+ (0<<0); /* not used in slave mode */
+#endif
}
void pcm_play_dma_init(void)