summaryrefslogtreecommitdiff
path: root/firmware/target/mips/ingenic_jz47xx/pcm-jz4740.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/mips/ingenic_jz47xx/pcm-jz4740.c')
-rw-r--r--firmware/target/mips/ingenic_jz47xx/pcm-jz4740.c164
1 files changed, 164 insertions, 0 deletions
diff --git a/firmware/target/mips/ingenic_jz47xx/pcm-jz4740.c b/firmware/target/mips/ingenic_jz47xx/pcm-jz4740.c
new file mode 100644
index 0000000000..a5cc61b844
--- /dev/null
+++ b/firmware/target/mips/ingenic_jz47xx/pcm-jz4740.c
@@ -0,0 +1,164 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2008 by Maurus Cuelenaere
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21
22#include "system.h"
23#include "kernel.h"
24#include "logf.h"
25#include "audio.h"
26#include "sound.h"
27#include "pcm.h"
28#include "jz4740.h"
29
30/****************************************************************************
31 ** Playback DMA transfer
32 **/
33
34void pcm_postinit(void)
35{
36 audiohw_postinit(); /* implemented not for all codecs */
37 pcm_apply_settings();
38}
39
40const void * pcm_play_dma_get_peak_buffer(int *count)
41{
42 /* TODO */
43 *count = 0;
44 return NULL;
45}
46
47void pcm_play_dma_init(void)
48{
49 /* TODO */
50
51 /* Initialize default register values. */
52 audiohw_init();
53
54 /* Power on */
55 audiohw_enable_output(true);
56
57 /* Unmute the master channel (DAC should be at zero point now). */
58 audiohw_mute(false);
59}
60
61void pcm_apply_settings(void)
62{
63 /* TODO */
64}
65
66void pcm_set_frequency(unsigned int frequency)
67{
68 (void) frequency;
69 /* TODO */
70}
71
72static void play_start_pcm(void)
73{
74 pcm_apply_settings();
75
76 /* TODO */
77}
78
79static void play_stop_pcm(void)
80{
81 /* TODO */
82}
83
84void pcm_play_dma_start(const void *addr, size_t size)
85{
86 (void)addr;
87 (void)size;
88 /* TODO */
89
90 play_start_pcm();
91}
92
93void pcm_play_dma_stop(void)
94{
95 play_stop_pcm();
96
97 /* TODO */
98}
99
100void pcm_play_lock(void)
101{
102 /* TODO */
103}
104
105void pcm_play_unlock(void)
106{
107 /* TODO */
108}
109
110void pcm_play_dma_pause(bool pause)
111{
112 if(pause)
113 play_stop_pcm();
114 else
115 play_start_pcm();
116
117}
118
119size_t pcm_get_bytes_waiting(void)
120{
121 /* TODO */
122 return 0;
123}
124
125#ifdef HAVE_RECORDING
126/* TODO */
127void pcm_rec_dma_init(void)
128{
129}
130
131void pcm_rec_dma_close(void)
132{
133}
134
135void pcm_rec_dma_start(void *addr, size_t size)
136{
137 (void) addr;
138 (void) size;
139}
140
141void pcm_rec_dma_stop(void)
142{
143}
144
145void pcm_rec_lock(void)
146{
147}
148
149void pcm_rec_unlock(void)
150{
151}
152
153const void * pcm_rec_dma_get_peak_buffer(int *count)
154{
155 *count = 0;
156 return NULL;
157}
158
159void pcm_record_more(void *start, size_t size)
160{
161 (void) start;
162 (void) size;
163}
164#endif