ASoC: wm8960: Convert to params_width()
authorMark Brown <broonie@linaro.org>
Thu, 31 Jul 2014 11:53:23 +0000 (12:53 +0100)
committerMark Brown <broonie@linaro.org>
Thu, 31 Jul 2014 17:47:43 +0000 (18:47 +0100)
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>
sound/soc/codecs/wm8960.c

index a145d04..1916ac7 100644 (file)
@@ -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;
        }