Skip to content

Commit

Permalink
Merge remote-tracking branch 'asoc/topic/pcm1681' into asoc-next
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Brown committed Mar 12, 2014
2 parents b8f8615 + 50a68fb commit 08fa654
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions sound/soc/codecs/pcm1681.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 08fa654

Please sign in to comment.