ASoC: Remove table based DAPM/control setup support from snd_soc_platform_driver
authorLars-Peter Clausen <lars@metafoo.de>
Wed, 20 Aug 2014 11:08:49 +0000 (13:08 +0200)
committerMark Brown <broonie@linaro.org>
Sat, 6 Sep 2014 13:46:30 +0000 (14:46 +0100)
There are no users left and new users should rather use the component_driver
struct embedded in the snd_soc_platform_driver struct to do this. E.g.:

static const struct snd_soc_platform_driver foobar_driver = {
.component_driver = {
.dapm_widgets = ...,
.num_dapm_widgets = ...,
...,
},
...
};

instead of

static const struct snd_soc_platform_driver foobar_driver = {
.dapm_widgets = ...,
.num_dapm_widgets = ...,
...
};

This also allows us to remove the steal_sibling_dai_widgets hack.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
include/sound/soc.h
sound/soc/soc-core.c

index f8b23dd7c3a79b959b8349cd2146e4362943423a..cd141a156da28a97be3b1aba4ff12cdaaef0e6f3 100644 (file)
@@ -764,7 +764,6 @@ struct snd_soc_component {
        unsigned int num_dapm_widgets;
        const struct snd_soc_dapm_route *dapm_routes;
        unsigned int num_dapm_routes;
-       bool steal_sibling_dai_widgets;
        struct snd_soc_codec *codec;
 
        int (*probe)(struct snd_soc_component *);
@@ -868,14 +867,6 @@ struct snd_soc_platform_driver {
        int (*pcm_new)(struct snd_soc_pcm_runtime *);
        void (*pcm_free)(struct snd_pcm *);
 
-       /* Default control and setup, added after probe() is run */
-       const struct snd_kcontrol_new *controls;
-       int num_controls;
-       const struct snd_soc_dapm_widget *dapm_widgets;
-       int num_dapm_widgets;
-       const struct snd_soc_dapm_route *dapm_routes;
-       int num_dapm_routes;
-
        /*
         * For platform caused delay reporting.
         * Optional.
index 1b422c5c36c8ef8ca6f31d6a040cdd7cf69101f3..052f59c1917f4f477420f9df0504a49a6c46d43a 100644 (file)
@@ -1087,7 +1087,6 @@ static int soc_probe_component(struct snd_soc_card *card,
        struct snd_soc_component *component)
 {
        struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component);
-       struct snd_soc_component *dai_component, *component2;
        struct snd_soc_dai *dai;
        int ret;
 
@@ -1114,44 +1113,12 @@ static int soc_probe_component(struct snd_soc_card *card,
                }
        }
 
-       /*
-        * This is rather ugly, but certain platforms expect that the DAPM
-        * widgets for the DAIs for components with the same parent device are
-        * created in the platforms DAPM context. Until that is fixed we need to
-        * keep this.
-        */
-       if (component->steal_sibling_dai_widgets) {
-               dai_component = NULL;
-               list_for_each_entry(component2, &component_list, list) {
-                       if (component == component2)
-                               continue;
-
-                       if (component2->dev == component->dev &&
-                           !list_empty(&component2->dai_list)) {
-                               dai_component = component2;
-                               break;
-                       }
-               }
-       } else {
-               dai_component = component;
-               list_for_each_entry(component2, &component_list, list) {
-                       if (component2->dev == component->dev &&
-                           component2->steal_sibling_dai_widgets) {
-                               dai_component = NULL;
-                               break;
-                       }
-               }
-       }
-
-       if (dai_component) {
-               list_for_each_entry(dai, &dai_component->dai_list, list) {
-                       snd_soc_dapm_new_dai_widgets(dapm, dai);
-                       if (ret != 0) {
-                               dev_err(component->dev,
-                                       "Failed to create DAI widgets %d\n",
-                                       ret);
-                               goto err_probe;
-                       }
+       list_for_each_entry(dai, &component->dai_list, list) {
+               ret = snd_soc_dapm_new_dai_widgets(dapm, dai);
+               if (ret != 0) {
+                       dev_err(component->dev,
+                               "Failed to create DAI widgets %d\n", ret);
+                       goto err_probe;
                }
        }
 
@@ -4164,19 +4131,6 @@ int snd_soc_add_platform(struct device *dev, struct snd_soc_platform *platform,
 
        platform->dev = dev;
        platform->driver = platform_drv;
-       if (platform_drv->controls) {
-               platform->component.controls = platform_drv->controls;
-               platform->component.num_controls = platform_drv->num_controls;
-       }
-       if (platform_drv->dapm_widgets) {
-               platform->component.dapm_widgets = platform_drv->dapm_widgets;
-               platform->component.num_dapm_widgets = platform_drv->num_dapm_widgets;
-               platform->component.steal_sibling_dai_widgets = true;
-       }
-       if (platform_drv->dapm_routes) {
-               platform->component.dapm_routes = platform_drv->dapm_routes;
-               platform->component.num_dapm_routes = platform_drv->num_dapm_routes;
-       }
 
        if (platform_drv->probe)
                platform->component.probe = snd_soc_platform_drv_probe;