summaryrefslogtreecommitdiff
path: root/firmware/export/mas35xx.h
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/export/mas35xx.h')
-rw-r--r--firmware/export/mas35xx.h59
1 files changed, 42 insertions, 17 deletions
diff --git a/firmware/export/mas35xx.h b/firmware/export/mas35xx.h
index f75658fce1..7643e0efdc 100644
--- a/firmware/export/mas35xx.h
+++ b/firmware/export/mas35xx.h
@@ -39,6 +39,14 @@
39 39
40#if CONFIG_CODEC == MAS3507D 40#if CONFIG_CODEC == MAS3507D
41 41
42#define VOLUME_MIN -780
43#define VOLUME_MAX 180
44#define AUDIOHW_CAPS (BASS_CAP | TREBLE_CAP | PRESCALER_CAP)
45
46AUDIOHW_SETTING(SOUND_VOLUME, "dB", 0, 1, -78, 18, -18)
47AUDIOHW_SETTING(SOUND_BASS, "dB", 0, 1, -15, 15, 7)
48AUDIOHW_SETTING(SOUND_TREBLE, "dB", 0, 1, -15, 15, 7)
49
42/* I2C defines */ 50/* I2C defines */
43#define MAS_ADR 0x3a 51#define MAS_ADR 0x3a
44#define MAS_DEV_WRITE (MAS_ADR | 0x00) 52#define MAS_DEV_WRITE (MAS_ADR | 0x00)
@@ -71,10 +79,6 @@
71#define MAS_D0_OUT_RL 0x7fa 79#define MAS_D0_OUT_RL 0x7fa
72#define MAS_D0_OUT_RR 0x7fb 80#define MAS_D0_OUT_RR 0x7fb
73 81
74#define VOLUME_MIN -780
75#define VOLUME_MAX 180
76#define AUDIOHW_CAPS (BASS_CAP | TREBLE_CAP | PRESCALER_CAP)
77
78static const unsigned int bass_table[] = 82static const unsigned int bass_table[] =
79{ 83{
80 0x9e400, /* -15dB */ 84 0x9e400, /* -15dB */
@@ -167,6 +171,36 @@ static const unsigned int prescale_table[] =
167 171
168#else /* CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F */ 172#else /* CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F */
169 173
174#define VOLUME_MIN -400
175#define VOLUME_MAX 600
176
177AUDIOHW_SETTING(VOLUME, "dB", 0, 1,-100, 12, -25)
178AUDIOHW_SETTING(BASS, "dB", 0, 1, -12, 12, 6)
179AUDIOHW_SETTING(TREBLE, "dB", 0, 1, -12, 12, 6)
180AUDIOHW_SETTING(LOUDNESS, "dB", 0, 1, 0, 17, 0)
181AUDIOHW_SETTING(AVC "", 0, 1, -1, 4, 0)
182AUDIOHW_SETTING(MDB_STRENGTH, "dB", 0, 1, 0, 127, 48)
183AUDIOHW_SETTING(MDB_HARMONICS, "%", 0, 1, 0, 100, 50)
184AUDIOHW_SETTING(MDB_CENTER "Hz", 0, 10, 20, 300, 60)
185AUDIOHW_SETTING(MDB_SHAPE "Hz", 0, 10, 50, 300, 90)
186AUDIOHW_SETTING(MDB_ENABLE "", 0, 1, 0, 1, 0)
187AUDIOHW_SETTING(SUPERBASS "", 0, 1, 0, 1, 0)
188
189#if CONFIG_CODEC == MAS3587F && defined(HAVE_RECORDING)
190/* MAS3587F and MAS3539F handle clipping prevention internally so we do not
191 * need the prescaler -> CLIPPING_CAP */
192#define AUDIOHW_CAPS (BASS_CAP | TREBLE_CAP | BALANCE_CAP | CLIPPING_CAP | \
193 MONO_VOL_CAP | LIN_GAIN_CAP | MIC_GAIN_CAP)
194AUDIOHW_SETTING(LEFT_GAIN, "dB", 1, 1, 0, 15, 8, (val - 2) * 15)
195AUDIOHW_SETTING(RIGHT_GAIN, "dB", 1, 1, 0, 15, 8, (val - 2) * 15)
196AUDIOHW_SETTING(MIC_GAIN, "dB", 1, 1, 0, 15, 2, val * 15 + 210)
197#else
198/* MAS3587F and MAS3539F handle clipping prevention internally so we do not
199 * need the prescaler -> CLIPPING_CAP */
200#define AUDIOHW_CAPS (BASS_CAP | TREBLE_CAP | BALANCE_CAP | CLIPPING_CAP | \
201 MONO_VOL_CAP)
202#endif /* MAS3587F && HAVE_RECORDING */
203
170/* I2C defines */ 204/* I2C defines */
171#define MAS_ADR 0x3c 205#define MAS_ADR 0x3c
172#define MAS_DEV_WRITE (MAS_ADR | 0x00) 206#define MAS_DEV_WRITE (MAS_ADR | 0x00)
@@ -248,18 +282,7 @@ static const unsigned int prescale_table[] =
248#define MAS_D0_CRC_ERROR_COUNT 0xfd3 282#define MAS_D0_CRC_ERROR_COUNT 0xfd3
249#endif 283#endif
250 284
251/* MAS3587F and MAS3539F handle clipping prevention internally so we do not need
252 * the prescaler -> CLIPPING_CAP
253 */
254
255#define VOLUME_MIN -400
256#define VOLUME_MAX 600
257#define AUDIOHW_CAPS (BASS_CAP | TREBLE_CAP | BALANCE_CAP | CLIPPING_CAP)
258
259#endif /* CONFIG_CODEC */
260
261/* Function prototypes */ 285/* Function prototypes */
262#if CONFIG_CODEC == MAS3587F || CONFIG_CODEC == MAS3539F
263extern void audiohw_set_loudness(int value); 286extern void audiohw_set_loudness(int value);
264extern void audiohw_set_avc(int value); 287extern void audiohw_set_avc(int value);
265extern void audiohw_set_mdb_strength(int value); 288extern void audiohw_set_mdb_strength(int value);
@@ -269,7 +292,9 @@ extern void audiohw_set_mdb_shape(int value);
269extern void audiohw_set_mdb_enable(int value); 292extern void audiohw_set_mdb_enable(int value);
270extern void audiohw_set_superbass(int value); 293extern void audiohw_set_superbass(int value);
271extern void audiohw_set_balance(int val); 294extern void audiohw_set_balance(int val);
272extern void audiohw_set_pitch(unsigned long val); 295extern void audiohw_set_pitch(int32_t val);
273#endif 296extern int audiohw_get_pitch(void);
297
298#endif /* CONFIG_CODEC */
274 299
275#endif /* _MAS35XX_H */ 300#endif /* _MAS35XX_H */