summaryrefslogtreecommitdiff
path: root/firmware/target
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target')
-rw-r--r--firmware/target/arm/tms320dm320/creative-zvm/pcm-creativezvm.c58
1 files changed, 46 insertions, 12 deletions
diff --git a/firmware/target/arm/tms320dm320/creative-zvm/pcm-creativezvm.c b/firmware/target/arm/tms320dm320/creative-zvm/pcm-creativezvm.c
index 6501125f9e..49f75c26ce 100644
--- a/firmware/target/arm/tms320dm320/creative-zvm/pcm-creativezvm.c
+++ b/firmware/target/arm/tms320dm320/creative-zvm/pcm-creativezvm.c
@@ -22,21 +22,59 @@
22#include "audio.h" 22#include "audio.h"
23#include "sound.h" 23#include "sound.h"
24#include "file.h" 24#include "file.h"
25#include "dm320.h"
26#include "audiohw.h"
27#include "dsp-target.h"
25 28
26void pcm_postinit(void) 29void pcm_play_dma_init(void)
27{ 30{
31 IO_CLK_O1DIV = 3;
32 /* Set GIO25 to CLKOUT1A */
33 IO_GIO_FSEL2 |= 3;
34 sleep(5);
35
36 audiohw_init();
28 37
38 audiohw_set_frequency(1);
39
40 /* init DSP */
41 dsp_init();
29} 42}
30 43
31const void * pcm_play_dma_get_peak_buffer(int *count) 44void pcm_postinit(void)
32{ 45{
33 (void) count; 46 audiohw_postinit();
34 return 0; 47 /* wake DSP */
48 dsp_wake();
35} 49}
36 50
37void pcm_play_dma_init(void) 51/* set frequency used by the audio hardware */
52void pcm_set_frequency(unsigned int frequency)
38{ 53{
54 int index;
55
56 switch(frequency)
57 {
58 case SAMPR_11:
59 case SAMPR_22:
60 index = 0;
61 break;
62 default:
63 case SAMPR_44:
64 index = 1;
65 break;
66 case SAMPR_88:
67 index = 2;
68 break;
69 }
70
71 audiohw_set_frequency(index);
72} /* pcm_set_frequency */
39 73
74const void * pcm_play_dma_get_peak_buffer(int *count)
75{
76 (void) count;
77 return 0;
40} 78}
41 79
42void pcm_apply_settings(void) 80void pcm_apply_settings(void)
@@ -44,15 +82,11 @@ void pcm_apply_settings(void)
44 82
45} 83}
46 84
47void pcm_set_frequency(unsigned int frequency)
48{
49 (void) frequency;
50}
51
52void pcm_play_dma_start(const void *addr, size_t size) 85void pcm_play_dma_start(const void *addr, size_t size)
53{ 86{
54 (void) addr; 87 (void)addr;
55 (void) size; 88 (void)size;
89 DEBUGF("pcm_play_dma_start(0x%x, %d)", addr, size);
56} 90}
57 91
58void pcm_play_dma_stop(void) 92void pcm_play_dma_stop(void)