aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/pcm1681.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/codecs/pcm1681.c')
-rw-r--r--sound/soc/codecs/pcm1681.c15
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,
172 struct snd_soc_codec *codec = dai->codec; 172 struct snd_soc_codec *codec = dai->codec;
173 struct pcm1681_private *priv = snd_soc_codec_get_drvdata(codec); 173 struct pcm1681_private *priv = snd_soc_codec_get_drvdata(codec);
174 int val = 0, ret; 174 int val = 0, ret;
175 int pcm_format = params_format(params);
176 175
177 priv->rate = params_rate(params); 176 priv->rate = params_rate(params);
178 177
179 switch (priv->format & SND_SOC_DAIFMT_FORMAT_MASK) { 178 switch (priv->format & SND_SOC_DAIFMT_FORMAT_MASK) {
180 case SND_SOC_DAIFMT_RIGHT_J: 179 case SND_SOC_DAIFMT_RIGHT_J:
181 if (pcm_format == SNDRV_PCM_FORMAT_S24_LE) 180 switch (params_width(params)) {
182 val = 0x00; 181 case 24:
183 else if (pcm_format == SNDRV_PCM_FORMAT_S16_LE) 182 val = 0;
184 val = 0x03; 183 break;
184 case 16:
185 val = 3;
186 break;
187 default:
188 return -EINVAL;
189 }
185 break; 190 break;
186 case SND_SOC_DAIFMT_I2S: 191 case SND_SOC_DAIFMT_I2S:
187 val = 0x04; 192 val = 0x04;