Skip to content

Commit

Permalink
ASoC: sgtl5000: Fix maximum value for microphone gain
Browse files Browse the repository at this point in the history
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.

Signed-off-by: Eric Nelson <eric.nelson@boundarydevices.com>
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
  • Loading branch information
Fabio Estevam authored and Mark Brown committed Dec 24, 2012
1 parent a49f0d1 commit b50684d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sound/soc/codecs/sgtl5000.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit b50684d

Please sign in to comment.