Patchwork [2/2] UBUNTU: SAUCE: Expose sdp4430/panda driver names to userspace

login
register
mail settings
Submitter Lee Jones
Date Oct. 14, 2010, 2:47 p.m.
Message ID <d2906dfc1ff7f6da5e9d2fa21b0c2a49e203553b.1287067043.git.lee.jones@canonical.com>
Download mbox | patch
Permalink /patch/67831/
State Accepted
Delegated to: Stefan Bader
Headers show

Comments

Lee Jones - Oct. 14, 2010, 2:47 p.m.
From: Liam Girdwood <lrg@slimlogic.co.uk>

BugLink: http://bugs.launchpad.net/bugs/637947

Signed-off-by: Lee Jones <lee.jones@canonical.com>
---
 include/sound/soc.h      |    1 +
 sound/soc/omap/sdp4430.c |    9 +++++++--
 sound/soc/soc-core.c     |    2 +-
 3 files changed, 9 insertions(+), 3 deletions(-)

Patch

diff --git a/include/sound/soc.h b/include/sound/soc.h
index a05b879..b4a2325 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -606,6 +606,7 @@  struct snd_soc_dai_link {
 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;
diff --git a/sound/soc/omap/sdp4430.c b/sound/soc/omap/sdp4430.c
index a21a9ed..1557ff6 100644
--- a/sound/soc/omap/sdp4430.c
+++ b/sound/soc/omap/sdp4430.c
@@ -717,8 +717,8 @@  static struct snd_soc_dai_link sdp4430_dai[] = {
 
 /* Audio machine driver */
 static struct snd_soc_card snd_soc_sdp4430 = {
-	.name = "SDP4430",
-	.long_name = "TI OMAP4 SDP4430 Board",
+	.driver_name = "OMAP4",
+	.long_name = "TI OMAP4 Board",
 	.dai_link = sdp4430_dai,
 	.num_links = ARRAY_SIZE(sdp4430_dai),
 };
@@ -736,6 +736,11 @@  static int __init sdp4430_soc_init(void)
 	}
 	printk(KERN_INFO "SDP4430 SoC init\n");
 
+	if (machine_is_omap_4430sdp())
+		snd_soc_sdp4430.name = "SDP4430";
+	else if (machine_is_omap4_panda())
+		snd_soc_sdp4430.name = "Panda";
+
 	sdp4430_snd_device = platform_device_alloc("soc-audio", -1);
 	if (!sdp4430_snd_device) {
 		printk(KERN_ERR "Platform device allocation failed\n");
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index d1d78de..c59225e 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -1773,7 +1773,7 @@  static void snd_soc_instantiate_card(struct snd_soc_card *card)
 	snprintf(card->snd_card->longname, sizeof(card->snd_card->longname),
 		 "%s", card->long_name);
 	snprintf(card->snd_card->driver, sizeof(card->snd_card->driver),
-		 "%s", card->name);
+		 "%s", card->driver_name);
 
 	ret = snd_card_register(card->snd_card);
 	if (ret < 0) {