ASoC: core: Add support for DAI and machine kcontrols.
[deliverable/linux.git] / sound / soc / codecs / wm8994.c
index 93d27b6602571c3f600f9272defe0b05f12a8c3b..8ae6585edbe0ce518d2228c8d2b7f7db75ac32ee 100644 (file)
@@ -2645,6 +2645,7 @@ static struct snd_soc_dai_driver wm8994_dai[] = {
                        .channels_max = 2,
                        .rates = WM8994_RATES,
                        .formats = WM8994_FORMATS,
+                       .sig_bits = 24,
                },
                .capture = {
                        .stream_name = "AIF1 Capture",
@@ -2652,6 +2653,7 @@ static struct snd_soc_dai_driver wm8994_dai[] = {
                        .channels_max = 2,
                        .rates = WM8994_RATES,
                        .formats = WM8994_FORMATS,
+                       .sig_bits = 24,
                 },
                .ops = &wm8994_aif1_dai_ops,
        },
@@ -2664,6 +2666,7 @@ static struct snd_soc_dai_driver wm8994_dai[] = {
                        .channels_max = 2,
                        .rates = WM8994_RATES,
                        .formats = WM8994_FORMATS,
+                       .sig_bits = 24,
                },
                .capture = {
                        .stream_name = "AIF2 Capture",
@@ -2671,6 +2674,7 @@ static struct snd_soc_dai_driver wm8994_dai[] = {
                        .channels_max = 2,
                        .rates = WM8994_RATES,
                        .formats = WM8994_FORMATS,
+                       .sig_bits = 24,
                },
                .probe = wm8994_aif2_probe,
                .ops = &wm8994_aif2_dai_ops,
@@ -2684,6 +2688,7 @@ static struct snd_soc_dai_driver wm8994_dai[] = {
                        .channels_max = 2,
                        .rates = WM8994_RATES,
                        .formats = WM8994_FORMATS,
+                       .sig_bits = 24,
                },
                .capture = {
                        .stream_name = "AIF3 Capture",
@@ -2691,7 +2696,8 @@ static struct snd_soc_dai_driver wm8994_dai[] = {
                        .channels_max = 2,
                        .rates = WM8994_RATES,
                        .formats = WM8994_FORMATS,
-               },
+                       .sig_bits = 24,
+                },
                .ops = &wm8994_aif3_dai_ops,
        }
 };
@@ -2861,7 +2867,7 @@ static void wm8994_handle_retune_mobile_pdata(struct wm8994_priv *wm8994)
        wm8994->retune_mobile_enum.max = wm8994->num_retune_mobile_texts;
        wm8994->retune_mobile_enum.texts = wm8994->retune_mobile_texts;
 
-       ret = snd_soc_add_controls(wm8994->codec, controls,
+       ret = snd_soc_add_codec_controls(wm8994->codec, controls,
                                   ARRAY_SIZE(controls));
        if (ret != 0)
                dev_err(wm8994->codec->dev,
@@ -2914,7 +2920,7 @@ static void wm8994_handle_pdata(struct wm8994_priv *wm8994)
                wm8994->drc_enum.max = pdata->num_drc_cfgs;
                wm8994->drc_enum.texts = wm8994->drc_texts;
 
-               ret = snd_soc_add_controls(wm8994->codec, controls,
+               ret = snd_soc_add_codec_controls(wm8994->codec, controls,
                                           ARRAY_SIZE(controls));
                if (ret != 0)
                        dev_err(wm8994->codec->dev,
@@ -2930,7 +2936,7 @@ static void wm8994_handle_pdata(struct wm8994_priv *wm8994)
        if (pdata->num_retune_mobile_cfgs)
                wm8994_handle_retune_mobile_pdata(wm8994);
        else
-               snd_soc_add_controls(wm8994->codec, wm8994_eq_controls,
+               snd_soc_add_codec_controls(wm8994->codec, wm8994_eq_controls,
                                     ARRAY_SIZE(wm8994_eq_controls));
 
        for (i = 0; i < ARRAY_SIZE(pdata->micbias); i++) {
@@ -3083,7 +3089,7 @@ static void wm8958_default_micdet(u16 status, void *data)
        }
 
 
-       if (wm8994->mic_detecting && status & 0x4) {
+       if (wm8994->mic_detecting && status & 0xfc) {
                dev_dbg(codec->dev, "Detected headphone\n");
                wm8994->mic_detecting = false;
 
@@ -3390,10 +3396,18 @@ static int wm8994_codec_probe(struct snd_soc_codec *codec)
        pm_runtime_enable(codec->dev);
        pm_runtime_resume(codec->dev);
 
+       /* By default use idle_bias_off, will override for WM8994 */
+       codec->dapm.idle_bias_off = 1;
+
        /* Set revision-specific configuration */
        wm8994->revision = snd_soc_read(codec, WM8994_CHIP_REVISION);
        switch (control->type) {
        case WM8994:
+               /* Single ended line outputs should have VMID on. */
+               if (!wm8994->pdata->lineout1_diff ||
+                   !wm8994->pdata->lineout2_diff)
+                       codec->dapm.idle_bias_off = 0;
+
                switch (wm8994->revision) {
                case 2:
                case 3:
@@ -3638,7 +3652,7 @@ static int wm8994_codec_probe(struct snd_soc_codec *codec)
        wm8994_handle_pdata(wm8994);
 
        wm_hubs_add_analogue_controls(codec);
-       snd_soc_add_controls(codec, wm8994_snd_controls,
+       snd_soc_add_codec_controls(codec, wm8994_snd_controls,
                             ARRAY_SIZE(wm8994_snd_controls));
        snd_soc_dapm_new_controls(dapm, wm8994_dapm_widgets,
                                  ARRAY_SIZE(wm8994_dapm_widgets));
@@ -3664,7 +3678,7 @@ static int wm8994_codec_probe(struct snd_soc_codec *codec)
                }
                break;
        case WM8958:
-               snd_soc_add_controls(codec, wm8958_snd_controls,
+               snd_soc_add_codec_controls(codec, wm8958_snd_controls,
                                     ARRAY_SIZE(wm8958_snd_controls));
                snd_soc_dapm_new_controls(dapm, wm8958_dapm_widgets,
                                          ARRAY_SIZE(wm8958_dapm_widgets));
@@ -3686,7 +3700,7 @@ static int wm8994_codec_probe(struct snd_soc_codec *codec)
                break;
 
        case WM1811:
-               snd_soc_add_controls(codec, wm8958_snd_controls,
+               snd_soc_add_codec_controls(codec, wm8958_snd_controls,
                                     ARRAY_SIZE(wm8958_snd_controls));
                snd_soc_dapm_new_controls(dapm, wm8958_dapm_widgets,
                                          ARRAY_SIZE(wm8958_dapm_widgets));
This page took 0.026679 seconds and 5 git commands to generate.