diff options
author | Mark Brown <broonie@linaro.org> | 2014-07-31 12:53:23 +0100 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2014-07-31 18:47:43 +0100 |
commit | 39e9cc46469e1d56522e6de45a6b2468d4d7eb60 (patch) | |
tree | 24bf8795ef621ed6bd00b069552ea628b4d3ff4a /sound | |
parent | 1df93ca37501f752add410f5994e1259ae714e17 (diff) | |
download | blackbird-op-linux-39e9cc46469e1d56522e6de45a6b2468d4d7eb60.tar.gz blackbird-op-linux-39e9cc46469e1d56522e6de45a6b2468d4d7eb60.zip |
ASoC: wm8960: Convert to params_width()
The CODEC doesn't care how data is laid out in memory.
Signed-off-by: Mark Brown <broonie@linaro.org>
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/codecs/wm8960.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/sound/soc/codecs/wm8960.c b/sound/soc/codecs/wm8960.c index a145d0431b63..1916ac74fdc4 100644 --- a/sound/soc/codecs/wm8960.c +++ b/sound/soc/codecs/wm8960.c @@ -567,24 +567,21 @@ static int wm8960_hw_params(struct snd_pcm_substream *substream, struct snd_soc_codec *codec = dai->codec; struct wm8960_priv *wm8960 = snd_soc_codec_get_drvdata(codec); u16 iface = snd_soc_read(codec, WM8960_IFACE1) & 0xfff3; - snd_pcm_format_t format = params_format(params); int i; /* bit size */ - switch (format) { - case SNDRV_PCM_FORMAT_S16_LE: - case SNDRV_PCM_FORMAT_S16_BE: + switch (params_width(params)) { + case 16: break; - case SNDRV_PCM_FORMAT_S20_3LE: - case SNDRV_PCM_FORMAT_S20_3BE: + case 20: iface |= 0x0004; break; - case SNDRV_PCM_FORMAT_S24_LE: - case SNDRV_PCM_FORMAT_S24_BE: + case 24: iface |= 0x0008; break; default: - dev_err(codec->dev, "unsupported format %i\n", format); + dev_err(codec->dev, "unsupported width %d\n", + params_width(params)); return -EINVAL; } |