summaryrefslogtreecommitdiff
path: root/firmware/target/arm
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/arm')
-rw-r--r--firmware/target/arm/as3525/pcm-as3525.c11
-rw-r--r--firmware/target/arm/imx233/pcm-imx233.c6
-rw-r--r--firmware/target/arm/imx31/gigabeat-s/pcm-gigabeat-s.c24
-rw-r--r--firmware/target/arm/pcm-telechips.c5
-rw-r--r--firmware/target/arm/pnx0101/pcm-pnx0101.c5
-rw-r--r--firmware/target/arm/pp/pcm-pp.c5
-rw-r--r--firmware/target/arm/rk27xx/pcm-rk27xx.c6
-rw-r--r--firmware/target/arm/s3c2440/gigabeat-fx/pcm-meg-fx.c6
-rw-r--r--firmware/target/arm/s3c2440/mini2440/pcm-mini2440.c6
-rw-r--r--firmware/target/arm/s5l8700/pcm-s5l8700.c7
-rw-r--r--firmware/target/arm/s5l8702/pcm-s5l8702.c7
-rw-r--r--firmware/target/arm/tms320dm320/creative-zvm/pcm-creativezvm.c5
-rw-r--r--firmware/target/arm/tms320dm320/mrobe-500/pcm-mr500.c5
-rw-r--r--firmware/target/arm/tms320dm320/sansa-connect/pcm-sansaconnect.c5
14 files changed, 1 insertions, 102 deletions
diff --git a/firmware/target/arm/as3525/pcm-as3525.c b/firmware/target/arm/as3525/pcm-as3525.c
index 90b6aabd7c..dfbda388be 100644
--- a/firmware/target/arm/as3525/pcm-as3525.c
+++ b/firmware/target/arm/as3525/pcm-as3525.c
@@ -200,17 +200,6 @@ void pcm_dma_apply_settings(void)
200 0x01ffffff); 200 0x01ffffff);
201} 201}
202 202
203size_t pcm_get_bytes_waiting(void)
204{
205 int oldstatus = disable_irq_save();
206 size_t addr = DMAC_CH_SRC_ADDR(0);
207 size_t start_addr = (size_t)dma_start_addr;
208 size_t start_size = dma_start_size;
209 restore_interrupt(oldstatus);
210
211 return start_size - addr + start_addr;
212}
213
214const void * pcm_play_dma_get_peak_buffer(int *count) 203const void * pcm_play_dma_get_peak_buffer(int *count)
215{ 204{
216 int oldstatus = disable_irq_save(); 205 int oldstatus = disable_irq_save();
diff --git a/firmware/target/arm/imx233/pcm-imx233.c b/firmware/target/arm/imx233/pcm-imx233.c
index 7e20a7ce68..c06120e4aa 100644
--- a/firmware/target/arm/imx233/pcm-imx233.c
+++ b/firmware/target/arm/imx233/pcm-imx233.c
@@ -175,12 +175,6 @@ void pcm_dma_apply_settings(void)
175 pcm_play_unlock(); 175 pcm_play_unlock();
176} 176}
177 177
178size_t pcm_get_bytes_waiting(void)
179{
180 struct imx233_dma_info_t info = imx233_dma_get_info(APB_AUDIO_DAC, DMA_INFO_AHB_BYTES);
181 return info.ahb_bytes;
182}
183
184const void *pcm_play_dma_get_peak_buffer(int *count) 178const void *pcm_play_dma_get_peak_buffer(int *count)
185{ 179{
186 if(!dac_freezed) 180 if(!dac_freezed)
diff --git a/firmware/target/arm/imx31/gigabeat-s/pcm-gigabeat-s.c b/firmware/target/arm/imx31/gigabeat-s/pcm-gigabeat-s.c
index 72d8e4a021..13dff6ecb5 100644
--- a/firmware/target/arm/imx31/gigabeat-s/pcm-gigabeat-s.c
+++ b/firmware/target/arm/imx31/gigabeat-s/pcm-gigabeat-s.c
@@ -224,30 +224,6 @@ void pcm_play_dma_stop(void)
224 play_stop_pcm(); 224 play_stop_pcm();
225} 225}
226 226
227/* Return the number of bytes waiting - full L-R sample pairs only */
228size_t pcm_get_bytes_waiting(void)
229{
230 static unsigned long dsa NOCACHEBSS_ATTR;
231 long offs, size;
232 int oldstatus;
233
234 /* read burst dma source address register in channel context */
235 sdma_read_words(&dsa, CHANNEL_CONTEXT_ADDR(DMA_PLAY_CH_NUM)+0x0b, 1);
236
237 oldstatus = disable_irq_save();
238 offs = dsa - (unsigned long)dma_play_bd.buf_addr;
239 size = dma_play_bd.mode.count;
240 restore_irq(oldstatus);
241
242 /* Be addresses are coherent (no buffer change during read) */
243 if (offs >= 0 && offs < size)
244 {
245 return (size - offs) & ~3;
246 }
247
248 return 0;
249}
250
251/* Return a pointer to the samples and the number of them in *count */ 227/* Return a pointer to the samples and the number of them in *count */
252const void * pcm_play_dma_get_peak_buffer(int *count) 228const void * pcm_play_dma_get_peak_buffer(int *count)
253{ 229{
diff --git a/firmware/target/arm/pcm-telechips.c b/firmware/target/arm/pcm-telechips.c
index 9c64b58594..68bae1b0a9 100644
--- a/firmware/target/arm/pcm-telechips.c
+++ b/firmware/target/arm/pcm-telechips.c
@@ -194,11 +194,6 @@ void pcm_play_unlock(void)
194 restore_fiq(status); 194 restore_fiq(status);
195} 195}
196 196
197size_t pcm_get_bytes_waiting(void)
198{
199 return dma_play_data.size & ~3;
200}
201
202#ifdef HAVE_RECORDING 197#ifdef HAVE_RECORDING
203/* TODO: implement */ 198/* TODO: implement */
204void pcm_rec_dma_init(void) 199void pcm_rec_dma_init(void)
diff --git a/firmware/target/arm/pnx0101/pcm-pnx0101.c b/firmware/target/arm/pnx0101/pcm-pnx0101.c
index 01ead4723b..6099dcb7ef 100644
--- a/firmware/target/arm/pnx0101/pcm-pnx0101.c
+++ b/firmware/target/arm/pnx0101/pcm-pnx0101.c
@@ -192,11 +192,6 @@ void pcm_dma_apply_settings(void)
192{ 192{
193} 193}
194 194
195size_t pcm_get_bytes_waiting(void)
196{
197 return p_size & ~3;
198}
199
200const void * pcm_play_dma_get_peak_buffer(int *count) 195const void * pcm_play_dma_get_peak_buffer(int *count)
201{ 196{
202 unsigned long addr = (unsigned long)p; 197 unsigned long addr = (unsigned long)p;
diff --git a/firmware/target/arm/pp/pcm-pp.c b/firmware/target/arm/pp/pcm-pp.c
index 91d567ee83..8434123a92 100644
--- a/firmware/target/arm/pp/pcm-pp.c
+++ b/firmware/target/arm/pp/pcm-pp.c
@@ -497,11 +497,6 @@ void pcm_play_dma_stop(void)
497#endif 497#endif
498} 498}
499 499
500size_t pcm_get_bytes_waiting(void)
501{
502 return dma_play_data.size & ~3;
503}
504
505void pcm_play_dma_init(void) 500void pcm_play_dma_init(void)
506{ 501{
507 /* Initialize default register values. */ 502 /* Initialize default register values. */
diff --git a/firmware/target/arm/rk27xx/pcm-rk27xx.c b/firmware/target/arm/rk27xx/pcm-rk27xx.c
index 5cfe54f9de..c0b4c45805 100644
--- a/firmware/target/arm/rk27xx/pcm-rk27xx.c
+++ b/firmware/target/arm/rk27xx/pcm-rk27xx.c
@@ -250,12 +250,6 @@ void pcm_dma_apply_settings(void)
250 audiohw_set_frequency(pcm_fsel); 250 audiohw_set_frequency(pcm_fsel);
251} 251}
252 252
253size_t pcm_get_bytes_waiting(void)
254{
255 /* current terminate count is in transfer size units (4bytes here) */
256 return (HDMA_CCNT0 & 0xffff)<<2;
257}
258
259/* audio DMA ISR called when chunk from callers buffer has been transfered */ 253/* audio DMA ISR called when chunk from callers buffer has been transfered */
260void INT_HDMA(void) 254void INT_HDMA(void)
261{ 255{
diff --git a/firmware/target/arm/s3c2440/gigabeat-fx/pcm-meg-fx.c b/firmware/target/arm/s3c2440/gigabeat-fx/pcm-meg-fx.c
index da5dc9cdd5..d784180e77 100644
--- a/firmware/target/arm/s3c2440/gigabeat-fx/pcm-meg-fx.c
+++ b/firmware/target/arm/s3c2440/gigabeat-fx/pcm-meg-fx.c
@@ -220,12 +220,6 @@ void fiq_handler(void)
220 pcm_play_dma_status_callback(PCM_DMAST_STARTED); 220 pcm_play_dma_status_callback(PCM_DMAST_STARTED);
221} 221}
222 222
223size_t pcm_get_bytes_waiting(void)
224{
225 /* lie a little and only return full pairs */
226 return (DSTAT2 & 0xFFFFE) * 2;
227}
228
229const void * pcm_play_dma_get_peak_buffer(int *count) 223const void * pcm_play_dma_get_peak_buffer(int *count)
230{ 224{
231 unsigned long addr = DCSRC2; 225 unsigned long addr = DCSRC2;
diff --git a/firmware/target/arm/s3c2440/mini2440/pcm-mini2440.c b/firmware/target/arm/s3c2440/mini2440/pcm-mini2440.c
index dbb1a06809..9574522586 100644
--- a/firmware/target/arm/s3c2440/mini2440/pcm-mini2440.c
+++ b/firmware/target/arm/s3c2440/mini2440/pcm-mini2440.c
@@ -260,12 +260,6 @@ void fiq_handler(void)
260 pcm_play_dma_status_callback(PCM_DMAST_STARTED); 260 pcm_play_dma_status_callback(PCM_DMAST_STARTED);
261} 261}
262 262
263size_t pcm_get_bytes_waiting(void)
264{
265 /* lie a little and only return full pairs */
266 return (DSTAT2 & 0xFFFFE) * 2;
267}
268
269const void * pcm_play_dma_get_peak_buffer(int *count) 263const void * pcm_play_dma_get_peak_buffer(int *count)
270{ 264{
271 unsigned long addr = DCSRC2; 265 unsigned long addr = DCSRC2;
diff --git a/firmware/target/arm/s5l8700/pcm-s5l8700.c b/firmware/target/arm/s5l8700/pcm-s5l8700.c
index 47525611ee..050e14451d 100644
--- a/firmware/target/arm/s5l8700/pcm-s5l8700.c
+++ b/firmware/target/arm/s5l8700/pcm-s5l8700.c
@@ -259,12 +259,7 @@ void pcm_play_dma_postinit(void)
259/* set the configured PCM frequency */ 259/* set the configured PCM frequency */
260void pcm_dma_apply_settings(void) 260void pcm_dma_apply_settings(void)
261{ 261{
262 pcm_dma_set_freq(pcm_fsel); 262 pcm_dma_set_freq(pcm_fsel);
263}
264
265size_t pcm_get_bytes_waiting(void)
266{
267 return (nextsize + DMACTCNT0 + 2) << 1;
268} 263}
269 264
270const void * pcm_play_dma_get_peak_buffer(int *count) 265const void * pcm_play_dma_get_peak_buffer(int *count)
diff --git a/firmware/target/arm/s5l8702/pcm-s5l8702.c b/firmware/target/arm/s5l8702/pcm-s5l8702.c
index a62a7243a2..33fe637770 100644
--- a/firmware/target/arm/s5l8702/pcm-s5l8702.c
+++ b/firmware/target/arm/s5l8702/pcm-s5l8702.c
@@ -216,13 +216,6 @@ void pcm_play_dma_postinit(void)
216 audiohw_postinit(); 216 audiohw_postinit();
217} 217}
218 218
219size_t pcm_get_bytes_waiting(void)
220{
221 size_t total_bytes;
222 dmac_ch_get_info(&dma_play_ch, NULL, &total_bytes);
223 return total_bytes;
224}
225
226const void* pcm_play_dma_get_peak_buffer(int *count) 219const void* pcm_play_dma_get_peak_buffer(int *count)
227{ 220{
228 void *addr = dmac_ch_get_info(&dma_play_ch, count, NULL); 221 void *addr = dmac_ch_get_info(&dma_play_ch, count, NULL);
diff --git a/firmware/target/arm/tms320dm320/creative-zvm/pcm-creativezvm.c b/firmware/target/arm/tms320dm320/creative-zvm/pcm-creativezvm.c
index f31185c2ea..d5e30ad73b 100644
--- a/firmware/target/arm/tms320dm320/creative-zvm/pcm-creativezvm.c
+++ b/firmware/target/arm/tms320dm320/creative-zvm/pcm-creativezvm.c
@@ -84,8 +84,3 @@ void pcm_play_unlock(void)
84{ 84{
85 85
86} 86}
87
88size_t pcm_get_bytes_waiting(void)
89{
90 return 0;
91}
diff --git a/firmware/target/arm/tms320dm320/mrobe-500/pcm-mr500.c b/firmware/target/arm/tms320dm320/mrobe-500/pcm-mr500.c
index 0d7bcbab37..5ce5a8f399 100644
--- a/firmware/target/arm/tms320dm320/mrobe-500/pcm-mr500.c
+++ b/firmware/target/arm/tms320dm320/mrobe-500/pcm-mr500.c
@@ -120,11 +120,6 @@ void pcm_play_unlock(void)
120 120
121} 121}
122 122
123size_t pcm_get_bytes_waiting(void)
124{
125 return DSP_(_sdem_dsp_size)-DSP_(_sdem_level);
126}
127
128/* Only used when debugging */ 123/* Only used when debugging */
129static char buffer[80]; 124static char buffer[80];
130 125
diff --git a/firmware/target/arm/tms320dm320/sansa-connect/pcm-sansaconnect.c b/firmware/target/arm/tms320dm320/sansa-connect/pcm-sansaconnect.c
index c2932fd762..f9f19a8045 100644
--- a/firmware/target/arm/tms320dm320/sansa-connect/pcm-sansaconnect.c
+++ b/firmware/target/arm/tms320dm320/sansa-connect/pcm-sansaconnect.c
@@ -127,11 +127,6 @@ void pcm_play_unlock(void)
127 127
128} 128}
129 129
130size_t pcm_get_bytes_waiting(void)
131{
132 return DSP_(_sdem_dsp_size)-DSP_(_sdem_level);
133}
134
135/* Only used when debugging */ 130/* Only used when debugging */
136static char buffer[80]; 131static char buffer[80];
137 132