Skip to content

Commit

Permalink
odroid-c2:Digital volume of hifi-shield2 is limited to 0dB.
Browse files Browse the repository at this point in the history
Change-Id: I43415efb1b8db5a35e06a447837b542ff98ecfc6
  • Loading branch information
hardkernel committed Mar 16, 2017
1 parent 66d5649 commit 0099bd0
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions sound/soc/aml/m8/odroid_dac2.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,24 @@

#define DRV_NAME "odroid_dac2"

static bool digital_gain_0db_limit = true;

static int odroid_dac2_init(struct snd_soc_pcm_runtime *rtd)
{
if (digital_gain_0db_limit) {
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;
}

static int dac2_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params)
{
Expand Down Expand Up @@ -104,6 +122,7 @@ static struct snd_soc_dai_link dac2_dai_link[] = {
.codec_name = "pcm512x.1-004c",
.codec_dai_name = "pcm512x-hifi",
.ops = &odroid_ops,
.init = odroid_dac2_init,
},
};

Expand Down

0 comments on commit 0099bd0

Please sign in to comment.