mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 01:49:46 +00:00
Set a limit of 0dB on Digital Volume Control
The main volume control in the PCM512x DAC has a range up to +24dB. This is dangerously loud and can potentially cause massive clipping in the output stages. Therefore this sets a sensible limit of 0dB for this control.
This commit is contained in:
committed by
popcornmix
parent
d1225854e0
commit
b9739050a1
@@ -25,7 +25,13 @@
|
||||
|
||||
static int snd_rpi_iqaudio_dac_init(struct snd_soc_pcm_runtime *rtd)
|
||||
{
|
||||
// NOT USED struct snd_soc_codec *codec = rtd->codec;
|
||||
int ret;
|
||||
struct snd_soc_card *card = rtd->card;
|
||||
struct snd_soc_codec *codec = rtd->codec;
|
||||
|
||||
ret = snd_soc_limit_volume(codec, "Digital Playback Volume", 207);
|
||||
if (ret < 0)
|
||||
dev_warn(card->dev, "Failed to set volume limit: %d\n", ret);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user