summaryrefslogtreecommitdiff
path: root/firmware/drivers/audio
diff options
context:
space:
mode:
authorRob Purchase <shotofadds@rockbox.org>2008-01-14 22:04:48 +0000
committerRob Purchase <shotofadds@rockbox.org>2008-01-14 22:04:48 +0000
commit47ea030e2e68a51f91a2c2302b7ea4d3ee1a2a07 (patch)
tree0a48ce653e22ec9a2673474f718217d9659e0c6b /firmware/drivers/audio
parentb30ca8ca5ab6c8ea27b8fe1f5fb38ebad09b7e62 (diff)
downloadrockbox-47ea030e2e68a51f91a2c2302b7ea4d3ee1a2a07.tar.gz
rockbox-47ea030e2e68a51f91a2c2302b7ea4d3ee1a2a07.zip
Initial Cowon D2 commit:
* bootloader test program (basic LCD & button drivers, reads touchscreen) * work-in-progress stubs for main build git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16090 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/drivers/audio')
-rw-r--r--firmware/drivers/audio/wm8985.c143
1 files changed, 143 insertions, 0 deletions
diff --git a/firmware/drivers/audio/wm8985.c b/firmware/drivers/audio/wm8985.c
new file mode 100644
index 0000000000..3117b06f98
--- /dev/null
+++ b/firmware/drivers/audio/wm8985.c
@@ -0,0 +1,143 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Stubs for WM8985 audio codec, (unwisely?) based on 8975 driver.
11 *
12 * All files in this archive are subject to the GNU General Public License.
13 * See the file COPYING in the source tree root for full license agreement.
14 *
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
17 *
18 ****************************************************************************/
19#include "logf.h"
20#include "system.h"
21#include "string.h"
22#include "audio.h"
23
24#include "wmcodec.h"
25#include "audiohw.h"
26#include "i2s.h"
27
28/* TODO: fix these values, they're copied straight from WM8975 */
29const struct sound_settings_info audiohw_settings[] = {
30 [SOUND_VOLUME] = {"dB", 0, 1, -74, 6, -25},
31 [SOUND_BASS] = {"dB", 0, 1, -6, 9, 0},
32 [SOUND_TREBLE] = {"dB", 0, 1, -6, 9, 0},
33 [SOUND_BALANCE] = {"%", 0, 1,-100, 100, 0},
34 [SOUND_CHANNELS] = {"", 0, 1, 0, 5, 0},
35 [SOUND_STEREO_WIDTH] = {"%", 0, 5, 0, 250, 100},
36 [SOUND_LEFT_GAIN] = {"dB", 1, 1,-128, 96, 0},
37 [SOUND_RIGHT_GAIN] = {"dB", 1, 1,-128, 96, 0},
38 [SOUND_MIC_GAIN] = {"dB", 1, 1,-128, 108, 16},
39};
40
41/* convert tenth of dB volume to master volume register value */
42int tenthdb2master(int db)
43{
44 #warning function not implemented
45
46 (void)db;
47 return 0;
48}
49
50/* Silently enable / disable audio output */
51void audiohw_enable_output(bool enable)
52{
53 #warning function not implemented
54
55 (void)enable;
56}
57
58int audiohw_set_master_vol(int vol_l, int vol_r)
59{
60 #warning function not implemented
61
62 (void)vol_l;
63 (void)vol_r;
64 return 0;
65}
66
67int audiohw_set_lineout_vol(int vol_l, int vol_r)
68{
69 #warning function not implemented
70
71 (void)vol_l;
72 (void)vol_r;
73 return 0;
74}
75
76void audiohw_set_bass(int value)
77{
78 #warning function not implemented
79
80 (void)value;
81}
82
83void audiohw_set_treble(int value)
84{
85 #warning function not implemented
86
87 (void)value;
88}
89
90void audiohw_mute(bool mute)
91{
92 #warning function not implemented
93
94 (void)mute;
95}
96
97void audiohw_close(void)
98{
99 #warning function not implemented
100}
101
102void audiohw_set_nsorder(int order)
103{
104 #warning function not implemented
105
106 (void)order;
107}
108
109/* Note: Disable output before calling this function */
110void audiohw_set_sample_rate(int sampling_control)
111{
112 #warning function not implemented
113
114 (void)sampling_control;
115}
116
117void audiohw_enable_recording(bool source_mic)
118{
119 #warning function not implemented
120
121 (void)source_mic;
122}
123
124void audiohw_disable_recording(void)
125{
126 #warning function not implemented
127}
128
129void audiohw_set_recvol(int left, int right, int type)
130{
131 #warning function not implemented
132
133 (void)left;
134 (void)right;
135 (void)type;
136}
137
138void audiohw_set_monitor(bool enable)
139{
140 #warning function not implemented
141
142 (void)enable;
143}