diff options
Diffstat (limited to 'firmware/target/arm/s5l8702')
-rw-r--r-- | firmware/target/arm/s5l8702/pcm-s5l8702.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/firmware/target/arm/s5l8702/pcm-s5l8702.c b/firmware/target/arm/s5l8702/pcm-s5l8702.c index 1974c47d51..cbfe6ea007 100644 --- a/firmware/target/arm/s5l8702/pcm-s5l8702.c +++ b/firmware/target/arm/s5l8702/pcm-s5l8702.c | |||
@@ -139,16 +139,28 @@ void pcm_play_dma_pause(bool pause) | |||
139 | else I2STXCOM &= ~1; | 139 | else I2STXCOM &= ~1; |
140 | } | 140 | } |
141 | 141 | ||
142 | /* MCLK = 12MHz (MCLKDIV2=1), [CS42L55 DS, s4.8] */ | ||
143 | #define MCLK_FREQ 12000000 | ||
144 | |||
145 | /* set the configured PCM frequency */ | ||
146 | void pcm_dma_apply_settings(void) | ||
147 | { | ||
148 | /* configure I2S clock ratio */ | ||
149 | I2SCLKDIV = MCLK_FREQ / hw_freq_sampr[pcm_fsel]; | ||
150 | /* select CS42L55 sample rate */ | ||
151 | audiohw_set_frequency(pcm_fsel); | ||
152 | } | ||
153 | |||
142 | void pcm_play_dma_init(void) | 154 | void pcm_play_dma_init(void) |
143 | { | 155 | { |
144 | PWRCON(0) &= ~(1 << 4); | 156 | PWRCON(0) &= ~(1 << 4); |
145 | PWRCON(1) &= ~(1 << 7); | 157 | PWRCON(1) &= ~(1 << 7); |
146 | I2S40 = 0x110; | ||
147 | I2STXCON = 0xb100019; | 158 | I2STXCON = 0xb100019; |
148 | I2SCLKCON = 1; | 159 | I2SCLKCON = 1; |
149 | VIC0INTENABLE = 1 << IRQ_DMAC0; | 160 | VIC0INTENABLE = 1 << IRQ_DMAC0; |
150 | 161 | ||
151 | audiohw_preinit(); | 162 | audiohw_preinit(); |
163 | pcm_dma_apply_settings(); | ||
152 | } | 164 | } |
153 | 165 | ||
154 | void pcm_play_dma_postinit(void) | 166 | void pcm_play_dma_postinit(void) |
@@ -156,10 +168,6 @@ void pcm_play_dma_postinit(void) | |||
156 | audiohw_postinit(); | 168 | audiohw_postinit(); |
157 | } | 169 | } |
158 | 170 | ||
159 | void pcm_dma_apply_settings(void) | ||
160 | { | ||
161 | } | ||
162 | |||
163 | size_t pcm_get_bytes_waiting(void) | 171 | size_t pcm_get_bytes_waiting(void) |
164 | { | 172 | { |
165 | int bytes = pcm_remaining; | 173 | int bytes = pcm_remaining; |