summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
Diffstat (limited to 'firmware')
-rw-r--r--firmware/drivers/audio/ak4537.c2
-rw-r--r--firmware/drivers/audio/as3514.c4
-rw-r--r--firmware/drivers/audio/cs42l55.c4
-rw-r--r--firmware/drivers/audio/rk27xx_codec.c2
-rw-r--r--firmware/drivers/audio/tsc2100.c2
-rw-r--r--firmware/drivers/audio/uda1341.c2
-rw-r--r--firmware/drivers/audio/wm8758.c2
-rw-r--r--firmware/export/audiohw.h4
-rw-r--r--firmware/export/config.h4
-rw-r--r--firmware/export/mas35xx.h10
-rw-r--r--firmware/export/uda1341.h3
-rw-r--r--firmware/export/wm8751.h4
12 files changed, 24 insertions, 19 deletions
diff --git a/firmware/drivers/audio/ak4537.c b/firmware/drivers/audio/ak4537.c
index 4a9010d4e7..6f4e85a7fa 100644
--- a/firmware/drivers/audio/ak4537.c
+++ b/firmware/drivers/audio/ak4537.c
@@ -207,7 +207,7 @@ void audiohw_close(void)
akcodec_close(); /* target-specific */
}
-void audiohw_set_master_vol(int vol_l, int vol_r)
+void audiohw_set_volume(int vol_l, int vol_r)
{
vol_l = vol_tenthdb2hw(vol_l);
vol_r = vol_tenthdb2hw(vol_r);
diff --git a/firmware/drivers/audio/as3514.c b/firmware/drivers/audio/as3514.c
index b9118f9fcf..e1c7f6575e 100644
--- a/firmware/drivers/audio/as3514.c
+++ b/firmware/drivers/audio/as3514.c
@@ -240,7 +240,7 @@ void audiohw_postinit(void)
audiohw_mute(false);
}
-void audiohw_set_master_vol(int vol_l, int vol_r)
+void audiohw_set_volume(int vol_l, int vol_r)
{
unsigned int hph_r, hph_l;
unsigned int mix_l, mix_r;
@@ -298,7 +298,7 @@ void audiohw_set_lineout_volume(int vol_l, int vol_r)
{
#ifdef HAVE_AS3543
/* line out volume is set in the same registers */
- audiohw_set_master_volume(vol_l, vol_r);
+ audiohw_set_volume(vol_l, vol_r);
#else
vol_l = vol_tenthdb2hw(vol_l);
vol_r = vol_tenthdb2hw(vol_r);
diff --git a/firmware/drivers/audio/cs42l55.c b/firmware/drivers/audio/cs42l55.c
index 75fcd80b77..6c6e17abd4 100644
--- a/firmware/drivers/audio/cs42l55.c
+++ b/firmware/drivers/audio/cs42l55.c
@@ -111,7 +111,7 @@ void audiohw_postinit(void)
audiohw_mute(false);
}
-void audiohw_set_master_vol(int vol_l, int vol_r)
+void audiohw_set_volume(int vol_l, int vol_r)
{
vol_l = vol_tenthdb2hw(vol_l);
vol_r = vol_tenthdb2hw(vol_r);
@@ -121,7 +121,7 @@ void audiohw_set_master_vol(int vol_l, int vol_r)
vol_r << HPBCTL_HPBVOL_SHIFT);
}
-void audiohw_set_lineout_vol(int vol_l, int vol_r)
+void audiohw_set_lineout_volume(int vol_l, int vol_r)
{
vol_l = vol_tenthdb2hw(vol_l);
vol_r = vol_tenthdb2hw(vol_r);
diff --git a/firmware/drivers/audio/rk27xx_codec.c b/firmware/drivers/audio/rk27xx_codec.c
index aada17cc0a..8f294ba9f3 100644
--- a/firmware/drivers/audio/rk27xx_codec.c
+++ b/firmware/drivers/audio/rk27xx_codec.c
@@ -133,7 +133,7 @@ void audiohw_set_frequency(int fsel)
codec_write(CCR2, values_freq[fsel]);
}
-void audiohw_set_master_vol(int vol_l, int vol_r)
+void audiohw_set_volume(int vol_l, int vol_r)
{
vol_l = vol_tenthdb2hw(vol_l);
vol_r = vol_tenthdb2hw(vol_r);
diff --git a/firmware/drivers/audio/tsc2100.c b/firmware/drivers/audio/tsc2100.c
index 41327ae3d7..fda192a62a 100644
--- a/firmware/drivers/audio/tsc2100.c
+++ b/firmware/drivers/audio/tsc2100.c
@@ -74,7 +74,7 @@ void audiohw_postinit(void)
audiohw_mute(false);
}
-void audiohw_set_master_volume(int vol_l, int vol_r)
+void audiohw_set_volume(int vol_l, int vol_r)
{
vol_l = vol_tenthdb2hw(vol_l);
vol_r = vol_tenthdb2hw(vol_r);
diff --git a/firmware/drivers/audio/uda1341.c b/firmware/drivers/audio/uda1341.c
index ac3bcedb7d..e15cd39bfc 100644
--- a/firmware/drivers/audio/uda1341.c
+++ b/firmware/drivers/audio/uda1341.c
@@ -166,7 +166,7 @@ void audiohw_init(void)
audiohw_set_bass (0);
audiohw_set_treble (0);
- audiohw_set_master_vol (26, 26); /* -25 dB */
+ audiohw_set_volume (-250); /* -25 dB */
}
void audiohw_postinit(void)
diff --git a/firmware/drivers/audio/wm8758.c b/firmware/drivers/audio/wm8758.c
index 3e0c88c55c..387a1a48c4 100644
--- a/firmware/drivers/audio/wm8758.c
+++ b/firmware/drivers/audio/wm8758.c
@@ -134,7 +134,7 @@ void audiohw_postinit(void)
audiohw_mute(false);
}
-void audiohw_set_master_vol(int vol_l, int vol_r)
+void audiohw_set_volume(int vol_l, int vol_r)
{
int dac_l, amp_l, dac_r, amp_r;
get_volume_params(vol_l, &dac_l, &amp_l);
diff --git a/firmware/export/audiohw.h b/firmware/export/audiohw.h
index e18e996282..4bd4ecb019 100644
--- a/firmware/export/audiohw.h
+++ b/firmware/export/audiohw.h
@@ -54,15 +54,13 @@ struct sound_settings_info
short defaultval;
};
+#undef AUDIOHW_SETTING /* will have been #defined in config.h as empty */
#define AUDIOHW_SETTING(name, us, nd, st, minv, maxv, defv, expr...) \
static const struct sound_settings_info _audiohw_setting_##name = \
{ .unit = us, .numdecimals = nd, .steps = st, \
.minval = minv, .maxval = maxv, .defaultval = defv }; \
static inline int _sound_val2phys_##name(int val) \
{ return #expr[0] ? expr : val; }
-#else
-/* ...otherwise these produce nothing. */
-#define AUDIOHW_SETTING(name, us, nd, st, minv, maxv, defv, expr...)
#endif
#ifdef HAVE_UDA1380
diff --git a/firmware/export/config.h b/firmware/export/config.h
index ec69e53157..6a4a4648c8 100644
--- a/firmware/export/config.h
+++ b/firmware/export/config.h
@@ -1139,4 +1139,8 @@ Lyre prototype 1 */
#define ROCKBOX_HAS_LOGDISKF
#endif
+/* null audiohw setting macro for when codec header is included for reasons
+ other than audio support */
+#define AUDIOHW_SETTING(name, us, nd, st, minv, maxv, defv, expr...)
+
#endif /* __CONFIG_H__ */
diff --git a/firmware/export/mas35xx.h b/firmware/export/mas35xx.h
index 7643e0efdc..3f7912f856 100644
--- a/firmware/export/mas35xx.h
+++ b/firmware/export/mas35xx.h
@@ -178,13 +178,13 @@ AUDIOHW_SETTING(VOLUME, "dB", 0, 1,-100, 12, -25)
AUDIOHW_SETTING(BASS, "dB", 0, 1, -12, 12, 6)
AUDIOHW_SETTING(TREBLE, "dB", 0, 1, -12, 12, 6)
AUDIOHW_SETTING(LOUDNESS, "dB", 0, 1, 0, 17, 0)
-AUDIOHW_SETTING(AVC "", 0, 1, -1, 4, 0)
+AUDIOHW_SETTING(AVC, "", 0, 1, -1, 4, 0)
AUDIOHW_SETTING(MDB_STRENGTH, "dB", 0, 1, 0, 127, 48)
AUDIOHW_SETTING(MDB_HARMONICS, "%", 0, 1, 0, 100, 50)
-AUDIOHW_SETTING(MDB_CENTER "Hz", 0, 10, 20, 300, 60)
-AUDIOHW_SETTING(MDB_SHAPE "Hz", 0, 10, 50, 300, 90)
-AUDIOHW_SETTING(MDB_ENABLE "", 0, 1, 0, 1, 0)
-AUDIOHW_SETTING(SUPERBASS "", 0, 1, 0, 1, 0)
+AUDIOHW_SETTING(MDB_CENTER, "Hz", 0, 10, 20, 300, 60)
+AUDIOHW_SETTING(MDB_SHAPE, "Hz", 0, 10, 50, 300, 90)
+AUDIOHW_SETTING(MDB_ENABLE, "", 0, 1, 0, 1, 0)
+AUDIOHW_SETTING(SUPERBASS, "", 0, 1, 0, 1, 0)
#if CONFIG_CODEC == MAS3587F && defined(HAVE_RECORDING)
/* MAS3587F and MAS3539F handle clipping prevention internally so we do not
diff --git a/firmware/export/uda1341.h b/firmware/export/uda1341.h
index 5641bd301f..81eb1a3fa9 100644
--- a/firmware/export/uda1341.h
+++ b/firmware/export/uda1341.h
@@ -26,7 +26,8 @@
#define VOLUME_MIN -840
#define VOLUME_MAX 0
-#define AUDIOHW_CAPS (BASS_CAP | TREBLE_CAP | MIC_GAIN_CAP | LIN_GAIN_CAP)
+#define AUDIOHW_CAPS (BASS_CAP | TREBLE_CAP | MIC_GAIN_CAP | LIN_GAIN_CAP\
+ | MONO_VOL_CAP)
AUDIOHW_SETTING(VOLUME, "dB", 0, 1, -84, 0, -25)
AUDIOHW_SETTING(BASS, "dB", 0, 2, 0, 24, 0)
diff --git a/firmware/export/wm8751.h b/firmware/export/wm8751.h
index 6e7bb245dd..c19bd153eb 100644
--- a/firmware/export/wm8751.h
+++ b/firmware/export/wm8751.h
@@ -25,11 +25,13 @@
#define VOLUME_MIN -730
#define VOLUME_MAX 60
+#define AUDIOHW_SETTING(name, us, nd, st, minv, maxv, defv, expr...)
+
+#if defined(HAVE_WM8750)
#define AUDIOHW_CAPS (BASS_CAP | TREBLE_CAP | PRESCALER_CAP | \
BASS_CUTOFF_CAP | TREBLE_CUTOFF_CAP | \
DEPTH_3D_CAP | LIN_GAIN_CAP | MIC_GAIN_CAP)
-#if defined(HAVE_WM8750)
AUDIOHW_SETTING(DEPTH_3D, "%", 0, 1, 0, 15, 0, (100 * val + 8) / 15)
#ifdef HAVE_RECORDING
/* PGA -17.25dB to 30.0dB in 0.75dB increments 64 steps