linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 1/1] ASoC: codecs: nau8824: fix max volume for Speaker output
@ 2024-12-19  4:22 Maxim Kochetkov
  2025-01-13 16:57 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Maxim Kochetkov @ 2024-12-19  4:22 UTC (permalink / raw)
  To: linux-sound, alsa-devel
  Cc: andy.shevchenko, u.kleine-koenig, tiwai, perex, broonie,
	lgirdwood, linux-kernel, Maxim Kochetkov

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>
---
 sound/soc/codecs/nau8824.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/sound/soc/codecs/nau8824.c b/sound/soc/codecs/nau8824.c
index 12540397fd4d..5aaf8c496300 100644
--- a/sound/soc/codecs/nau8824.c
+++ b/sound/soc/codecs/nau8824.c
@@ -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),
-- 
2.45.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2 1/1] ASoC: codecs: nau8824: fix max volume for Speaker output
  2024-12-19  4:22 [PATCH v2 1/1] ASoC: codecs: nau8824: fix max volume for Speaker output Maxim Kochetkov
@ 2025-01-13 16:57 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2025-01-13 16:57 UTC (permalink / raw)
  To: linux-sound, alsa-devel, Maxim Kochetkov
  Cc: andy.shevchenko, u.kleine-koenig, tiwai, perex, lgirdwood,
	linux-kernel

On Thu, 19 Dec 2024 07:22:27 +0300, Maxim Kochetkov wrote:
> 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
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/1] ASoC: codecs: nau8824: fix max volume for Speaker output
      commit: d5a4d7f10fcdcae952f7d5c603c61795c0abb7a7

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-01-13 16:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-19  4:22 [PATCH v2 1/1] ASoC: codecs: nau8824: fix max volume for Speaker output Maxim Kochetkov
2025-01-13 16:57 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).