[PATCH 09/13] ASoC: omap-hdmi-card: Changes for registeing the driver from OMAPDSS

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




The old OMAP HDMI audio registering from arch/arm/mach-omap2/devices.c
was broken. The new approach is to register the drivers from OMAPDSS HDMI
driver. The commit does the necessary changes for this approach.

Signed-off-by: Jyri Sarha <jsarha@xxxxxx>
---
 sound/soc/omap/omap-hdmi-card.c |   20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)

diff --git a/sound/soc/omap/omap-hdmi-card.c b/sound/soc/omap/omap-hdmi-card.c
index f649fe8..56c0055 100644
--- a/sound/soc/omap/omap-hdmi-card.c
+++ b/sound/soc/omap/omap-hdmi-card.c
@@ -26,15 +26,13 @@
 #include <sound/soc.h>
 #include <asm/mach-types.h>
 #include <video/omapdss.h>
+#include <sound/omap-hdmi-card-pdata.h>
 
 #define DRV_NAME "omap-hdmi-audio"
 
 static struct snd_soc_dai_link omap_hdmi_dai = {
 	.name = "HDMI",
 	.stream_name = "HDMI",
-	.cpu_dai_name = "omap-hdmi-audio-dai",
-	.platform_name = "omap-hdmi-audio-dai",
-	.codec_name = "hdmi-audio-codec",
 	.codec_dai_name = "hdmi-hifi",
 };
 
@@ -47,14 +45,28 @@ static struct snd_soc_card snd_soc_omap_hdmi = {
 
 static int omap_hdmi_probe(struct platform_device *pdev)
 {
+	struct device *dev = &pdev->dev;
+	struct asoc_omap_hdmi_card_pdata *pdata = dev->platform_data;
 	struct snd_soc_card *card = &snd_soc_omap_hdmi;
 	int ret;
 
+	if (!pdata) {
+		dev_err(dev, "No platform data, bailing out\n");
+		return -ENODEV;
+	}
+
 	card->dev = &pdev->dev;
 
+	omap_hdmi_dai.cpu_dai_name =
+		devm_kstrdup(dev, pdata->cpudai_name, GFP_KERNEL);
+	omap_hdmi_dai.platform_name =
+		devm_kstrdup(dev, pdata->cpudai_name, GFP_KERNEL);
+	omap_hdmi_dai.codec_name =
+		devm_kstrdup(dev, pdata->codec_name, GFP_KERNEL);
+
 	ret = snd_soc_register_card(card);
 	if (ret) {
-		dev_err(&pdev->dev, "snd_soc_register_card failed (%d)\n", ret);
+		dev_err(dev, "snd_soc_register_card failed (%d)\n", ret);
 		card->dev = NULL;
 		return ret;
 	}
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]
  Powered by Linux