]> Git Repo - linux.git/commitdiff
ASoC: codecs: jz4725b: use right control for Capture Volume
authorSiarhei Volkau <[email protected]>
Sun, 16 Oct 2022 13:26:44 +0000 (16:26 +0300)
committerMark Brown <[email protected]>
Mon, 17 Oct 2022 11:50:27 +0000 (12:50 +0100)
Line In Bypass control is used as Master Capture at the moment
this is completely incorrect.

Current control routed to Mixer instead of ADC, thus can't affect
Capture path. ADC control shall be used instead.

ADC volume control parameters are different, so the patch fixes that
as well. Manual says (16.6.3.2 Programmable input attenuation amplifier:
PGATM) that gain varies in range 0dB..22.5dB with 1.5dB step.

Signed-off-by: Siarhei Volkau <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
sound/soc/codecs/jz4725b.c

index 72549ee2e78930f68f8ce47d2eed65e55a5d5d23..4363d898a7d4e2ca1ea3c16fb8c7668a89408805 100644 (file)
@@ -136,13 +136,16 @@ enum {
 #define REG_CGR3_GO1L_OFFSET           0
 #define REG_CGR3_GO1L_MASK             (0x1f << REG_CGR3_GO1L_OFFSET)
 
+#define REG_CGR10_GIL_OFFSET           0
+#define REG_CGR10_GIR_OFFSET           4
+
 struct jz_icdc {
        struct regmap *regmap;
        void __iomem *base;
        struct clk *clk;
 };
 
-static const SNDRV_CTL_TLVD_DECLARE_DB_LINEAR(jz4725b_line_tlv, -1500, 600);
+static const SNDRV_CTL_TLVD_DECLARE_DB_SCALE(jz4725b_adc_tlv,     0, 150, 0);
 static const SNDRV_CTL_TLVD_DECLARE_DB_SCALE(jz4725b_dac_tlv, -2250, 150, 0);
 
 static const struct snd_kcontrol_new jz4725b_codec_controls[] = {
@@ -151,11 +154,11 @@ static const struct snd_kcontrol_new jz4725b_codec_controls[] = {
                       REG_CGR1_GODL_OFFSET,
                       REG_CGR1_GODR_OFFSET,
                       0xf, 1, jz4725b_dac_tlv),
-       SOC_DOUBLE_R_TLV("Master Capture Volume",
-                        JZ4725B_CODEC_REG_CGR3,
-                        JZ4725B_CODEC_REG_CGR2,
-                        REG_CGR2_GO1R_OFFSET,
-                        0x1f, 1, jz4725b_line_tlv),
+       SOC_DOUBLE_TLV("Master Capture Volume",
+                      JZ4725B_CODEC_REG_CGR10,
+                      REG_CGR10_GIL_OFFSET,
+                      REG_CGR10_GIR_OFFSET,
+                      0xf, 0, jz4725b_adc_tlv),
 
        SOC_SINGLE("Master Playback Switch", JZ4725B_CODEC_REG_CR1,
                   REG_CR1_DAC_MUTE_OFFSET, 1, 1),
This page took 0.058525 seconds and 4 git commands to generate.