add more registers for the tsc2100
[Rockbox.git] / firmware / export / audiohw.h
blobb3493b86d90f4774aecca78b8ff6bba177ef53a7
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_WM8978)
31 #include "wm8978.h"
32 #elif defined(HAVE_WM8975)
33 #include "wm8975.h"
34 #elif defined(HAVE_WM8985)
35 #include "wm8985.h"
36 #elif defined(HAVE_WM8758)
37 #include "wm8758.h"
38 #elif defined(HAVE_WM8721)
39 #include "wm8721.h"
40 #elif defined(HAVE_WM8731)
41 #include "wm8731.h"
42 #elif defined(HAVE_TLV320)
43 #include "tlv320.h"
44 #elif defined(HAVE_AS3514)
45 #include "as3514.h"
46 #elif defined(HAVE_MAS35XX)
47 #include "mas35xx.h"
48 #elif defined(HAVE_TSC2100)
49 #include "tsc2100.h"
50 #endif
52 enum {
53 SOUND_VOLUME = 0,
54 SOUND_BASS,
55 SOUND_TREBLE,
56 SOUND_BALANCE,
57 SOUND_CHANNELS,
58 SOUND_STEREO_WIDTH,
59 #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
60 SOUND_LOUDNESS,
61 SOUND_AVC,
62 SOUND_MDB_STRENGTH,
63 SOUND_MDB_HARMONICS,
64 SOUND_MDB_CENTER,
65 SOUND_MDB_SHAPE,
66 SOUND_MDB_ENABLE,
67 SOUND_SUPERBASS,
68 #endif
69 #if CONFIG_CODEC == MAS3587F || defined(HAVE_UDA1380) || defined(HAVE_TLV320)\
70 || defined(HAVE_WM8975) || defined(HAVE_WM8758) || defined(HAVE_WM8731) \
71 || defined(HAVE_AS3514) || defined(HAVE_WM8978) || defined(HAVE_WM8985)
72 SOUND_LEFT_GAIN,
73 SOUND_RIGHT_GAIN,
74 SOUND_MIC_GAIN,
75 #endif
76 #if defined(HAVE_WM8758) || defined(HAVE_WM8985)
77 SOUND_BASS_CUTOFF,
78 SOUND_TREBLE_CUTOFF,
79 #endif
82 enum Channel {
83 SOUND_CHAN_STEREO,
84 SOUND_CHAN_MONO,
85 SOUND_CHAN_CUSTOM,
86 SOUND_CHAN_MONO_LEFT,
87 SOUND_CHAN_MONO_RIGHT,
88 SOUND_CHAN_KARAOKE,
89 SOUND_CHAN_NUM_MODES,
92 struct sound_settings_info {
93 const char *unit;
94 int numdecimals;
95 int steps;
96 int minval;
97 int maxval;
98 int defaultval;
101 /* This struct is used by every driver to export its min/max/default values for
102 * its audio settings. Keep in mind that the order must be correct! */
103 extern const struct sound_settings_info audiohw_settings[];
105 /* All usable functions implemented by a audio codec drivers. Most of
106 * the function in sound settings are only called, when in audio codecs
107 * .h file suitable defines are added.
111 * Initialize audio codec to a well defined state.
113 void audiohw_init(void);
116 * Do initial audio codec setup.
118 void audiohw_preinit(void);
121 * Do some stuff (codec related) after audiohw_init that needs to be
122 * delayed such as enabling outputs to prevent popping. This lets
123 * other inits in the system complete in the meantime.
125 void audiohw_postinit(void);
128 * Close audio codec.
130 void audiohw_close(void);
133 * Mute or enable sound.
134 * @param mute true or false.
136 void audiohw_mute(bool mute);
139 * Silently en/disable audio output.
140 * @param enable true or false.
142 void audiohw_enable_output(bool enable);
144 #ifdef HAVE_RECORDING
147 * Enable recording.
148 * @param source_mic if this is true, we want to record from microphone,
149 * else we want to record FM/LineIn.
151 void audiohw_enable_recording(bool source_mic);
154 * Disable recording.
156 void audiohw_disable_recording(void);
159 * Set gain of recording source.
160 * @param left gain value.
161 * @param right will not be used if recording from micophone (mono).
162 * @param type AUDIO_GAIN_MIC, AUDIO_GAIN_LINEIN.
164 void audiohw_set_recvol(int left, int right, int type);
167 * Enable or disable recording monitor.
168 * @param enable ture or false.
170 void audiohw_set_monitor(bool enable);
172 #endif /*HAVE_RECORDING*/
175 #if CONFIG_CODEC != SWCODEC
177 /* functions which are only used by mas35xx codecs, but are also
178 aviable on SWCODECS through dsp */
181 * Set channel configuration.
182 * @param val new channel value (see enum Channel).
184 void audiohw_set_channel(int val);
187 * Set stereo width.
188 * @param val new stereo width value.
190 void audiohw_set_stereo_width(int val);
192 #endif /* CONFIG_CODEC != SWCODEC */
194 #endif /* _AUDIOHW_H_ */