diff options
-rw-r--r-- | firmware/target/arm/rk27xx/pcm-rk27xx.c | 21 |
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) |