From 8829e909b4e756bfb2ad9210eec61d0dc55e1731 Mon Sep 17 00:00:00 2001 From: Michael Sevakis Date: Thu, 25 Apr 2013 16:37:12 -0400 Subject: Bass/Treble caps should exist implicitly with HAVE_SW_TONE_CONTROLS. If AUDIOHW_CAPS is defined without explicit BASS_CAP/TREBLE_CAP while HAVE_SW_TONE_CONTROLS is defined, AUDIOHW_HAVE_BASS/TREBLE should be defined or otherwise the tone controls won't show up. TREBLE/BASS were being defined if AUDIOHW_CAPS was NOT defined, but the same rule should apply if the codec needs to specify other caps but doesn't use hardware tone controls. (I'm surprised noone noticed some settings gone missing :-) Change-Id: I85b5c467bab07bb62362a0dc2d582267ac2d8ec9 --- firmware/export/audiohw.h | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/firmware/export/audiohw.h b/firmware/export/audiohw.h index e3b9623262..843ac0c0c4 100644 --- a/firmware/export/audiohw.h +++ b/firmware/export/audiohw.h @@ -116,16 +116,6 @@ struct sound_settings_info #define AUDIOHW_HAVE_MONO_VOLUME #endif -/* Some values are the same for every codec and can be defined here one - time. */ -#ifdef HAVE_SW_TONE_CONTROLS -AUDIOHW_SETTING(BASS, "dB", 0, 1, -24, 24, 0) -AUDIOHW_SETTING(TREBLE, "dB", 0, 1, -24, 24, 0) -#endif /* HAVE_SW_TONE_CONTROLS */ -AUDIOHW_SETTING(BALANCE, "%", 0, 1, -100, 100, 0) -AUDIOHW_SETTING(CHANNELS, "", 0, 1, 0, 5, 0) -AUDIOHW_SETTING(STEREO_WIDTH, "%", 0, 5, 0, 250, 100) - /* convert caps into defines */ #ifdef AUDIOHW_CAPS /* Tone controls */ @@ -282,14 +272,13 @@ enum AUDIOHW_EQ_SETTINGS #define AUDIOHW_HAVE_MIC_GAIN #endif #endif /* HAVE_RECORDING */ +#endif /* AUDIOHW_CAPS */ -#else /* ndef AUDIOHW_CAPS */ -#if defined (HAVE_SW_TONE_CONTROLS) +#ifdef HAVE_SW_TONE_CONTROLS /* Needed for proper sound support */ #define AUDIOHW_HAVE_BASS #define AUDIOHW_HAVE_TREBLE -#endif -#endif /* AUDIOHW_CAPS */ +#endif /* HAVE_SW_TONE_CONTROLS */ /* Generate enumeration of SOUND_xxx constants */ #include "audiohw_settings.h" @@ -548,4 +537,15 @@ typedef int (*audiohw_swcodec_cb_type)(int msg, intptr_t param); void audiohw_swcodec_set_callback(audiohw_swcodec_cb_type func); #endif /* CONFIG_CODEC == SWCODEC */ +/** + * Some setting are the same for every codec and can be defined here. + */ +#ifdef HAVE_SW_TONE_CONTROLS +AUDIOHW_SETTING(BASS, "dB", 0, 1, -24, 24, 0) +AUDIOHW_SETTING(TREBLE, "dB", 0, 1, -24, 24, 0) +#endif /* HAVE_SW_TONE_CONTROLS */ +AUDIOHW_SETTING(BALANCE, "%", 0, 1, -100, 100, 0) +AUDIOHW_SETTING(CHANNELS, "", 0, 1, 0, 5, 0) +AUDIOHW_SETTING(STEREO_WIDTH, "%", 0, 5, 0, 250, 100) + #endif /* _AUDIOHW_H_ */ -- cgit v1.2.3