Merge remote-tracking branches 'asoc/topic/tlv320aic3x', 'asoc/topic/width', 'asoc...
[linux-drm-fsl-dcu.git] / sound / soc / codecs / wm8960.c
index a145d0431b63dbc11c975f8b226a6f250ed17008..4dc4e85116cd214da566ff84d7d56e673e17927a 100644 (file)
@@ -472,7 +472,7 @@ static int wm8960_add_widgets(struct snd_soc_codec *codec)
         * list each time to find the desired power state do so now
         * and save the result.
         */
-       list_for_each_entry(w, &codec->card->widgets, list) {
+       list_for_each_entry(w, &codec->component.card->widgets, list) {
                if (w->dapm != &codec->dapm)
                        continue;
                if (strcmp(w->name, "LOUT1 PGA") == 0)
@@ -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;
        }