forked from len0rd/rockbox
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
This commit is contained in:
parent
e8e06f81f9
commit
0dc76136ca
1 changed files with 15 additions and 6 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue