summaryrefslogtreecommitdiff
path: root/firmware/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/drivers')
-rw-r--r--firmware/drivers/audio/as3514.c10
-rw-r--r--firmware/drivers/audio/mas35xx.c54
-rw-r--r--firmware/drivers/audio/tlv320.c13
-rw-r--r--firmware/drivers/audio/uda1380.c12
-rw-r--r--firmware/drivers/audio/wm8731l.c13
-rw-r--r--firmware/drivers/audio/wm8751.c9
-rw-r--r--firmware/drivers/audio/wm8758.c12
-rw-r--r--firmware/drivers/audio/wm8975.c12
8 files changed, 134 insertions, 1 deletions
diff --git a/firmware/drivers/audio/as3514.c b/firmware/drivers/audio/as3514.c
index d068e08081..98e3e439a0 100644
--- a/firmware/drivers/audio/as3514.c
+++ b/firmware/drivers/audio/as3514.c
@@ -27,6 +27,16 @@
27#include "i2s.h" 27#include "i2s.h"
28#include "i2c-pp.h" 28#include "i2c-pp.h"
29 29
30const struct sound_settings_info audiohw_settings[] = {
31 [SOUND_VOLUME] = {"dB", 0, 1, -74, 6, -25},
32 /* HAVE_SW_TONE_CONTROLS */
33 [SOUND_BASS] = {"dB", 0, 1, -24, 24, 0},
34 [SOUND_TREBLE] = {"dB", 0, 1, -24, 24, 0},
35 [SOUND_BALANCE] = {"%", 0, 1,-100, 100, 0},
36 [SOUND_CHANNELS] = {"", 0, 1, 0, 5, 0},
37 [SOUND_STEREO_WIDTH] = {"%", 0, 1, 0, 255, 100},
38};
39
30/* Shadow registers */ 40/* Shadow registers */
31int as3514_regs[0x1E]; /* last audio register: PLLMODE 0x1d */ 41int as3514_regs[0x1E]; /* last audio register: PLLMODE 0x1d */
32 42
diff --git a/firmware/drivers/audio/mas35xx.c b/firmware/drivers/audio/mas35xx.c
new file mode 100644
index 0000000000..6a9d290049
--- /dev/null
+++ b/firmware/drivers/audio/mas35xx.c
@@ -0,0 +1,54 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id: wm8975.c 13453 2007-05-20 23:10:15Z christian $
9 *
10 * Driver for MAS35xx audio codec
11 *
12 *
13 * Copyright (c) 2007 by Christian Gmeiner
14 *
15 * All files in this archive are subject to the GNU General Public License.
16 * See the file COPYING in the source tree root for full license agreement.
17 *
18 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19 * KIND, either express or implied.
20 *
21 ****************************************************************************/
22
23#include "config.h"
24#include "mas35xx.h"
25
26const struct sound_settings_info audiohw_settings[] = {
27#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
28 [SOUND_VOLUME] = {"dB", 0, 1,-100, 12, -25},
29 [SOUND_BASS] = {"dB", 0, 1, -12, 12, 6},
30 [SOUND_TREBLE] = {"dB", 0, 1, -12, 12, 6},
31#else /* MAS3507D */
32 [SOUND_VOLUME] = {"dB", 0, 1, -78, 18, -18},
33 [SOUND_BASS] = {"dB", 0, 1, -15, 15, 7},
34 [SOUND_TREBLE] = {"dB", 0, 1, -15, 15, 7},
35#endif
36 [SOUND_BALANCE] = {"%", 0, 1,-100, 100, 0},
37 [SOUND_CHANNELS] = {"", 0, 1, 0, 5, 0},
38 [SOUND_STEREO_WIDTH] = {"%", 0, 1, 0, 255, 100},
39#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
40 [SOUND_LOUDNESS] = {"dB", 0, 1, 0, 17, 0},
41 [SOUND_AVC] = {"", 0, 1, -1, 4, 0},
42 [SOUND_MDB_STRENGTH] = {"dB", 0, 1, 0, 127, 48},
43 [SOUND_MDB_HARMONICS] = {"%", 0, 1, 0, 100, 50},
44 [SOUND_MDB_CENTER] = {"Hz", 0, 10, 20, 300, 60},
45 [SOUND_MDB_SHAPE] = {"Hz", 0, 10, 50, 300, 90},
46 [SOUND_MDB_ENABLE] = {"", 0, 1, 0, 1, 0},
47 [SOUND_SUPERBASS] = {"", 0, 1, 0, 1, 0},
48#endif
49#if CONFIG_CODEC == MAS3587F
50 [SOUND_LEFT_GAIN] = {"dB", 1, 1, 0, 15, 8},
51 [SOUND_RIGHT_GAIN] = {"dB", 1, 1, 0, 15, 8},
52 [SOUND_MIC_GAIN] = {"dB", 1, 1, 0, 15, 2},
53#endif
54};
diff --git a/firmware/drivers/audio/tlv320.c b/firmware/drivers/audio/tlv320.c
index 90587fc23a..95945883bf 100644
--- a/firmware/drivers/audio/tlv320.c
+++ b/firmware/drivers/audio/tlv320.c
@@ -24,6 +24,19 @@
24#include "i2c-coldfire.h" 24#include "i2c-coldfire.h"
25#include "tlv320.h" 25#include "tlv320.h"
26 26
27const struct sound_settings_info audiohw_settings[] = {
28 [SOUND_VOLUME] = {"dB", 0, 1, -73, 6, -20},
29 /* HAVE_SW_TONE_CONTROLS */
30 [SOUND_BASS] = {"dB", 0, 1, -24, 24, 0},
31 [SOUND_TREBLE] = {"dB", 0, 1, -24, 24, 0},
32 [SOUND_BALANCE] = {"%", 0, 1,-100, 100, 0},
33 [SOUND_CHANNELS] = {"", 0, 1, 0, 5, 0},
34 [SOUND_STEREO_WIDTH] = {"%", 0, 1, 0, 255, 100},
35 [SOUND_LEFT_GAIN] = {"dB", 1, 1, 0, 31, 23},
36 [SOUND_RIGHT_GAIN] = {"dB", 1, 1, 0, 31, 23},
37 [SOUND_MIC_GAIN] = {"dB", 1, 1, 0, 1, 1},
38};
39
27/* convert tenth of dB volume (-840..0) to master volume register value */ 40/* convert tenth of dB volume (-840..0) to master volume register value */
28int tenthdb2master(int db) 41int tenthdb2master(int db)
29{ 42{
diff --git a/firmware/drivers/audio/uda1380.c b/firmware/drivers/audio/uda1380.c
index ae0d1e841d..6ee35fab4d 100644
--- a/firmware/drivers/audio/uda1380.c
+++ b/firmware/drivers/audio/uda1380.c
@@ -26,6 +26,18 @@
26#include "uda1380.h" 26#include "uda1380.h"
27#include "pcf50606.h" 27#include "pcf50606.h"
28 28
29const struct sound_settings_info audiohw_settings[] = {
30 [SOUND_VOLUME] = {"dB", 0, 1, -84, 0, -25},
31 [SOUND_BASS] = {"dB", 0, 2, 0, 24, 0},
32 [SOUND_TREBLE] = {"dB", 0, 2, 0, 6, 0},
33 [SOUND_BALANCE] = {"%", 0, 1,-100, 100, 0},
34 [SOUND_CHANNELS] = {"", 0, 1, 0, 5, 0},
35 [SOUND_STEREO_WIDTH] = {"%", 0, 1, 0, 255, 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
29/* convert tenth of dB volume (-840..0) to master volume register value */ 41/* convert tenth of dB volume (-840..0) to master volume register value */
30int tenthdb2master(int db) 42int tenthdb2master(int db)
31{ 43{
diff --git a/firmware/drivers/audio/wm8731l.c b/firmware/drivers/audio/wm8731l.c
index ffed5c9347..dcf7c4eca0 100644
--- a/firmware/drivers/audio/wm8731l.c
+++ b/firmware/drivers/audio/wm8731l.c
@@ -37,6 +37,19 @@
37/* use zero crossing to reduce clicks during volume changes */ 37/* use zero crossing to reduce clicks during volume changes */
38#define VOLUME_ZC_WAIT (1<<7) 38#define VOLUME_ZC_WAIT (1<<7)
39 39
40const struct sound_settings_info audiohw_settings[] = {
41 [SOUND_VOLUME] = {"dB", 0, 1, -74, 6, -25},
42 /* HAVE_SW_TONE_CONTROLS */
43 [SOUND_BASS] = {"dB", 0, 1, -24, 24, 0},
44 [SOUND_TREBLE] = {"dB", 0, 1, -24, 24, 0},
45 [SOUND_BALANCE] = {"%", 0, 1,-100, 100, 0},
46 [SOUND_CHANNELS] = {"", 0, 1, 0, 5, 0},
47 [SOUND_STEREO_WIDTH] = {"%", 0, 1, 0, 255, 100},
48 [SOUND_LEFT_GAIN] = {"dB", 1, 1,-128, 96, 0},
49 [SOUND_RIGHT_GAIN] = {"dB", 1, 1,-128, 96, 0},
50 [SOUND_MIC_GAIN] = {"dB", 1, 1,-128, 108, 16},
51};
52
40/* convert tenth of dB volume (-730..60) to master volume register value */ 53/* convert tenth of dB volume (-730..60) to master volume register value */
41int tenthdb2master(int db) 54int tenthdb2master(int db)
42{ 55{
diff --git a/firmware/drivers/audio/wm8751.c b/firmware/drivers/audio/wm8751.c
index 2f79f27c7c..bb2b40bbbd 100644
--- a/firmware/drivers/audio/wm8751.c
+++ b/firmware/drivers/audio/wm8751.c
@@ -29,6 +29,15 @@
29#include "audio.h" 29#include "audio.h"
30#include "sound.h" 30#include "sound.h"
31 31
32const struct sound_settings_info audiohw_settings[] = {
33 [SOUND_VOLUME] = {"dB", 0, 1, -74, 6, -25},
34 [SOUND_BASS] = {"dB", 1, 15, -60, 90, 0},
35 [SOUND_TREBLE] = {"dB", 1, 15, -60, 90, 0},
36 [SOUND_BALANCE] = {"%", 0, 1,-100, 100, 0},
37 [SOUND_CHANNELS] = {"", 0, 1, 0, 5, 0},
38 [SOUND_STEREO_WIDTH] = {"%", 0, 1, 0, 255, 100},
39};
40
32/* Flags used in combination with settings */ 41/* Flags used in combination with settings */
33 42
34/* use zero crossing to reduce clicks during volume changes */ 43/* use zero crossing to reduce clicks during volume changes */
diff --git a/firmware/drivers/audio/wm8758.c b/firmware/drivers/audio/wm8758.c
index b8e220753c..34f95a989d 100644
--- a/firmware/drivers/audio/wm8758.c
+++ b/firmware/drivers/audio/wm8758.c
@@ -31,6 +31,18 @@
31#include "wm8758.h" 31#include "wm8758.h"
32#include "i2s.h" 32#include "i2s.h"
33 33
34const struct sound_settings_info audiohw_settings[] = {
35 [SOUND_VOLUME] = {"dB", 0, 1, -58, 6, -25},
36 [SOUND_BASS] = {"dB", 0, 1, -6, 9, 0},
37 [SOUND_TREBLE] = {"dB", 0, 1, -6, 9, 0},
38 [SOUND_BALANCE] = {"%", 0, 1,-100, 100, 0},
39 [SOUND_CHANNELS] = {"", 0, 1, 0, 5, 0},
40 [SOUND_STEREO_WIDTH] = {"%", 0, 1, 0, 255, 100},
41 [SOUND_LEFT_GAIN] = {"dB", 1, 1,-128, 96, 0},
42 [SOUND_RIGHT_GAIN] = {"dB", 1, 1,-128, 96, 0},
43 [SOUND_MIC_GAIN] = {"dB", 1, 1,-128, 108, 16},
44};
45
34/* convert tenth of dB volume (-57..6) to master volume register value */ 46/* convert tenth of dB volume (-57..6) to master volume register value */
35int tenthdb2master(int db) 47int tenthdb2master(int db)
36{ 48{
diff --git a/firmware/drivers/audio/wm8975.c b/firmware/drivers/audio/wm8975.c
index 3d870a8f90..4b018b985b 100644
--- a/firmware/drivers/audio/wm8975.c
+++ b/firmware/drivers/audio/wm8975.c
@@ -35,7 +35,17 @@
35/* use zero crossing to reduce clicks during volume changes */ 35/* use zero crossing to reduce clicks during volume changes */
36#define VOLUME_ZC_WAIT (1<<7) 36#define VOLUME_ZC_WAIT (1<<7)
37 37
38 38const struct sound_settings_info audiohw_settings[] = {
39 [SOUND_VOLUME] = {"dB", 0, 1, -74, 6, -25},
40 [SOUND_BASS] = {"dB", 0, 1, -6, 9, 0},
41 [SOUND_TREBLE] = {"dB", 0, 1, -6, 9, 0},
42 [SOUND_BALANCE] = {"%", 0, 1,-100, 100, 0},
43 [SOUND_CHANNELS] = {"", 0, 1, 0, 5, 0},
44 [SOUND_STEREO_WIDTH] = {"%", 0, 1, 0, 255, 100},
45 [SOUND_LEFT_GAIN] = {"dB", 1, 1,-128, 96, 0},
46 [SOUND_RIGHT_GAIN] = {"dB", 1, 1,-128, 96, 0},
47 [SOUND_MIC_GAIN] = {"dB", 1, 1,-128, 108, 16},
48};
39 49
40/* convert tenth of dB volume (-730..60) to master volume register value */ 50/* convert tenth of dB volume (-730..60) to master volume register value */
41int tenthdb2master(int db) 51int tenthdb2master(int db)