ASoC: codecs: nau8824: fix max volume for Speaker output
authorMaxim Kochetkov <fido_max@inbox.ru>
Thu, 19 Dec 2024 04:22:27 +0000 (07:22 +0300)
committerMark Brown <broonie@kernel.org>
Mon, 13 Jan 2025 14:16:44 +0000 (14:16 +0000)
There is no audio output if Speaker volume is set above 25.
According to datasheet Rev 2.5 maximum allowed value for the
Speaker output is 0b11001 (25)

0x6D CLASSD_GAIN_1/ 0x6E CLASSD_GAIN_2:

Left/Right Channel Class-D Driver Gain For DAC Left/Right
Input
(Step size is 1dB.)
00000 = Mute (DEFAULT)
00001 = 0dB
00002 = 1dB
...
11000 = 23dB
11001 = 24dB

So adjust this value in accordance with the datasheet.

Signed-off-by: Maxim Kochetkov <fido_max@inbox.ru>
Link: https://patch.msgid.link/20241219042227.7075-1-fido_max@inbox.ru
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/nau8824.c

index 12540397fd4d544eb6dee34a7badbb2d917785ea..5aaf8c4963002433a7a5d92f7753a9fa2656b7bc 100644 (file)
@@ -368,13 +368,13 @@ static const struct snd_kcontrol_new nau8824_snd_controls[] = {
        SOC_ENUM("DAC Oversampling Rate", nau8824_dac_oversampl_enum),
 
        SOC_SINGLE_TLV("Speaker Right DACR Volume",
-               NAU8824_REG_CLASSD_GAIN_1, 8, 0x1f, 0, spk_vol_tlv),
+               NAU8824_REG_CLASSD_GAIN_1, 8, 0x19, 0, spk_vol_tlv),
        SOC_SINGLE_TLV("Speaker Left DACL Volume",
-               NAU8824_REG_CLASSD_GAIN_2, 0, 0x1f, 0, spk_vol_tlv),
+               NAU8824_REG_CLASSD_GAIN_2, 0, 0x19, 0, spk_vol_tlv),
        SOC_SINGLE_TLV("Speaker Left DACR Volume",
-               NAU8824_REG_CLASSD_GAIN_1, 0, 0x1f, 0, spk_vol_tlv),
+               NAU8824_REG_CLASSD_GAIN_1, 0, 0x19, 0, spk_vol_tlv),
        SOC_SINGLE_TLV("Speaker Right DACL Volume",
-               NAU8824_REG_CLASSD_GAIN_2, 8, 0x1f, 0, spk_vol_tlv),
+               NAU8824_REG_CLASSD_GAIN_2, 8, 0x19, 0, spk_vol_tlv),
 
        SOC_SINGLE_TLV("Headphone Right DACR Volume",
                NAU8824_REG_ATT_PORT0, 8, 0x1f, 0, hp_vol_tlv),