From b58fcf48f12dec6bbd0f3b8f120407c4a4eb394b Mon Sep 17 00:00:00 2001 From: ckkim Date: Thu, 20 Aug 2020 14:16:59 +0900 Subject: [PATCH] ODROID-C4:soundcard digital volume is limited to 0dB Change-Id: I6e162e6ead96ad9264ee23afa2f72936966113ad --- sound/soc/amlogic/auge/card.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/sound/soc/amlogic/auge/card.c b/sound/soc/amlogic/auge/card.c index 4b90f8b904f5..1dc7247c6d03 100644 --- a/sound/soc/amlogic/auge/card.c +++ b/sound/soc/amlogic/auge/card.c @@ -499,6 +499,20 @@ static int aml_card_dai_init(struct snd_soc_pcm_runtime *rtd) bool idle_clk = false; int ret, i; +#if defined(CONFIG_ARCH_MESON64_ODROID_COMMON) + struct snd_soc_card *card = rtd->card; + struct device *dev = aml_priv_to_dev(priv); + + /* Hifi-shield2 : Digital volume is limited to 0dB */ + ret = snd_soc_limit_volume(card, "Digital Playback Volume", 207); + if (ret < 0) + dev_dbg(dev, "Not found mixer : 'Digital Playback Volume'\n"); + + /* line-out : Digital volume is limited to 0dB */ + ret = snd_soc_limit_volume(card, "DAC Digital Playback Volume", 254); + if (ret < 0) + dev_dbg(dev, "Not found mixer : 'DAC Digital Playback Volume'\n"); +#endif /* enable dai-link mclk when CONTINUOUS clk setted */ idle_clk = !!(rtd->dai_link->dai_fmt & SND_SOC_DAIFMT_CONT);