Device detection based on USB PIDs. This is currently linux only and requires libusb...
[Rockbox.git] / firmware / export / audiohw.h
blobdf155e225663ea50ff0ad7ae7272475eda626406
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)
31 #include "wm8975.h"
32 #elif defined(HAVE_WM8758)
33 #include "wm8758.h"
34 #elif defined(HAVE_WM8731) || defined(HAVE_WM8721)
35 #include "wm8731l.h"
36 #elif defined(HAVE_TLV320)
37 #include "tlv320.h"
38 #elif defined(HAVE_AS3514)
39 #include "as3514.h"
40 #elif defined(HAVE_MAS35XX)
41 #include "mas35xx.h"
42 #endif
44 enum {
45 SOUND_VOLUME = 0,
46 SOUND_BASS,
47 SOUND_TREBLE,
48 SOUND_BALANCE,
49 SOUND_CHANNELS,
50 SOUND_STEREO_WIDTH,
51 #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
52 SOUND_LOUDNESS,
53 SOUND_AVC,
54 SOUND_MDB_STRENGTH,
55 SOUND_MDB_HARMONICS,
56 SOUND_MDB_CENTER,
57 SOUND_MDB_SHAPE,
58 SOUND_MDB_ENABLE,
59 SOUND_SUPERBASS,
60 #endif
61 #if CONFIG_CODEC == MAS3587F || defined(HAVE_UDA1380) || defined(HAVE_TLV320)\
62 || defined(HAVE_WM8975) || defined(HAVE_WM8758) || defined(HAVE_WM8731) \
63 || defined(HAVE_AS3514)
64 SOUND_LEFT_GAIN,
65 SOUND_RIGHT_GAIN,
66 SOUND_MIC_GAIN,
67 #endif
70 enum Channel {
71 SOUND_CHAN_STEREO,
72 SOUND_CHAN_MONO,
73 SOUND_CHAN_CUSTOM,
74 SOUND_CHAN_MONO_LEFT,
75 SOUND_CHAN_MONO_RIGHT,
76 SOUND_CHAN_KARAOKE,
77 SOUND_CHAN_NUM_MODES,
80 struct sound_settings_info {
81 const char *unit;
82 int numdecimals;
83 int steps;
84 int minval;
85 int maxval;
86 int defaultval;
89 /* This struct is used by every driver to export its min/max/default values for
90 * its audio settings. Keep in mind that the order must be correct! */
91 extern const struct sound_settings_info audiohw_settings[];
93 /* All usable functions implemented by a audio codec drivers. Most of
94 * the function in sound settings are only called, when in audio codecs
95 * .h file suitable defines are added.
98 /**
99 * Initialize audio codec to a well defined state.
101 void audiohw_init(void);
104 * Close audio codec.
106 void audiohw_close(void);
109 * Mute or enable sound.
110 * @param mute true or false
112 void audiohw_mute(bool mute);
114 #endif /* _AUDIOHW_H_ */