Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ASoC: codecs/jz4770: Add missing gain control after DAC/ADC mixer

The capture and playback paths both have a configurable gain after their
respective mixer, which can be set from -31 dB to 0 dB in 32 steps.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Link: https://lore.kernel.org/r/20211125232543.117074-1-paul@crapouillou.net
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Paul Cercueil and committed by
Mark Brown
0b189395 f670b274

+9
+9
sound/soc/codecs/jz4770.c
··· 307 307 static const DECLARE_TLV_DB_SCALE(adc_tlv, 0, 100, 0); 308 308 static const DECLARE_TLV_DB_MINMAX(out_tlv, -2500, 600); 309 309 static const DECLARE_TLV_DB_SCALE(linein_tlv, -2500, 100, 0); 310 + static const DECLARE_TLV_DB_MINMAX(mixer_tlv, -3100, 0); 310 311 311 312 /* Unconditional controls. */ 312 313 static const struct snd_kcontrol_new jz4770_codec_snd_controls[] = { ··· 320 319 SOC_DOUBLE_R_TLV("Line In Bypass Playback Volume", 321 320 JZ4770_CODEC_REG_GCR_LIBYL, JZ4770_CODEC_REG_GCR_LIBYR, 322 321 REG_GCR_GAIN_OFFSET, REG_GCR_GAIN_MAX, 1, linein_tlv), 322 + 323 + SOC_SINGLE_TLV("Mixer Capture Volume", 324 + JZ4770_CODEC_REG_GCR_MIXADC, 325 + REG_GCR_GAIN_OFFSET, REG_GCR_GAIN_MAX, 1, mixer_tlv), 326 + 327 + SOC_SINGLE_TLV("Mixer Playback Volume", 328 + JZ4770_CODEC_REG_GCR_MIXDAC, 329 + REG_GCR_GAIN_OFFSET, REG_GCR_GAIN_MAX, 1, mixer_tlv), 323 330 }; 324 331 325 332 static const struct snd_kcontrol_new jz4770_codec_pcm_playback_controls[] = {