diff options
author | Siarhei Volkau <lis8215@gmail.com> | 2022-10-16 16:26:48 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2022-10-17 12:50:31 +0100 |
commit | 4b192aa09b3c3615c79f8c60704a2efd15e500d0 (patch) | |
tree | d03c37feed6ab8a3279a52386ef82c62f3f97e40 | |
parent | 616c291820d155cbad258ecae5c7dbca2c01f07f (diff) |
ASoC: codecs: jz4725b: add missed microphone widgets
Microphone input can be single ended or differential, although
known SoCs with that codec expose MIC1P only.
Also there is 20dB mic boost in the Mic1 path.
Signed-off-by: Siarhei Volkau <lis8215@gmail.com>
Link: https://lore.kernel.org/r/20221016132648.3011729-8-lis8215@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r-- | sound/soc/codecs/jz4725b.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/sound/soc/codecs/jz4725b.c b/sound/soc/codecs/jz4725b.c index 52b2bb95baa1..685ba1d3a644 100644 --- a/sound/soc/codecs/jz4725b.c +++ b/sound/soc/codecs/jz4725b.c @@ -175,6 +175,15 @@ static const SNDRV_CTL_TLVD_DECLARE_DB_RANGE(jz4725b_out_tlv, 12, 23, TLV_DB_SCALE_ITEM(-1050, 100, 0), 24, 31, TLV_DB_SCALE_ITEM( 100, 50, 0), ); +static const SNDRV_CTL_TLVD_DECLARE_DB_SCALE(jz4725b_mic_boost_tlv, 0, 2000, 0); + +static const char * const jz4725b_mic_mode_texts[] = { + "Single Ended", "Differential", +}; + +static const struct soc_enum jz4725b_mic_mode_enum = + SOC_ENUM_SINGLE(JZ4725B_CODEC_REG_CR3, REG_CR3_MICDIFF_OFFSET, + 2, jz4725b_mic_mode_texts); static const struct snd_kcontrol_new jz4725b_codec_controls[] = { SOC_DOUBLE_TLV("DAC Playback Volume", @@ -219,6 +228,13 @@ static const struct snd_kcontrol_new jz4725b_codec_controls[] = { SOC_SINGLE("High-Pass Filter Capture Switch", JZ4725B_CODEC_REG_CR2, REG_CR2_ADC_HPF_OFFSET, 1, 0), + + SOC_ENUM("Mic Mode Capture Switch", jz4725b_mic_mode_enum), + + SOC_SINGLE_TLV("Mic1 Boost Capture Volume", + JZ4725B_CODEC_REG_PMR2, + REG_PMR2_GIM_OFFSET, + 1, 0, jz4725b_mic_boost_tlv), }; static const char * const jz4725b_codec_adc_src_texts[] = { |