ASoC: Fix maximum value for microphone gain
Subsystems (3)
Fabio Estevam
maintainerPATCH 1/1 ASoC: Fix maximum value for microphone gain
From: Fabio Estevam <[email protected]>
sgtl5000 microphone gain only has 2 bits of resolution, so maximum value is 3.
Quoted 1 line
From Eric Nelson:
"We also found that for the microphones we have here (commodity PC boom mics) a default value of 2 for the gain gives the best results."
So change the default microphone gain as well.
--- sound/soc/codecs/sgtl5000.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
sound/soc/codecs/sgtl5000.c +2 -2
@@ -401,7 +401,7 @@ static const struct snd_kcontrol_new sgtl5000_snd_controls[] = { 5, 1, 0),SOC_SINGLE_TLV ("Mic Volume" ,SGTL5000_CHIP_MIC_CTRL , - 0, 4, 0, mic_gain_tlv), + 0, 3, 0, mic_gain_tlv), };/* mute the codec used by alsa core */
@@ -1344,7 +1344,7 @@ static int sgtl5000_probe(struct snd_soc_codec *codec)SGTL5000_HP_ZCD_EN | SGTL5000_ADC_ZCD_EN); -snd_soc_write (codec,SGTL5000_CHIP_MIC_CTRL ,0 ); +snd_soc_write (codec,SGTL5000_CHIP_MIC_CTRL ,2 );/* * disable DAP
Signature · 1 line
1.7.9.5
Quoted 9 lines · Fabio Estevam
From: Fabio Estevam <[email protected]>
sgtl5000 microphone gain only has 2 bits of resolution, so maximum value is 3.
From Eric Nelson:
"We also found that for the microphones we have here (commodity PC boom mics) a default value of 2 for the gain gives the best results."So change the default microphone gain as well.
The first bit is fine but the default change is not generally the sort of thing we do in ASoC - we generally go with the chip defaults, it saves on going round in circles arguing about what the defaults should be. Why would other systems not want a different default?