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.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/firmware/target/arm/pcm-pp.c b/firmware/target/arm/pcm-pp.c
index e483700e88..41bd92bd0d 100644
--- a/firmware/target/arm/pcm-pp.c
+++ b/firmware/target/arm/pcm-pp.c
@@ -93,13 +93,7 @@ void fiq(void)
93 "bls .fifo_full \n\t" /* FIFO full, exit */ 93 "bls .fifo_full \n\t" /* FIFO full, exit */
94 "ldr r10, [r9], #4 \n\t" /* load two samples */ 94 "ldr r10, [r9], #4 \n\t" /* load two samples */
95#ifdef HAVE_AS3514 95#ifdef HAVE_AS3514
96 /* The AS3514 reads 3 bytes at a time, it seems, ignoring the lowest. 96 "str r10, [r12, #0x40]\n\t" /* write them */
97 This code seems to work well, but we may have to mask off the extra
98 bits - at the expense of a few extra cycles in the FIQ */
99 "mov r10, r10, ror #2\n\t" /* put left sample at the top bits */
100 "str r10, [r12, #0x40]\n\t" /* write top sample, lower sample ignored */
101 "mov r10, r10, ror #16\n\t" /* put left sample at the top bits */
102 "str r10, [r12, #0x40]\n\t" /* then write it */
103#else 97#else
104 "mov r10, r10, ror #16\n\t" /* put left sample at the top bits */ 98 "mov r10, r10, ror #16\n\t" /* put left sample at the top bits */
105 "str r10, [r12, #0x40]\n\t" /* write top sample, lower sample ignored */ 99 "str r10, [r12, #0x40]\n\t" /* write top sample, lower sample ignored */
@@ -184,8 +178,13 @@ void fiq(void)
184 return; 178 return;
185 } 179 }
186 180
181#ifdef HAVE_AS3514
182 IISFIFO_WR = *(int32_t *)p;
183 p += 2;
184#else
187 IISFIFO_WR = (*(p++))<<16; 185 IISFIFO_WR = (*(p++))<<16;
188 IISFIFO_WR = (*(p++))<<16; 186 IISFIFO_WR = (*(p++))<<16;
187#endif
189 p_size-=4; 188 p_size-=4;
190 } 189 }
191 190
@@ -240,8 +239,13 @@ void pcm_play_dma_start(const void *addr, size_t size)
240 return; 239 return;
241 } 240 }
242 241
242#ifdef HAVE_AS3514
243 IISFIFO_WR = *(int32_t *)p;
244 p += 2;
245#else
243 IISFIFO_WR = (*(p++))<<16; 246 IISFIFO_WR = (*(p++))<<16;
244 IISFIFO_WR = (*(p++))<<16; 247 IISFIFO_WR = (*(p++))<<16;
248#endif
245 p_size-=4; 249 p_size-=4;
246 } 250 }
247} 251}
@@ -315,8 +319,13 @@ void pcm_play_pause_unpause(void)
315 return; 319 return;
316 } 320 }
317 321
322#ifdef HAVE_AS3514
323 IISFIFO_WR = *(int32_t *)p;
324 p += 2;
325#else
318 IISFIFO_WR = (*(p++))<<16; 326 IISFIFO_WR = (*(p++))<<16;
319 IISFIFO_WR = (*(p++))<<16; 327 IISFIFO_WR = (*(p++))<<16;
328#endif
320 p_size-=4; 329 p_size-=4;
321 } 330 }
322} 331}