summaryrefslogtreecommitdiff
path: root/firmware/target/arm/pcm-pp.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/arm/pcm-pp.c')
-rw-r--r--firmware/target/arm/pcm-pp.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/firmware/target/arm/pcm-pp.c b/firmware/target/arm/pcm-pp.c
index e37ee9aaad..cbc1c17fbb 100644
--- a/firmware/target/arm/pcm-pp.c
+++ b/firmware/target/arm/pcm-pp.c
@@ -94,11 +94,11 @@ static int sr_ctrl = MROBE100_44100HZ;
94#endif 94#endif
95 95
96void pcm_set_frequency(unsigned int frequency) 96void pcm_set_frequency(unsigned int frequency)
97{ 97{
98#ifdef HAVE_WM8731 98#ifdef HAVE_WM8731
99 pcm_freq = frequency; 99 pcm_freq = frequency;
100#else 100#else
101 (void)frequency; 101 (void)frequency;
102 pcm_freq = HW_SAMPR_DEFAULT; 102 pcm_freq = HW_SAMPR_DEFAULT;
103#endif 103#endif
104#ifdef HAVE_WM8751 104#ifdef HAVE_WM8751
@@ -113,7 +113,7 @@ void pcm_apply_settings(void)
113#endif 113#endif
114 114
115#ifdef HAVE_WM8731 115#ifdef HAVE_WM8731
116 audiohw_set_sample_rate(pcm_freq); 116 audiohw_set_sample_rate(pcm_freq);
117#endif 117#endif
118 pcm_curr_sampr = pcm_freq; 118 pcm_curr_sampr = pcm_freq;
119} 119}
@@ -144,7 +144,7 @@ void fiq_playback(void)
144 */ 144 */
145 asm volatile ( 145 asm volatile (
146 "stmfd sp!, { r0-r3, lr } \n" /* stack scratch regs and lr */ 146 "stmfd sp!, { r0-r3, lr } \n" /* stack scratch regs and lr */
147 147
148#if CONFIG_CPU == PP5002 148#if CONFIG_CPU == PP5002
149 "ldr r12, =0xcf001040 \n" /* Some magic from iPodLinux */ 149 "ldr r12, =0xcf001040 \n" /* Some magic from iPodLinux */
150 "ldr r12, [r12] \n" 150 "ldr r12, [r12] \n"
@@ -157,12 +157,12 @@ void fiq_playback(void)
157 ".check_fifo: \n" 157 ".check_fifo: \n"
158 "ldr r0, [r10, %[cfg]] \n" /* read IISFIFO_CFG to check FIFO status */ 158 "ldr r0, [r10, %[cfg]] \n" /* read IISFIFO_CFG to check FIFO status */
159 "and r0, r0, %[mask] \n" /* r0 = IIS_TX_FREE_COUNT << 16 (PP502x) */ 159 "and r0, r0, %[mask] \n" /* r0 = IIS_TX_FREE_COUNT << 16 (PP502x) */
160 160
161 "mov r1, r0, lsr #16 \n" /* number of free FIFO slots */ 161 "mov r1, r0, lsr #16 \n" /* number of free FIFO slots */
162 "cmp r1, r9, lsr #2 \n" /* number of words from source */ 162 "cmp r1, r9, lsr #2 \n" /* number of words from source */
163 "movgt r1, r9, lsr #2 \n" /* r1 = amount of allowed loops */ 163 "movgt r1, r9, lsr #2 \n" /* r1 = amount of allowed loops */
164 "sub r9, r9, r1, lsl #2 \n" /* r1 words will be written in following loop */ 164 "sub r9, r9, r1, lsl #2 \n" /* r1 words will be written in following loop */
165 165
166 "subs r1, r1, #2 \n" 166 "subs r1, r1, #2 \n"
167 ".fifo_loop_2: \n" 167 ".fifo_loop_2: \n"
168 "ldmgeia r8!, {r2, r12} \n" /* load four samples */ 168 "ldmgeia r8!, {r2, r12} \n" /* load four samples */
@@ -170,15 +170,15 @@ void fiq_playback(void)
170 "strge r12, [r10, %[wr]] \n" /* write sample 2-3 to IISFIFO_WR */ 170 "strge r12, [r10, %[wr]] \n" /* write sample 2-3 to IISFIFO_WR */
171 "subges r1, r1, #2 \n" /* one more loop? */ 171 "subges r1, r1, #2 \n" /* one more loop? */
172 "bge .fifo_loop_2 \n" /* yes, continue */ 172 "bge .fifo_loop_2 \n" /* yes, continue */
173 173
174 "tst r1, #1 \n" /* two samples (one word) left? */ 174 "tst r1, #1 \n" /* two samples (one word) left? */
175 "ldrne r12, [r8], #4 \n" /* load two samples */ 175 "ldrne r12, [r8], #4 \n" /* load two samples */
176 "strne r12, [r10, %[wr]] \n" /* write sample 0-1 to IISFIFO_WR */ 176 "strne r12, [r10, %[wr]] \n" /* write sample 0-1 to IISFIFO_WR */
177 177
178 "cmp r9, #0 \n" /* either FIFO is full or source buffer is empty */ 178 "cmp r9, #0 \n" /* either FIFO is full or source buffer is empty */
179 "bgt .exit \n" /* if source buffer is not empty, FIFO must be full */ 179 "bgt .exit \n" /* if source buffer is not empty, FIFO must be full */
180#elif SAMPLE_SIZE == 32 180#elif SAMPLE_SIZE == 32
181 ".check_fifo: \n" 181 ".check_fifo: \n"
182 "ldr r0, [r10, %[cfg]] \n" /* read IISFIFO_CFG to check FIFO status */ 182 "ldr r0, [r10, %[cfg]] \n" /* read IISFIFO_CFG to check FIFO status */
183 "and r0, r0, %[mask] \n" /* r0 = IIS_TX_FREE_COUNT << 23 (PP5002) */ 183 "and r0, r0, %[mask] \n" /* r0 = IIS_TX_FREE_COUNT << 23 (PP5002) */
184 184
@@ -187,7 +187,7 @@ void fiq_playback(void)
187 "cmp r1, r9, lsr #2 \n" /* number of words from source */ 187 "cmp r1, r9, lsr #2 \n" /* number of words from source */
188 "movgt r1, r9, lsr #2 \n" /* r1 = amount of allowed loops */ 188 "movgt r1, r9, lsr #2 \n" /* r1 = amount of allowed loops */
189 "sub r9, r9, r1, lsl #2 \n" /* r1 words will be written in following loop */ 189 "sub r9, r9, r1, lsl #2 \n" /* r1 words will be written in following loop */
190 190
191 ".fifo_loop: \n" 191 ".fifo_loop: \n"
192 "ldr r12, [r8], #4 \n" /* load two samples */ 192 "ldr r12, [r8], #4 \n" /* load two samples */
193 "mov r2 , r12, lsl #16 \n" /* put left sample at the top bits */ 193 "mov r2 , r12, lsl #16 \n" /* put left sample at the top bits */
@@ -195,11 +195,11 @@ void fiq_playback(void)
195 "str r12, [r10, %[wr]] \n" /* write low sample to IISFIFO_WR*/ 195 "str r12, [r10, %[wr]] \n" /* write low sample to IISFIFO_WR*/
196 "subs r1, r1, #1 \n" /* one more loop? */ 196 "subs r1, r1, #1 \n" /* one more loop? */
197 "bgt .fifo_loop \n" /* yes, continue */ 197 "bgt .fifo_loop \n" /* yes, continue */
198 198
199 "cmp r9, #0 \n" /* either FIFO is full or source buffer is empty */ 199 "cmp r9, #0 \n" /* either FIFO is full or source buffer is empty */
200 "bgt .exit \n" /* if source buffer is not empty, FIFO must be full */ 200 "bgt .exit \n" /* if source buffer is not empty, FIFO must be full */
201#endif 201#endif
202 202
203 ".more_data: \n" 203 ".more_data: \n"
204 "ldr r2, =pcm_callback_for_more \n" 204 "ldr r2, =pcm_callback_for_more \n"
205 "ldr r2, [r2] \n" /* get callback address */ 205 "ldr r2, [r2] \n" /* get callback address */