Add DM320 I²C driver, although not (yet) enabled in the sources.
[Rockbox.git] / firmware / export / audiohw.h
blobca706811a07e51529b58d7e843c2e742e7da3e9b
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
10 * Copyright (C) 2007 by Christian Gmeiner
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.
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
18 ****************************************************************************/
20 #ifndef _AUDIOHW_H_
21 #define _AUDIOHW_H_
23 #include "config.h"
24 #include <stdbool.h>
26 #ifdef HAVE_UDA1380
27 #include "uda1380.h"
28 #elif defined(HAVE_WM8751)
29 #include "wm8751.h"
30 #elif defined(HAVE_WM8975) || defined(HAVE_WM8978)
31 #include "wm8975.h"
32 #elif defined(HAVE_WM8985)
33 #include "wm8985.h"
34 #elif defined(HAVE_WM8758)
35 #include "wm8758.h"
36 #elif defined(HAVE_WM8721)
37 #include "wm8721.h"
38 #elif defined(HAVE_WM8731)
39 #include "wm8731.h"
40 #elif defined(HAVE_TLV320)
41 #include "tlv320.h"
42 #elif defined(HAVE_AS3514)
43 #include "as3514.h"
44 #elif defined(HAVE_MAS35XX)
45 #include "mas35xx.h"
46 #endif
48 enum {
49 SOUND_VOLUME = 0,
50 SOUND_BASS,
51 SOUND_TREBLE,
52 SOUND_BALANCE,
53 SOUND_CHANNELS,
54 SOUND_STEREO_WIDTH,
55 #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
56 SOUND_LOUDNESS,
57 SOUND_AVC,
58 SOUND_MDB_STRENGTH,
59 SOUND_MDB_HARMONICS,
60 SOUND_MDB_CENTER,
61 SOUND_MDB_SHAPE,
62 SOUND_MDB_ENABLE,
63 SOUND_SUPERBASS,
64 #endif
65 #if CONFIG_CODEC == MAS3587F || defined(HAVE_UDA1380) || defined(HAVE_TLV320)\
66 || defined(HAVE_WM8975) || defined(HAVE_WM8758) || defined(HAVE_WM8731) \
67 || defined(HAVE_AS3514) || defined(HAVE_WM8978) || defined(HAVE_WM8985)
68 SOUND_LEFT_GAIN,
69 SOUND_RIGHT_GAIN,
70 SOUND_MIC_GAIN,
71 #endif
72 #ifdef HAVE_WM8758
73 SOUND_BASS_CUTOFF,
74 SOUND_TREBLE_CUTOFF,
75 #endif
78 enum Channel {
79 SOUND_CHAN_STEREO,
80 SOUND_CHAN_MONO,
81 SOUND_CHAN_CUSTOM,
82 SOUND_CHAN_MONO_LEFT,
83 SOUND_CHAN_MONO_RIGHT,
84 SOUND_CHAN_KARAOKE,
85 SOUND_CHAN_NUM_MODES,
88 struct sound_settings_info {
89 const char *unit;
90 int numdecimals;
91 int steps;
92 int minval;
93 int maxval;
94 int defaultval;
97 /* This struct is used by every driver to export its min/max/default values for
98 * its audio settings. Keep in mind that the order must be correct! */
99 extern const struct sound_settings_info audiohw_settings[];
101 /* All usable functions implemented by a audio codec drivers. Most of
102 * the function in sound settings are only called, when in audio codecs
103 * .h file suitable defines are added.
107 * Initialize audio codec to a well defined state.
109 void audiohw_init(void);
112 * Do some stuff (codec related) after audiohw_init.
114 void audiohw_postinit(void);
117 * Close audio codec.
119 void audiohw_close(void);
122 * Mute or enable sound.
123 * @param mute true or false.
125 void audiohw_mute(bool mute);
128 * Silently en/disable audio output.
129 * @param enable true or false.
131 void audiohw_enable_output(bool enable);
133 #ifdef HAVE_RECORDING
136 * Enable recording.
137 * @param source_mic if this is true, we want to record from microphone,
138 * else we want to record FM/LineIn.
140 void audiohw_enable_recording(bool source_mic);
143 * Disable recording.
145 void audiohw_disable_recording(void);
148 * Set gain of recording source.
149 * @param left gain value.
150 * @param right will not be used if recording from micophone (mono).
151 * @param type AUDIO_GAIN_MIC, AUDIO_GAIN_LINEIN.
153 void audiohw_set_recvol(int left, int right, int type);
156 * Enable or disable recording monitor.
157 * @param enable ture or false.
159 void audiohw_set_monitor(bool enable);
161 #endif /*HAVE_RECORDING*/
163 #endif /* _AUDIOHW_H_ */