]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - sound/soc/soc-core.c
Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
[linux.git] / sound / soc / soc-core.c
index a4cb141b8f388328ce6ee41a48f50fa7ece8e060..3d56f1fe5914e981ac9e480e3b335c139d25b6f5 100644 (file)
@@ -190,6 +190,21 @@ static int dai_list_show(struct seq_file *m, void *v)
 }
 DEFINE_SHOW_ATTRIBUTE(dai_list);
 
+static int component_list_show(struct seq_file *m, void *v)
+{
+       struct snd_soc_component *component;
+
+       mutex_lock(&client_mutex);
+
+       list_for_each_entry(component, &component_list, list)
+               seq_printf(m, "%s\n", component->name);
+
+       mutex_unlock(&client_mutex);
+
+       return 0;
+}
+DEFINE_SHOW_ATTRIBUTE(component_list);
+
 static void soc_init_card_debugfs(struct snd_soc_card *card)
 {
        if (!snd_soc_debugfs_root)
@@ -228,6 +243,10 @@ static void snd_soc_debugfs_init(void)
        if (!debugfs_create_file("dais", 0444, snd_soc_debugfs_root, NULL,
                                 &dai_list_fops))
                pr_warn("ASoC: Failed to create DAI list debugfs file\n");
+
+       if (!debugfs_create_file("components", 0444, snd_soc_debugfs_root, NULL,
+                                &component_list_fops))
+               pr_warn("ASoC: Failed to create component list debugfs file\n");
 }
 
 static void snd_soc_debugfs_exit(void)
@@ -2764,8 +2783,7 @@ static struct snd_soc_dai *soc_add_dai(struct snd_soc_component *component,
  *                     parent's name.
  */
 static int snd_soc_register_dais(struct snd_soc_component *component,
-       struct snd_soc_dai_driver *dai_drv, size_t count,
-       bool legacy_dai_naming)
+                                struct snd_soc_dai_driver *dai_drv, size_t count)
 {
        struct device *dev = component->dev;
        struct snd_soc_dai *dai;
@@ -2777,7 +2795,7 @@ static int snd_soc_register_dais(struct snd_soc_component *component,
        for (i = 0; i < count; i++) {
 
                dai = soc_add_dai(component, dai_drv + i,
-                               count == 1 && legacy_dai_naming);
+                                 count == 1 && !component->driver->non_legacy_dai_naming);
                if (dai == NULL) {
                        ret = -ENOMEM;
                        goto err;
@@ -2939,8 +2957,10 @@ EXPORT_SYMBOL_GPL(snd_soc_component_exit_regmap);
 
 #endif
 
-static void snd_soc_component_add_unlocked(struct snd_soc_component *component)
+static void snd_soc_component_add(struct snd_soc_component *component)
 {
+       mutex_lock(&client_mutex);
+
        if (!component->driver->write && !component->driver->read) {
                if (!component->regmap)
                        component->regmap = dev_get_regmap(component->dev, NULL);
@@ -2950,12 +2970,7 @@ static void snd_soc_component_add_unlocked(struct snd_soc_component *component)
 
        list_add(&component->list, &component_list);
        INIT_LIST_HEAD(&component->dobj_list);
-}
 
-static void snd_soc_component_add(struct snd_soc_component *component)
-{
-       mutex_lock(&client_mutex);
-       snd_soc_component_add_unlocked(component);
        mutex_unlock(&client_mutex);
 }
 
@@ -3030,8 +3045,7 @@ int snd_soc_add_component(struct device *dev,
                }
        }
 
-       ret = snd_soc_register_dais(component, dai_drv, num_dai,
-                                   !component_driver->non_legacy_dai_naming);
+       ret = snd_soc_register_dais(component, dai_drv, num_dai);
        if (ret < 0) {
                dev_err(dev, "ASoC: Failed to register DAIs: %d\n", ret);
                goto err_cleanup;