ASoC: max9867: fix volume controls
authorPavel Dobias <dobias@2n.cz>
Fri, 15 May 2020 12:07:57 +0000 (14:07 +0200)
committerMark Brown <broonie@kernel.org>
Mon, 18 May 2020 17:33:27 +0000 (18:33 +0100)
The xmax values for Master Playback Volume and Mic Boost
Capture Volume are specified incorrectly (one greater)
which results in the wrong dB gain being shown to the user
in the case of Master Playback Volume.

Signed-off-by: Pavel Dobias <dobias@2n.cz>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20200515120757.24669-1-dobias@2n.cz
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/max9867.c

index 8600c54..2e4aa23 100644 (file)
@@ -46,13 +46,13 @@ static const SNDRV_CTL_TLVD_DECLARE_DB_RANGE(max9867_micboost_tlv,
 
 static const struct snd_kcontrol_new max9867_snd_controls[] = {
        SOC_DOUBLE_R_TLV("Master Playback Volume", MAX9867_LEFTVOL,
-                       MAX9867_RIGHTVOL, 0, 41, 1, max9867_master_tlv),
+                       MAX9867_RIGHTVOL, 0, 40, 1, max9867_master_tlv),
        SOC_DOUBLE_R_TLV("Line Capture Volume", MAX9867_LEFTLINELVL,
                        MAX9867_RIGHTLINELVL, 0, 15, 1, max9867_line_tlv),
        SOC_DOUBLE_R_TLV("Mic Capture Volume", MAX9867_LEFTMICGAIN,
                        MAX9867_RIGHTMICGAIN, 0, 20, 1, max9867_mic_tlv),
        SOC_DOUBLE_R_TLV("Mic Boost Capture Volume", MAX9867_LEFTMICGAIN,
-                       MAX9867_RIGHTMICGAIN, 5, 4, 0, max9867_micboost_tlv),
+                       MAX9867_RIGHTMICGAIN, 5, 3, 0, max9867_micboost_tlv),
        SOC_SINGLE("Digital Sidetone Volume", MAX9867_SIDETONE, 0, 31, 1),
        SOC_SINGLE_TLV("Digital Playback Volume", MAX9867_DACLEVEL, 0, 15, 1,
                        max9867_dac_tlv),