diff options
author | Mark Brown <broonie@linaro.org> | 2014-03-12 23:04:07 +0000 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2014-03-12 23:04:07 +0000 |
commit | 08fa654549bc427a7660a1c93d8ba5bd477618ba (patch) | |
tree | 6a49f9885fc2761e3aa0675965840fa5126acccb /sound/soc/codecs | |
parent | b8f861586c9c2433b22f81e933845cb8aaa18d9e (diff) | |
parent | 50a68fb4bc2516f593ceffa6617c93090d335f31 (diff) |
Merge remote-tracking branch 'asoc/topic/pcm1681' into asoc-next
Diffstat (limited to 'sound/soc/codecs')
-rw-r--r-- | sound/soc/codecs/pcm1681.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/sound/soc/codecs/pcm1681.c b/sound/soc/codecs/pcm1681.c index 73f9c3630e2c..e427544183d7 100644 --- a/sound/soc/codecs/pcm1681.c +++ b/sound/soc/codecs/pcm1681.c @@ -172,16 +172,21 @@ static int pcm1681_hw_params(struct snd_pcm_substream *substream, struct snd_soc_codec *codec = dai->codec; struct pcm1681_private *priv = snd_soc_codec_get_drvdata(codec); int val = 0, ret; - int pcm_format = params_format(params); priv->rate = params_rate(params); switch (priv->format & SND_SOC_DAIFMT_FORMAT_MASK) { case SND_SOC_DAIFMT_RIGHT_J: - if (pcm_format == SNDRV_PCM_FORMAT_S24_LE) - val = 0x00; - else if (pcm_format == SNDRV_PCM_FORMAT_S16_LE) - val = 0x03; + switch (params_width(params)) { + case 24: + val = 0; + break; + case 16: + val = 3; + break; + default: + return -EINVAL; + } break; case SND_SOC_DAIFMT_I2S: val = 0x04; |