Skip to content

Commit

Permalink
ASoC: AD1836: Add input gain control for ADC2
Browse files Browse the repository at this point in the history
The AD1836 has a PGA for its second ADC. This patch adds a control for
adjusting the the gain of the PGA.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
  • Loading branch information
Lars-Peter Clausen authored and Mark Brown committed Jun 6, 2011
1 parent 583eada commit f97d0c6
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions sound/soc/codecs/ad1836.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,13 @@ static const struct snd_soc_dapm_route ad183x_dapm_routes[] = {
{ "ADC", NULL, "ADC_PWR" },
};

static const DECLARE_TLV_DB_SCALE(ad1836_in_tlv, 0, 300, 0);

static const struct snd_kcontrol_new ad1836_controls[] = {
SOC_DOUBLE_TLV("ADC2 Capture Volume", AD183X_ADC_CTRL1, 3, 0, 4, 0,
ad1836_in_tlv),
};

/*
* DAI ops entries
*/
Expand Down Expand Up @@ -280,6 +287,10 @@ static int ad1836_probe(struct snd_soc_codec *codec)
if (ad1836->type == AD1836) {
/* left/right diff:PGA/MUX */
snd_soc_write(codec, AD1836_ADC_CTRL3, 0x3A);
ret = snd_soc_add_controls(codec, ad1836_controls,
ARRAY_SIZE(ad1836_controls));
if (ret)
return ret;
} else {
snd_soc_write(codec, AD1836_ADC_CTRL3, 0x00);
}
Expand Down

0 comments on commit f97d0c6

Please sign in to comment.