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:
Howard Mitchell
2015-03-02 17:28:02 +00:00
committed by popcornmix
parent d1225854e0
commit b9739050a1

View File

@@ -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;
}