ASoC: core - allow ASoC more flexible machine name
authorLiam Girdwood <lrg@ti.com>
Thu, 12 May 2011 15:14:04 +0000 (16:14 +0100)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Thu, 12 May 2011 15:40:03 +0000 (17:40 +0200)
Allow ASoC machine drivers to register a driver name
and a longname. This allows user space to determine
the flavour of machine driver.

Signed-off-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
include/sound/soc.h
sound/soc/soc-core.c

index b27c7a2d3bb0bdd0fb1b8dd37b2dc6bd523ff62d..f1de3e0c75bcad1da0cbed760272fe5e190bccdc 100644 (file)
@@ -702,6 +702,8 @@ struct snd_soc_aux_dev {
 /* SoC card */
 struct snd_soc_card {
        const char *name;
+       const char *long_name;
+       const char *driver_name;
        struct device *dev;
        struct snd_card *snd_card;
        struct module *owner;
index a477e218aa282a842b55ab48a076502a96881847..c1a4cf480c72969b98cfe35d2c54dcf77cd33719 100644 (file)
@@ -1926,9 +1926,11 @@ static void snd_soc_instantiate_card(struct snd_soc_card *card)
                                        card->num_dapm_routes);
 
        snprintf(card->snd_card->shortname, sizeof(card->snd_card->shortname),
-                "%s",  card->name);
-       snprintf(card->snd_card->longname, sizeof(card->snd_card->longname),
                 "%s", card->name);
+       snprintf(card->snd_card->longname, sizeof(card->snd_card->longname),
+                "%s", card->long_name ? card->long_name : card->name);
+       snprintf(card->snd_card->driver, sizeof(card->snd_card->driver),
+                "%s", card->driver_name);
 
        if (card->late_probe) {
                ret = card->late_probe(card);