]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ASoC: codecs: ES8326: Add a kcontrol for PGAGAIN
authorZhang Yi <zhangyi@everest-semi.com>
Tue, 16 Dec 2025 06:47:20 +0000 (14:47 +0800)
committerMark Brown <broonie@kernel.org>
Wed, 17 Dec 2025 12:01:24 +0000 (12:01 +0000)
set a kcontrol to control bit 7 of ES8326_PGAGAIN
instead of setting a fixed value in the driver

Signed-off-by: Zhang Yi <zhangyi@everest-semi.com>
Link: https://patch.msgid.link/20251216064721.4622-2-zhangyi@everest-semi.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/es8326.c

index 05b13661c38cdfcb2ed4764170540e4241458224..25dcce15a1fef6bce8cb83b8178ad03700bbfab3 100644 (file)
@@ -245,6 +245,7 @@ static const struct snd_kcontrol_new es8326_snd_controls[] = {
                         adc_vol_tlv),
        SOC_DOUBLE_TLV("ADC PGA Volume", ES8326_ADC_SCALE, 4, 0, 5, 0, adc_pga_tlv),
        SOC_SINGLE_TLV("ADC PGA Gain Volume", ES8326_PGAGAIN, 0, 10, 0, adc_analog_pga_tlv),
+       SOC_SINGLE("ADC PGA SE Switch", ES8326_PGAGAIN, 7, 1, 0),
        SOC_SINGLE_TLV("ADC Ramp Rate", ES8326_ADC_RAMPRATE, 0, 0x0f, 0, softramp_rate),
        SOC_SINGLE("ALC Capture Switch", ES8326_ALC_RECOVERY, 3, 1, 0),
        SOC_SINGLE_TLV("ALC Capture Recovery Level", ES8326_ALC_LEVEL,
@@ -934,11 +935,8 @@ static void es8326_jack_detect_handler(struct work_struct *work)
                        dev_dbg(comp->dev, "Headset detected\n");
                        snd_soc_jack_report(es8326->jack,
                                        SND_JACK_HEADSET, SND_JACK_HEADSET);
-
                        regmap_update_bits(es8326->regmap, ES8326_PGA_PDN,
                                        0x08, 0x08);
-                       regmap_update_bits(es8326->regmap, ES8326_PGAGAIN,
-                                       0x80, 0x80);
                        regmap_write(es8326->regmap, ES8326_ADC1_SRC, 0x00);
                        regmap_write(es8326->regmap, ES8326_ADC2_SRC, 0x00);
                        regmap_update_bits(es8326->regmap, ES8326_PGA_PDN,