ASoC: Intel: sof_sdw: use .controls/.widgets to add controls/widgets
[sfrench/cifs-2.6.git] / sound / soc / intel / boards / sof_sdw_rt5682.c
index 9fbe36322a835a2d680df31f0ed7da91e914a282..1741226fe052f28540d4722838598e87ad71eff7 100644 (file)
 #include <sound/jack.h>
 #include "sof_sdw_common.h"
 
-static const struct snd_soc_dapm_widget generic_jack_widgets[] = {
-       SND_SOC_DAPM_HP("Headphone", NULL),
-       SND_SOC_DAPM_MIC("Headset Mic", NULL),
-};
-
 static const struct snd_soc_dapm_route rt5682_map[] = {
        /*Headphones*/
        { "Headphone", NULL, "rt5682 HPOL" },
@@ -29,11 +24,6 @@ static const struct snd_soc_dapm_route rt5682_map[] = {
        { "rt5682 IN1P", NULL, "Headset Mic" },
 };
 
-static const struct snd_kcontrol_new generic_jack_controls[] = {
-       SOC_DAPM_PIN_SWITCH("Headphone"),
-       SOC_DAPM_PIN_SWITCH("Headset Mic"),
-};
-
 static struct snd_soc_jack_pin rt5682_jack_pins[] = {
        {
                .pin    = "Headphone",
@@ -69,20 +59,6 @@ int rt5682_rtd_init(struct snd_soc_pcm_runtime *rtd)
        if (!card->components)
                return -ENOMEM;
 
-       ret = snd_soc_add_card_controls(card, generic_jack_controls,
-                                       ARRAY_SIZE(generic_jack_controls));
-       if (ret) {
-               dev_err(card->dev, "rt5682 control addition failed: %d\n", ret);
-               return ret;
-       }
-
-       ret = snd_soc_dapm_new_controls(&card->dapm, generic_jack_widgets,
-                                       ARRAY_SIZE(generic_jack_widgets));
-       if (ret) {
-               dev_err(card->dev, "rt5682 widgets addition failed: %d\n", ret);
-               return ret;
-       }
-
        ret = snd_soc_dapm_add_routes(&card->dapm, rt5682_map,
                                      ARRAY_SIZE(rt5682_map));