Add DAC's oversampling filter roll-off selection to sound settings.

Change-Id: I1258ba50dd9308f49d97965562f3a423c9bfb785
This commit is contained in:
Andrew Ryabinin 2013-05-12 23:23:45 +04:00
parent f6e179bd8e
commit 0519f7e5ab
9 changed files with 96 additions and 0 deletions

View file

@ -40,6 +40,7 @@
#define MONO_VOL_CAP (1 << 10)
#define LIN_GAIN_CAP (1 << 11)
#define MIC_GAIN_CAP (1 << 12)
#define FILTER_ROLL_OFF_CAP (1 << 13)
/* Used by every driver to export its min/max/default values for its audio
settings. */
@ -269,6 +270,11 @@ enum AUDIOHW_EQ_SETTINGS
#define AUDIOHW_HAVE_MIC_GAIN
#endif
#endif /* HAVE_RECORDING */
#if (AUDIOHW_CAPS & FILTER_ROLL_OFF_CAP)
#define AUDIOHW_HAVE_FILTER_ROLL_OFF
#endif
#endif /* AUDIOHW_CAPS */
#ifdef HAVE_SW_TONE_CONTROLS
@ -454,6 +460,16 @@ void audiohw_set_eq_band_width(unsigned int band, int val);
void audiohw_set_depth_3d(int val);
#endif
#ifdef AUDIOHW_HAVE_FILTER_ROLL_OFF
/**
* Set DAC's oversampling filter roll-off.
* @param val 0 - sharp roll-off, 1 - slow roll-off.
* NOTE: AUDIOHW_CAPS need to contain
* FILTER_ROLL_OFF_CAP
*/
void audiohw_set_filter_roll_off(int val);
#endif
void audiohw_set_frequency(int fsel);

View file

@ -110,6 +110,9 @@ AUDIOHW_SETTINGS(
#if defined(AUDIOHW_HAVE_DEPTH_3D)
AUDIOHW_SETTING_ENT(DEPTH_3D, sound_set_depth_3d)
#endif
#if defined(AUDIOHW_HAVE_FILTER_ROLL_OFF)
AUDIOHW_SETTING_ENT(FILTER_ROLL_OFF, sound_set_filter_roll_off)
#endif
/* Hardware EQ tone controls */
#if defined(AUDIOHW_HAVE_EQ)
AUDIOHW_SETTING_ENT(EQ_BAND1_GAIN, sound_set_hw_eq_band1_gain)

View file

@ -51,6 +51,10 @@ void sound_set_treble_cutoff(int value);
void sound_set_depth_3d(int value);
#endif
#if defined(AUDIOHW_HAVE_FILTER_ROLL_OFF)
void sound_set_filter_roll_off(int value);
#endif
#ifdef AUDIOHW_HAVE_EQ
/*
* band = SOUND_EQ_BANDb

View file

@ -314,6 +314,16 @@ void sound_set_depth_3d(int value)
}
#endif /* AUDIOHW_HAVE_DEPTH_3D */
#if defined(AUDIOHW_HAVE_FILTER_ROLL_OFF)
void sound_set_filter_roll_off(int value)
{
if (!audio_is_initialized)
return;
audiohw_set_filter_roll_off(value);
}
#endif
#if defined(AUDIOHW_HAVE_EQ)
int sound_enum_hw_eq_band_setting(unsigned int band,
unsigned int band_setting)