Skip to contentSkip to conversation

Fix OMAP4+ HDMI audio

PATCH New Jyri Sarha 2 participants 14 messages May 23, 2014 1 message not in the archive

Subsystems (8)
lore
Share & tools
lore

Jyri Sarha

author
#0 lore raw

cover Fix OMAP4+ HDMI audio

This patch set fixes the resource sharing problems between omap-hdmi-dai driver and OMAPDSS HDMI driver. It does it by registering the OMAP HDMI audio related ASoC drivers from OMAPDSS HDMI driver. Platform data structs have been added for omap-hdmi-dai and omap-hdmi-card drivers to pass the information and resources from OMAPDSS HDMI driver.

The idea of this patch set is to fix HDMI audio for the next release after it got broken by OMAPDSS DT changes. It does not mean that I have abandoned the patch set that integrates the omap-hdmi-dai driver into OMAPDSS HDMI driver. The OMAPDSS side of those patches just had some dependencies to the recent ASoC side patches that would have caused problems in the next merge. I'll mail a revised and rebased version of those patches soon.

Best regards,
Jyri

Jyri Sarha (13):
ARM: omap4.dtsi: Add audio related parametes to hdmi node
ARM: omap5.dtsi: Add audio related parameters to hdmi node
ARM: OMAP2+: Remove non working OMAP HDMI audio initialization
OMAPDSS: hdmi_wp: Add function for getting hdmi_wp physical base
address
OMAPDSS: hdmi_audio: Add hdmi_audio.c for registering HDMI audio
support
ASoC: omap-hdmi-dai: Add platform data struct for omap-hdmi-dai
driver
ASoC: omap-hdmi-card: Add platform data stuct for omap-hdmi-card
driver
ASoC: omap-hdmi: Changes for registeing the driver from OMAPDSS
ASoC: omap-hdmi-card: Changes for registeing the driver from OMAPDSS
OMAPDSS: hdmi4: Register HDMI audio ASoC drivers from HDMI driver
OMAPDSS: hdmi.h: Add HDMI_AUDIO_LAYOUT_6CH enum value
OMAPDSS: hdmi5: Register HDMI audio ASoC drivers from HDMI driver
ASoC: omap: Add Kconfig option for OMAP5 HDMI audio

 arch/arm/boot/dts/omap4.dtsi               |    2 +
 arch/arm/boot/dts/omap5.dtsi               |    2 +
 arch/arm/mach-omap2/devices.c              |   28 ---------
 drivers/video/fbdev/omap2/dss/Makefile     |    2 +-
 drivers/video/fbdev/omap2/dss/hdmi.h       |   17 ++++-
 drivers/video/fbdev/omap2/dss/hdmi4.c      |   15 +++++
 drivers/video/fbdev/omap2/dss/hdmi5.c      |   15 +++++
 drivers/video/fbdev/omap2/dss/hdmi_audio.c |   92 ++++++++++++++++++++++++++++
 drivers/video/fbdev/omap2/dss/hdmi_wp.c    |    6 ++
 include/sound/omap-hdmi-card-pdata.h       |   28 +++++++++
 include/sound/omap-hdmi-dai-pdata.h        |   31 ++++++++++
 sound/soc/omap/Kconfig                     |   13 +++-
 sound/soc/omap/omap-hdmi-card.c            |   20 ++++--
 sound/soc/omap/omap-hdmi.c                 |   65 +++++---------------
 14 files changed, 253 insertions(+), 83 deletions(-)
 create mode 100644 drivers/video/fbdev/omap2/dss/hdmi_audio.c
 create mode 100644 include/sound/omap-hdmi-card-pdata.h
 create mode 100644 include/sound/omap-hdmi-dai-pdata.h
Signature · 1 line
1.7.9.5
author
#1 lore raw

PATCH 1/13 ARM: omap4.dtsi: Add audio related parametes to hdmi node

Adds HDMI audio sDMA properties.

---
 arch/arm/boot/dts/omap4.dtsi |    2 ++
 1 file changed, 2 insertions(+)
arch/arm/boot/dts/omap4.dtsi +2 -0
index 649b5cd..335ed54 100644
@@ -919,6 +919,8 @@
 				ti,hwmods = "dss_hdmi";
 				clocks = <&dss_48mhz_clk>, <&dss_sys_clk>;
 				clock-names = "fck", "sys_clk";
+				dmas = <&sdma 76>;
+				dma-names = "audio_tx";
 			};
 		};
 	};
Signature · 1 line
1.7.9.5
author
#2 lore raw

PATCH 2/13 ARM: omap5.dtsi: Add audio related parameters to hdmi node

In reply to Jyri Sarha

Adds HDMI audio sDMA properties.

---
 arch/arm/boot/dts/omap5.dtsi |    2 ++
 1 file changed, 2 insertions(+)
arch/arm/boot/dts/omap5.dtsi +2 -0
index 32c02ce..279a9c7 100644
@@ -937,6 +937,8 @@
 				ti,hwmods = "dss_hdmi";
 				clocks = <&dss_48mhz_clk>, <&dss_sys_clk>;
 				clock-names = "fck", "sys_clk";
+				dmas = <&sdma 76>;
+				dma-names = "audio_tx";
 			};
 		};
 	};
Signature · 1 line
1.7.9.5
#4 lore raw

PATCH 3/13 ARM: OMAP2+: Remove non working OMAP HDMI audio initialization

In reply to a message not in the archive

This code is not working currently and it can be removed. There is a conflict in sharing resources with the actual HDMI driver and with the ASoC HDMI audio DAI driver.

---
 arch/arm/mach-omap2/devices.c |   28 ----------------------------
 1 file changed, 28 deletions(-)
arch/arm/mach-omap2/devices.c +0 -28
index e58609b..4bab682 100644
@@ -330,33 +330,6 @@ static void omap_init_audio(void)
 static inline void omap_init_audio(void) {}
 #endif
 
-#if defined(CONFIG_SND_OMAP_SOC_OMAP_HDMI) || \
-		defined(CONFIG_SND_OMAP_SOC_OMAP_HDMI_MODULE)
-
-static struct platform_device omap_hdmi_audio = {
-	.name	= "omap-hdmi-audio",
-	.id	= -1,
-};
-
-static void __init omap_init_hdmi_audio(void)
-{
-	struct omap_hwmod *oh;
-	struct platform_device *pdev;
-
-	oh = omap_hwmod_lookup("dss_hdmi");
-	if (!oh)
-		return;
-
-	pdev = omap_device_build("omap-hdmi-audio-dai", -1, oh, NULL, 0);
-	WARN(IS_ERR(pdev),
-	     "Can't build omap_device for omap-hdmi-audio-dai.\n");
-
-	platform_device_register(&omap_hdmi_audio);
-}
-#else
-static inline void omap_init_hdmi_audio(void) {}
-#endif
-
 #if defined(CONFIG_SPI_OMAP24XX) || defined(CONFIG_SPI_OMAP24XX_MODULE)
 
 #include <linux/platform_data/spi-omap2-mcspi.h>
@@ -492,7 +465,6 @@ static int __init omap2_init_devices(void)
 	 */
 	omap_init_audio();
 	omap_init_camera();
-	omap_init_hdmi_audio();
 	omap_init_mbox();
 	/* If dtb is there, the devices will be created dynamically */
 	if (!of_have_populated_dt()) {
Signature · 6 lines
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
author
#6 lore raw

PATCH 4/13 OMAPDSS: hdmi_wp: Add function for getting hdmi_wp physical base address

In reply to Jyri Sarha

The hdmi_wp physical base address is needed for hdmi audio dma.

---
 drivers/video/fbdev/omap2/dss/hdmi.h    |    2 ++
 drivers/video/fbdev/omap2/dss/hdmi_wp.c |    6 ++++++
 2 files changed, 8 insertions(+)
drivers/video/fbdev/omap2/dss/hdmi.h +2 -0
index fbee078..f644bc8 100644
@@ -341,6 +341,7 @@ struct hdmi_core_infoframe_avi {
 
 struct hdmi_wp_data {
 	void __iomem *base;
+	phys_addr_t phys_base;
 };
 
 struct hdmi_pll_data {
@@ -410,6 +411,7 @@ void hdmi_wp_video_config_timing(struct hdmi_wp_data *wp,
 void hdmi_wp_init_vid_fmt_timings(struct hdmi_video_format *video_fmt,
 		struct omap_video_timings *timings, struct hdmi_config *param);
 int hdmi_wp_init(struct platform_device *pdev, struct hdmi_wp_data *wp);
+phys_addr_t hdmi_wp_get_phys_addr(struct hdmi_wp_data *wp);
 
 /* HDMI PLL funcs */
 int hdmi_pll_enable(struct hdmi_pll_data *pll, struct hdmi_wp_data *wp);
drivers/video/fbdev/omap2/dss/hdmi_wp.c +6 -0
index a16a190..bee6df3 100644
@@ -264,6 +264,7 @@ int hdmi_wp_init(struct platform_device *pdev, struct hdmi_wp_data *wp)
 		temp_res.end = temp_res.start + WP_SIZE - 1;
 		res = &temp_res;
 	}
+	wp->phys_base = res->start;
 
 	wp->base = devm_ioremap(&pdev->dev, res->start, resource_size(res));
 	if (!wp->base) {
@@ -273,3 +274,8 @@ int hdmi_wp_init(struct platform_device *pdev, struct hdmi_wp_data *wp)
 
 	return 0;
 }
+
+phys_addr_t hdmi_wp_get_phys_addr(struct hdmi_wp_data *wp)
+{
+	return wp->phys_base;
+}
Signature · 1 line
1.7.9.5
author
#7 lore raw

PATCH 5/13 OMAPDSS: hdmi_audio: Add hdmi_audio.c for registering HDMI audio support

In reply to Jyri Sarha

HDMI audio is implemented using ASoC component drivers. The drivers were earlier registered from under mach-omap2 but that code had problems with sharing the HDMI resources. This commit adds functions for registering the ASoC drivers needed for HDMI audio from HDMI driver itself.

---
 drivers/video/fbdev/omap2/dss/Makefile     |    2 +-
 drivers/video/fbdev/omap2/dss/hdmi.h       |   12 ++++
 drivers/video/fbdev/omap2/dss/hdmi_audio.c |   92 ++++++++++++++++++++++++++++
 3 files changed, 105 insertions(+), 1 deletion(-)
 create mode 100644 drivers/video/fbdev/omap2/dss/hdmi_audio.c
drivers/video/fbdev/omap2/dss/Makefile +1 -1
index 390ab74..7ea2d7c 100644
@@ -11,7 +11,7 @@ omapdss-$(CONFIG_OMAP2_DSS_VENC) += venc.o
 omapdss-$(CONFIG_OMAP2_DSS_SDI) += sdi.o
 omapdss-$(CONFIG_OMAP2_DSS_DSI) += dsi.o
 omapdss-$(CONFIG_OMAP2_DSS_HDMI_COMMON) += hdmi_common.o hdmi_wp.o hdmi_pll.o \
-	hdmi_phy.o
+	hdmi_phy.o hdmi_audio.o
 omapdss-$(CONFIG_OMAP4_DSS_HDMI) += hdmi4.o hdmi4_core.o
 omapdss-$(CONFIG_OMAP5_DSS_HDMI) += hdmi5.o hdmi5_core.o
 ccflags-$(CONFIG_OMAP2_DSS_DEBUG) += -DDEBUG
drivers/video/fbdev/omap2/dss/hdmi.h +12 -0
index f644bc8..3ddb5f8 100644
@@ -434,6 +434,18 @@ int hdmi_parse_lanes_of(struct platform_device *pdev, struct device_node *ep,
 	struct hdmi_phy_data *phy);
 
 #if defined(CONFIG_OMAP4_DSS_HDMI_AUDIO) || defined(CONFIG_OMAP5_DSS_HDMI_AUDIO)
+struct hdmi_audio_data {
+	struct platform_device *cpudai_pdev;
+	struct platform_device *codec_pdev;
+	struct platform_device *card_pdev;
+};
+
+int hdmi_audio_register(struct platform_device *pdev,
+			struct hdmi_audio_data *data,
+			struct omap_dss_device *hdmi,
+			struct hdmi_wp_data *wp);
+void hdmi_audio_unregister(struct hdmi_audio_data *data);
+
 int hdmi_compute_acr(u32 pclk, u32 sample_freq, u32 *n, u32 *cts);
 int hdmi_wp_audio_enable(struct hdmi_wp_data *wp, bool enable);
 int hdmi_wp_audio_core_req_enable(struct hdmi_wp_data *wp, bool enable);
drivers/video/fbdev/omap2/dss/hdmi_audio.c new file +92 -0

92 lines not on this page · raw message

Signature · 1 line
1.7.9.5
author
#8 lore raw

PATCH 6/13 ASoC: omap-hdmi-dai: Add platform data struct for omap-hdmi-dai driver

In reply to Jyri Sarha

Provide the means to pass OMAPDSS HDMI resources over to omap-hdmi-dai driver when the OMAPDSS driver registers the DAI driver.

---
 include/sound/omap-hdmi-dai-pdata.h |   31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)
 create mode 100644 include/sound/omap-hdmi-dai-pdata.h
include/sound/omap-hdmi-dai-pdata.h new file +31 -0
new file mode 100644
index 0000000..337c859
@@ -0,0 +1,31 @@
+/*
+ * omap-hdmi-dai-pdata.h
+ *
+ * Platform data for OMAP ALSA SoC DAI driver for HDMI audio on OMAP4+
+ * processors.
+ * Copyright (C) 2014 Texas Instruments Incorporated - http://www.ti.com/
+ * Authors: Jyri Sarha <[email protected]>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ */
+
+#ifndef __OMAP_HDMI_DAI_PDATA_H__
+#define __OMAP_HDMI_DAI_PDATA_H__
+
+struct omap_dss_device;
+
+struct asoc_omap_hdmi_dai_pdata {
+	struct omap_dss_device *dssdev;
+	dma_addr_t dma_addr;
+	unsigned int dma_req;
+};
+
+#endif
Signature · 1 line
1.7.9.5
author
#9 lore raw

PATCH 7/13 ASoC: omap-hdmi-card: Add platform data stuct for omap-hdmi-card driver

In reply to Jyri Sarha

The names of the needed ASoC component drivers need to be passed to the omap-hdmi-card driver for it to find them.

---
 include/sound/omap-hdmi-card-pdata.h |   28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)
 create mode 100644 include/sound/omap-hdmi-card-pdata.h
include/sound/omap-hdmi-card-pdata.h new file +28 -0
new file mode 100644
index 0000000..f70495b
@@ -0,0 +1,28 @@
+/*
+ * omap-hdmi-card-pdata.h
+ *
+ * Platform data for OMAP ALSA SoC card driver for HDMI audio on OMAP4+
+ * processors.
+ * Copyright (C) 2014 Texas Instruments Incorporated - http://www.ti.com/
+ * Authors: Jyri Sarha <[email protected]>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ */
+
+#ifndef __OMAP_HDMI_CARD_PDATA_H__
+#define __OMAP_HDMI_CARD_PDATA_H__
+
+struct asoc_omap_hdmi_card_pdata {
+	const char *cpudai_name;
+	const char *codec_name;
+};
+
+#endif
Signature · 1 line
1.7.9.5
author
#10 lore raw

PATCH 8/13 ASoC: omap-hdmi: Changes for registeing the driver from OMAPDSS

In reply to Jyri Sarha

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

---
 sound/soc/omap/omap-hdmi.c |   65 ++++++++++++--------------------------------
 1 file changed, 17 insertions(+), 48 deletions(-)
sound/soc/omap/omap-hdmi.c +17 -48
index 537a1ec..ed0a37c 100644
@@ -35,6 +35,7 @@
 #include <sound/dmaengine_pcm.h>
 #include <video/omapdss.h>
 
+#include <sound/omap-hdmi-dai-pdata.h>
 #include "omap-hdmi.h"
 #include "omap-pcm.h"
 
@@ -65,7 +66,7 @@ static int omap_hdmi_dai_startup(struct snd_pcm_substream *substream,
 		return err;
 	}
 
-	if (!priv->dssdev->driver->audio_supported(priv->dssdev)) {
+	if (!priv->dssdev->ops.hdmi->audio_supported(priv->dssdev)) {
 		dev_err(dai->dev, "audio not supported\n");
 		return -ENODEV;
 	}
@@ -80,7 +81,7 @@ static int omap_hdmi_dai_prepare(struct snd_pcm_substream *substream,
 {
 	struct hdmi_priv *priv = snd_soc_dai_get_drvdata(dai);
 
-	return priv->dssdev->driver->audio_enable(priv->dssdev);
+	return priv->dssdev->ops.hdmi->audio_enable(priv->dssdev);
 }
 
 static int omap_hdmi_dai_hw_params(struct snd_pcm_substream *substream,
@@ -206,7 +207,7 @@ static int omap_hdmi_dai_hw_params(struct snd_pcm_substream *substream,
 	priv->dss_audio.iec = iec;
 	priv->dss_audio.cea = cea;
 
-	err = priv->dssdev->driver->audio_config(priv->dssdev,
+	err = priv->dssdev->ops.hdmi->audio_config(priv->dssdev,
 						 &priv->dss_audio);
 
 	return err;
@@ -222,12 +223,12 @@ static int omap_hdmi_dai_trigger(struct snd_pcm_substream *substream, int cmd,
 	case SNDRV_PCM_TRIGGER_START:
 	case SNDRV_PCM_TRIGGER_RESUME:
 	case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
-		err = priv->dssdev->driver->audio_start(priv->dssdev);
+		err = priv->dssdev->ops.hdmi->audio_start(priv->dssdev);
 		break;
 	case SNDRV_PCM_TRIGGER_STOP:
 	case SNDRV_PCM_TRIGGER_SUSPEND:
 	case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
-		priv->dssdev->driver->audio_stop(priv->dssdev);
+		priv->dssdev->ops.hdmi->audio_stop(priv->dssdev);
 		break;
 	default:
 		err = -EINVAL;
@@ -240,7 +241,7 @@ static void omap_hdmi_dai_shutdown(struct snd_pcm_substream *substream,
 {
 	struct hdmi_priv *priv = snd_soc_dai_get_drvdata(dai);
 
-	priv->dssdev->driver->audio_disable(priv->dssdev);
+	priv->dssdev->ops.hdmi->audio_disable(priv->dssdev);
 }
 
 static const struct snd_soc_dai_ops omap_hdmi_dai_ops = {
@@ -267,10 +268,14 @@ static const struct snd_soc_component_driver omap_hdmi_component = {
 
 static int omap_hdmi_probe(struct platform_device *pdev)
 {
-	int ret;
-	struct resource *hdmi_rsrc;
+	struct asoc_omap_hdmi_dai_pdata *pdata = pdev->dev.platform_data;
 	struct hdmi_priv *hdmi_data;
-	bool hdmi_dev_found = false;
+	int ret;
+
+	if (!pdata) {
+		dev_err(&pdev->dev, "No platform data, bailing out\n");
+		return -ENODEV;
+	}
 
 	hdmi_data = devm_kzalloc(&pdev->dev, sizeof(*hdmi_data), GFP_KERNEL);
 	if (hdmi_data == NULL) {
@@ -278,48 +283,12 @@ static int omap_hdmi_probe(struct platform_device *pdev)
 		return -ENOMEM;
 	}
 
-	hdmi_rsrc = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	if (!hdmi_rsrc) {
-		dev_err(&pdev->dev, "Cannot obtain IORESOURCE_MEM HDMI\n");
-		return -ENODEV;
-	}
-
-	hdmi_data->dma_data.addr = hdmi_rsrc->start + OMAP_HDMI_AUDIO_DMA_PORT;
-
-	hdmi_rsrc = platform_get_resource(pdev, IORESOURCE_DMA, 0);
-	if (!hdmi_rsrc) {
-		dev_err(&pdev->dev, "Cannot obtain IORESOURCE_DMA HDMI\n");
-		return -ENODEV;
-	}
-
-	hdmi_data->dma_req = hdmi_rsrc->start;
+	hdmi_data->dma_data.addr = pdata->dma_addr;
+	hdmi_data->dma_req = pdata->dma_req;
 	hdmi_data->dma_data.filter_data = &hdmi_data->dma_req;
 	hdmi_data->dma_data.addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
 
-	/*
-	 * TODO: We assume that there is only one DSS HDMI device. Future
-	 * OMAP implementations may support more than one HDMI devices and
-	 * we should provided separate audio support for all of them.
-	 */
-	/* Find an HDMI device. */
-	for_each_dss_dev(hdmi_data->dssdev) {
-		omap_dss_get_device(hdmi_data->dssdev);
-
-		if (!hdmi_data->dssdev->driver) {
-			omap_dss_put_device(hdmi_data->dssdev);
-			continue;
-		}
-
-		if (hdmi_data->dssdev->type == OMAP_DISPLAY_TYPE_HDMI) {
-			hdmi_dev_found = true;
-			break;
-		}
-	}
-
-	if (!hdmi_dev_found) {
-		dev_err(&pdev->dev, "no driver for HDMI display found\n");
-		return -ENODEV;
-	}
+	hdmi_data->dssdev = pdata->dssdev;
 
 	dev_set_drvdata(&pdev->dev, hdmi_data);
 	ret = snd_soc_register_component(&pdev->dev, &omap_hdmi_component,
Signature · 1 line
1.7.9.5
author
#11 lore raw

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

In reply to Jyri Sarha

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.

---
 sound/soc/omap/omap-hdmi-card.c |   20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)
sound/soc/omap/omap-hdmi-card.c +16 -4
index f649fe8..56c0055 100644
@@ -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;
 	}
Signature · 1 line
1.7.9.5
author
#12 lore raw

PATCH 10/13 OMAPDSS: hdmi4: Register HDMI audio ASoC drivers from HDMI driver

In reply to Jyri Sarha

The registering is best done here to share the resources owned by OMAPDSS HDMI driver with ASoC DAI and platform drivers.

---
 drivers/video/fbdev/omap2/dss/hdmi4.c |   15 +++++++++++++++
 1 file changed, 15 insertions(+)
drivers/video/fbdev/omap2/dss/hdmi4.c +15 -0
index 626aad2..62ad1d9 100644
@@ -52,6 +52,9 @@ static struct {
 	struct clk *sys_clk;
 	struct regulator *vdda_hdmi_dac_reg;
 
+#if defined(CONFIG_OMAP4_DSS_HDMI_AUDIO)
+	struct hdmi_audio_data audio;
+#endif
 	bool core_enabled;
 
 	struct omap_dss_device output;
@@ -736,6 +739,15 @@ static int omapdss_hdmihw_probe(struct platform_device *pdev)
 
 	hdmi_init_output(pdev);
 
+#if defined(CONFIG_OMAP4_DSS_HDMI_AUDIO)
+	r = hdmi_audio_register(pdev, &hdmi.audio, &hdmi.output, &hdmi.wp);
+	if (r) {
+		DSSERR("Registering HDMI audio failed\n");
+		hdmi_uninit_output(pdev);
+		pm_runtime_disable(&pdev->dev);
+		return r;
+	}
+#endif
 	dss_debugfs_create_file("hdmi", hdmi_dump_regs);
 
 	return 0;
@@ -743,6 +755,9 @@ static int omapdss_hdmihw_probe(struct platform_device *pdev)
 
 static int __exit omapdss_hdmihw_remove(struct platform_device *pdev)
 {
+#if defined(CONFIG_OMAP4_DSS_HDMI_AUDIO)
+	hdmi_audio_unregister(&hdmi.audio);
+#endif
 	hdmi_uninit_output(pdev);
 
 	pm_runtime_disable(&pdev->dev);
Signature · 1 line
1.7.9.5
author
#13 lore raw

PATCH 11/13 OMAPDSS: hdmi.h: Add HDMI_AUDIO_LAYOUT_6CH enum value

In reply to Jyri Sarha

The OMAP5 HDMI audio implementation needs HDMI_AUDIO_LAYOUT_6CH in hdmi_core_audio_layout enum. I found the correct value from ti-linux 3.8 tree.

---
 drivers/video/fbdev/omap2/dss/hdmi.h |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/video/fbdev/omap2/dss/hdmi.h +2 -1
index 3ddb5f8..c9efc92 100644
@@ -159,7 +159,8 @@ enum hdmi_audio_blk_strt_end_sig {
 
 enum hdmi_core_audio_layout {
 	HDMI_AUDIO_LAYOUT_2CH = 0,
-	HDMI_AUDIO_LAYOUT_8CH = 1
+	HDMI_AUDIO_LAYOUT_8CH = 1,
+	HDMI_AUDIO_LAYOUT_6CH = 2
 };
 
 enum hdmi_core_cts_mode {
Signature · 1 line
1.7.9.5
#5 lore raw

PATCH 12/13 OMAPDSS: hdmi5: Register HDMI audio ASoC drivers from HDMI driver

In reply to a message not in the archive

The registering is best done here to share the resources owned by OMAPDSS HDMI driver with ASoC DAI and platform drivers.

---
 drivers/video/fbdev/omap2/dss/hdmi5.c |   15 +++++++++++++++
 1 file changed, 15 insertions(+)
drivers/video/fbdev/omap2/dss/hdmi5.c +15 -0
index c468b9e..1ba387b 100644
@@ -57,6 +57,9 @@ static struct {
 	struct clk *sys_clk;
 	struct regulator *vdda_reg;
 
+#if defined(CONFIG_OMAP5_DSS_HDMI_AUDIO)
+	struct hdmi_audio_data audio;
+#endif
 	bool core_enabled;
 
 	struct omap_dss_device output;
@@ -761,6 +764,15 @@ static int omapdss_hdmihw_probe(struct platform_device *pdev)
 
 	hdmi_init_output(pdev);
 
+#if defined(CONFIG_OMAP5_DSS_HDMI_AUDIO)
+	r = hdmi_audio_register(pdev, &hdmi.audio, &hdmi.output, &hdmi.wp);
+	if (r) {
+		DSSERR("Registering HDMI audio failed\n");
+		hdmi_uninit_output(pdev);
+		pm_runtime_disable(&pdev->dev);
+		return r;
+	}
+#endif
 	dss_debugfs_create_file("hdmi", hdmi_dump_regs);
 
 	return 0;
@@ -768,6 +780,9 @@ static int omapdss_hdmihw_probe(struct platform_device *pdev)
 
 static int __exit omapdss_hdmihw_remove(struct platform_device *pdev)
 {
+#if defined(CONFIG_OMAP5_DSS_HDMI_AUDIO)
+	hdmi_audio_unregister(&hdmi.audio);
+#endif
 	hdmi_uninit_output(pdev);
 
 	pm_runtime_disable(&pdev->dev);
Signature · 6 lines
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
author
#14 lore raw

PATCH 13/13 ASoC: omap: Add Kconfig option for OMAP5 HDMI audio

In reply to Jyri Sarha

Adds SND_OMAP_SOC_OMAP5_HDMI config option for OMAP5 HDMI audio support.

---
 sound/soc/omap/Kconfig |   13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)
sound/soc/omap/Kconfig +12 -1
index d44463a..697e1b8 100644
@@ -101,7 +101,7 @@ config SND_OMAP_SOC_OMAP_ABE_TWL6040
 	  - PandaBoardES (4460)
 
 config SND_OMAP_SOC_OMAP_HDMI
-	tristate "SoC Audio support for Texas Instruments OMAP HDMI"
+	tristate "SoC Audio support for Texas Instruments OMAP4 HDMI"
 	depends on SND_OMAP_SOC && OMAP4_DSS_HDMI && OMAP2_DSS
 	select SND_OMAP_SOC_HDMI
 	select SND_SOC_HDMI_CODEC
@@ -110,6 +110,17 @@ config SND_OMAP_SOC_OMAP_HDMI
 	  Say Y if you want to add support for SoC HDMI audio on Texas Instruments
 	  OMAP4 chips
 
+
+config SND_OMAP_SOC_OMAP5_HDMI
+	tristate "SoC Audio support for Texas Instruments OMAP5 HDMI"
+	depends on SND_OMAP_SOC && OMAP5_DSS_HDMI && OMAP2_DSS
+	select SND_OMAP_SOC_HDMI
+	select SND_SOC_HDMI_CODEC
+	select OMAP5_DSS_HDMI_AUDIO
+	help
+	  Say Y if you want to add support for SoC HDMI audio on Texas Instruments
+	  OMAP5 chips
+
 config SND_OMAP_SOC_OMAP3_PANDORA
 	tristate "SoC Audio support for OMAP3 Pandora"
 	depends on TWL4030_CORE && SND_OMAP_SOC && MACH_OMAP3_PANDORA
Signature · 1 line
1.7.9.5