All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/12] Rework OMAP4+ HDMI audio support
@ 2014-06-26 19:20 ` Jyri Sarha
  0 siblings, 0 replies; 60+ messages in thread
From: Jyri Sarha @ 2014-06-26 19:20 UTC (permalink / raw)
  To: alsa-devel, linux-fbdev, linux-omap
  Cc: liam.r.girdwood, detheridge, broonie, Jyri Sarha, peter.ujfalusi,
	tomi.valkeinen, jyri.sarha

The patches are based on linux 3.16-rc2 and OMAPDSS HDMI infoframe
patches[1] from Tomi Valkeinen. The base, the patches, and couple of
additional not-to-be-merged omap2plus_defconfig patches can be found
here:

git://git.ti.com/~jyrisarha/ti-linux-kernel/jyrisarhas-audio-video-linux-feature-tree.git omap-hdmi-audio

The patch set fixes OMAP4+ HDMI audio. The structure of the
implementation looks a bit different than before. Instead of creating
a driver specific API for a separate ASoC component driver to connect
to, this implementation integrates an the ASoC cpu-dai component
driver into the HDMI driver. Also the other ASoC component drivers
needed for operational audio are automatically registered by the HDMI
driver. There is no need to add anything to the device tree as long as
the nodes needed for HDMI video are there.

Big part of the HDMI audio code is still unchanged and there is a need
for a cleanup there. Also there is still probably something wrong with
speaker mapping of multi-channel streams. I will get back to cleaning
up these issues later.

Best regards,
Jyri

[1] http://marc.info/?l=linux-fbdev&m\x140360425130951&w=2

Jyri Sarha (12):
  ARM: OMAP2+: Remove non working OMAP HDMI audio initialization
  OMAPDSS: hdmi.h: Add HDMI_AUDIO_LAYOUT_6CH enum value
  OMAPDSS: hdmi_wp: Add function for getting hdmi_wp physical base
    address
  OMAPDSS: hdmi_audio: Integrated ASoC DAI component driver
    implementation
  OMAPDSS: Kconfig: Select audio dependencies if OMAP4_DSS_HDMI_AUDIO=y
  OMAPDSS: hdmi4: Register HDMI audio ASoC drivers from HDMI driver
  OMAPDSS: Kconfig: Select audio dependencies if OMAP5_DSS_HDMI_AUDIO=y
  OMAPDSS: hdmi5: Register HDMI audio ASoC drivers from HDMI driver
  ASoC: omap: Remove obsolete HDMI audio code and Kconfig options
  OMAPDSS: hdmi4: Remove callbacks for an external ASoC DAI driver
  OMAPDSS: hdmi5: Remove callbacks for an external ASoC DAI driver
  OMAPDSS: Remove all references to obsolete HDMI audio callbacks

 arch/arm/mach-omap2/devices.c                      |   28 --
 .../fbdev/omap2/displays-new/connector-hdmi.c      |   99 ------
 .../fbdev/omap2/displays-new/encoder-tpd12s015.c   |   56 ---
 drivers/video/fbdev/omap2/dss/Kconfig              |   24 +-
 drivers/video/fbdev/omap2/dss/Makefile             |    2 +
 drivers/video/fbdev/omap2/dss/hdmi.h               |   43 ++-
 drivers/video/fbdev/omap2/dss/hdmi4.c              |  158 +++------
 drivers/video/fbdev/omap2/dss/hdmi5.c              |  170 +++------
 drivers/video/fbdev/omap2/dss/hdmi_audio.c         |  317 +++++++++++++++++
 drivers/video/fbdev/omap2/dss/hdmi_wp.c            |    6 +
 include/video/omapdss.h                            |   31 --
 sound/soc/omap/Kconfig                             |   13 -
 sound/soc/omap/Makefile                            |    4 -
 sound/soc/omap/omap-hdmi-card.c                    |   87 -----
 sound/soc/omap/omap-hdmi.c                         |  364 --------------------
 sound/soc/omap/omap-hdmi.h                         |   38 --
 16 files changed, 489 insertions(+), 951 deletions(-)
 create mode 100644 drivers/video/fbdev/omap2/dss/hdmi_audio.c
 delete mode 100644 sound/soc/omap/omap-hdmi-card.c
 delete mode 100644 sound/soc/omap/omap-hdmi.c
 delete mode 100644 sound/soc/omap/omap-hdmi.h

-- 
1.7.9.5


^ permalink raw reply	[flat|nested] 60+ messages in thread

* [PATCH 00/12] Rework OMAP4+ HDMI audio support
@ 2014-06-26 19:20 ` Jyri Sarha
  0 siblings, 0 replies; 60+ messages in thread
From: Jyri Sarha @ 2014-06-26 19:20 UTC (permalink / raw)
  To: alsa-devel, linux-fbdev, linux-omap
  Cc: liam.r.girdwood, detheridge, broonie, Jyri Sarha, peter.ujfalusi,
	tomi.valkeinen, jyri.sarha

The patches are based on linux 3.16-rc2 and OMAPDSS HDMI infoframe
patches[1] from Tomi Valkeinen. The base, the patches, and couple of
additional not-to-be-merged omap2plus_defconfig patches can be found
here:

git://git.ti.com/~jyrisarha/ti-linux-kernel/jyrisarhas-audio-video-linux-feature-tree.git omap-hdmi-audio

The patch set fixes OMAP4+ HDMI audio. The structure of the
implementation looks a bit different than before. Instead of creating
a driver specific API for a separate ASoC component driver to connect
to, this implementation integrates an the ASoC cpu-dai component
driver into the HDMI driver. Also the other ASoC component drivers
needed for operational audio are automatically registered by the HDMI
driver. There is no need to add anything to the device tree as long as
the nodes needed for HDMI video are there.

Big part of the HDMI audio code is still unchanged and there is a need
for a cleanup there. Also there is still probably something wrong with
speaker mapping of multi-channel streams. I will get back to cleaning
up these issues later.

Best regards,
Jyri

[1] http://marc.info/?l=linux-fbdev&m=140360425130951&w=2

Jyri Sarha (12):
  ARM: OMAP2+: Remove non working OMAP HDMI audio initialization
  OMAPDSS: hdmi.h: Add HDMI_AUDIO_LAYOUT_6CH enum value
  OMAPDSS: hdmi_wp: Add function for getting hdmi_wp physical base
    address
  OMAPDSS: hdmi_audio: Integrated ASoC DAI component driver
    implementation
  OMAPDSS: Kconfig: Select audio dependencies if OMAP4_DSS_HDMI_AUDIO=y
  OMAPDSS: hdmi4: Register HDMI audio ASoC drivers from HDMI driver
  OMAPDSS: Kconfig: Select audio dependencies if OMAP5_DSS_HDMI_AUDIO=y
  OMAPDSS: hdmi5: Register HDMI audio ASoC drivers from HDMI driver
  ASoC: omap: Remove obsolete HDMI audio code and Kconfig options
  OMAPDSS: hdmi4: Remove callbacks for an external ASoC DAI driver
  OMAPDSS: hdmi5: Remove callbacks for an external ASoC DAI driver
  OMAPDSS: Remove all references to obsolete HDMI audio callbacks

 arch/arm/mach-omap2/devices.c                      |   28 --
 .../fbdev/omap2/displays-new/connector-hdmi.c      |   99 ------
 .../fbdev/omap2/displays-new/encoder-tpd12s015.c   |   56 ---
 drivers/video/fbdev/omap2/dss/Kconfig              |   24 +-
 drivers/video/fbdev/omap2/dss/Makefile             |    2 +
 drivers/video/fbdev/omap2/dss/hdmi.h               |   43 ++-
 drivers/video/fbdev/omap2/dss/hdmi4.c              |  158 +++------
 drivers/video/fbdev/omap2/dss/hdmi5.c              |  170 +++------
 drivers/video/fbdev/omap2/dss/hdmi_audio.c         |  317 +++++++++++++++++
 drivers/video/fbdev/omap2/dss/hdmi_wp.c            |    6 +
 include/video/omapdss.h                            |   31 --
 sound/soc/omap/Kconfig                             |   13 -
 sound/soc/omap/Makefile                            |    4 -
 sound/soc/omap/omap-hdmi-card.c                    |   87 -----
 sound/soc/omap/omap-hdmi.c                         |  364 --------------------
 sound/soc/omap/omap-hdmi.h                         |   38 --
 16 files changed, 489 insertions(+), 951 deletions(-)
 create mode 100644 drivers/video/fbdev/omap2/dss/hdmi_audio.c
 delete mode 100644 sound/soc/omap/omap-hdmi-card.c
 delete mode 100644 sound/soc/omap/omap-hdmi.c
 delete mode 100644 sound/soc/omap/omap-hdmi.h

-- 
1.7.9.5

^ permalink raw reply	[flat|nested] 60+ messages in thread

* [PATCH 01/12] ARM: OMAP2+: Remove non working OMAP HDMI audio initialization
  2014-06-26 19:20 ` Jyri Sarha
@ 2014-06-26 19:20   ` Jyri Sarha
  -1 siblings, 0 replies; 60+ messages in thread
From: Jyri Sarha @ 2014-06-26 19:20 UTC (permalink / raw)
  To: alsa-devel, linux-fbdev, linux-omap
  Cc: peter.ujfalusi, broonie, liam.r.girdwood, tomi.valkeinen,
	detheridge, jyri.sarha, Jyri Sarha

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.

Signed-off-by: Jyri Sarha <jsarha@ti.com>
---
 arch/arm/mach-omap2/devices.c |   28 ----------------------------
 1 file changed, 28 deletions(-)

diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
index 592ba0a..b6f8f34 100644
--- a/arch/arm/mach-omap2/devices.c
+++ b/arch/arm/mach-omap2/devices.c
@@ -297,33 +297,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>
@@ -459,7 +432,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()) {
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [PATCH 01/12] ARM: OMAP2+: Remove non working OMAP HDMI audio initialization
@ 2014-06-26 19:20   ` Jyri Sarha
  0 siblings, 0 replies; 60+ messages in thread
From: Jyri Sarha @ 2014-06-26 19:20 UTC (permalink / raw)
  To: alsa-devel, linux-fbdev, linux-omap
  Cc: peter.ujfalusi, broonie, liam.r.girdwood, tomi.valkeinen,
	detheridge, jyri.sarha, Jyri Sarha

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.

Signed-off-by: Jyri Sarha <jsarha@ti.com>
---
 arch/arm/mach-omap2/devices.c |   28 ----------------------------
 1 file changed, 28 deletions(-)

diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
index 592ba0a..b6f8f34 100644
--- a/arch/arm/mach-omap2/devices.c
+++ b/arch/arm/mach-omap2/devices.c
@@ -297,33 +297,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>
@@ -459,7 +432,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()) {
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [PATCH 02/12] OMAPDSS: hdmi.h: Add HDMI_AUDIO_LAYOUT_6CH enum value
  2014-06-26 19:20 ` Jyri Sarha
@ 2014-06-26 19:20   ` Jyri Sarha
  -1 siblings, 0 replies; 60+ messages in thread
From: Jyri Sarha @ 2014-06-26 19:20 UTC (permalink / raw)
  To: alsa-devel, linux-fbdev, linux-omap
  Cc: peter.ujfalusi, broonie, liam.r.girdwood, tomi.valkeinen,
	detheridge, jyri.sarha, 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.

Signed-off-by: Jyri Sarha <jsarha@ti.com>
---
 drivers/video/fbdev/omap2/dss/hdmi.h |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/video/fbdev/omap2/dss/hdmi.h b/drivers/video/fbdev/omap2/dss/hdmi.h
index 262771b..1f01068 100644
--- a/drivers/video/fbdev/omap2/dss/hdmi.h
+++ b/drivers/video/fbdev/omap2/dss/hdmi.h
@@ -160,7 +160,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 {
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [PATCH 02/12] OMAPDSS: hdmi.h: Add HDMI_AUDIO_LAYOUT_6CH enum value
@ 2014-06-26 19:20   ` Jyri Sarha
  0 siblings, 0 replies; 60+ messages in thread
From: Jyri Sarha @ 2014-06-26 19:20 UTC (permalink / raw)
  To: alsa-devel, linux-fbdev, linux-omap
  Cc: peter.ujfalusi, broonie, liam.r.girdwood, tomi.valkeinen,
	detheridge, jyri.sarha, 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.

Signed-off-by: Jyri Sarha <jsarha@ti.com>
---
 drivers/video/fbdev/omap2/dss/hdmi.h |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/video/fbdev/omap2/dss/hdmi.h b/drivers/video/fbdev/omap2/dss/hdmi.h
index 262771b..1f01068 100644
--- a/drivers/video/fbdev/omap2/dss/hdmi.h
+++ b/drivers/video/fbdev/omap2/dss/hdmi.h
@@ -160,7 +160,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 {
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [PATCH 03/12] OMAPDSS: hdmi_wp: Add function for getting hdmi_wp physical base address
  2014-06-26 19:20 ` Jyri Sarha
@ 2014-06-26 19:20   ` Jyri Sarha
  -1 siblings, 0 replies; 60+ messages in thread
From: Jyri Sarha @ 2014-06-26 19:20 UTC (permalink / raw)
  To: alsa-devel, linux-fbdev, linux-omap
  Cc: peter.ujfalusi, broonie, liam.r.girdwood, tomi.valkeinen,
	detheridge, jyri.sarha, Jyri Sarha

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

Signed-off-by: Jyri Sarha <jsarha@ti.com>
---
 drivers/video/fbdev/omap2/dss/hdmi.h    |    2 ++
 drivers/video/fbdev/omap2/dss/hdmi_wp.c |    6 ++++++
 2 files changed, 8 insertions(+)

diff --git a/drivers/video/fbdev/omap2/dss/hdmi.h b/drivers/video/fbdev/omap2/dss/hdmi.h
index 1f01068..927cb4d 100644
--- a/drivers/video/fbdev/omap2/dss/hdmi.h
+++ b/drivers/video/fbdev/omap2/dss/hdmi.h
@@ -250,6 +250,7 @@ struct hdmi_core_audio_config {
 
 struct hdmi_wp_data {
 	void __iomem *base;
+	phys_addr_t phys_base;
 };
 
 struct hdmi_pll_data {
@@ -317,6 +318,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);
diff --git a/drivers/video/fbdev/omap2/dss/hdmi_wp.c b/drivers/video/fbdev/omap2/dss/hdmi_wp.c
index 496327e..eadd4ed 100644
--- a/drivers/video/fbdev/omap2/dss/hdmi_wp.c
+++ b/drivers/video/fbdev/omap2/dss/hdmi_wp.c
@@ -247,6 +247,7 @@ int hdmi_wp_init(struct platform_device *pdev, struct hdmi_wp_data *wp)
 		DSSERR("can't get WP mem resource\n");
 		return -EINVAL;
 	}
+	wp->phys_base = res->start;
 
 	wp->base = devm_ioremap_resource(&pdev->dev, res);
 	if (IS_ERR(wp->base)) {
@@ -256,3 +257,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;
+}
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [PATCH 03/12] OMAPDSS: hdmi_wp: Add function for getting hdmi_wp physical base address
@ 2014-06-26 19:20   ` Jyri Sarha
  0 siblings, 0 replies; 60+ messages in thread
From: Jyri Sarha @ 2014-06-26 19:20 UTC (permalink / raw)
  To: alsa-devel, linux-fbdev, linux-omap
  Cc: peter.ujfalusi, broonie, liam.r.girdwood, tomi.valkeinen,
	detheridge, jyri.sarha, Jyri Sarha

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

Signed-off-by: Jyri Sarha <jsarha@ti.com>
---
 drivers/video/fbdev/omap2/dss/hdmi.h    |    2 ++
 drivers/video/fbdev/omap2/dss/hdmi_wp.c |    6 ++++++
 2 files changed, 8 insertions(+)

diff --git a/drivers/video/fbdev/omap2/dss/hdmi.h b/drivers/video/fbdev/omap2/dss/hdmi.h
index 1f01068..927cb4d 100644
--- a/drivers/video/fbdev/omap2/dss/hdmi.h
+++ b/drivers/video/fbdev/omap2/dss/hdmi.h
@@ -250,6 +250,7 @@ struct hdmi_core_audio_config {
 
 struct hdmi_wp_data {
 	void __iomem *base;
+	phys_addr_t phys_base;
 };
 
 struct hdmi_pll_data {
@@ -317,6 +318,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);
diff --git a/drivers/video/fbdev/omap2/dss/hdmi_wp.c b/drivers/video/fbdev/omap2/dss/hdmi_wp.c
index 496327e..eadd4ed 100644
--- a/drivers/video/fbdev/omap2/dss/hdmi_wp.c
+++ b/drivers/video/fbdev/omap2/dss/hdmi_wp.c
@@ -247,6 +247,7 @@ int hdmi_wp_init(struct platform_device *pdev, struct hdmi_wp_data *wp)
 		DSSERR("can't get WP mem resource\n");
 		return -EINVAL;
 	}
+	wp->phys_base = res->start;
 
 	wp->base = devm_ioremap_resource(&pdev->dev, res);
 	if (IS_ERR(wp->base)) {
@@ -256,3 +257,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;
+}
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [PATCH 04/12] OMAPDSS: hdmi_audio: Integrated ASoC DAI component driver implementation
  2014-06-26 19:20 ` Jyri Sarha
@ 2014-06-26 19:20   ` Jyri Sarha
  -1 siblings, 0 replies; 60+ messages in thread
From: Jyri Sarha @ 2014-06-26 19:20 UTC (permalink / raw)
  To: alsa-devel, linux-fbdev, linux-omap
  Cc: peter.ujfalusi, broonie, liam.r.girdwood, tomi.valkeinen,
	detheridge, jyri.sarha, Jyri Sarha

Integrate ASoC DAI component driver in to the OMAP hdmi driver. The
patch also updates the relevant entry in ti,omap5-dss DT binding
document. The driver registers a dummy hdmi codec driver and a
simple-card driver to produce a fully functional ALSA device. The DAI
driver is implemented in hdmi_audio.c, but it still needs to be
registered from hdmi4.c or hdmi5.c.

Signed-off-by: Jyri Sarha <jsarha@ti.com>
---
 drivers/video/fbdev/omap2/dss/Makefile     |    2 +
 drivers/video/fbdev/omap2/dss/hdmi.h       |   38 +++-
 drivers/video/fbdev/omap2/dss/hdmi_audio.c |  317 ++++++++++++++++++++++++++++
 3 files changed, 355 insertions(+), 2 deletions(-)
 create mode 100644 drivers/video/fbdev/omap2/dss/hdmi_audio.c

diff --git a/drivers/video/fbdev/omap2/dss/Makefile b/drivers/video/fbdev/omap2/dss/Makefile
index 245f933..8260987 100644
--- a/drivers/video/fbdev/omap2/dss/Makefile
+++ b/drivers/video/fbdev/omap2/dss/Makefile
@@ -14,5 +14,7 @@ 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
 omapdss-$(CONFIG_OMAP4_DSS_HDMI) += hdmi4.o hdmi4_core.o
+omapdss-$(CONFIG_OMAP4_DSS_HDMI_AUDIO) += hdmi_audio.o
 omapdss-$(CONFIG_OMAP5_DSS_HDMI) += hdmi5.o hdmi5_core.o
+omapdss-$(CONFIG_OMAP5_DSS_HDMI_AUDIO) += hdmi_audio.o
 ccflags-$(CONFIG_OMAP2_DSS_DEBUG) += -DDEBUG
diff --git a/drivers/video/fbdev/omap2/dss/hdmi.h b/drivers/video/fbdev/omap2/dss/hdmi.h
index 927cb4d..cc6ecb5 100644
--- a/drivers/video/fbdev/omap2/dss/hdmi.h
+++ b/drivers/video/fbdev/omap2/dss/hdmi.h
@@ -25,6 +25,11 @@
 #include <linux/hdmi.h>
 #include <video/omapdss.h>
 
+#if defined(CONFIG_OMAP4_DSS_HDMI_AUDIO) || defined(CONFIG_OMAP5_DSS_HDMI_AUDIO)
+#include <sound/dmaengine_pcm.h>
+#include <uapi/sound/asound.h>
+#endif
+
 #include "dss.h"
 
 /* HDMI Wrapper */
@@ -338,6 +343,35 @@ 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 {
+	/* These should be initialized when hdmi_audio_register() is called */
+	struct mutex *hdmi_lock;
+	struct hdmi_wp_data *wp;
+	struct hdmi_core_data *core;
+	struct hdmi_config *cfg;
+	struct snd_soc_dai_driver *hdmi_dai_drv;
+
+	int (*audio_start)(struct hdmi_core_data *core,
+			   struct hdmi_wp_data *wp);
+	void (*audio_stop)(struct hdmi_core_data *core,
+			   struct hdmi_wp_data *wp);
+	int (*audio_config)(struct hdmi_core_data *core,
+			    struct hdmi_wp_data *wp,
+			    struct omap_dss_audio *audio,
+			    u32 pclk);
+
+	/* These are of audio implementation's private use */
+	struct snd_dmaengine_dai_dma_data dma_data;
+	struct omap_dss_audio dss_audio;
+	struct snd_aes_iec958 iec;
+	struct snd_cea_861_aud_if cea;
+	struct platform_device *codec_pdev;
+	struct platform_device *card_pdev;
+};
+
+int hdmi_audio_register(struct platform_device *pdev);
+void hdmi_audio_unregister(struct platform_device *pdev);
+
 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);
@@ -345,9 +379,9 @@ void hdmi_wp_audio_config_format(struct hdmi_wp_data *wp,
 		struct hdmi_audio_format *aud_fmt);
 void hdmi_wp_audio_config_dma(struct hdmi_wp_data *wp,
 		struct hdmi_audio_dma *aud_dma);
-static inline bool hdmi_mode_has_audio(int mode)
+static inline bool hdmi_mode_has_audio(struct hdmi_config *cfg)
 {
-	return mode = HDMI_HDMI ? true : false;
+	return cfg->hdmi_dvi_mode = HDMI_HDMI ? true : false;
 }
 #endif
 #endif
diff --git a/drivers/video/fbdev/omap2/dss/hdmi_audio.c b/drivers/video/fbdev/omap2/dss/hdmi_audio.c
new file mode 100644
index 0000000..a8a0b78
--- /dev/null
+++ b/drivers/video/fbdev/omap2/dss/hdmi_audio.c
@@ -0,0 +1,317 @@
+/*
+ * OMAP4+ HDMI audio
+ *
+ * Copyright (C) 2014 Texas Instruments Incorporated
+ *
+ * Authors: Jyri Sarha <jsarha@ti.com>
+ *
+ * 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.
+ *
+ */
+
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/err.h>
+#include <linux/string.h>
+#include <linux/platform_device.h>
+#include <sound/soc.h>
+#include <sound/pcm_params.h>
+#include <sound/dmaengine_pcm.h>
+#include <uapi/sound/asound.h>
+#include <sound/asoundef.h>
+#include <sound/omap-pcm.h>
+#include <sound/simple_card.h>
+
+#include "hdmi.h"
+
+static int hdmi_dai_startup(struct snd_pcm_substream *substream,
+			    struct snd_soc_dai *dai)
+{
+	struct hdmi_audio_data *dd = snd_soc_dai_get_drvdata(dai);
+	int ret;
+	/*
+	 * Make sure that the period bytes are multiple of the DMA packet size.
+	 * Largest packet size we use is 32 32-bit words = 128 bytes
+	 */
+	ret = snd_pcm_hw_constraint_step(substream->runtime, 0,
+					 SNDRV_PCM_HW_PARAM_PERIOD_BYTES, 128);
+	if (ret < 0) {
+		dev_err(dai->dev, "could not apply constraint\n");
+		return ret;
+	}
+
+	mutex_lock(dd->hdmi_lock);
+	ret = hdmi_mode_has_audio(dd->cfg);
+	mutex_unlock(dd->hdmi_lock);
+	if (!ret) {
+		dev_err(dai->dev, "audio not supported\n");
+		return -ENODEV;
+	}
+
+	snd_soc_dai_set_dma_data(dai, substream, &dd->dma_data);
+
+	return 0;
+}
+
+static int hdmi_dai_prepare(struct snd_pcm_substream *substream,
+			    struct snd_soc_dai *dai)
+{
+	struct hdmi_audio_data *dd = snd_soc_dai_get_drvdata(dai);
+	int r;
+
+	mutex_lock(dd->hdmi_lock);
+
+	if (!hdmi_mode_has_audio(dd->cfg)) {
+		r = -EPERM;
+		goto err;
+	}
+
+	r = hdmi_wp_audio_enable(dd->wp, true);
+
+err:
+	mutex_unlock(dd->hdmi_lock);
+	return r;
+}
+
+static int hdmi_dai_hw_params(struct snd_pcm_substream *substream,
+			      struct snd_pcm_hw_params *params,
+			      struct snd_soc_dai *dai)
+{
+	struct hdmi_audio_data *dd = snd_soc_dai_get_drvdata(dai);
+	struct snd_aes_iec958 *iec = &dd->iec;
+	struct snd_cea_861_aud_if *cea = &dd->cea;
+	int err;
+
+	switch (params_format(params)) {
+	case SNDRV_PCM_FORMAT_S16_LE:
+		dd->dma_data.maxburst = 16;
+		break;
+	case SNDRV_PCM_FORMAT_S24_LE:
+		dd->dma_data.maxburst = 32;
+		break;
+	default:
+		dev_err(dai->dev, "format not supported!\n");
+		return -EINVAL;
+	}
+
+	dd->dss_audio.iec = iec;
+	dd->dss_audio.cea = cea;
+	/*
+	 * fill the IEC-60958 channel status word
+	 */
+	/* initialize the word bytes */
+	memset(iec->status, 0, sizeof(iec->status));
+
+	/* specify IEC-60958-3 (commercial use) */
+	iec->status[0] &= ~IEC958_AES0_PROFESSIONAL;
+
+	/* specify that the audio is LPCM*/
+	iec->status[0] &= ~IEC958_AES0_NONAUDIO;
+
+	iec->status[0] |= IEC958_AES0_CON_NOT_COPYRIGHT;
+
+	iec->status[0] |= IEC958_AES0_CON_EMPHASIS_NONE;
+
+	iec->status[0] |= IEC958_AES1_PRO_MODE_NOTID;
+
+	iec->status[1] = IEC958_AES1_CON_GENERAL;
+
+	iec->status[2] |= IEC958_AES2_CON_SOURCE_UNSPEC;
+
+	iec->status[2] |= IEC958_AES2_CON_CHANNEL_UNSPEC;
+
+	switch (params_rate(params)) {
+	case 32000:
+		iec->status[3] |= IEC958_AES3_CON_FS_32000;
+		break;
+	case 44100:
+		iec->status[3] |= IEC958_AES3_CON_FS_44100;
+		break;
+	case 48000:
+		iec->status[3] |= IEC958_AES3_CON_FS_48000;
+		break;
+	case 88200:
+		iec->status[3] |= IEC958_AES3_CON_FS_88200;
+		break;
+	case 96000:
+		iec->status[3] |= IEC958_AES3_CON_FS_96000;
+		break;
+	case 176400:
+		iec->status[3] |= IEC958_AES3_CON_FS_176400;
+		break;
+	case 192000:
+		iec->status[3] |= IEC958_AES3_CON_FS_192000;
+		break;
+	default:
+		dev_err(dai->dev, "rate not supported!\n");
+		return -EINVAL;
+	}
+
+	/* specify the clock accuracy */
+	iec->status[3] |= IEC958_AES3_CON_CLOCK_1000PPM;
+
+	/*
+	 * specify the word length. The same word length value can mean
+	 * two different lengths. Hence, we need to specify the maximum
+	 * word length as well.
+	 */
+	switch (params_format(params)) {
+	case SNDRV_PCM_FORMAT_S16_LE:
+		iec->status[4] |= IEC958_AES4_CON_WORDLEN_20_16;
+		iec->status[4] &= ~IEC958_AES4_CON_MAX_WORDLEN_24;
+		break;
+	case SNDRV_PCM_FORMAT_S24_LE:
+		iec->status[4] |= IEC958_AES4_CON_WORDLEN_24_20;
+		iec->status[4] |= IEC958_AES4_CON_MAX_WORDLEN_24;
+		break;
+	default:
+		dev_err(dai->dev, "format not supported!\n");
+		return -EINVAL;
+	}
+
+	/*
+	 * Fill the CEA-861 audio infoframe (see spec for details)
+	 */
+
+	cea->db1_ct_cc = (params_channels(params) - 1)
+		& CEA861_AUDIO_INFOFRAME_DB1CC;
+	cea->db1_ct_cc |= CEA861_AUDIO_INFOFRAME_DB1CT_FROM_STREAM;
+
+	cea->db2_sf_ss = CEA861_AUDIO_INFOFRAME_DB2SF_FROM_STREAM;
+	cea->db2_sf_ss |= CEA861_AUDIO_INFOFRAME_DB2SS_FROM_STREAM;
+
+	cea->db3 = 0; /* not used, all zeros */
+
+	/*
+	 * The OMAP HDMI IP requires to use the 8-channel channel code when
+	 * transmitting more than two channels.
+	 */
+	if (params_channels(params) = 2)
+		cea->db4_ca = 0x0;
+	else
+		cea->db4_ca = 0x13;
+
+	cea->db5_dminh_lsv = CEA861_AUDIO_INFOFRAME_DB5_DM_INH_PROHIBITED;
+	/* the expression is trivial but makes clear what we are doing */
+	cea->db5_dminh_lsv |= (0 & CEA861_AUDIO_INFOFRAME_DB5_LSV);
+
+	mutex_lock(dd->hdmi_lock);
+
+	if (!hdmi_mode_has_audio(dd->cfg)) {
+		err = -EPERM;
+		goto err;
+	}
+
+	err = dd->audio_config(dd->core, dd->wp, &dd->dss_audio,
+			       dd->cfg->timings.pixelclock);
+err:
+	mutex_unlock(dd->hdmi_lock);
+	return err;
+}
+
+static int hdmi_dai_trigger(struct snd_pcm_substream *substream, int cmd,
+			    struct snd_soc_dai *dai)
+{
+	struct hdmi_audio_data *dd = snd_soc_dai_get_drvdata(dai);
+	int err = 0;
+
+	switch (cmd) {
+	case SNDRV_PCM_TRIGGER_START:
+	case SNDRV_PCM_TRIGGER_RESUME:
+	case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
+		err = dd->audio_start(dd->core, dd->wp);
+		break;
+	case SNDRV_PCM_TRIGGER_STOP:
+	case SNDRV_PCM_TRIGGER_SUSPEND:
+	case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
+		dd->audio_start(dd->core, dd->wp);
+		break;
+	default:
+		err = -EINVAL;
+	}
+	return err;
+}
+
+static void hdmi_dai_shutdown(struct snd_pcm_substream *substream,
+			      struct snd_soc_dai *dai)
+{
+	struct hdmi_audio_data *dd = snd_soc_dai_get_drvdata(dai);
+
+	hdmi_wp_audio_enable(dd->wp, false);
+}
+
+static const struct snd_soc_dai_ops hdmi_dai_ops = {
+	.startup	= hdmi_dai_startup,
+	.hw_params	= hdmi_dai_hw_params,
+	.prepare	= hdmi_dai_prepare,
+	.trigger	= hdmi_dai_trigger,
+	.shutdown	= hdmi_dai_shutdown,
+};
+
+static const struct snd_soc_component_driver omap_hdmi_component = {
+	.name = "omapdss_hdmi",
+};
+
+static struct asoc_simple_card_info card_info = {
+	.name = "HDMI",
+	.card = "OMAPHDMI",
+	.codec_dai.name = "hdmi-hifi",
+};
+
+int hdmi_audio_register(struct platform_device *pdev)
+{
+	struct hdmi_audio_data *dd = dev_get_drvdata(&pdev->dev);
+	struct device *dev = &pdev->dev;
+	int ret;
+
+	dd->dma_data.addr = hdmi_wp_get_phys_addr(dd->wp) + HDMI_WP_AUDIO_DATA;
+	dd->dma_data.filter_data = "audio_tx";
+	dd->dma_data.addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
+	dd->hdmi_dai_drv->ops = &hdmi_dai_ops,
+
+	ret = snd_soc_register_component(dev, &omap_hdmi_component,
+					 dd->hdmi_dai_drv, 1);
+	if (ret)
+		return ret;
+
+	ret = omap_pcm_platform_register(dev);
+	if (ret)
+		return ret;
+
+	dd->codec_pdev = platform_device_register_data(dev, "hdmi-audio-codec",
+						       0, NULL, 0);
+	if (IS_ERR(dd->codec_pdev)) {
+		snd_soc_unregister_component(dev);
+		return PTR_ERR(dd->codec_pdev);
+	}
+
+	card_info.cpu_dai.name = dev_name(dev);
+	card_info.platform = dev_name(dev);
+	card_info.codec = dev_name(&dd->codec_pdev->dev);
+
+	dd->card_pdev +		platform_device_register_data(dev, "asoc-simple-card", 0,
+					      &card_info, sizeof(card_info));
+	if (IS_ERR(dd->card_pdev)) {
+		snd_soc_unregister_component(dev);
+		platform_device_unregister(dd->codec_pdev);
+		return PTR_ERR(dd->card_pdev);
+	}
+	return 0;
+}
+
+void hdmi_audio_unregister(struct platform_device *pdev)
+{
+	struct hdmi_audio_data *dd = dev_get_drvdata(&pdev->dev);
+
+	platform_device_unregister(dd->card_pdev);
+	platform_device_unregister(dd->codec_pdev);
+	snd_soc_unregister_component(&pdev->dev);
+}
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [PATCH 04/12] OMAPDSS: hdmi_audio: Integrated ASoC DAI component driver implementation
@ 2014-06-26 19:20   ` Jyri Sarha
  0 siblings, 0 replies; 60+ messages in thread
From: Jyri Sarha @ 2014-06-26 19:20 UTC (permalink / raw)
  To: alsa-devel, linux-fbdev, linux-omap
  Cc: peter.ujfalusi, broonie, liam.r.girdwood, tomi.valkeinen,
	detheridge, jyri.sarha, Jyri Sarha

Integrate ASoC DAI component driver in to the OMAP hdmi driver. The
patch also updates the relevant entry in ti,omap5-dss DT binding
document. The driver registers a dummy hdmi codec driver and a
simple-card driver to produce a fully functional ALSA device. The DAI
driver is implemented in hdmi_audio.c, but it still needs to be
registered from hdmi4.c or hdmi5.c.

Signed-off-by: Jyri Sarha <jsarha@ti.com>
---
 drivers/video/fbdev/omap2/dss/Makefile     |    2 +
 drivers/video/fbdev/omap2/dss/hdmi.h       |   38 +++-
 drivers/video/fbdev/omap2/dss/hdmi_audio.c |  317 ++++++++++++++++++++++++++++
 3 files changed, 355 insertions(+), 2 deletions(-)
 create mode 100644 drivers/video/fbdev/omap2/dss/hdmi_audio.c

diff --git a/drivers/video/fbdev/omap2/dss/Makefile b/drivers/video/fbdev/omap2/dss/Makefile
index 245f933..8260987 100644
--- a/drivers/video/fbdev/omap2/dss/Makefile
+++ b/drivers/video/fbdev/omap2/dss/Makefile
@@ -14,5 +14,7 @@ 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
 omapdss-$(CONFIG_OMAP4_DSS_HDMI) += hdmi4.o hdmi4_core.o
+omapdss-$(CONFIG_OMAP4_DSS_HDMI_AUDIO) += hdmi_audio.o
 omapdss-$(CONFIG_OMAP5_DSS_HDMI) += hdmi5.o hdmi5_core.o
+omapdss-$(CONFIG_OMAP5_DSS_HDMI_AUDIO) += hdmi_audio.o
 ccflags-$(CONFIG_OMAP2_DSS_DEBUG) += -DDEBUG
diff --git a/drivers/video/fbdev/omap2/dss/hdmi.h b/drivers/video/fbdev/omap2/dss/hdmi.h
index 927cb4d..cc6ecb5 100644
--- a/drivers/video/fbdev/omap2/dss/hdmi.h
+++ b/drivers/video/fbdev/omap2/dss/hdmi.h
@@ -25,6 +25,11 @@
 #include <linux/hdmi.h>
 #include <video/omapdss.h>
 
+#if defined(CONFIG_OMAP4_DSS_HDMI_AUDIO) || defined(CONFIG_OMAP5_DSS_HDMI_AUDIO)
+#include <sound/dmaengine_pcm.h>
+#include <uapi/sound/asound.h>
+#endif
+
 #include "dss.h"
 
 /* HDMI Wrapper */
@@ -338,6 +343,35 @@ 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 {
+	/* These should be initialized when hdmi_audio_register() is called */
+	struct mutex *hdmi_lock;
+	struct hdmi_wp_data *wp;
+	struct hdmi_core_data *core;
+	struct hdmi_config *cfg;
+	struct snd_soc_dai_driver *hdmi_dai_drv;
+
+	int (*audio_start)(struct hdmi_core_data *core,
+			   struct hdmi_wp_data *wp);
+	void (*audio_stop)(struct hdmi_core_data *core,
+			   struct hdmi_wp_data *wp);
+	int (*audio_config)(struct hdmi_core_data *core,
+			    struct hdmi_wp_data *wp,
+			    struct omap_dss_audio *audio,
+			    u32 pclk);
+
+	/* These are of audio implementation's private use */
+	struct snd_dmaengine_dai_dma_data dma_data;
+	struct omap_dss_audio dss_audio;
+	struct snd_aes_iec958 iec;
+	struct snd_cea_861_aud_if cea;
+	struct platform_device *codec_pdev;
+	struct platform_device *card_pdev;
+};
+
+int hdmi_audio_register(struct platform_device *pdev);
+void hdmi_audio_unregister(struct platform_device *pdev);
+
 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);
@@ -345,9 +379,9 @@ void hdmi_wp_audio_config_format(struct hdmi_wp_data *wp,
 		struct hdmi_audio_format *aud_fmt);
 void hdmi_wp_audio_config_dma(struct hdmi_wp_data *wp,
 		struct hdmi_audio_dma *aud_dma);
-static inline bool hdmi_mode_has_audio(int mode)
+static inline bool hdmi_mode_has_audio(struct hdmi_config *cfg)
 {
-	return mode == HDMI_HDMI ? true : false;
+	return cfg->hdmi_dvi_mode == HDMI_HDMI ? true : false;
 }
 #endif
 #endif
diff --git a/drivers/video/fbdev/omap2/dss/hdmi_audio.c b/drivers/video/fbdev/omap2/dss/hdmi_audio.c
new file mode 100644
index 0000000..a8a0b78
--- /dev/null
+++ b/drivers/video/fbdev/omap2/dss/hdmi_audio.c
@@ -0,0 +1,317 @@
+/*
+ * OMAP4+ HDMI audio
+ *
+ * Copyright (C) 2014 Texas Instruments Incorporated
+ *
+ * Authors: Jyri Sarha <jsarha@ti.com>
+ *
+ * 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.
+ *
+ */
+
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/err.h>
+#include <linux/string.h>
+#include <linux/platform_device.h>
+#include <sound/soc.h>
+#include <sound/pcm_params.h>
+#include <sound/dmaengine_pcm.h>
+#include <uapi/sound/asound.h>
+#include <sound/asoundef.h>
+#include <sound/omap-pcm.h>
+#include <sound/simple_card.h>
+
+#include "hdmi.h"
+
+static int hdmi_dai_startup(struct snd_pcm_substream *substream,
+			    struct snd_soc_dai *dai)
+{
+	struct hdmi_audio_data *dd = snd_soc_dai_get_drvdata(dai);
+	int ret;
+	/*
+	 * Make sure that the period bytes are multiple of the DMA packet size.
+	 * Largest packet size we use is 32 32-bit words = 128 bytes
+	 */
+	ret = snd_pcm_hw_constraint_step(substream->runtime, 0,
+					 SNDRV_PCM_HW_PARAM_PERIOD_BYTES, 128);
+	if (ret < 0) {
+		dev_err(dai->dev, "could not apply constraint\n");
+		return ret;
+	}
+
+	mutex_lock(dd->hdmi_lock);
+	ret = hdmi_mode_has_audio(dd->cfg);
+	mutex_unlock(dd->hdmi_lock);
+	if (!ret) {
+		dev_err(dai->dev, "audio not supported\n");
+		return -ENODEV;
+	}
+
+	snd_soc_dai_set_dma_data(dai, substream, &dd->dma_data);
+
+	return 0;
+}
+
+static int hdmi_dai_prepare(struct snd_pcm_substream *substream,
+			    struct snd_soc_dai *dai)
+{
+	struct hdmi_audio_data *dd = snd_soc_dai_get_drvdata(dai);
+	int r;
+
+	mutex_lock(dd->hdmi_lock);
+
+	if (!hdmi_mode_has_audio(dd->cfg)) {
+		r = -EPERM;
+		goto err;
+	}
+
+	r = hdmi_wp_audio_enable(dd->wp, true);
+
+err:
+	mutex_unlock(dd->hdmi_lock);
+	return r;
+}
+
+static int hdmi_dai_hw_params(struct snd_pcm_substream *substream,
+			      struct snd_pcm_hw_params *params,
+			      struct snd_soc_dai *dai)
+{
+	struct hdmi_audio_data *dd = snd_soc_dai_get_drvdata(dai);
+	struct snd_aes_iec958 *iec = &dd->iec;
+	struct snd_cea_861_aud_if *cea = &dd->cea;
+	int err;
+
+	switch (params_format(params)) {
+	case SNDRV_PCM_FORMAT_S16_LE:
+		dd->dma_data.maxburst = 16;
+		break;
+	case SNDRV_PCM_FORMAT_S24_LE:
+		dd->dma_data.maxburst = 32;
+		break;
+	default:
+		dev_err(dai->dev, "format not supported!\n");
+		return -EINVAL;
+	}
+
+	dd->dss_audio.iec = iec;
+	dd->dss_audio.cea = cea;
+	/*
+	 * fill the IEC-60958 channel status word
+	 */
+	/* initialize the word bytes */
+	memset(iec->status, 0, sizeof(iec->status));
+
+	/* specify IEC-60958-3 (commercial use) */
+	iec->status[0] &= ~IEC958_AES0_PROFESSIONAL;
+
+	/* specify that the audio is LPCM*/
+	iec->status[0] &= ~IEC958_AES0_NONAUDIO;
+
+	iec->status[0] |= IEC958_AES0_CON_NOT_COPYRIGHT;
+
+	iec->status[0] |= IEC958_AES0_CON_EMPHASIS_NONE;
+
+	iec->status[0] |= IEC958_AES1_PRO_MODE_NOTID;
+
+	iec->status[1] = IEC958_AES1_CON_GENERAL;
+
+	iec->status[2] |= IEC958_AES2_CON_SOURCE_UNSPEC;
+
+	iec->status[2] |= IEC958_AES2_CON_CHANNEL_UNSPEC;
+
+	switch (params_rate(params)) {
+	case 32000:
+		iec->status[3] |= IEC958_AES3_CON_FS_32000;
+		break;
+	case 44100:
+		iec->status[3] |= IEC958_AES3_CON_FS_44100;
+		break;
+	case 48000:
+		iec->status[3] |= IEC958_AES3_CON_FS_48000;
+		break;
+	case 88200:
+		iec->status[3] |= IEC958_AES3_CON_FS_88200;
+		break;
+	case 96000:
+		iec->status[3] |= IEC958_AES3_CON_FS_96000;
+		break;
+	case 176400:
+		iec->status[3] |= IEC958_AES3_CON_FS_176400;
+		break;
+	case 192000:
+		iec->status[3] |= IEC958_AES3_CON_FS_192000;
+		break;
+	default:
+		dev_err(dai->dev, "rate not supported!\n");
+		return -EINVAL;
+	}
+
+	/* specify the clock accuracy */
+	iec->status[3] |= IEC958_AES3_CON_CLOCK_1000PPM;
+
+	/*
+	 * specify the word length. The same word length value can mean
+	 * two different lengths. Hence, we need to specify the maximum
+	 * word length as well.
+	 */
+	switch (params_format(params)) {
+	case SNDRV_PCM_FORMAT_S16_LE:
+		iec->status[4] |= IEC958_AES4_CON_WORDLEN_20_16;
+		iec->status[4] &= ~IEC958_AES4_CON_MAX_WORDLEN_24;
+		break;
+	case SNDRV_PCM_FORMAT_S24_LE:
+		iec->status[4] |= IEC958_AES4_CON_WORDLEN_24_20;
+		iec->status[4] |= IEC958_AES4_CON_MAX_WORDLEN_24;
+		break;
+	default:
+		dev_err(dai->dev, "format not supported!\n");
+		return -EINVAL;
+	}
+
+	/*
+	 * Fill the CEA-861 audio infoframe (see spec for details)
+	 */
+
+	cea->db1_ct_cc = (params_channels(params) - 1)
+		& CEA861_AUDIO_INFOFRAME_DB1CC;
+	cea->db1_ct_cc |= CEA861_AUDIO_INFOFRAME_DB1CT_FROM_STREAM;
+
+	cea->db2_sf_ss = CEA861_AUDIO_INFOFRAME_DB2SF_FROM_STREAM;
+	cea->db2_sf_ss |= CEA861_AUDIO_INFOFRAME_DB2SS_FROM_STREAM;
+
+	cea->db3 = 0; /* not used, all zeros */
+
+	/*
+	 * The OMAP HDMI IP requires to use the 8-channel channel code when
+	 * transmitting more than two channels.
+	 */
+	if (params_channels(params) == 2)
+		cea->db4_ca = 0x0;
+	else
+		cea->db4_ca = 0x13;
+
+	cea->db5_dminh_lsv = CEA861_AUDIO_INFOFRAME_DB5_DM_INH_PROHIBITED;
+	/* the expression is trivial but makes clear what we are doing */
+	cea->db5_dminh_lsv |= (0 & CEA861_AUDIO_INFOFRAME_DB5_LSV);
+
+	mutex_lock(dd->hdmi_lock);
+
+	if (!hdmi_mode_has_audio(dd->cfg)) {
+		err = -EPERM;
+		goto err;
+	}
+
+	err = dd->audio_config(dd->core, dd->wp, &dd->dss_audio,
+			       dd->cfg->timings.pixelclock);
+err:
+	mutex_unlock(dd->hdmi_lock);
+	return err;
+}
+
+static int hdmi_dai_trigger(struct snd_pcm_substream *substream, int cmd,
+			    struct snd_soc_dai *dai)
+{
+	struct hdmi_audio_data *dd = snd_soc_dai_get_drvdata(dai);
+	int err = 0;
+
+	switch (cmd) {
+	case SNDRV_PCM_TRIGGER_START:
+	case SNDRV_PCM_TRIGGER_RESUME:
+	case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
+		err = dd->audio_start(dd->core, dd->wp);
+		break;
+	case SNDRV_PCM_TRIGGER_STOP:
+	case SNDRV_PCM_TRIGGER_SUSPEND:
+	case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
+		dd->audio_start(dd->core, dd->wp);
+		break;
+	default:
+		err = -EINVAL;
+	}
+	return err;
+}
+
+static void hdmi_dai_shutdown(struct snd_pcm_substream *substream,
+			      struct snd_soc_dai *dai)
+{
+	struct hdmi_audio_data *dd = snd_soc_dai_get_drvdata(dai);
+
+	hdmi_wp_audio_enable(dd->wp, false);
+}
+
+static const struct snd_soc_dai_ops hdmi_dai_ops = {
+	.startup	= hdmi_dai_startup,
+	.hw_params	= hdmi_dai_hw_params,
+	.prepare	= hdmi_dai_prepare,
+	.trigger	= hdmi_dai_trigger,
+	.shutdown	= hdmi_dai_shutdown,
+};
+
+static const struct snd_soc_component_driver omap_hdmi_component = {
+	.name = "omapdss_hdmi",
+};
+
+static struct asoc_simple_card_info card_info = {
+	.name = "HDMI",
+	.card = "OMAPHDMI",
+	.codec_dai.name = "hdmi-hifi",
+};
+
+int hdmi_audio_register(struct platform_device *pdev)
+{
+	struct hdmi_audio_data *dd = dev_get_drvdata(&pdev->dev);
+	struct device *dev = &pdev->dev;
+	int ret;
+
+	dd->dma_data.addr = hdmi_wp_get_phys_addr(dd->wp) + HDMI_WP_AUDIO_DATA;
+	dd->dma_data.filter_data = "audio_tx";
+	dd->dma_data.addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
+	dd->hdmi_dai_drv->ops = &hdmi_dai_ops,
+
+	ret = snd_soc_register_component(dev, &omap_hdmi_component,
+					 dd->hdmi_dai_drv, 1);
+	if (ret)
+		return ret;
+
+	ret = omap_pcm_platform_register(dev);
+	if (ret)
+		return ret;
+
+	dd->codec_pdev = platform_device_register_data(dev, "hdmi-audio-codec",
+						       0, NULL, 0);
+	if (IS_ERR(dd->codec_pdev)) {
+		snd_soc_unregister_component(dev);
+		return PTR_ERR(dd->codec_pdev);
+	}
+
+	card_info.cpu_dai.name = dev_name(dev);
+	card_info.platform = dev_name(dev);
+	card_info.codec = dev_name(&dd->codec_pdev->dev);
+
+	dd->card_pdev =
+		platform_device_register_data(dev, "asoc-simple-card", 0,
+					      &card_info, sizeof(card_info));
+	if (IS_ERR(dd->card_pdev)) {
+		snd_soc_unregister_component(dev);
+		platform_device_unregister(dd->codec_pdev);
+		return PTR_ERR(dd->card_pdev);
+	}
+	return 0;
+}
+
+void hdmi_audio_unregister(struct platform_device *pdev)
+{
+	struct hdmi_audio_data *dd = dev_get_drvdata(&pdev->dev);
+
+	platform_device_unregister(dd->card_pdev);
+	platform_device_unregister(dd->codec_pdev);
+	snd_soc_unregister_component(&pdev->dev);
+}
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [PATCH 05/12] OMAPDSS: Kconfig: Select audio dependencies if OMAP4_DSS_HDMI_AUDIO=y
  2014-06-26 19:20 ` Jyri Sarha
@ 2014-06-26 19:20   ` Jyri Sarha
  -1 siblings, 0 replies; 60+ messages in thread
From: Jyri Sarha @ 2014-06-26 19:20 UTC (permalink / raw)
  To: alsa-devel, linux-fbdev, linux-omap
  Cc: peter.ujfalusi, broonie, liam.r.girdwood, tomi.valkeinen,
	detheridge, jyri.sarha, Jyri Sarha

Adds help section and SND_SOC dependency to OMAP4_DSS_HDMI_AUDIO.
Selects SND_OMAP_SOC, SND_SOC_HDMI_CODEC, and SND_SIMPLE_CARD if
OMAP4_DSS_HDMI_AUDIO is enabled.

Signed-off-by: Jyri Sarha <jsarha@ti.com>
---
 drivers/video/fbdev/omap2/dss/Kconfig |   14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/drivers/video/fbdev/omap2/dss/Kconfig b/drivers/video/fbdev/omap2/dss/Kconfig
index 3d5eb6c..871f722 100644
--- a/drivers/video/fbdev/omap2/dss/Kconfig
+++ b/drivers/video/fbdev/omap2/dss/Kconfig
@@ -6,6 +6,9 @@ menuconfig OMAP2_DSS
 	select VIDEOMODE_HELPERS
 	select OMAP2_DSS_INIT
 	select HDMI
+	select SND_OMAP_SOC if OMAP4_DSS_HDMI_AUDIO
+	select SND_SOC_HDMI_CODEC if OMAP4_DSS_HDMI_AUDIO
+	select SND_SIMPLE_CARD if OMAP4_DSS_HDMI_AUDIO
         help
 	  OMAP2+ Display Subsystem support.
 
@@ -75,7 +78,16 @@ config OMAP4_DSS_HDMI
 	  HDMI support for OMAP4 based SoCs.
 
 config OMAP4_DSS_HDMI_AUDIO
-	bool
+	bool "HDMI audio support for OMAP4"
+	depends on OMAP4_DSS_HDMI
+	depends on SND_SOC=y || OMAP2_DSS = SND_SOC
+	default y
+	help
+	  HDMI audio support for OMAP4 based SoCs. Adds integrated
+	  ASoC Digital Audio Interface component driver into OMAPDSS
+	  module. If enabled OMAP2_DSS selects SND_OMAP_SOC,
+	  SND_SOC_HDMI_CODEC, and SND_SIMPLE_CARD for full HDMI
+	  audio support.
 
 config OMAP5_DSS_HDMI
 	bool "HDMI support for OMAP5"
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [PATCH 05/12] OMAPDSS: Kconfig: Select audio dependencies if OMAP4_DSS_HDMI_AUDIO=y
@ 2014-06-26 19:20   ` Jyri Sarha
  0 siblings, 0 replies; 60+ messages in thread
From: Jyri Sarha @ 2014-06-26 19:20 UTC (permalink / raw)
  To: alsa-devel, linux-fbdev, linux-omap
  Cc: peter.ujfalusi, broonie, liam.r.girdwood, tomi.valkeinen,
	detheridge, jyri.sarha, Jyri Sarha

Adds help section and SND_SOC dependency to OMAP4_DSS_HDMI_AUDIO.
Selects SND_OMAP_SOC, SND_SOC_HDMI_CODEC, and SND_SIMPLE_CARD if
OMAP4_DSS_HDMI_AUDIO is enabled.

Signed-off-by: Jyri Sarha <jsarha@ti.com>
---
 drivers/video/fbdev/omap2/dss/Kconfig |   14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/drivers/video/fbdev/omap2/dss/Kconfig b/drivers/video/fbdev/omap2/dss/Kconfig
index 3d5eb6c..871f722 100644
--- a/drivers/video/fbdev/omap2/dss/Kconfig
+++ b/drivers/video/fbdev/omap2/dss/Kconfig
@@ -6,6 +6,9 @@ menuconfig OMAP2_DSS
 	select VIDEOMODE_HELPERS
 	select OMAP2_DSS_INIT
 	select HDMI
+	select SND_OMAP_SOC if OMAP4_DSS_HDMI_AUDIO
+	select SND_SOC_HDMI_CODEC if OMAP4_DSS_HDMI_AUDIO
+	select SND_SIMPLE_CARD if OMAP4_DSS_HDMI_AUDIO
         help
 	  OMAP2+ Display Subsystem support.
 
@@ -75,7 +78,16 @@ config OMAP4_DSS_HDMI
 	  HDMI support for OMAP4 based SoCs.
 
 config OMAP4_DSS_HDMI_AUDIO
-	bool
+	bool "HDMI audio support for OMAP4"
+	depends on OMAP4_DSS_HDMI
+	depends on SND_SOC=y || OMAP2_DSS = SND_SOC
+	default y
+	help
+	  HDMI audio support for OMAP4 based SoCs. Adds integrated
+	  ASoC Digital Audio Interface component driver into OMAPDSS
+	  module. If enabled OMAP2_DSS selects SND_OMAP_SOC,
+	  SND_SOC_HDMI_CODEC, and SND_SIMPLE_CARD for full HDMI
+	  audio support.
 
 config OMAP5_DSS_HDMI
 	bool "HDMI support for OMAP5"
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [PATCH 06/12] OMAPDSS: hdmi4: Register HDMI audio ASoC drivers from HDMI driver
  2014-06-26 19:20 ` Jyri Sarha
@ 2014-06-26 19:20   ` Jyri Sarha
  -1 siblings, 0 replies; 60+ messages in thread
From: Jyri Sarha @ 2014-06-26 19:20 UTC (permalink / raw)
  To: alsa-devel, linux-fbdev, linux-omap
  Cc: peter.ujfalusi, broonie, liam.r.girdwood, tomi.valkeinen,
	detheridge, jyri.sarha, Jyri Sarha

Add audio datamember to hdmi struct and call register and unregister
functions form hdmi_audio.c. Register function registers the
integrated cpu dai, dummy HDMI codec, and simple-card machine driver
for complete HDMI audio support.

Signed-off-by: Jyri Sarha <jsarha@ti.com>
---
 drivers/video/fbdev/omap2/dss/hdmi4.c |   45 +++++++++++++++++++++++++++++++++
 1 file changed, 45 insertions(+)

diff --git a/drivers/video/fbdev/omap2/dss/hdmi4.c b/drivers/video/fbdev/omap2/dss/hdmi4.c
index 342ddb4..48f11f8 100644
--- a/drivers/video/fbdev/omap2/dss/hdmi4.c
+++ b/drivers/video/fbdev/omap2/dss/hdmi4.c
@@ -34,6 +34,11 @@
 #include <linux/regulator/consumer.h>
 #include <video/omapdss.h>
 
+#if defined(CONFIG_OMAP4_DSS_HDMI_AUDIO)
+#include <sound/soc.h>
+#include <sound/soc-dai.h>
+#endif
+
 #include "hdmi4_core.h"
 #include "dss.h"
 #include "dss_features.h"
@@ -52,6 +57,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;
@@ -671,6 +679,21 @@ err:
 	return r;
 }
 
+#if defined(CONFIG_OMAP4_DSS_HDMI_AUDIO)
+static struct snd_soc_dai_driver omap_hdmi_dai = {
+	.name = "omap4-hdmi-dai",
+	.playback = {
+		.channels_min = 2,
+		.channels_max = 8,
+		.rates = (SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 |
+			  SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_88200 |
+			  SNDRV_PCM_RATE_96000 | SNDRV_PCM_RATE_176400 |
+			  SNDRV_PCM_RATE_192000),
+		.formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_LE,
+	},
+};
+#endif
+
 /* HDMI HW IP initialisation */
 static int omapdss_hdmihw_probe(struct platform_device *pdev)
 {
@@ -727,6 +750,25 @@ static int omapdss_hdmihw_probe(struct platform_device *pdev)
 
 	hdmi_init_output(pdev);
 
+#if defined(CONFIG_OMAP4_DSS_HDMI_AUDIO)
+	/* drvdata is only used by HDMI audio */
+	hdmi.audio.hdmi_lock = &hdmi.lock;
+	hdmi.audio.wp = &hdmi.wp;
+	hdmi.audio.core = &hdmi.core;
+	hdmi.audio.cfg = &hdmi.cfg;
+	hdmi.audio.hdmi_dai_drv = &omap_hdmi_dai;
+	hdmi.audio.audio_start = hdmi4_audio_start;
+	hdmi.audio.audio_stop = hdmi4_audio_stop;
+	hdmi.audio.audio_config = hdmi4_audio_config;
+	dev_set_drvdata(&pdev->dev, &hdmi.audio);
+	r = hdmi_audio_register(pdev);
+	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;
@@ -734,6 +776,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(pdev);
+#endif
 	hdmi_uninit_output(pdev);
 
 	pm_runtime_disable(&pdev->dev);
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [PATCH 06/12] OMAPDSS: hdmi4: Register HDMI audio ASoC drivers from HDMI driver
@ 2014-06-26 19:20   ` Jyri Sarha
  0 siblings, 0 replies; 60+ messages in thread
From: Jyri Sarha @ 2014-06-26 19:20 UTC (permalink / raw)
  To: alsa-devel, linux-fbdev, linux-omap
  Cc: peter.ujfalusi, broonie, liam.r.girdwood, tomi.valkeinen,
	detheridge, jyri.sarha, Jyri Sarha

Add audio datamember to hdmi struct and call register and unregister
functions form hdmi_audio.c. Register function registers the
integrated cpu dai, dummy HDMI codec, and simple-card machine driver
for complete HDMI audio support.

Signed-off-by: Jyri Sarha <jsarha@ti.com>
---
 drivers/video/fbdev/omap2/dss/hdmi4.c |   45 +++++++++++++++++++++++++++++++++
 1 file changed, 45 insertions(+)

diff --git a/drivers/video/fbdev/omap2/dss/hdmi4.c b/drivers/video/fbdev/omap2/dss/hdmi4.c
index 342ddb4..48f11f8 100644
--- a/drivers/video/fbdev/omap2/dss/hdmi4.c
+++ b/drivers/video/fbdev/omap2/dss/hdmi4.c
@@ -34,6 +34,11 @@
 #include <linux/regulator/consumer.h>
 #include <video/omapdss.h>
 
+#if defined(CONFIG_OMAP4_DSS_HDMI_AUDIO)
+#include <sound/soc.h>
+#include <sound/soc-dai.h>
+#endif
+
 #include "hdmi4_core.h"
 #include "dss.h"
 #include "dss_features.h"
@@ -52,6 +57,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;
@@ -671,6 +679,21 @@ err:
 	return r;
 }
 
+#if defined(CONFIG_OMAP4_DSS_HDMI_AUDIO)
+static struct snd_soc_dai_driver omap_hdmi_dai = {
+	.name = "omap4-hdmi-dai",
+	.playback = {
+		.channels_min = 2,
+		.channels_max = 8,
+		.rates = (SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 |
+			  SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_88200 |
+			  SNDRV_PCM_RATE_96000 | SNDRV_PCM_RATE_176400 |
+			  SNDRV_PCM_RATE_192000),
+		.formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_LE,
+	},
+};
+#endif
+
 /* HDMI HW IP initialisation */
 static int omapdss_hdmihw_probe(struct platform_device *pdev)
 {
@@ -727,6 +750,25 @@ static int omapdss_hdmihw_probe(struct platform_device *pdev)
 
 	hdmi_init_output(pdev);
 
+#if defined(CONFIG_OMAP4_DSS_HDMI_AUDIO)
+	/* drvdata is only used by HDMI audio */
+	hdmi.audio.hdmi_lock = &hdmi.lock;
+	hdmi.audio.wp = &hdmi.wp;
+	hdmi.audio.core = &hdmi.core;
+	hdmi.audio.cfg = &hdmi.cfg;
+	hdmi.audio.hdmi_dai_drv = &omap_hdmi_dai;
+	hdmi.audio.audio_start = hdmi4_audio_start;
+	hdmi.audio.audio_stop = hdmi4_audio_stop;
+	hdmi.audio.audio_config = hdmi4_audio_config;
+	dev_set_drvdata(&pdev->dev, &hdmi.audio);
+	r = hdmi_audio_register(pdev);
+	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;
@@ -734,6 +776,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(pdev);
+#endif
 	hdmi_uninit_output(pdev);
 
 	pm_runtime_disable(&pdev->dev);
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [PATCH 07/12] OMAPDSS: Kconfig: Select audio dependencies if OMAP5_DSS_HDMI_AUDIO=y
  2014-06-26 19:20 ` Jyri Sarha
@ 2014-06-26 19:20   ` Jyri Sarha
  -1 siblings, 0 replies; 60+ messages in thread
From: Jyri Sarha @ 2014-06-26 19:20 UTC (permalink / raw)
  To: alsa-devel, linux-fbdev, linux-omap
  Cc: peter.ujfalusi, broonie, liam.r.girdwood, tomi.valkeinen,
	detheridge, jyri.sarha, Jyri Sarha

Adds help section and SND_SOC dependency to OMAP4_DSS_HDMI_AUDIO.
Selects SND_OMAP_SOC, SND_SOC_HDMI_CODEC, and SND_SIMPLE_CARD if
OMAP4_DSS_HDMI_AUDIO is enabled.

Signed-off-by: Jyri Sarha <jsarha@ti.com>
---
 drivers/video/fbdev/omap2/dss/Kconfig |   16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/drivers/video/fbdev/omap2/dss/Kconfig b/drivers/video/fbdev/omap2/dss/Kconfig
index 871f722..1cce26c 100644
--- a/drivers/video/fbdev/omap2/dss/Kconfig
+++ b/drivers/video/fbdev/omap2/dss/Kconfig
@@ -6,9 +6,9 @@ menuconfig OMAP2_DSS
 	select VIDEOMODE_HELPERS
 	select OMAP2_DSS_INIT
 	select HDMI
-	select SND_OMAP_SOC if OMAP4_DSS_HDMI_AUDIO
-	select SND_SOC_HDMI_CODEC if OMAP4_DSS_HDMI_AUDIO
-	select SND_SIMPLE_CARD if OMAP4_DSS_HDMI_AUDIO
+	select SND_OMAP_SOC if OMAP4_DSS_HDMI_AUDIO || OMAP5_DSS_HDMI_AUDIO
+	select SND_SOC_HDMI_CODEC if OMAP4_DSS_HDMI_AUDIO || OMAP5_DSS_HDMI_AUDIO
+	select SND_SIMPLE_CARD if OMAP4_DSS_HDMI_AUDIO || OMAP5_DSS_HDMI_AUDIO
         help
 	  OMAP2+ Display Subsystem support.
 
@@ -99,8 +99,16 @@ config OMAP5_DSS_HDMI
 	  specification.
 
 config OMAP5_DSS_HDMI_AUDIO
+	bool "HDMI audio support for OMAP5"
 	depends on OMAP5_DSS_HDMI
-	bool
+	depends on SND_SOC=y || OMAP2_DSS = SND_SOC
+	default y
+	help
+	  HDMI audio support for OMAP5 based SoCs. Adds integrated
+	  ASoC Digital Audio Interface component driver into OMAPDSS
+	  module. If enabled OMAP2_DSS selects SND_OMAP_SOC,
+	  SND_SOC_HDMI_CODEC, and SND_SIMPLE_CARD for full HDMI
+	  audio support.
 
 config OMAP2_DSS_SDI
 	bool "SDI support"
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [PATCH 07/12] OMAPDSS: Kconfig: Select audio dependencies if OMAP5_DSS_HDMI_AUDIO=y
@ 2014-06-26 19:20   ` Jyri Sarha
  0 siblings, 0 replies; 60+ messages in thread
From: Jyri Sarha @ 2014-06-26 19:20 UTC (permalink / raw)
  To: alsa-devel, linux-fbdev, linux-omap
  Cc: peter.ujfalusi, broonie, liam.r.girdwood, tomi.valkeinen,
	detheridge, jyri.sarha, Jyri Sarha

Adds help section and SND_SOC dependency to OMAP4_DSS_HDMI_AUDIO.
Selects SND_OMAP_SOC, SND_SOC_HDMI_CODEC, and SND_SIMPLE_CARD if
OMAP4_DSS_HDMI_AUDIO is enabled.

Signed-off-by: Jyri Sarha <jsarha@ti.com>
---
 drivers/video/fbdev/omap2/dss/Kconfig |   16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/drivers/video/fbdev/omap2/dss/Kconfig b/drivers/video/fbdev/omap2/dss/Kconfig
index 871f722..1cce26c 100644
--- a/drivers/video/fbdev/omap2/dss/Kconfig
+++ b/drivers/video/fbdev/omap2/dss/Kconfig
@@ -6,9 +6,9 @@ menuconfig OMAP2_DSS
 	select VIDEOMODE_HELPERS
 	select OMAP2_DSS_INIT
 	select HDMI
-	select SND_OMAP_SOC if OMAP4_DSS_HDMI_AUDIO
-	select SND_SOC_HDMI_CODEC if OMAP4_DSS_HDMI_AUDIO
-	select SND_SIMPLE_CARD if OMAP4_DSS_HDMI_AUDIO
+	select SND_OMAP_SOC if OMAP4_DSS_HDMI_AUDIO || OMAP5_DSS_HDMI_AUDIO
+	select SND_SOC_HDMI_CODEC if OMAP4_DSS_HDMI_AUDIO || OMAP5_DSS_HDMI_AUDIO
+	select SND_SIMPLE_CARD if OMAP4_DSS_HDMI_AUDIO || OMAP5_DSS_HDMI_AUDIO
         help
 	  OMAP2+ Display Subsystem support.
 
@@ -99,8 +99,16 @@ config OMAP5_DSS_HDMI
 	  specification.
 
 config OMAP5_DSS_HDMI_AUDIO
+	bool "HDMI audio support for OMAP5"
 	depends on OMAP5_DSS_HDMI
-	bool
+	depends on SND_SOC=y || OMAP2_DSS = SND_SOC
+	default y
+	help
+	  HDMI audio support for OMAP5 based SoCs. Adds integrated
+	  ASoC Digital Audio Interface component driver into OMAPDSS
+	  module. If enabled OMAP2_DSS selects SND_OMAP_SOC,
+	  SND_SOC_HDMI_CODEC, and SND_SIMPLE_CARD for full HDMI
+	  audio support.
 
 config OMAP2_DSS_SDI
 	bool "SDI support"
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [PATCH 08/12] OMAPDSS: hdmi5: Register HDMI audio ASoC drivers from HDMI driver
  2014-06-26 19:20 ` Jyri Sarha
@ 2014-06-26 19:20   ` Jyri Sarha
  -1 siblings, 0 replies; 60+ messages in thread
From: Jyri Sarha @ 2014-06-26 19:20 UTC (permalink / raw)
  To: alsa-devel, linux-fbdev, linux-omap
  Cc: peter.ujfalusi, broonie, liam.r.girdwood, tomi.valkeinen,
	detheridge, jyri.sarha, Jyri Sarha

Add audio datamember to hdmi struct and call register and unregister
functions form hdmi_audio.c. Register function registers the
integrated cpu dai, dummy HDMI codec, and simple-card machine driver
for complete HDMI audio support.

Signed-off-by: Jyri Sarha <jsarha@ti.com>
---
 drivers/video/fbdev/omap2/dss/hdmi5.c |   57 +++++++++++++++++++++++++++++++++
 1 file changed, 57 insertions(+)

diff --git a/drivers/video/fbdev/omap2/dss/hdmi5.c b/drivers/video/fbdev/omap2/dss/hdmi5.c
index 713e35a..b49b33b 100644
--- a/drivers/video/fbdev/omap2/dss/hdmi5.c
+++ b/drivers/video/fbdev/omap2/dss/hdmi5.c
@@ -43,6 +43,11 @@
 #include "dss.h"
 #include "dss_features.h"
 
+#if defined(CONFIG_OMAP5_DSS_HDMI_AUDIO)
+#include <sound/soc.h>
+#include <sound/soc-dai.h>
+#endif
+
 static struct {
 	struct mutex lock;
 	struct platform_device *pdev;
@@ -57,6 +62,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;
@@ -696,6 +704,33 @@ err:
 	return r;
 }
 
+#if defined(CONFIG_OMAP5_DSS_HDMI_AUDIO)
+static int audio_start(struct hdmi_core_data *core, struct hdmi_wp_data *wp)
+{
+	hdmi_wp_audio_core_req_enable(wp, true);
+
+	return 0;
+}
+
+static void audio_stop(struct hdmi_core_data *core, struct hdmi_wp_data *wp)
+{
+	hdmi_wp_audio_core_req_enable(wp, false);
+}
+
+static struct snd_soc_dai_driver omap_hdmi_dai = {
+	.name = "omap5-hdmi-dai",
+	.playback = {
+		.channels_min = 2,
+		.channels_max = 8,
+		.rates = (SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 |
+			  SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_88200 |
+			  SNDRV_PCM_RATE_96000 | SNDRV_PCM_RATE_176400 |
+			  SNDRV_PCM_RATE_192000),
+		.formats = SNDRV_PCM_FMTBIT_S16_LE,
+	},
+};
+#endif
+
 /* HDMI HW IP initialisation */
 static int omapdss_hdmihw_probe(struct platform_device *pdev)
 {
@@ -752,6 +787,25 @@ static int omapdss_hdmihw_probe(struct platform_device *pdev)
 
 	hdmi_init_output(pdev);
 
+#if defined(CONFIG_OMAP5_DSS_HDMI_AUDIO)
+	/* drvdata is only used by HDMI audio */
+	hdmi.audio.hdmi_lock = &hdmi.lock;
+	hdmi.audio.wp = &hdmi.wp;
+	hdmi.audio.core = &hdmi.core;
+	hdmi.audio.cfg = &hdmi.cfg;
+	hdmi.audio.hdmi_dai_drv = &omap_hdmi_dai;
+	hdmi.audio.audio_start = audio_start;
+	hdmi.audio.audio_stop = audio_stop;
+	hdmi.audio.audio_config = hdmi5_audio_config;
+	dev_set_drvdata(&pdev->dev, &hdmi.audio);
+	r = hdmi_audio_register(pdev);
+	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;
@@ -759,6 +813,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(pdev);
+#endif
 	hdmi_uninit_output(pdev);
 
 	pm_runtime_disable(&pdev->dev);
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [PATCH 08/12] OMAPDSS: hdmi5: Register HDMI audio ASoC drivers from HDMI driver
@ 2014-06-26 19:20   ` Jyri Sarha
  0 siblings, 0 replies; 60+ messages in thread
From: Jyri Sarha @ 2014-06-26 19:20 UTC (permalink / raw)
  To: alsa-devel, linux-fbdev, linux-omap
  Cc: peter.ujfalusi, broonie, liam.r.girdwood, tomi.valkeinen,
	detheridge, jyri.sarha, Jyri Sarha

Add audio datamember to hdmi struct and call register and unregister
functions form hdmi_audio.c. Register function registers the
integrated cpu dai, dummy HDMI codec, and simple-card machine driver
for complete HDMI audio support.

Signed-off-by: Jyri Sarha <jsarha@ti.com>
---
 drivers/video/fbdev/omap2/dss/hdmi5.c |   57 +++++++++++++++++++++++++++++++++
 1 file changed, 57 insertions(+)

diff --git a/drivers/video/fbdev/omap2/dss/hdmi5.c b/drivers/video/fbdev/omap2/dss/hdmi5.c
index 713e35a..b49b33b 100644
--- a/drivers/video/fbdev/omap2/dss/hdmi5.c
+++ b/drivers/video/fbdev/omap2/dss/hdmi5.c
@@ -43,6 +43,11 @@
 #include "dss.h"
 #include "dss_features.h"
 
+#if defined(CONFIG_OMAP5_DSS_HDMI_AUDIO)
+#include <sound/soc.h>
+#include <sound/soc-dai.h>
+#endif
+
 static struct {
 	struct mutex lock;
 	struct platform_device *pdev;
@@ -57,6 +62,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;
@@ -696,6 +704,33 @@ err:
 	return r;
 }
 
+#if defined(CONFIG_OMAP5_DSS_HDMI_AUDIO)
+static int audio_start(struct hdmi_core_data *core, struct hdmi_wp_data *wp)
+{
+	hdmi_wp_audio_core_req_enable(wp, true);
+
+	return 0;
+}
+
+static void audio_stop(struct hdmi_core_data *core, struct hdmi_wp_data *wp)
+{
+	hdmi_wp_audio_core_req_enable(wp, false);
+}
+
+static struct snd_soc_dai_driver omap_hdmi_dai = {
+	.name = "omap5-hdmi-dai",
+	.playback = {
+		.channels_min = 2,
+		.channels_max = 8,
+		.rates = (SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 |
+			  SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_88200 |
+			  SNDRV_PCM_RATE_96000 | SNDRV_PCM_RATE_176400 |
+			  SNDRV_PCM_RATE_192000),
+		.formats = SNDRV_PCM_FMTBIT_S16_LE,
+	},
+};
+#endif
+
 /* HDMI HW IP initialisation */
 static int omapdss_hdmihw_probe(struct platform_device *pdev)
 {
@@ -752,6 +787,25 @@ static int omapdss_hdmihw_probe(struct platform_device *pdev)
 
 	hdmi_init_output(pdev);
 
+#if defined(CONFIG_OMAP5_DSS_HDMI_AUDIO)
+	/* drvdata is only used by HDMI audio */
+	hdmi.audio.hdmi_lock = &hdmi.lock;
+	hdmi.audio.wp = &hdmi.wp;
+	hdmi.audio.core = &hdmi.core;
+	hdmi.audio.cfg = &hdmi.cfg;
+	hdmi.audio.hdmi_dai_drv = &omap_hdmi_dai;
+	hdmi.audio.audio_start = audio_start;
+	hdmi.audio.audio_stop = audio_stop;
+	hdmi.audio.audio_config = hdmi5_audio_config;
+	dev_set_drvdata(&pdev->dev, &hdmi.audio);
+	r = hdmi_audio_register(pdev);
+	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;
@@ -759,6 +813,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(pdev);
+#endif
 	hdmi_uninit_output(pdev);
 
 	pm_runtime_disable(&pdev->dev);
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [PATCH 09/12] ASoC: omap: Remove obsolete HDMI audio code and Kconfig options
  2014-06-26 19:20 ` Jyri Sarha
@ 2014-06-26 19:21   ` Jyri Sarha
  -1 siblings, 0 replies; 60+ messages in thread
From: Jyri Sarha @ 2014-06-26 19:21 UTC (permalink / raw)
  To: alsa-devel, linux-fbdev, linux-omap
  Cc: peter.ujfalusi, broonie, liam.r.girdwood, tomi.valkeinen,
	detheridge, jyri.sarha, Jyri Sarha

Removes omap-hdmi DAI driver, omap-hdmi-card driver, the related
Kconfig options, and Makefile entries. The HDMI DAI drivers has been
integrated directly to OMAP4+ HDMI drivers and simple-card driver is
used instead of omap-hdmi-card driver.

Signed-off-by: Jyri Sarha <jsarha@ti.com>
---
 sound/soc/omap/Kconfig          |   13 --
 sound/soc/omap/Makefile         |    4 -
 sound/soc/omap/omap-hdmi-card.c |   87 ----------
 sound/soc/omap/omap-hdmi.c      |  364 ---------------------------------------
 sound/soc/omap/omap-hdmi.h      |   38 ----
 5 files changed, 506 deletions(-)
 delete mode 100644 sound/soc/omap/omap-hdmi-card.c
 delete mode 100644 sound/soc/omap/omap-hdmi.c
 delete mode 100644 sound/soc/omap/omap-hdmi.h

diff --git a/sound/soc/omap/Kconfig b/sound/soc/omap/Kconfig
index d44463a..5c7b0aa 100644
--- a/sound/soc/omap/Kconfig
+++ b/sound/soc/omap/Kconfig
@@ -12,9 +12,6 @@ config SND_OMAP_SOC_MCBSP
 config SND_OMAP_SOC_MCPDM
 	tristate
 
-config SND_OMAP_SOC_HDMI
-	tristate
-
 config SND_OMAP_SOC_N810
 	tristate "SoC Audio support for Nokia N810"
 	depends on SND_OMAP_SOC && MACH_NOKIA_N810 && I2C
@@ -100,16 +97,6 @@ config SND_OMAP_SOC_OMAP_ABE_TWL6040
 	  - PandaBoard (4430)
 	  - PandaBoardES (4460)
 
-config SND_OMAP_SOC_OMAP_HDMI
-	tristate "SoC Audio support for Texas Instruments OMAP HDMI"
-	depends on SND_OMAP_SOC && OMAP4_DSS_HDMI && OMAP2_DSS
-	select SND_OMAP_SOC_HDMI
-	select SND_SOC_HDMI_CODEC
-	select OMAP4_DSS_HDMI_AUDIO
-	help
-	  Say Y if you want to add support for SoC HDMI audio on Texas Instruments
-	  OMAP4 chips
-
 config SND_OMAP_SOC_OMAP3_PANDORA
 	tristate "SoC Audio support for OMAP3 Pandora"
 	depends on TWL4030_CORE && SND_OMAP_SOC && MACH_OMAP3_PANDORA
diff --git a/sound/soc/omap/Makefile b/sound/soc/omap/Makefile
index a725905..5832fe1 100644
--- a/sound/soc/omap/Makefile
+++ b/sound/soc/omap/Makefile
@@ -3,13 +3,11 @@ snd-soc-omap-objs := omap-pcm.o
 snd-soc-omap-dmic-objs := omap-dmic.o
 snd-soc-omap-mcbsp-objs := omap-mcbsp.o mcbsp.o
 snd-soc-omap-mcpdm-objs := omap-mcpdm.o
-snd-soc-omap-hdmi-objs := omap-hdmi.o
 
 obj-$(CONFIG_SND_OMAP_SOC) += snd-soc-omap.o
 obj-$(CONFIG_SND_OMAP_SOC_DMIC) += snd-soc-omap-dmic.o
 obj-$(CONFIG_SND_OMAP_SOC_MCBSP) += snd-soc-omap-mcbsp.o
 obj-$(CONFIG_SND_OMAP_SOC_MCPDM) += snd-soc-omap-mcpdm.o
-obj-$(CONFIG_SND_OMAP_SOC_HDMI) += snd-soc-omap-hdmi.o
 
 # OMAP Machine Support
 snd-soc-n810-objs := n810.o
@@ -20,7 +18,6 @@ snd-soc-am3517evm-objs := am3517evm.o
 snd-soc-omap-abe-twl6040-objs := omap-abe-twl6040.o
 snd-soc-omap-twl4030-objs := omap-twl4030.o
 snd-soc-omap3pandora-objs := omap3pandora.o
-snd-soc-omap-hdmi-card-objs := omap-hdmi-card.o
 
 obj-$(CONFIG_SND_OMAP_SOC_N810) += snd-soc-n810.o
 obj-$(CONFIG_SND_OMAP_SOC_RX51) += snd-soc-rx51.o
@@ -30,4 +27,3 @@ obj-$(CONFIG_SND_OMAP_SOC_AM3517EVM) += snd-soc-am3517evm.o
 obj-$(CONFIG_SND_OMAP_SOC_OMAP_ABE_TWL6040) += snd-soc-omap-abe-twl6040.o
 obj-$(CONFIG_SND_OMAP_SOC_OMAP_TWL4030) += snd-soc-omap-twl4030.o
 obj-$(CONFIG_SND_OMAP_SOC_OMAP3_PANDORA) += snd-soc-omap3pandora.o
-obj-$(CONFIG_SND_OMAP_SOC_OMAP_HDMI) += snd-soc-omap-hdmi-card.o
diff --git a/sound/soc/omap/omap-hdmi-card.c b/sound/soc/omap/omap-hdmi-card.c
deleted file mode 100644
index f649fe8..0000000
--- a/sound/soc/omap/omap-hdmi-card.c
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * omap-hdmi-card.c
- *
- * OMAP ALSA SoC machine driver for TI OMAP HDMI
- * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
- * Author: Ricardo Neri <ricardo.neri@ti.com>
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#include <linux/module.h>
-#include <sound/pcm.h>
-#include <sound/soc.h>
-#include <asm/mach-types.h>
-#include <video/omapdss.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",
-};
-
-static struct snd_soc_card snd_soc_omap_hdmi = {
-	.name = "OMAPHDMI",
-	.owner = THIS_MODULE,
-	.dai_link = &omap_hdmi_dai,
-	.num_links = 1,
-};
-
-static int omap_hdmi_probe(struct platform_device *pdev)
-{
-	struct snd_soc_card *card = &snd_soc_omap_hdmi;
-	int ret;
-
-	card->dev = &pdev->dev;
-
-	ret = snd_soc_register_card(card);
-	if (ret) {
-		dev_err(&pdev->dev, "snd_soc_register_card failed (%d)\n", ret);
-		card->dev = NULL;
-		return ret;
-	}
-	return 0;
-}
-
-static int omap_hdmi_remove(struct platform_device *pdev)
-{
-	struct snd_soc_card *card = platform_get_drvdata(pdev);
-
-	snd_soc_unregister_card(card);
-	card->dev = NULL;
-	return 0;
-}
-
-static struct platform_driver omap_hdmi_driver = {
-	.driver = {
-		.name = DRV_NAME,
-		.owner = THIS_MODULE,
-	},
-	.probe = omap_hdmi_probe,
-	.remove = omap_hdmi_remove,
-};
-
-module_platform_driver(omap_hdmi_driver);
-
-MODULE_AUTHOR("Ricardo Neri <ricardo.neri@ti.com>");
-MODULE_DESCRIPTION("OMAP HDMI machine ASoC driver");
-MODULE_LICENSE("GPL");
-MODULE_ALIAS("platform:" DRV_NAME);
diff --git a/sound/soc/omap/omap-hdmi.c b/sound/soc/omap/omap-hdmi.c
deleted file mode 100644
index eb9c392..0000000
--- a/sound/soc/omap/omap-hdmi.c
+++ /dev/null
@@ -1,364 +0,0 @@
-/*
- * omap-hdmi.c
- *
- * OMAP ALSA SoC DAI driver for HDMI audio on OMAP4 processors.
- * Copyright (C) 2010-2011 Texas Instruments Incorporated - http://www.ti.com/
- * Authors: Jorge Candelaria <jorge.candelaria@ti.com>
- *          Ricardo Neri <ricardo.neri@ti.com>
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#include <linux/init.h>
-#include <linux/module.h>
-#include <linux/device.h>
-#include <sound/core.h>
-#include <sound/pcm.h>
-#include <sound/pcm_params.h>
-#include <sound/initval.h>
-#include <sound/soc.h>
-#include <sound/asound.h>
-#include <sound/asoundef.h>
-#include <sound/dmaengine_pcm.h>
-#include <video/omapdss.h>
-#include <sound/omap-pcm.h>
-
-#include "omap-hdmi.h"
-
-#define DRV_NAME "omap-hdmi-audio-dai"
-
-struct hdmi_priv {
-	struct snd_dmaengine_dai_dma_data dma_data;
-	unsigned int dma_req;
-	struct omap_dss_audio dss_audio;
-	struct snd_aes_iec958 iec;
-	struct snd_cea_861_aud_if cea;
-	struct omap_dss_device *dssdev;
-};
-
-static int omap_hdmi_dai_startup(struct snd_pcm_substream *substream,
-				  struct snd_soc_dai *dai)
-{
-	struct hdmi_priv *priv = snd_soc_dai_get_drvdata(dai);
-	int err;
-	/*
-	 * Make sure that the period bytes are multiple of the DMA packet size.
-	 * Largest packet size we use is 32 32-bit words = 128 bytes
-	 */
-	err = snd_pcm_hw_constraint_step(substream->runtime, 0,
-				 SNDRV_PCM_HW_PARAM_PERIOD_BYTES, 128);
-	if (err < 0) {
-		dev_err(dai->dev, "could not apply constraint\n");
-		return err;
-	}
-
-	if (!priv->dssdev->driver->audio_supported(priv->dssdev)) {
-		dev_err(dai->dev, "audio not supported\n");
-		return -ENODEV;
-	}
-
-	snd_soc_dai_set_dma_data(dai, substream, &priv->dma_data);
-
-	return 0;
-}
-
-static int omap_hdmi_dai_prepare(struct snd_pcm_substream *substream,
-				struct snd_soc_dai *dai)
-{
-	struct hdmi_priv *priv = snd_soc_dai_get_drvdata(dai);
-
-	return priv->dssdev->driver->audio_enable(priv->dssdev);
-}
-
-static int omap_hdmi_dai_hw_params(struct snd_pcm_substream *substream,
-				    struct snd_pcm_hw_params *params,
-				    struct snd_soc_dai *dai)
-{
-	struct hdmi_priv *priv = snd_soc_dai_get_drvdata(dai);
-	struct snd_aes_iec958 *iec = &priv->iec;
-	struct snd_cea_861_aud_if *cea = &priv->cea;
-	int err = 0;
-
-	switch (params_format(params)) {
-	case SNDRV_PCM_FORMAT_S16_LE:
-		priv->dma_data.maxburst = 16;
-		break;
-	case SNDRV_PCM_FORMAT_S24_LE:
-		priv->dma_data.maxburst = 32;
-		break;
-	default:
-		dev_err(dai->dev, "format not supported!\n");
-		return -EINVAL;
-	}
-
-	/*
-	 * fill the IEC-60958 channel status word
-	 */
-	/* initialize the word bytes */
-	memset(iec->status, 0, sizeof(iec->status));
-
-	/* specify IEC-60958-3 (commercial use) */
-	iec->status[0] &= ~IEC958_AES0_PROFESSIONAL;
-
-	/* specify that the audio is LPCM*/
-	iec->status[0] &= ~IEC958_AES0_NONAUDIO;
-
-	iec->status[0] |= IEC958_AES0_CON_NOT_COPYRIGHT;
-
-	iec->status[0] |= IEC958_AES0_CON_EMPHASIS_NONE;
-
-	iec->status[0] |= IEC958_AES1_PRO_MODE_NOTID;
-
-	iec->status[1] = IEC958_AES1_CON_GENERAL;
-
-	iec->status[2] |= IEC958_AES2_CON_SOURCE_UNSPEC;
-
-	iec->status[2] |= IEC958_AES2_CON_CHANNEL_UNSPEC;
-
-	switch (params_rate(params)) {
-	case 32000:
-		iec->status[3] |= IEC958_AES3_CON_FS_32000;
-		break;
-	case 44100:
-		iec->status[3] |= IEC958_AES3_CON_FS_44100;
-		break;
-	case 48000:
-		iec->status[3] |= IEC958_AES3_CON_FS_48000;
-		break;
-	case 88200:
-		iec->status[3] |= IEC958_AES3_CON_FS_88200;
-		break;
-	case 96000:
-		iec->status[3] |= IEC958_AES3_CON_FS_96000;
-		break;
-	case 176400:
-		iec->status[3] |= IEC958_AES3_CON_FS_176400;
-		break;
-	case 192000:
-		iec->status[3] |= IEC958_AES3_CON_FS_192000;
-		break;
-	default:
-		dev_err(dai->dev, "rate not supported!\n");
-		return -EINVAL;
-	}
-
-	/* specify the clock accuracy */
-	iec->status[3] |= IEC958_AES3_CON_CLOCK_1000PPM;
-
-	/*
-	 * specify the word length. The same word length value can mean
-	 * two different lengths. Hence, we need to specify the maximum
-	 * word length as well.
-	 */
-	switch (params_format(params)) {
-	case SNDRV_PCM_FORMAT_S16_LE:
-		iec->status[4] |= IEC958_AES4_CON_WORDLEN_20_16;
-		iec->status[4] &= ~IEC958_AES4_CON_MAX_WORDLEN_24;
-		break;
-	case SNDRV_PCM_FORMAT_S24_LE:
-		iec->status[4] |= IEC958_AES4_CON_WORDLEN_24_20;
-		iec->status[4] |= IEC958_AES4_CON_MAX_WORDLEN_24;
-		break;
-	default:
-		dev_err(dai->dev, "format not supported!\n");
-		return -EINVAL;
-	}
-
-	/*
-	 * Fill the CEA-861 audio infoframe (see spec for details)
-	 */
-
-	cea->db1_ct_cc = (params_channels(params) - 1)
-		& CEA861_AUDIO_INFOFRAME_DB1CC;
-	cea->db1_ct_cc |= CEA861_AUDIO_INFOFRAME_DB1CT_FROM_STREAM;
-
-	cea->db2_sf_ss = CEA861_AUDIO_INFOFRAME_DB2SF_FROM_STREAM;
-	cea->db2_sf_ss |= CEA861_AUDIO_INFOFRAME_DB2SS_FROM_STREAM;
-
-	cea->db3 = 0; /* not used, all zeros */
-
-	/*
-	 * The OMAP HDMI IP requires to use the 8-channel channel code when
-	 * transmitting more than two channels.
-	 */
-	if (params_channels(params) = 2)
-		cea->db4_ca = 0x0;
-	else
-		cea->db4_ca = 0x13;
-
-	cea->db5_dminh_lsv = CEA861_AUDIO_INFOFRAME_DB5_DM_INH_PROHIBITED;
-	/* the expression is trivial but makes clear what we are doing */
-	cea->db5_dminh_lsv |= (0 & CEA861_AUDIO_INFOFRAME_DB5_LSV);
-
-	priv->dss_audio.iec = iec;
-	priv->dss_audio.cea = cea;
-
-	err = priv->dssdev->driver->audio_config(priv->dssdev,
-						 &priv->dss_audio);
-
-	return err;
-}
-
-static int omap_hdmi_dai_trigger(struct snd_pcm_substream *substream, int cmd,
-				struct snd_soc_dai *dai)
-{
-	struct hdmi_priv *priv = snd_soc_dai_get_drvdata(dai);
-	int err = 0;
-
-	switch (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);
-		break;
-	case SNDRV_PCM_TRIGGER_STOP:
-	case SNDRV_PCM_TRIGGER_SUSPEND:
-	case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
-		priv->dssdev->driver->audio_stop(priv->dssdev);
-		break;
-	default:
-		err = -EINVAL;
-	}
-	return err;
-}
-
-static void omap_hdmi_dai_shutdown(struct snd_pcm_substream *substream,
-				struct snd_soc_dai *dai)
-{
-	struct hdmi_priv *priv = snd_soc_dai_get_drvdata(dai);
-
-	priv->dssdev->driver->audio_disable(priv->dssdev);
-}
-
-static const struct snd_soc_dai_ops omap_hdmi_dai_ops = {
-	.startup	= omap_hdmi_dai_startup,
-	.hw_params	= omap_hdmi_dai_hw_params,
-	.prepare	= omap_hdmi_dai_prepare,
-	.trigger	= omap_hdmi_dai_trigger,
-	.shutdown	= omap_hdmi_dai_shutdown,
-};
-
-static struct snd_soc_dai_driver omap_hdmi_dai = {
-	.playback = {
-		.channels_min = 2,
-		.channels_max = 8,
-		.rates = OMAP_HDMI_RATES,
-		.formats = OMAP_HDMI_FORMATS,
-	},
-	.ops = &omap_hdmi_dai_ops,
-};
-
-static const struct snd_soc_component_driver omap_hdmi_component = {
-	.name		= DRV_NAME,
-};
-
-static int omap_hdmi_probe(struct platform_device *pdev)
-{
-	int ret;
-	struct resource *hdmi_rsrc;
-	struct hdmi_priv *hdmi_data;
-	bool hdmi_dev_found = false;
-
-	hdmi_data = devm_kzalloc(&pdev->dev, sizeof(*hdmi_data), GFP_KERNEL);
-	if (hdmi_data = NULL) {
-		dev_err(&pdev->dev, "Cannot allocate memory for HDMI data\n");
-		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.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;
-	}
-
-	dev_set_drvdata(&pdev->dev, hdmi_data);
-	ret = snd_soc_register_component(&pdev->dev, &omap_hdmi_component,
-					 &omap_hdmi_dai, 1);
-
-	if (ret)
-		return ret;
-
-	return omap_pcm_platform_register(&pdev->dev);
-}
-
-static int omap_hdmi_remove(struct platform_device *pdev)
-{
-	struct hdmi_priv *hdmi_data = dev_get_drvdata(&pdev->dev);
-
-	snd_soc_unregister_component(&pdev->dev);
-
-	if (hdmi_data = NULL) {
-		dev_err(&pdev->dev, "cannot obtain HDMi data\n");
-		return -ENODEV;
-	}
-
-	omap_dss_put_device(hdmi_data->dssdev);
-	return 0;
-}
-
-static struct platform_driver hdmi_dai_driver = {
-	.driver = {
-		.name = DRV_NAME,
-		.owner = THIS_MODULE,
-	},
-	.probe = omap_hdmi_probe,
-	.remove = omap_hdmi_remove,
-};
-
-module_platform_driver(hdmi_dai_driver);
-
-MODULE_AUTHOR("Jorge Candelaria <jorge.candelaria@ti.com>");
-MODULE_AUTHOR("Ricardo Neri <ricardo.neri@ti.com>");
-MODULE_DESCRIPTION("OMAP HDMI SoC Interface");
-MODULE_LICENSE("GPL");
-MODULE_ALIAS("platform:" DRV_NAME);
diff --git a/sound/soc/omap/omap-hdmi.h b/sound/soc/omap/omap-hdmi.h
deleted file mode 100644
index 6ad2bf4..0000000
--- a/sound/soc/omap/omap-hdmi.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * omap-hdmi.h
- *
- * Definitions for OMAP ALSA SoC DAI driver for HDMI audio on OMAP4 processors.
- * Copyright (C) 2010-2011 Texas Instruments Incorporated - http://www.ti.com/
- * Authors: Jorge Candelaria <jorge.candelaria@ti.com>
- *          Ricardo Neri <ricardo.neri@ti.com>
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#ifndef __OMAP_HDMI_H__
-#define __OMAP_HDMI_H__
-
-#define OMAP_HDMI_AUDIO_DMA_PORT 0x8c
-
-#define OMAP_HDMI_RATES	(SNDRV_PCM_RATE_32000 | \
-				SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000 | \
-				SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000 | \
-				SNDRV_PCM_RATE_176400 | SNDRV_PCM_RATE_192000)
-
-#define OMAP_HDMI_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | \
-				SNDRV_PCM_FMTBIT_S24_LE)
-
-#endif
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [PATCH 09/12] ASoC: omap: Remove obsolete HDMI audio code and Kconfig options
@ 2014-06-26 19:21   ` Jyri Sarha
  0 siblings, 0 replies; 60+ messages in thread
From: Jyri Sarha @ 2014-06-26 19:21 UTC (permalink / raw)
  To: alsa-devel, linux-fbdev, linux-omap
  Cc: peter.ujfalusi, broonie, liam.r.girdwood, tomi.valkeinen,
	detheridge, jyri.sarha, Jyri Sarha

Removes omap-hdmi DAI driver, omap-hdmi-card driver, the related
Kconfig options, and Makefile entries. The HDMI DAI drivers has been
integrated directly to OMAP4+ HDMI drivers and simple-card driver is
used instead of omap-hdmi-card driver.

Signed-off-by: Jyri Sarha <jsarha@ti.com>
---
 sound/soc/omap/Kconfig          |   13 --
 sound/soc/omap/Makefile         |    4 -
 sound/soc/omap/omap-hdmi-card.c |   87 ----------
 sound/soc/omap/omap-hdmi.c      |  364 ---------------------------------------
 sound/soc/omap/omap-hdmi.h      |   38 ----
 5 files changed, 506 deletions(-)
 delete mode 100644 sound/soc/omap/omap-hdmi-card.c
 delete mode 100644 sound/soc/omap/omap-hdmi.c
 delete mode 100644 sound/soc/omap/omap-hdmi.h

diff --git a/sound/soc/omap/Kconfig b/sound/soc/omap/Kconfig
index d44463a..5c7b0aa 100644
--- a/sound/soc/omap/Kconfig
+++ b/sound/soc/omap/Kconfig
@@ -12,9 +12,6 @@ config SND_OMAP_SOC_MCBSP
 config SND_OMAP_SOC_MCPDM
 	tristate
 
-config SND_OMAP_SOC_HDMI
-	tristate
-
 config SND_OMAP_SOC_N810
 	tristate "SoC Audio support for Nokia N810"
 	depends on SND_OMAP_SOC && MACH_NOKIA_N810 && I2C
@@ -100,16 +97,6 @@ config SND_OMAP_SOC_OMAP_ABE_TWL6040
 	  - PandaBoard (4430)
 	  - PandaBoardES (4460)
 
-config SND_OMAP_SOC_OMAP_HDMI
-	tristate "SoC Audio support for Texas Instruments OMAP HDMI"
-	depends on SND_OMAP_SOC && OMAP4_DSS_HDMI && OMAP2_DSS
-	select SND_OMAP_SOC_HDMI
-	select SND_SOC_HDMI_CODEC
-	select OMAP4_DSS_HDMI_AUDIO
-	help
-	  Say Y if you want to add support for SoC HDMI audio on Texas Instruments
-	  OMAP4 chips
-
 config SND_OMAP_SOC_OMAP3_PANDORA
 	tristate "SoC Audio support for OMAP3 Pandora"
 	depends on TWL4030_CORE && SND_OMAP_SOC && MACH_OMAP3_PANDORA
diff --git a/sound/soc/omap/Makefile b/sound/soc/omap/Makefile
index a725905..5832fe1 100644
--- a/sound/soc/omap/Makefile
+++ b/sound/soc/omap/Makefile
@@ -3,13 +3,11 @@ snd-soc-omap-objs := omap-pcm.o
 snd-soc-omap-dmic-objs := omap-dmic.o
 snd-soc-omap-mcbsp-objs := omap-mcbsp.o mcbsp.o
 snd-soc-omap-mcpdm-objs := omap-mcpdm.o
-snd-soc-omap-hdmi-objs := omap-hdmi.o
 
 obj-$(CONFIG_SND_OMAP_SOC) += snd-soc-omap.o
 obj-$(CONFIG_SND_OMAP_SOC_DMIC) += snd-soc-omap-dmic.o
 obj-$(CONFIG_SND_OMAP_SOC_MCBSP) += snd-soc-omap-mcbsp.o
 obj-$(CONFIG_SND_OMAP_SOC_MCPDM) += snd-soc-omap-mcpdm.o
-obj-$(CONFIG_SND_OMAP_SOC_HDMI) += snd-soc-omap-hdmi.o
 
 # OMAP Machine Support
 snd-soc-n810-objs := n810.o
@@ -20,7 +18,6 @@ snd-soc-am3517evm-objs := am3517evm.o
 snd-soc-omap-abe-twl6040-objs := omap-abe-twl6040.o
 snd-soc-omap-twl4030-objs := omap-twl4030.o
 snd-soc-omap3pandora-objs := omap3pandora.o
-snd-soc-omap-hdmi-card-objs := omap-hdmi-card.o
 
 obj-$(CONFIG_SND_OMAP_SOC_N810) += snd-soc-n810.o
 obj-$(CONFIG_SND_OMAP_SOC_RX51) += snd-soc-rx51.o
@@ -30,4 +27,3 @@ obj-$(CONFIG_SND_OMAP_SOC_AM3517EVM) += snd-soc-am3517evm.o
 obj-$(CONFIG_SND_OMAP_SOC_OMAP_ABE_TWL6040) += snd-soc-omap-abe-twl6040.o
 obj-$(CONFIG_SND_OMAP_SOC_OMAP_TWL4030) += snd-soc-omap-twl4030.o
 obj-$(CONFIG_SND_OMAP_SOC_OMAP3_PANDORA) += snd-soc-omap3pandora.o
-obj-$(CONFIG_SND_OMAP_SOC_OMAP_HDMI) += snd-soc-omap-hdmi-card.o
diff --git a/sound/soc/omap/omap-hdmi-card.c b/sound/soc/omap/omap-hdmi-card.c
deleted file mode 100644
index f649fe8..0000000
--- a/sound/soc/omap/omap-hdmi-card.c
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * omap-hdmi-card.c
- *
- * OMAP ALSA SoC machine driver for TI OMAP HDMI
- * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
- * Author: Ricardo Neri <ricardo.neri@ti.com>
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#include <linux/module.h>
-#include <sound/pcm.h>
-#include <sound/soc.h>
-#include <asm/mach-types.h>
-#include <video/omapdss.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",
-};
-
-static struct snd_soc_card snd_soc_omap_hdmi = {
-	.name = "OMAPHDMI",
-	.owner = THIS_MODULE,
-	.dai_link = &omap_hdmi_dai,
-	.num_links = 1,
-};
-
-static int omap_hdmi_probe(struct platform_device *pdev)
-{
-	struct snd_soc_card *card = &snd_soc_omap_hdmi;
-	int ret;
-
-	card->dev = &pdev->dev;
-
-	ret = snd_soc_register_card(card);
-	if (ret) {
-		dev_err(&pdev->dev, "snd_soc_register_card failed (%d)\n", ret);
-		card->dev = NULL;
-		return ret;
-	}
-	return 0;
-}
-
-static int omap_hdmi_remove(struct platform_device *pdev)
-{
-	struct snd_soc_card *card = platform_get_drvdata(pdev);
-
-	snd_soc_unregister_card(card);
-	card->dev = NULL;
-	return 0;
-}
-
-static struct platform_driver omap_hdmi_driver = {
-	.driver = {
-		.name = DRV_NAME,
-		.owner = THIS_MODULE,
-	},
-	.probe = omap_hdmi_probe,
-	.remove = omap_hdmi_remove,
-};
-
-module_platform_driver(omap_hdmi_driver);
-
-MODULE_AUTHOR("Ricardo Neri <ricardo.neri@ti.com>");
-MODULE_DESCRIPTION("OMAP HDMI machine ASoC driver");
-MODULE_LICENSE("GPL");
-MODULE_ALIAS("platform:" DRV_NAME);
diff --git a/sound/soc/omap/omap-hdmi.c b/sound/soc/omap/omap-hdmi.c
deleted file mode 100644
index eb9c392..0000000
--- a/sound/soc/omap/omap-hdmi.c
+++ /dev/null
@@ -1,364 +0,0 @@
-/*
- * omap-hdmi.c
- *
- * OMAP ALSA SoC DAI driver for HDMI audio on OMAP4 processors.
- * Copyright (C) 2010-2011 Texas Instruments Incorporated - http://www.ti.com/
- * Authors: Jorge Candelaria <jorge.candelaria@ti.com>
- *          Ricardo Neri <ricardo.neri@ti.com>
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#include <linux/init.h>
-#include <linux/module.h>
-#include <linux/device.h>
-#include <sound/core.h>
-#include <sound/pcm.h>
-#include <sound/pcm_params.h>
-#include <sound/initval.h>
-#include <sound/soc.h>
-#include <sound/asound.h>
-#include <sound/asoundef.h>
-#include <sound/dmaengine_pcm.h>
-#include <video/omapdss.h>
-#include <sound/omap-pcm.h>
-
-#include "omap-hdmi.h"
-
-#define DRV_NAME "omap-hdmi-audio-dai"
-
-struct hdmi_priv {
-	struct snd_dmaengine_dai_dma_data dma_data;
-	unsigned int dma_req;
-	struct omap_dss_audio dss_audio;
-	struct snd_aes_iec958 iec;
-	struct snd_cea_861_aud_if cea;
-	struct omap_dss_device *dssdev;
-};
-
-static int omap_hdmi_dai_startup(struct snd_pcm_substream *substream,
-				  struct snd_soc_dai *dai)
-{
-	struct hdmi_priv *priv = snd_soc_dai_get_drvdata(dai);
-	int err;
-	/*
-	 * Make sure that the period bytes are multiple of the DMA packet size.
-	 * Largest packet size we use is 32 32-bit words = 128 bytes
-	 */
-	err = snd_pcm_hw_constraint_step(substream->runtime, 0,
-				 SNDRV_PCM_HW_PARAM_PERIOD_BYTES, 128);
-	if (err < 0) {
-		dev_err(dai->dev, "could not apply constraint\n");
-		return err;
-	}
-
-	if (!priv->dssdev->driver->audio_supported(priv->dssdev)) {
-		dev_err(dai->dev, "audio not supported\n");
-		return -ENODEV;
-	}
-
-	snd_soc_dai_set_dma_data(dai, substream, &priv->dma_data);
-
-	return 0;
-}
-
-static int omap_hdmi_dai_prepare(struct snd_pcm_substream *substream,
-				struct snd_soc_dai *dai)
-{
-	struct hdmi_priv *priv = snd_soc_dai_get_drvdata(dai);
-
-	return priv->dssdev->driver->audio_enable(priv->dssdev);
-}
-
-static int omap_hdmi_dai_hw_params(struct snd_pcm_substream *substream,
-				    struct snd_pcm_hw_params *params,
-				    struct snd_soc_dai *dai)
-{
-	struct hdmi_priv *priv = snd_soc_dai_get_drvdata(dai);
-	struct snd_aes_iec958 *iec = &priv->iec;
-	struct snd_cea_861_aud_if *cea = &priv->cea;
-	int err = 0;
-
-	switch (params_format(params)) {
-	case SNDRV_PCM_FORMAT_S16_LE:
-		priv->dma_data.maxburst = 16;
-		break;
-	case SNDRV_PCM_FORMAT_S24_LE:
-		priv->dma_data.maxburst = 32;
-		break;
-	default:
-		dev_err(dai->dev, "format not supported!\n");
-		return -EINVAL;
-	}
-
-	/*
-	 * fill the IEC-60958 channel status word
-	 */
-	/* initialize the word bytes */
-	memset(iec->status, 0, sizeof(iec->status));
-
-	/* specify IEC-60958-3 (commercial use) */
-	iec->status[0] &= ~IEC958_AES0_PROFESSIONAL;
-
-	/* specify that the audio is LPCM*/
-	iec->status[0] &= ~IEC958_AES0_NONAUDIO;
-
-	iec->status[0] |= IEC958_AES0_CON_NOT_COPYRIGHT;
-
-	iec->status[0] |= IEC958_AES0_CON_EMPHASIS_NONE;
-
-	iec->status[0] |= IEC958_AES1_PRO_MODE_NOTID;
-
-	iec->status[1] = IEC958_AES1_CON_GENERAL;
-
-	iec->status[2] |= IEC958_AES2_CON_SOURCE_UNSPEC;
-
-	iec->status[2] |= IEC958_AES2_CON_CHANNEL_UNSPEC;
-
-	switch (params_rate(params)) {
-	case 32000:
-		iec->status[3] |= IEC958_AES3_CON_FS_32000;
-		break;
-	case 44100:
-		iec->status[3] |= IEC958_AES3_CON_FS_44100;
-		break;
-	case 48000:
-		iec->status[3] |= IEC958_AES3_CON_FS_48000;
-		break;
-	case 88200:
-		iec->status[3] |= IEC958_AES3_CON_FS_88200;
-		break;
-	case 96000:
-		iec->status[3] |= IEC958_AES3_CON_FS_96000;
-		break;
-	case 176400:
-		iec->status[3] |= IEC958_AES3_CON_FS_176400;
-		break;
-	case 192000:
-		iec->status[3] |= IEC958_AES3_CON_FS_192000;
-		break;
-	default:
-		dev_err(dai->dev, "rate not supported!\n");
-		return -EINVAL;
-	}
-
-	/* specify the clock accuracy */
-	iec->status[3] |= IEC958_AES3_CON_CLOCK_1000PPM;
-
-	/*
-	 * specify the word length. The same word length value can mean
-	 * two different lengths. Hence, we need to specify the maximum
-	 * word length as well.
-	 */
-	switch (params_format(params)) {
-	case SNDRV_PCM_FORMAT_S16_LE:
-		iec->status[4] |= IEC958_AES4_CON_WORDLEN_20_16;
-		iec->status[4] &= ~IEC958_AES4_CON_MAX_WORDLEN_24;
-		break;
-	case SNDRV_PCM_FORMAT_S24_LE:
-		iec->status[4] |= IEC958_AES4_CON_WORDLEN_24_20;
-		iec->status[4] |= IEC958_AES4_CON_MAX_WORDLEN_24;
-		break;
-	default:
-		dev_err(dai->dev, "format not supported!\n");
-		return -EINVAL;
-	}
-
-	/*
-	 * Fill the CEA-861 audio infoframe (see spec for details)
-	 */
-
-	cea->db1_ct_cc = (params_channels(params) - 1)
-		& CEA861_AUDIO_INFOFRAME_DB1CC;
-	cea->db1_ct_cc |= CEA861_AUDIO_INFOFRAME_DB1CT_FROM_STREAM;
-
-	cea->db2_sf_ss = CEA861_AUDIO_INFOFRAME_DB2SF_FROM_STREAM;
-	cea->db2_sf_ss |= CEA861_AUDIO_INFOFRAME_DB2SS_FROM_STREAM;
-
-	cea->db3 = 0; /* not used, all zeros */
-
-	/*
-	 * The OMAP HDMI IP requires to use the 8-channel channel code when
-	 * transmitting more than two channels.
-	 */
-	if (params_channels(params) == 2)
-		cea->db4_ca = 0x0;
-	else
-		cea->db4_ca = 0x13;
-
-	cea->db5_dminh_lsv = CEA861_AUDIO_INFOFRAME_DB5_DM_INH_PROHIBITED;
-	/* the expression is trivial but makes clear what we are doing */
-	cea->db5_dminh_lsv |= (0 & CEA861_AUDIO_INFOFRAME_DB5_LSV);
-
-	priv->dss_audio.iec = iec;
-	priv->dss_audio.cea = cea;
-
-	err = priv->dssdev->driver->audio_config(priv->dssdev,
-						 &priv->dss_audio);
-
-	return err;
-}
-
-static int omap_hdmi_dai_trigger(struct snd_pcm_substream *substream, int cmd,
-				struct snd_soc_dai *dai)
-{
-	struct hdmi_priv *priv = snd_soc_dai_get_drvdata(dai);
-	int err = 0;
-
-	switch (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);
-		break;
-	case SNDRV_PCM_TRIGGER_STOP:
-	case SNDRV_PCM_TRIGGER_SUSPEND:
-	case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
-		priv->dssdev->driver->audio_stop(priv->dssdev);
-		break;
-	default:
-		err = -EINVAL;
-	}
-	return err;
-}
-
-static void omap_hdmi_dai_shutdown(struct snd_pcm_substream *substream,
-				struct snd_soc_dai *dai)
-{
-	struct hdmi_priv *priv = snd_soc_dai_get_drvdata(dai);
-
-	priv->dssdev->driver->audio_disable(priv->dssdev);
-}
-
-static const struct snd_soc_dai_ops omap_hdmi_dai_ops = {
-	.startup	= omap_hdmi_dai_startup,
-	.hw_params	= omap_hdmi_dai_hw_params,
-	.prepare	= omap_hdmi_dai_prepare,
-	.trigger	= omap_hdmi_dai_trigger,
-	.shutdown	= omap_hdmi_dai_shutdown,
-};
-
-static struct snd_soc_dai_driver omap_hdmi_dai = {
-	.playback = {
-		.channels_min = 2,
-		.channels_max = 8,
-		.rates = OMAP_HDMI_RATES,
-		.formats = OMAP_HDMI_FORMATS,
-	},
-	.ops = &omap_hdmi_dai_ops,
-};
-
-static const struct snd_soc_component_driver omap_hdmi_component = {
-	.name		= DRV_NAME,
-};
-
-static int omap_hdmi_probe(struct platform_device *pdev)
-{
-	int ret;
-	struct resource *hdmi_rsrc;
-	struct hdmi_priv *hdmi_data;
-	bool hdmi_dev_found = false;
-
-	hdmi_data = devm_kzalloc(&pdev->dev, sizeof(*hdmi_data), GFP_KERNEL);
-	if (hdmi_data == NULL) {
-		dev_err(&pdev->dev, "Cannot allocate memory for HDMI data\n");
-		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.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;
-	}
-
-	dev_set_drvdata(&pdev->dev, hdmi_data);
-	ret = snd_soc_register_component(&pdev->dev, &omap_hdmi_component,
-					 &omap_hdmi_dai, 1);
-
-	if (ret)
-		return ret;
-
-	return omap_pcm_platform_register(&pdev->dev);
-}
-
-static int omap_hdmi_remove(struct platform_device *pdev)
-{
-	struct hdmi_priv *hdmi_data = dev_get_drvdata(&pdev->dev);
-
-	snd_soc_unregister_component(&pdev->dev);
-
-	if (hdmi_data == NULL) {
-		dev_err(&pdev->dev, "cannot obtain HDMi data\n");
-		return -ENODEV;
-	}
-
-	omap_dss_put_device(hdmi_data->dssdev);
-	return 0;
-}
-
-static struct platform_driver hdmi_dai_driver = {
-	.driver = {
-		.name = DRV_NAME,
-		.owner = THIS_MODULE,
-	},
-	.probe = omap_hdmi_probe,
-	.remove = omap_hdmi_remove,
-};
-
-module_platform_driver(hdmi_dai_driver);
-
-MODULE_AUTHOR("Jorge Candelaria <jorge.candelaria@ti.com>");
-MODULE_AUTHOR("Ricardo Neri <ricardo.neri@ti.com>");
-MODULE_DESCRIPTION("OMAP HDMI SoC Interface");
-MODULE_LICENSE("GPL");
-MODULE_ALIAS("platform:" DRV_NAME);
diff --git a/sound/soc/omap/omap-hdmi.h b/sound/soc/omap/omap-hdmi.h
deleted file mode 100644
index 6ad2bf4..0000000
--- a/sound/soc/omap/omap-hdmi.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * omap-hdmi.h
- *
- * Definitions for OMAP ALSA SoC DAI driver for HDMI audio on OMAP4 processors.
- * Copyright (C) 2010-2011 Texas Instruments Incorporated - http://www.ti.com/
- * Authors: Jorge Candelaria <jorge.candelaria@ti.com>
- *          Ricardo Neri <ricardo.neri@ti.com>
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#ifndef __OMAP_HDMI_H__
-#define __OMAP_HDMI_H__
-
-#define OMAP_HDMI_AUDIO_DMA_PORT 0x8c
-
-#define OMAP_HDMI_RATES	(SNDRV_PCM_RATE_32000 | \
-				SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000 | \
-				SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000 | \
-				SNDRV_PCM_RATE_176400 | SNDRV_PCM_RATE_192000)
-
-#define OMAP_HDMI_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | \
-				SNDRV_PCM_FMTBIT_S24_LE)
-
-#endif
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [PATCH 10/12] OMAPDSS: hdmi4: Remove callbacks for an external ASoC DAI driver
  2014-06-26 19:20 ` Jyri Sarha
@ 2014-06-26 19:21   ` Jyri Sarha
  -1 siblings, 0 replies; 60+ messages in thread
From: Jyri Sarha @ 2014-06-26 19:21 UTC (permalink / raw)
  To: alsa-devel, linux-fbdev, linux-omap
  Cc: peter.ujfalusi, broonie, liam.r.girdwood, tomi.valkeinen,
	detheridge, jyri.sarha, Jyri Sarha

Removes the OMAP4 HDMI audio callbacks for an external audio driver and
the old external DAI driver does not work anymore after this patch.

Signed-off-by: Jyri Sarha <jsarha@ti.com>
---
 drivers/video/fbdev/omap2/dss/hdmi4.c |  113 ---------------------------------
 1 file changed, 113 deletions(-)

diff --git a/drivers/video/fbdev/omap2/dss/hdmi4.c b/drivers/video/fbdev/omap2/dss/hdmi4.c
index 48f11f8..c56c8bc 100644
--- a/drivers/video/fbdev/omap2/dss/hdmi4.c
+++ b/drivers/video/fbdev/omap2/dss/hdmi4.c
@@ -492,112 +492,6 @@ static int hdmi_read_edid(struct omap_dss_device *dssdev,
 	return r;
 }
 
-#if defined(CONFIG_OMAP4_DSS_HDMI_AUDIO)
-static int hdmi_audio_enable(struct omap_dss_device *dssdev)
-{
-	int r;
-
-	mutex_lock(&hdmi.lock);
-
-	if (!hdmi_mode_has_audio(hdmi.cfg.cm.mode)) {
-		r = -EPERM;
-		goto err;
-	}
-
-	r = hdmi_wp_audio_enable(&hdmi.wp, true);
-	if (r)
-		goto err;
-
-	mutex_unlock(&hdmi.lock);
-	return 0;
-
-err:
-	mutex_unlock(&hdmi.lock);
-	return r;
-}
-
-static void hdmi_audio_disable(struct omap_dss_device *dssdev)
-{
-	hdmi_wp_audio_enable(&hdmi.wp, false);
-}
-
-static int hdmi_audio_start(struct omap_dss_device *dssdev)
-{
-	return hdmi4_audio_start(&hdmi.core, &hdmi.wp);
-}
-
-static void hdmi_audio_stop(struct omap_dss_device *dssdev)
-{
-	hdmi4_audio_stop(&hdmi.core, &hdmi.wp);
-}
-
-static bool hdmi_audio_supported(struct omap_dss_device *dssdev)
-{
-	bool r;
-
-	mutex_lock(&hdmi.lock);
-
-	r = hdmi_mode_has_audio(hdmi.cfg.cm.mode);
-
-	mutex_unlock(&hdmi.lock);
-	return r;
-}
-
-static int hdmi_audio_config(struct omap_dss_device *dssdev,
-		struct omap_dss_audio *audio)
-{
-	int r;
-	u32 pclk = hdmi.cfg.timings.pixelclock;
-
-	mutex_lock(&hdmi.lock);
-
-	if (!hdmi_mode_has_audio(hdmi.cfg.cm.mode)) {
-		r = -EPERM;
-		goto err;
-	}
-
-	r = hdmi4_audio_config(&hdmi.core, &hdmi.wp, audio, pclk);
-	if (r)
-		goto err;
-
-	mutex_unlock(&hdmi.lock);
-	return 0;
-
-err:
-	mutex_unlock(&hdmi.lock);
-	return r;
-}
-#else
-static int hdmi_audio_enable(struct omap_dss_device *dssdev)
-{
-	return -EPERM;
-}
-
-static void hdmi_audio_disable(struct omap_dss_device *dssdev)
-{
-}
-
-static int hdmi_audio_start(struct omap_dss_device *dssdev)
-{
-	return -EPERM;
-}
-
-static void hdmi_audio_stop(struct omap_dss_device *dssdev)
-{
-}
-
-static bool hdmi_audio_supported(struct omap_dss_device *dssdev)
-{
-	return false;
-}
-
-static int hdmi_audio_config(struct omap_dss_device *dssdev,
-		struct omap_dss_audio *audio)
-{
-	return -EPERM;
-}
-#endif
-
 static int hdmi_set_infoframe(struct omap_dss_device *dssdev,
 		const struct hdmi_avi_infoframe *avi)
 {
@@ -626,13 +520,6 @@ static const struct omapdss_hdmi_ops hdmi_ops = {
 	.read_edid		= hdmi_read_edid,
 	.set_infoframe		= hdmi_set_infoframe,
 	.set_hdmi_mode		= hdmi_set_hdmi_mode,
-
-	.audio_enable		= hdmi_audio_enable,
-	.audio_disable		= hdmi_audio_disable,
-	.audio_start		= hdmi_audio_start,
-	.audio_stop		= hdmi_audio_stop,
-	.audio_supported	= hdmi_audio_supported,
-	.audio_config		= hdmi_audio_config,
 };
 
 static void hdmi_init_output(struct platform_device *pdev)
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [PATCH 10/12] OMAPDSS: hdmi4: Remove callbacks for an external ASoC DAI driver
@ 2014-06-26 19:21   ` Jyri Sarha
  0 siblings, 0 replies; 60+ messages in thread
From: Jyri Sarha @ 2014-06-26 19:21 UTC (permalink / raw)
  To: alsa-devel, linux-fbdev, linux-omap
  Cc: peter.ujfalusi, broonie, liam.r.girdwood, tomi.valkeinen,
	detheridge, jyri.sarha, Jyri Sarha

Removes the OMAP4 HDMI audio callbacks for an external audio driver and
the old external DAI driver does not work anymore after this patch.

Signed-off-by: Jyri Sarha <jsarha@ti.com>
---
 drivers/video/fbdev/omap2/dss/hdmi4.c |  113 ---------------------------------
 1 file changed, 113 deletions(-)

diff --git a/drivers/video/fbdev/omap2/dss/hdmi4.c b/drivers/video/fbdev/omap2/dss/hdmi4.c
index 48f11f8..c56c8bc 100644
--- a/drivers/video/fbdev/omap2/dss/hdmi4.c
+++ b/drivers/video/fbdev/omap2/dss/hdmi4.c
@@ -492,112 +492,6 @@ static int hdmi_read_edid(struct omap_dss_device *dssdev,
 	return r;
 }
 
-#if defined(CONFIG_OMAP4_DSS_HDMI_AUDIO)
-static int hdmi_audio_enable(struct omap_dss_device *dssdev)
-{
-	int r;
-
-	mutex_lock(&hdmi.lock);
-
-	if (!hdmi_mode_has_audio(hdmi.cfg.cm.mode)) {
-		r = -EPERM;
-		goto err;
-	}
-
-	r = hdmi_wp_audio_enable(&hdmi.wp, true);
-	if (r)
-		goto err;
-
-	mutex_unlock(&hdmi.lock);
-	return 0;
-
-err:
-	mutex_unlock(&hdmi.lock);
-	return r;
-}
-
-static void hdmi_audio_disable(struct omap_dss_device *dssdev)
-{
-	hdmi_wp_audio_enable(&hdmi.wp, false);
-}
-
-static int hdmi_audio_start(struct omap_dss_device *dssdev)
-{
-	return hdmi4_audio_start(&hdmi.core, &hdmi.wp);
-}
-
-static void hdmi_audio_stop(struct omap_dss_device *dssdev)
-{
-	hdmi4_audio_stop(&hdmi.core, &hdmi.wp);
-}
-
-static bool hdmi_audio_supported(struct omap_dss_device *dssdev)
-{
-	bool r;
-
-	mutex_lock(&hdmi.lock);
-
-	r = hdmi_mode_has_audio(hdmi.cfg.cm.mode);
-
-	mutex_unlock(&hdmi.lock);
-	return r;
-}
-
-static int hdmi_audio_config(struct omap_dss_device *dssdev,
-		struct omap_dss_audio *audio)
-{
-	int r;
-	u32 pclk = hdmi.cfg.timings.pixelclock;
-
-	mutex_lock(&hdmi.lock);
-
-	if (!hdmi_mode_has_audio(hdmi.cfg.cm.mode)) {
-		r = -EPERM;
-		goto err;
-	}
-
-	r = hdmi4_audio_config(&hdmi.core, &hdmi.wp, audio, pclk);
-	if (r)
-		goto err;
-
-	mutex_unlock(&hdmi.lock);
-	return 0;
-
-err:
-	mutex_unlock(&hdmi.lock);
-	return r;
-}
-#else
-static int hdmi_audio_enable(struct omap_dss_device *dssdev)
-{
-	return -EPERM;
-}
-
-static void hdmi_audio_disable(struct omap_dss_device *dssdev)
-{
-}
-
-static int hdmi_audio_start(struct omap_dss_device *dssdev)
-{
-	return -EPERM;
-}
-
-static void hdmi_audio_stop(struct omap_dss_device *dssdev)
-{
-}
-
-static bool hdmi_audio_supported(struct omap_dss_device *dssdev)
-{
-	return false;
-}
-
-static int hdmi_audio_config(struct omap_dss_device *dssdev,
-		struct omap_dss_audio *audio)
-{
-	return -EPERM;
-}
-#endif
-
 static int hdmi_set_infoframe(struct omap_dss_device *dssdev,
 		const struct hdmi_avi_infoframe *avi)
 {
@@ -626,13 +520,6 @@ static const struct omapdss_hdmi_ops hdmi_ops = {
 	.read_edid		= hdmi_read_edid,
 	.set_infoframe		= hdmi_set_infoframe,
 	.set_hdmi_mode		= hdmi_set_hdmi_mode,
-
-	.audio_enable		= hdmi_audio_enable,
-	.audio_disable		= hdmi_audio_disable,
-	.audio_start		= hdmi_audio_start,
-	.audio_stop		= hdmi_audio_stop,
-	.audio_supported	= hdmi_audio_supported,
-	.audio_config		= hdmi_audio_config,
 };
 
 static void hdmi_init_output(struct platform_device *pdev)
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [PATCH 11/12] OMAPDSS: hdmi5: Remove callbacks for an external ASoC DAI driver
  2014-06-26 19:20 ` Jyri Sarha
@ 2014-06-26 19:21   ` Jyri Sarha
  -1 siblings, 0 replies; 60+ messages in thread
From: Jyri Sarha @ 2014-06-26 19:21 UTC (permalink / raw)
  To: alsa-devel, linux-fbdev, linux-omap
  Cc: peter.ujfalusi, broonie, liam.r.girdwood, tomi.valkeinen,
	detheridge, jyri.sarha, Jyri Sarha

Removes the OMAP5 HDMI audio callbacks for an external audio driver and
the old external DAI driver does not work anymore after this patch.

Signed-off-by: Jyri Sarha <jsarha@ti.com>
---
 drivers/video/fbdev/omap2/dss/hdmi5.c |  113 ---------------------------------
 1 file changed, 113 deletions(-)

diff --git a/drivers/video/fbdev/omap2/dss/hdmi5.c b/drivers/video/fbdev/omap2/dss/hdmi5.c
index b49b33b..ab801cf 100644
--- a/drivers/video/fbdev/omap2/dss/hdmi5.c
+++ b/drivers/video/fbdev/omap2/dss/hdmi5.c
@@ -517,112 +517,6 @@ static int hdmi_read_edid(struct omap_dss_device *dssdev,
 	return r;
 }
 
-#if defined(CONFIG_OMAP5_DSS_HDMI_AUDIO)
-static int hdmi_audio_enable(struct omap_dss_device *dssdev)
-{
-	int r;
-
-	mutex_lock(&hdmi.lock);
-
-	if (!hdmi_mode_has_audio(hdmi.cfg.cm.mode)) {
-		r = -EPERM;
-		goto err;
-	}
-
-	r = hdmi_wp_audio_enable(&hdmi.wp, true);
-	if (r)
-		goto err;
-
-	mutex_unlock(&hdmi.lock);
-	return 0;
-
-err:
-	mutex_unlock(&hdmi.lock);
-	return r;
-}
-
-static void hdmi_audio_disable(struct omap_dss_device *dssdev)
-{
-	hdmi_wp_audio_enable(&hdmi.wp, false);
-}
-
-static int hdmi_audio_start(struct omap_dss_device *dssdev)
-{
-	return hdmi_wp_audio_core_req_enable(&hdmi.wp, true);
-}
-
-static void hdmi_audio_stop(struct omap_dss_device *dssdev)
-{
-	hdmi_wp_audio_core_req_enable(&hdmi.wp, false);
-}
-
-static bool hdmi_audio_supported(struct omap_dss_device *dssdev)
-{
-	bool r;
-
-	mutex_lock(&hdmi.lock);
-
-	r = hdmi_mode_has_audio(hdmi.cfg.cm.mode);
-
-	mutex_unlock(&hdmi.lock);
-	return r;
-}
-
-static int hdmi_audio_config(struct omap_dss_device *dssdev,
-		struct omap_dss_audio *audio)
-{
-	int r;
-	u32 pclk = hdmi.cfg.timings.pixelclock;
-
-	mutex_lock(&hdmi.lock);
-
-	if (!hdmi_mode_has_audio(hdmi.cfg.cm.mode)) {
-		r = -EPERM;
-		goto err;
-	}
-
-	r = hdmi5_audio_config(&hdmi.core, &hdmi.wp, audio, pclk);
-	if (r)
-		goto err;
-
-	mutex_unlock(&hdmi.lock);
-	return 0;
-
-err:
-	mutex_unlock(&hdmi.lock);
-	return r;
-}
-#else
-static int hdmi_audio_enable(struct omap_dss_device *dssdev)
-{
-	return -EPERM;
-}
-
-static void hdmi_audio_disable(struct omap_dss_device *dssdev)
-{
-}
-
-static int hdmi_audio_start(struct omap_dss_device *dssdev)
-{
-	return -EPERM;
-}
-
-static void hdmi_audio_stop(struct omap_dss_device *dssdev)
-{
-}
-
-static bool hdmi_audio_supported(struct omap_dss_device *dssdev)
-{
-	return false;
-}
-
-static int hdmi_audio_config(struct omap_dss_device *dssdev,
-		struct omap_dss_audio *audio)
-{
-	return -EPERM;
-}
-#endif
-
 static int hdmi_set_infoframe(struct omap_dss_device *dssdev,
 		const struct hdmi_avi_infoframe *avi)
 {
@@ -651,13 +545,6 @@ static const struct omapdss_hdmi_ops hdmi_ops = {
 	.read_edid		= hdmi_read_edid,
 	.set_infoframe		= hdmi_set_infoframe,
 	.set_hdmi_mode		= hdmi_set_hdmi_mode,
-
-	.audio_enable		= hdmi_audio_enable,
-	.audio_disable		= hdmi_audio_disable,
-	.audio_start		= hdmi_audio_start,
-	.audio_stop		= hdmi_audio_stop,
-	.audio_supported	= hdmi_audio_supported,
-	.audio_config		= hdmi_audio_config,
 };
 
 static void hdmi_init_output(struct platform_device *pdev)
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [PATCH 11/12] OMAPDSS: hdmi5: Remove callbacks for an external ASoC DAI driver
@ 2014-06-26 19:21   ` Jyri Sarha
  0 siblings, 0 replies; 60+ messages in thread
From: Jyri Sarha @ 2014-06-26 19:21 UTC (permalink / raw)
  To: alsa-devel, linux-fbdev, linux-omap
  Cc: peter.ujfalusi, broonie, liam.r.girdwood, tomi.valkeinen,
	detheridge, jyri.sarha, Jyri Sarha

Removes the OMAP5 HDMI audio callbacks for an external audio driver and
the old external DAI driver does not work anymore after this patch.

Signed-off-by: Jyri Sarha <jsarha@ti.com>
---
 drivers/video/fbdev/omap2/dss/hdmi5.c |  113 ---------------------------------
 1 file changed, 113 deletions(-)

diff --git a/drivers/video/fbdev/omap2/dss/hdmi5.c b/drivers/video/fbdev/omap2/dss/hdmi5.c
index b49b33b..ab801cf 100644
--- a/drivers/video/fbdev/omap2/dss/hdmi5.c
+++ b/drivers/video/fbdev/omap2/dss/hdmi5.c
@@ -517,112 +517,6 @@ static int hdmi_read_edid(struct omap_dss_device *dssdev,
 	return r;
 }
 
-#if defined(CONFIG_OMAP5_DSS_HDMI_AUDIO)
-static int hdmi_audio_enable(struct omap_dss_device *dssdev)
-{
-	int r;
-
-	mutex_lock(&hdmi.lock);
-
-	if (!hdmi_mode_has_audio(hdmi.cfg.cm.mode)) {
-		r = -EPERM;
-		goto err;
-	}
-
-	r = hdmi_wp_audio_enable(&hdmi.wp, true);
-	if (r)
-		goto err;
-
-	mutex_unlock(&hdmi.lock);
-	return 0;
-
-err:
-	mutex_unlock(&hdmi.lock);
-	return r;
-}
-
-static void hdmi_audio_disable(struct omap_dss_device *dssdev)
-{
-	hdmi_wp_audio_enable(&hdmi.wp, false);
-}
-
-static int hdmi_audio_start(struct omap_dss_device *dssdev)
-{
-	return hdmi_wp_audio_core_req_enable(&hdmi.wp, true);
-}
-
-static void hdmi_audio_stop(struct omap_dss_device *dssdev)
-{
-	hdmi_wp_audio_core_req_enable(&hdmi.wp, false);
-}
-
-static bool hdmi_audio_supported(struct omap_dss_device *dssdev)
-{
-	bool r;
-
-	mutex_lock(&hdmi.lock);
-
-	r = hdmi_mode_has_audio(hdmi.cfg.cm.mode);
-
-	mutex_unlock(&hdmi.lock);
-	return r;
-}
-
-static int hdmi_audio_config(struct omap_dss_device *dssdev,
-		struct omap_dss_audio *audio)
-{
-	int r;
-	u32 pclk = hdmi.cfg.timings.pixelclock;
-
-	mutex_lock(&hdmi.lock);
-
-	if (!hdmi_mode_has_audio(hdmi.cfg.cm.mode)) {
-		r = -EPERM;
-		goto err;
-	}
-
-	r = hdmi5_audio_config(&hdmi.core, &hdmi.wp, audio, pclk);
-	if (r)
-		goto err;
-
-	mutex_unlock(&hdmi.lock);
-	return 0;
-
-err:
-	mutex_unlock(&hdmi.lock);
-	return r;
-}
-#else
-static int hdmi_audio_enable(struct omap_dss_device *dssdev)
-{
-	return -EPERM;
-}
-
-static void hdmi_audio_disable(struct omap_dss_device *dssdev)
-{
-}
-
-static int hdmi_audio_start(struct omap_dss_device *dssdev)
-{
-	return -EPERM;
-}
-
-static void hdmi_audio_stop(struct omap_dss_device *dssdev)
-{
-}
-
-static bool hdmi_audio_supported(struct omap_dss_device *dssdev)
-{
-	return false;
-}
-
-static int hdmi_audio_config(struct omap_dss_device *dssdev,
-		struct omap_dss_audio *audio)
-{
-	return -EPERM;
-}
-#endif
-
 static int hdmi_set_infoframe(struct omap_dss_device *dssdev,
 		const struct hdmi_avi_infoframe *avi)
 {
@@ -651,13 +545,6 @@ static const struct omapdss_hdmi_ops hdmi_ops = {
 	.read_edid		= hdmi_read_edid,
 	.set_infoframe		= hdmi_set_infoframe,
 	.set_hdmi_mode		= hdmi_set_hdmi_mode,
-
-	.audio_enable		= hdmi_audio_enable,
-	.audio_disable		= hdmi_audio_disable,
-	.audio_start		= hdmi_audio_start,
-	.audio_stop		= hdmi_audio_stop,
-	.audio_supported	= hdmi_audio_supported,
-	.audio_config		= hdmi_audio_config,
 };
 
 static void hdmi_init_output(struct platform_device *pdev)
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [PATCH 12/12] OMAPDSS: Remove all references to obsolete HDMI audio callbacks
  2014-06-26 19:20 ` Jyri Sarha
@ 2014-06-26 19:21   ` Jyri Sarha
  -1 siblings, 0 replies; 60+ messages in thread
From: Jyri Sarha @ 2014-06-26 19:21 UTC (permalink / raw)
  To: alsa-devel, linux-fbdev, linux-omap
  Cc: peter.ujfalusi, broonie, liam.r.girdwood, tomi.valkeinen,
	detheridge, jyri.sarha, Jyri Sarha

In new model these callbacks are obsolete since the ASoC component
drivers are integrated into the HDMI drivers and no callbacks are
needed anymore.

Signed-off-by: Jyri Sarha <jsarha@ti.com>
---
 .../fbdev/omap2/displays-new/connector-hdmi.c      |   99 --------------------
 .../fbdev/omap2/displays-new/encoder-tpd12s015.c   |   56 -----------
 include/video/omapdss.h                            |   31 ------
 3 files changed, 186 deletions(-)

diff --git a/drivers/video/fbdev/omap2/displays-new/connector-hdmi.c b/drivers/video/fbdev/omap2/displays-new/connector-hdmi.c
index 131c6e2..dd36d71 100644
--- a/drivers/video/fbdev/omap2/displays-new/connector-hdmi.c
+++ b/drivers/video/fbdev/omap2/displays-new/connector-hdmi.c
@@ -170,98 +170,6 @@ static bool hdmic_detect(struct omap_dss_device *dssdev)
 		return in->ops.hdmi->detect(in);
 }
 
-static int hdmic_audio_enable(struct omap_dss_device *dssdev)
-{
-	struct panel_drv_data *ddata = to_panel_data(dssdev);
-	struct omap_dss_device *in = ddata->in;
-	int r;
-
-	/* enable audio only if the display is active */
-	if (!omapdss_device_is_enabled(dssdev))
-		return -EPERM;
-
-	r = in->ops.hdmi->audio_enable(in);
-	if (r)
-		return r;
-
-	dssdev->audio_state = OMAP_DSS_AUDIO_ENABLED;
-
-	return 0;
-}
-
-static void hdmic_audio_disable(struct omap_dss_device *dssdev)
-{
-	struct panel_drv_data *ddata = to_panel_data(dssdev);
-	struct omap_dss_device *in = ddata->in;
-
-	in->ops.hdmi->audio_disable(in);
-
-	dssdev->audio_state = OMAP_DSS_AUDIO_DISABLED;
-}
-
-static int hdmic_audio_start(struct omap_dss_device *dssdev)
-{
-	struct panel_drv_data *ddata = to_panel_data(dssdev);
-	struct omap_dss_device *in = ddata->in;
-	int r;
-
-	/*
-	 * No need to check the panel state. It was checked when trasitioning
-	 * to AUDIO_ENABLED.
-	 */
-	if (dssdev->audio_state != OMAP_DSS_AUDIO_ENABLED)
-		return -EPERM;
-
-	r = in->ops.hdmi->audio_start(in);
-	if (r)
-		return r;
-
-	dssdev->audio_state = OMAP_DSS_AUDIO_PLAYING;
-
-	return 0;
-}
-
-static void hdmic_audio_stop(struct omap_dss_device *dssdev)
-{
-	struct panel_drv_data *ddata = to_panel_data(dssdev);
-	struct omap_dss_device *in = ddata->in;
-
-	in->ops.hdmi->audio_stop(in);
-
-	dssdev->audio_state = OMAP_DSS_AUDIO_ENABLED;
-}
-
-static bool hdmic_audio_supported(struct omap_dss_device *dssdev)
-{
-	struct panel_drv_data *ddata = to_panel_data(dssdev);
-	struct omap_dss_device *in = ddata->in;
-
-	if (!omapdss_device_is_enabled(dssdev))
-		return false;
-
-	return in->ops.hdmi->audio_supported(in);
-}
-
-static int hdmic_audio_config(struct omap_dss_device *dssdev,
-		struct omap_dss_audio *audio)
-{
-	struct panel_drv_data *ddata = to_panel_data(dssdev);
-	struct omap_dss_device *in = ddata->in;
-	int r;
-
-	/* config audio only if the display is active */
-	if (!omapdss_device_is_enabled(dssdev))
-		return -EPERM;
-
-	r = in->ops.hdmi->audio_config(in, audio);
-	if (r)
-		return r;
-
-	dssdev->audio_state = OMAP_DSS_AUDIO_CONFIGURED;
-
-	return 0;
-}
-
 static int hdmic_set_hdmi_mode(struct omap_dss_device *dssdev, bool hdmi_mode)
 {
 	struct panel_drv_data *ddata = to_panel_data(dssdev);
@@ -296,13 +204,6 @@ static struct omap_dss_driver hdmic_driver = {
 	.detect			= hdmic_detect,
 	.set_hdmi_mode		= hdmic_set_hdmi_mode,
 	.set_hdmi_infoframe	= hdmic_set_infoframe,
-
-	.audio_enable		= hdmic_audio_enable,
-	.audio_disable		= hdmic_audio_disable,
-	.audio_start		= hdmic_audio_start,
-	.audio_stop		= hdmic_audio_stop,
-	.audio_supported	= hdmic_audio_supported,
-	.audio_config		= hdmic_audio_config,
 };
 
 static int hdmic_probe_pdata(struct platform_device *pdev)
diff --git a/drivers/video/fbdev/omap2/displays-new/encoder-tpd12s015.c b/drivers/video/fbdev/omap2/displays-new/encoder-tpd12s015.c
index c891d8f..235e3d5 100644
--- a/drivers/video/fbdev/omap2/displays-new/encoder-tpd12s015.c
+++ b/drivers/video/fbdev/omap2/displays-new/encoder-tpd12s015.c
@@ -193,55 +193,6 @@ static bool tpd_detect(struct omap_dss_device *dssdev)
 	return gpio_get_value_cansleep(ddata->hpd_gpio);
 }
 
-static int tpd_audio_enable(struct omap_dss_device *dssdev)
-{
-	struct panel_drv_data *ddata = to_panel_data(dssdev);
-	struct omap_dss_device *in = ddata->in;
-
-	return in->ops.hdmi->audio_enable(in);
-}
-
-static void tpd_audio_disable(struct omap_dss_device *dssdev)
-{
-	struct panel_drv_data *ddata = to_panel_data(dssdev);
-	struct omap_dss_device *in = ddata->in;
-
-	in->ops.hdmi->audio_disable(in);
-}
-
-static int tpd_audio_start(struct omap_dss_device *dssdev)
-{
-	struct panel_drv_data *ddata = to_panel_data(dssdev);
-	struct omap_dss_device *in = ddata->in;
-
-	return in->ops.hdmi->audio_start(in);
-}
-
-static void tpd_audio_stop(struct omap_dss_device *dssdev)
-{
-	struct panel_drv_data *ddata = to_panel_data(dssdev);
-	struct omap_dss_device *in = ddata->in;
-
-	in->ops.hdmi->audio_stop(in);
-}
-
-static bool tpd_audio_supported(struct omap_dss_device *dssdev)
-{
-	struct panel_drv_data *ddata = to_panel_data(dssdev);
-	struct omap_dss_device *in = ddata->in;
-
-	return in->ops.hdmi->audio_supported(in);
-}
-
-static int tpd_audio_config(struct omap_dss_device *dssdev,
-		struct omap_dss_audio *audio)
-{
-	struct panel_drv_data *ddata = to_panel_data(dssdev);
-	struct omap_dss_device *in = ddata->in;
-
-	return in->ops.hdmi->audio_config(in, audio);
-}
-
 static int tpd_set_infoframe(struct omap_dss_device *dssdev,
 		const struct hdmi_avi_infoframe *avi)
 {
@@ -275,13 +226,6 @@ static const struct omapdss_hdmi_ops tpd_hdmi_ops = {
 	.detect			= tpd_detect,
 	.set_infoframe		= tpd_set_infoframe,
 	.set_hdmi_mode		= tpd_set_hdmi_mode,
-
-	.audio_enable		= tpd_audio_enable,
-	.audio_disable		= tpd_audio_disable,
-	.audio_start		= tpd_audio_start,
-	.audio_stop		= tpd_audio_stop,
-	.audio_supported	= tpd_audio_supported,
-	.audio_config		= tpd_audio_config,
 };
 
 static int tpd_probe_pdata(struct platform_device *pdev)
diff --git a/include/video/omapdss.h b/include/video/omapdss.h
index 069dfca..9035325 100644
--- a/include/video/omapdss.h
+++ b/include/video/omapdss.h
@@ -635,19 +635,6 @@ struct omapdss_hdmi_ops {
 	int (*set_hdmi_mode)(struct omap_dss_device *dssdev, bool hdmi_mode);
 	int (*set_infoframe)(struct omap_dss_device *dssdev,
 		const struct hdmi_avi_infoframe *avi);
-
-	/*
-	 * Note: These functions might sleep. Do not call while
-	 * holding a spinlock/readlock.
-	 */
-	int (*audio_enable)(struct omap_dss_device *dssdev);
-	void (*audio_disable)(struct omap_dss_device *dssdev);
-	bool (*audio_supported)(struct omap_dss_device *dssdev);
-	int (*audio_config)(struct omap_dss_device *dssdev,
-		struct omap_dss_audio *audio);
-	/* Note: These functions may not sleep */
-	int (*audio_start)(struct omap_dss_device *dssdev);
-	void (*audio_stop)(struct omap_dss_device *dssdev);
 };
 
 struct omapdss_dsi_ops {
@@ -858,24 +845,6 @@ struct omap_dss_driver {
 	int (*set_hdmi_mode)(struct omap_dss_device *dssdev, bool hdmi_mode);
 	int (*set_hdmi_infoframe)(struct omap_dss_device *dssdev,
 		const struct hdmi_avi_infoframe *avi);
-
-	/*
-	 * For display drivers that support audio. This encompasses
-	 * HDMI and DisplayPort at the moment.
-	 */
-	/*
-	 * Note: These functions might sleep. Do not call while
-	 * holding a spinlock/readlock.
-	 */
-	int (*audio_enable)(struct omap_dss_device *dssdev);
-	void (*audio_disable)(struct omap_dss_device *dssdev);
-	bool (*audio_supported)(struct omap_dss_device *dssdev);
-	int (*audio_config)(struct omap_dss_device *dssdev,
-		struct omap_dss_audio *audio);
-	/* Note: These functions may not sleep */
-	int (*audio_start)(struct omap_dss_device *dssdev);
-	void (*audio_stop)(struct omap_dss_device *dssdev);
-
 };
 
 enum omapdss_version omapdss_get_version(void);
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [PATCH 12/12] OMAPDSS: Remove all references to obsolete HDMI audio callbacks
@ 2014-06-26 19:21   ` Jyri Sarha
  0 siblings, 0 replies; 60+ messages in thread
From: Jyri Sarha @ 2014-06-26 19:21 UTC (permalink / raw)
  To: alsa-devel, linux-fbdev, linux-omap
  Cc: peter.ujfalusi, broonie, liam.r.girdwood, tomi.valkeinen,
	detheridge, jyri.sarha, Jyri Sarha

In new model these callbacks are obsolete since the ASoC component
drivers are integrated into the HDMI drivers and no callbacks are
needed anymore.

Signed-off-by: Jyri Sarha <jsarha@ti.com>
---
 .../fbdev/omap2/displays-new/connector-hdmi.c      |   99 --------------------
 .../fbdev/omap2/displays-new/encoder-tpd12s015.c   |   56 -----------
 include/video/omapdss.h                            |   31 ------
 3 files changed, 186 deletions(-)

diff --git a/drivers/video/fbdev/omap2/displays-new/connector-hdmi.c b/drivers/video/fbdev/omap2/displays-new/connector-hdmi.c
index 131c6e2..dd36d71 100644
--- a/drivers/video/fbdev/omap2/displays-new/connector-hdmi.c
+++ b/drivers/video/fbdev/omap2/displays-new/connector-hdmi.c
@@ -170,98 +170,6 @@ static bool hdmic_detect(struct omap_dss_device *dssdev)
 		return in->ops.hdmi->detect(in);
 }
 
-static int hdmic_audio_enable(struct omap_dss_device *dssdev)
-{
-	struct panel_drv_data *ddata = to_panel_data(dssdev);
-	struct omap_dss_device *in = ddata->in;
-	int r;
-
-	/* enable audio only if the display is active */
-	if (!omapdss_device_is_enabled(dssdev))
-		return -EPERM;
-
-	r = in->ops.hdmi->audio_enable(in);
-	if (r)
-		return r;
-
-	dssdev->audio_state = OMAP_DSS_AUDIO_ENABLED;
-
-	return 0;
-}
-
-static void hdmic_audio_disable(struct omap_dss_device *dssdev)
-{
-	struct panel_drv_data *ddata = to_panel_data(dssdev);
-	struct omap_dss_device *in = ddata->in;
-
-	in->ops.hdmi->audio_disable(in);
-
-	dssdev->audio_state = OMAP_DSS_AUDIO_DISABLED;
-}
-
-static int hdmic_audio_start(struct omap_dss_device *dssdev)
-{
-	struct panel_drv_data *ddata = to_panel_data(dssdev);
-	struct omap_dss_device *in = ddata->in;
-	int r;
-
-	/*
-	 * No need to check the panel state. It was checked when trasitioning
-	 * to AUDIO_ENABLED.
-	 */
-	if (dssdev->audio_state != OMAP_DSS_AUDIO_ENABLED)
-		return -EPERM;
-
-	r = in->ops.hdmi->audio_start(in);
-	if (r)
-		return r;
-
-	dssdev->audio_state = OMAP_DSS_AUDIO_PLAYING;
-
-	return 0;
-}
-
-static void hdmic_audio_stop(struct omap_dss_device *dssdev)
-{
-	struct panel_drv_data *ddata = to_panel_data(dssdev);
-	struct omap_dss_device *in = ddata->in;
-
-	in->ops.hdmi->audio_stop(in);
-
-	dssdev->audio_state = OMAP_DSS_AUDIO_ENABLED;
-}
-
-static bool hdmic_audio_supported(struct omap_dss_device *dssdev)
-{
-	struct panel_drv_data *ddata = to_panel_data(dssdev);
-	struct omap_dss_device *in = ddata->in;
-
-	if (!omapdss_device_is_enabled(dssdev))
-		return false;
-
-	return in->ops.hdmi->audio_supported(in);
-}
-
-static int hdmic_audio_config(struct omap_dss_device *dssdev,
-		struct omap_dss_audio *audio)
-{
-	struct panel_drv_data *ddata = to_panel_data(dssdev);
-	struct omap_dss_device *in = ddata->in;
-	int r;
-
-	/* config audio only if the display is active */
-	if (!omapdss_device_is_enabled(dssdev))
-		return -EPERM;
-
-	r = in->ops.hdmi->audio_config(in, audio);
-	if (r)
-		return r;
-
-	dssdev->audio_state = OMAP_DSS_AUDIO_CONFIGURED;
-
-	return 0;
-}
-
 static int hdmic_set_hdmi_mode(struct omap_dss_device *dssdev, bool hdmi_mode)
 {
 	struct panel_drv_data *ddata = to_panel_data(dssdev);
@@ -296,13 +204,6 @@ static struct omap_dss_driver hdmic_driver = {
 	.detect			= hdmic_detect,
 	.set_hdmi_mode		= hdmic_set_hdmi_mode,
 	.set_hdmi_infoframe	= hdmic_set_infoframe,
-
-	.audio_enable		= hdmic_audio_enable,
-	.audio_disable		= hdmic_audio_disable,
-	.audio_start		= hdmic_audio_start,
-	.audio_stop		= hdmic_audio_stop,
-	.audio_supported	= hdmic_audio_supported,
-	.audio_config		= hdmic_audio_config,
 };
 
 static int hdmic_probe_pdata(struct platform_device *pdev)
diff --git a/drivers/video/fbdev/omap2/displays-new/encoder-tpd12s015.c b/drivers/video/fbdev/omap2/displays-new/encoder-tpd12s015.c
index c891d8f..235e3d5 100644
--- a/drivers/video/fbdev/omap2/displays-new/encoder-tpd12s015.c
+++ b/drivers/video/fbdev/omap2/displays-new/encoder-tpd12s015.c
@@ -193,55 +193,6 @@ static bool tpd_detect(struct omap_dss_device *dssdev)
 	return gpio_get_value_cansleep(ddata->hpd_gpio);
 }
 
-static int tpd_audio_enable(struct omap_dss_device *dssdev)
-{
-	struct panel_drv_data *ddata = to_panel_data(dssdev);
-	struct omap_dss_device *in = ddata->in;
-
-	return in->ops.hdmi->audio_enable(in);
-}
-
-static void tpd_audio_disable(struct omap_dss_device *dssdev)
-{
-	struct panel_drv_data *ddata = to_panel_data(dssdev);
-	struct omap_dss_device *in = ddata->in;
-
-	in->ops.hdmi->audio_disable(in);
-}
-
-static int tpd_audio_start(struct omap_dss_device *dssdev)
-{
-	struct panel_drv_data *ddata = to_panel_data(dssdev);
-	struct omap_dss_device *in = ddata->in;
-
-	return in->ops.hdmi->audio_start(in);
-}
-
-static void tpd_audio_stop(struct omap_dss_device *dssdev)
-{
-	struct panel_drv_data *ddata = to_panel_data(dssdev);
-	struct omap_dss_device *in = ddata->in;
-
-	in->ops.hdmi->audio_stop(in);
-}
-
-static bool tpd_audio_supported(struct omap_dss_device *dssdev)
-{
-	struct panel_drv_data *ddata = to_panel_data(dssdev);
-	struct omap_dss_device *in = ddata->in;
-
-	return in->ops.hdmi->audio_supported(in);
-}
-
-static int tpd_audio_config(struct omap_dss_device *dssdev,
-		struct omap_dss_audio *audio)
-{
-	struct panel_drv_data *ddata = to_panel_data(dssdev);
-	struct omap_dss_device *in = ddata->in;
-
-	return in->ops.hdmi->audio_config(in, audio);
-}
-
 static int tpd_set_infoframe(struct omap_dss_device *dssdev,
 		const struct hdmi_avi_infoframe *avi)
 {
@@ -275,13 +226,6 @@ static const struct omapdss_hdmi_ops tpd_hdmi_ops = {
 	.detect			= tpd_detect,
 	.set_infoframe		= tpd_set_infoframe,
 	.set_hdmi_mode		= tpd_set_hdmi_mode,
-
-	.audio_enable		= tpd_audio_enable,
-	.audio_disable		= tpd_audio_disable,
-	.audio_start		= tpd_audio_start,
-	.audio_stop		= tpd_audio_stop,
-	.audio_supported	= tpd_audio_supported,
-	.audio_config		= tpd_audio_config,
 };
 
 static int tpd_probe_pdata(struct platform_device *pdev)
diff --git a/include/video/omapdss.h b/include/video/omapdss.h
index 069dfca..9035325 100644
--- a/include/video/omapdss.h
+++ b/include/video/omapdss.h
@@ -635,19 +635,6 @@ struct omapdss_hdmi_ops {
 	int (*set_hdmi_mode)(struct omap_dss_device *dssdev, bool hdmi_mode);
 	int (*set_infoframe)(struct omap_dss_device *dssdev,
 		const struct hdmi_avi_infoframe *avi);
-
-	/*
-	 * Note: These functions might sleep. Do not call while
-	 * holding a spinlock/readlock.
-	 */
-	int (*audio_enable)(struct omap_dss_device *dssdev);
-	void (*audio_disable)(struct omap_dss_device *dssdev);
-	bool (*audio_supported)(struct omap_dss_device *dssdev);
-	int (*audio_config)(struct omap_dss_device *dssdev,
-		struct omap_dss_audio *audio);
-	/* Note: These functions may not sleep */
-	int (*audio_start)(struct omap_dss_device *dssdev);
-	void (*audio_stop)(struct omap_dss_device *dssdev);
 };
 
 struct omapdss_dsi_ops {
@@ -858,24 +845,6 @@ struct omap_dss_driver {
 	int (*set_hdmi_mode)(struct omap_dss_device *dssdev, bool hdmi_mode);
 	int (*set_hdmi_infoframe)(struct omap_dss_device *dssdev,
 		const struct hdmi_avi_infoframe *avi);
-
-	/*
-	 * For display drivers that support audio. This encompasses
-	 * HDMI and DisplayPort at the moment.
-	 */
-	/*
-	 * Note: These functions might sleep. Do not call while
-	 * holding a spinlock/readlock.
-	 */
-	int (*audio_enable)(struct omap_dss_device *dssdev);
-	void (*audio_disable)(struct omap_dss_device *dssdev);
-	bool (*audio_supported)(struct omap_dss_device *dssdev);
-	int (*audio_config)(struct omap_dss_device *dssdev,
-		struct omap_dss_audio *audio);
-	/* Note: These functions may not sleep */
-	int (*audio_start)(struct omap_dss_device *dssdev);
-	void (*audio_stop)(struct omap_dss_device *dssdev);
-
 };
 
 enum omapdss_version omapdss_get_version(void);
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 60+ messages in thread

* Re: [PATCH 03/12] OMAPDSS: hdmi_wp: Add function for getting hdmi_wp physical base address
  2014-06-26 19:20   ` Jyri Sarha
@ 2014-06-27 10:41     ` Tomi Valkeinen
  -1 siblings, 0 replies; 60+ messages in thread
From: Tomi Valkeinen @ 2014-06-27 10:41 UTC (permalink / raw)
  To: Jyri Sarha, alsa-devel, linux-fbdev, linux-omap
  Cc: peter.ujfalusi, broonie, liam.r.girdwood, detheridge, jyri.sarha

[-- Attachment #1: Type: text/plain, Size: 2284 bytes --]

On 26/06/14 22:20, Jyri Sarha wrote:
> The hdmi_wp physical base address is needed for hdmi audio dma.
> 
> Signed-off-by: Jyri Sarha <jsarha@ti.com>
> ---
>  drivers/video/fbdev/omap2/dss/hdmi.h    |    2 ++
>  drivers/video/fbdev/omap2/dss/hdmi_wp.c |    6 ++++++
>  2 files changed, 8 insertions(+)
> 
> diff --git a/drivers/video/fbdev/omap2/dss/hdmi.h b/drivers/video/fbdev/omap2/dss/hdmi.h
> index 1f01068..927cb4d 100644
> --- a/drivers/video/fbdev/omap2/dss/hdmi.h
> +++ b/drivers/video/fbdev/omap2/dss/hdmi.h
> @@ -250,6 +250,7 @@ struct hdmi_core_audio_config {
>  
>  struct hdmi_wp_data {
>  	void __iomem *base;
> +	phys_addr_t phys_base;
>  };
>  
>  struct hdmi_pll_data {
> @@ -317,6 +318,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);
> diff --git a/drivers/video/fbdev/omap2/dss/hdmi_wp.c b/drivers/video/fbdev/omap2/dss/hdmi_wp.c
> index 496327e..eadd4ed 100644
> --- a/drivers/video/fbdev/omap2/dss/hdmi_wp.c
> +++ b/drivers/video/fbdev/omap2/dss/hdmi_wp.c
> @@ -247,6 +247,7 @@ int hdmi_wp_init(struct platform_device *pdev, struct hdmi_wp_data *wp)
>  		DSSERR("can't get WP mem resource\n");
>  		return -EINVAL;
>  	}
> +	wp->phys_base = res->start;
>  
>  	wp->base = devm_ioremap_resource(&pdev->dev, res);
>  	if (IS_ERR(wp->base)) {
> @@ -256,3 +257,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;
> +}
> 

Maybe it would be better to have a function which returns the phys
address for audio DMA? Only that one register is needed, right?

That makes the purpose of the function more obvious, and also if you
return the phys_base, the caller needs to know the offset to the DMA
register, and that offset should be a WP internal value.

 Tomi



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [PATCH 03/12] OMAPDSS: hdmi_wp: Add function for getting hdmi_wp physical base address
@ 2014-06-27 10:41     ` Tomi Valkeinen
  0 siblings, 0 replies; 60+ messages in thread
From: Tomi Valkeinen @ 2014-06-27 10:41 UTC (permalink / raw)
  To: Jyri Sarha, alsa-devel, linux-fbdev, linux-omap
  Cc: peter.ujfalusi, broonie, liam.r.girdwood, detheridge, jyri.sarha

[-- Attachment #1: Type: text/plain, Size: 2284 bytes --]

On 26/06/14 22:20, Jyri Sarha wrote:
> The hdmi_wp physical base address is needed for hdmi audio dma.
> 
> Signed-off-by: Jyri Sarha <jsarha@ti.com>
> ---
>  drivers/video/fbdev/omap2/dss/hdmi.h    |    2 ++
>  drivers/video/fbdev/omap2/dss/hdmi_wp.c |    6 ++++++
>  2 files changed, 8 insertions(+)
> 
> diff --git a/drivers/video/fbdev/omap2/dss/hdmi.h b/drivers/video/fbdev/omap2/dss/hdmi.h
> index 1f01068..927cb4d 100644
> --- a/drivers/video/fbdev/omap2/dss/hdmi.h
> +++ b/drivers/video/fbdev/omap2/dss/hdmi.h
> @@ -250,6 +250,7 @@ struct hdmi_core_audio_config {
>  
>  struct hdmi_wp_data {
>  	void __iomem *base;
> +	phys_addr_t phys_base;
>  };
>  
>  struct hdmi_pll_data {
> @@ -317,6 +318,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);
> diff --git a/drivers/video/fbdev/omap2/dss/hdmi_wp.c b/drivers/video/fbdev/omap2/dss/hdmi_wp.c
> index 496327e..eadd4ed 100644
> --- a/drivers/video/fbdev/omap2/dss/hdmi_wp.c
> +++ b/drivers/video/fbdev/omap2/dss/hdmi_wp.c
> @@ -247,6 +247,7 @@ int hdmi_wp_init(struct platform_device *pdev, struct hdmi_wp_data *wp)
>  		DSSERR("can't get WP mem resource\n");
>  		return -EINVAL;
>  	}
> +	wp->phys_base = res->start;
>  
>  	wp->base = devm_ioremap_resource(&pdev->dev, res);
>  	if (IS_ERR(wp->base)) {
> @@ -256,3 +257,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;
> +}
> 

Maybe it would be better to have a function which returns the phys
address for audio DMA? Only that one register is needed, right?

That makes the purpose of the function more obvious, and also if you
return the phys_base, the caller needs to know the offset to the DMA
register, and that offset should be a WP internal value.

 Tomi



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [PATCH 04/12] OMAPDSS: hdmi_audio: Integrated ASoC DAI component driver implementation
  2014-06-26 19:20   ` Jyri Sarha
@ 2014-06-27 11:10     ` Tomi Valkeinen
  -1 siblings, 0 replies; 60+ messages in thread
From: Tomi Valkeinen @ 2014-06-27 11:10 UTC (permalink / raw)
  To: Jyri Sarha, alsa-devel, linux-fbdev, linux-omap
  Cc: peter.ujfalusi, broonie, liam.r.girdwood, detheridge, jyri.sarha

[-- Attachment #1: Type: text/plain, Size: 3618 bytes --]

On 26/06/14 22:20, Jyri Sarha wrote:
> Integrate ASoC DAI component driver in to the OMAP hdmi driver. The
> patch also updates the relevant entry in ti,omap5-dss DT binding
> document. The driver registers a dummy hdmi codec driver and a
> simple-card driver to produce a fully functional ALSA device. The DAI
> driver is implemented in hdmi_audio.c, but it still needs to be
> registered from hdmi4.c or hdmi5.c.
> 
> Signed-off-by: Jyri Sarha <jsarha@ti.com>
> ---
>  drivers/video/fbdev/omap2/dss/Makefile     |    2 +
>  drivers/video/fbdev/omap2/dss/hdmi.h       |   38 +++-
>  drivers/video/fbdev/omap2/dss/hdmi_audio.c |  317 ++++++++++++++++++++++++++++
>  3 files changed, 355 insertions(+), 2 deletions(-)
>  create mode 100644 drivers/video/fbdev/omap2/dss/hdmi_audio.c
> 
> diff --git a/drivers/video/fbdev/omap2/dss/Makefile b/drivers/video/fbdev/omap2/dss/Makefile
> index 245f933..8260987 100644
> --- a/drivers/video/fbdev/omap2/dss/Makefile
> +++ b/drivers/video/fbdev/omap2/dss/Makefile
> @@ -14,5 +14,7 @@ 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
>  omapdss-$(CONFIG_OMAP4_DSS_HDMI) += hdmi4.o hdmi4_core.o
> +omapdss-$(CONFIG_OMAP4_DSS_HDMI_AUDIO) += hdmi_audio.o
>  omapdss-$(CONFIG_OMAP5_DSS_HDMI) += hdmi5.o hdmi5_core.o
> +omapdss-$(CONFIG_OMAP5_DSS_HDMI_AUDIO) += hdmi_audio.o
>  ccflags-$(CONFIG_OMAP2_DSS_DEBUG) += -DDEBUG
> diff --git a/drivers/video/fbdev/omap2/dss/hdmi.h b/drivers/video/fbdev/omap2/dss/hdmi.h
> index 927cb4d..cc6ecb5 100644
> --- a/drivers/video/fbdev/omap2/dss/hdmi.h
> +++ b/drivers/video/fbdev/omap2/dss/hdmi.h
> @@ -25,6 +25,11 @@
>  #include <linux/hdmi.h>
>  #include <video/omapdss.h>
>  
> +#if defined(CONFIG_OMAP4_DSS_HDMI_AUDIO) || defined(CONFIG_OMAP5_DSS_HDMI_AUDIO)

I think you're a bit overeager with these ifdefs =). They make the code
more difficult to read. The question is, what is their purpose here? I'm
quite sure those includes below can be included just fine even without
HDMI support in the driver. So as far as I see, their only purpose would
be to very minimally speed up the kernel compilation.

> +#include <sound/dmaengine_pcm.h>
> +#include <uapi/sound/asound.h>
> +#endif
> +
>  #include "dss.h"
>  
>  /* HDMI Wrapper */
> @@ -338,6 +343,35 @@ 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)

Same here. The struct definition doesn't do any harm, even if the audio
support is not compiled in.

> +struct hdmi_audio_data {
> +	/* These should be initialized when hdmi_audio_register() is called */
> +	struct mutex *hdmi_lock;
> +	struct hdmi_wp_data *wp;
> +	struct hdmi_core_data *core;
> +	struct hdmi_config *cfg;
> +	struct snd_soc_dai_driver *hdmi_dai_drv;
> +
> +	int (*audio_start)(struct hdmi_core_data *core,
> +			   struct hdmi_wp_data *wp);
> +	void (*audio_stop)(struct hdmi_core_data *core,
> +			   struct hdmi_wp_data *wp);
> +	int (*audio_config)(struct hdmi_core_data *core,
> +			    struct hdmi_wp_data *wp,
> +			    struct omap_dss_audio *audio,
> +			    u32 pclk);
> +
> +	/* These are of audio implementation's private use */
> +	struct snd_dmaengine_dai_dma_data dma_data;
> +	struct omap_dss_audio dss_audio;
> +	struct snd_aes_iec958 iec;
> +	struct snd_cea_861_aud_if cea;
> +	struct platform_device *codec_pdev;
> +	struct platform_device *card_pdev;
> +};

 Tomi




[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [PATCH 04/12] OMAPDSS: hdmi_audio: Integrated ASoC DAI component driver implementation
@ 2014-06-27 11:10     ` Tomi Valkeinen
  0 siblings, 0 replies; 60+ messages in thread
From: Tomi Valkeinen @ 2014-06-27 11:10 UTC (permalink / raw)
  To: Jyri Sarha, alsa-devel, linux-fbdev, linux-omap
  Cc: peter.ujfalusi, broonie, liam.r.girdwood, detheridge, jyri.sarha

[-- Attachment #1: Type: text/plain, Size: 3618 bytes --]

On 26/06/14 22:20, Jyri Sarha wrote:
> Integrate ASoC DAI component driver in to the OMAP hdmi driver. The
> patch also updates the relevant entry in ti,omap5-dss DT binding
> document. The driver registers a dummy hdmi codec driver and a
> simple-card driver to produce a fully functional ALSA device. The DAI
> driver is implemented in hdmi_audio.c, but it still needs to be
> registered from hdmi4.c or hdmi5.c.
> 
> Signed-off-by: Jyri Sarha <jsarha@ti.com>
> ---
>  drivers/video/fbdev/omap2/dss/Makefile     |    2 +
>  drivers/video/fbdev/omap2/dss/hdmi.h       |   38 +++-
>  drivers/video/fbdev/omap2/dss/hdmi_audio.c |  317 ++++++++++++++++++++++++++++
>  3 files changed, 355 insertions(+), 2 deletions(-)
>  create mode 100644 drivers/video/fbdev/omap2/dss/hdmi_audio.c
> 
> diff --git a/drivers/video/fbdev/omap2/dss/Makefile b/drivers/video/fbdev/omap2/dss/Makefile
> index 245f933..8260987 100644
> --- a/drivers/video/fbdev/omap2/dss/Makefile
> +++ b/drivers/video/fbdev/omap2/dss/Makefile
> @@ -14,5 +14,7 @@ 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
>  omapdss-$(CONFIG_OMAP4_DSS_HDMI) += hdmi4.o hdmi4_core.o
> +omapdss-$(CONFIG_OMAP4_DSS_HDMI_AUDIO) += hdmi_audio.o
>  omapdss-$(CONFIG_OMAP5_DSS_HDMI) += hdmi5.o hdmi5_core.o
> +omapdss-$(CONFIG_OMAP5_DSS_HDMI_AUDIO) += hdmi_audio.o
>  ccflags-$(CONFIG_OMAP2_DSS_DEBUG) += -DDEBUG
> diff --git a/drivers/video/fbdev/omap2/dss/hdmi.h b/drivers/video/fbdev/omap2/dss/hdmi.h
> index 927cb4d..cc6ecb5 100644
> --- a/drivers/video/fbdev/omap2/dss/hdmi.h
> +++ b/drivers/video/fbdev/omap2/dss/hdmi.h
> @@ -25,6 +25,11 @@
>  #include <linux/hdmi.h>
>  #include <video/omapdss.h>
>  
> +#if defined(CONFIG_OMAP4_DSS_HDMI_AUDIO) || defined(CONFIG_OMAP5_DSS_HDMI_AUDIO)

I think you're a bit overeager with these ifdefs =). They make the code
more difficult to read. The question is, what is their purpose here? I'm
quite sure those includes below can be included just fine even without
HDMI support in the driver. So as far as I see, their only purpose would
be to very minimally speed up the kernel compilation.

> +#include <sound/dmaengine_pcm.h>
> +#include <uapi/sound/asound.h>
> +#endif
> +
>  #include "dss.h"
>  
>  /* HDMI Wrapper */
> @@ -338,6 +343,35 @@ 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)

Same here. The struct definition doesn't do any harm, even if the audio
support is not compiled in.

> +struct hdmi_audio_data {
> +	/* These should be initialized when hdmi_audio_register() is called */
> +	struct mutex *hdmi_lock;
> +	struct hdmi_wp_data *wp;
> +	struct hdmi_core_data *core;
> +	struct hdmi_config *cfg;
> +	struct snd_soc_dai_driver *hdmi_dai_drv;
> +
> +	int (*audio_start)(struct hdmi_core_data *core,
> +			   struct hdmi_wp_data *wp);
> +	void (*audio_stop)(struct hdmi_core_data *core,
> +			   struct hdmi_wp_data *wp);
> +	int (*audio_config)(struct hdmi_core_data *core,
> +			    struct hdmi_wp_data *wp,
> +			    struct omap_dss_audio *audio,
> +			    u32 pclk);
> +
> +	/* These are of audio implementation's private use */
> +	struct snd_dmaengine_dai_dma_data dma_data;
> +	struct omap_dss_audio dss_audio;
> +	struct snd_aes_iec958 iec;
> +	struct snd_cea_861_aud_if cea;
> +	struct platform_device *codec_pdev;
> +	struct platform_device *card_pdev;
> +};

 Tomi




[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [PATCH 03/12] OMAPDSS: hdmi_wp: Add function for getting hdmi_wp physical base address
  2014-06-27 10:41     ` Tomi Valkeinen
@ 2014-06-27 11:35       ` Jyri Sarha
  -1 siblings, 0 replies; 60+ messages in thread
From: Jyri Sarha @ 2014-06-27 11:35 UTC (permalink / raw)
  To: Tomi Valkeinen, alsa-devel, linux-fbdev, linux-omap
  Cc: peter.ujfalusi, broonie, liam.r.girdwood, detheridge, jyri.sarha

On 06/27/2014 01:41 PM, Tomi Valkeinen wrote:
> On 26/06/14 22:20, Jyri Sarha wrote:
>> The hdmi_wp physical base address is needed for hdmi audio dma.
...
>
> Maybe it would be better to have a function which returns the phys
> address for audio DMA? Only that one register is needed, right?
>
> That makes the purpose of the function more obvious, and also if you
> return the phys_base, the caller needs to know the offset to the DMA
> register, and that offset should be a WP internal value.
>

Sounds good, I'll do that.

Cheers,
Jyri

^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [PATCH 03/12] OMAPDSS: hdmi_wp: Add function for getting hdmi_wp physical base address
@ 2014-06-27 11:35       ` Jyri Sarha
  0 siblings, 0 replies; 60+ messages in thread
From: Jyri Sarha @ 2014-06-27 11:35 UTC (permalink / raw)
  To: Tomi Valkeinen, alsa-devel, linux-fbdev, linux-omap
  Cc: peter.ujfalusi, broonie, liam.r.girdwood, detheridge, jyri.sarha

On 06/27/2014 01:41 PM, Tomi Valkeinen wrote:
> On 26/06/14 22:20, Jyri Sarha wrote:
>> The hdmi_wp physical base address is needed for hdmi audio dma.
...
>
> Maybe it would be better to have a function which returns the phys
> address for audio DMA? Only that one register is needed, right?
>
> That makes the purpose of the function more obvious, and also if you
> return the phys_base, the caller needs to know the offset to the DMA
> register, and that offset should be a WP internal value.
>

Sounds good, I'll do that.

Cheers,
Jyri

^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [PATCH 06/12] OMAPDSS: hdmi4: Register HDMI audio ASoC drivers from HDMI driver
  2014-06-26 19:20   ` Jyri Sarha
@ 2014-06-27 11:39     ` Tomi Valkeinen
  -1 siblings, 0 replies; 60+ messages in thread
From: Tomi Valkeinen @ 2014-06-27 11:39 UTC (permalink / raw)
  To: Jyri Sarha, alsa-devel, linux-fbdev, linux-omap
  Cc: peter.ujfalusi, broonie, liam.r.girdwood, detheridge, jyri.sarha

[-- Attachment #1: Type: text/plain, Size: 3243 bytes --]

On 26/06/14 22:20, Jyri Sarha wrote:
> Add audio datamember to hdmi struct and call register and unregister
> functions form hdmi_audio.c. Register function registers the
> integrated cpu dai, dummy HDMI codec, and simple-card machine driver
> for complete HDMI audio support.
> 
> Signed-off-by: Jyri Sarha <jsarha@ti.com>
> ---
>  drivers/video/fbdev/omap2/dss/hdmi4.c |   45 +++++++++++++++++++++++++++++++++
>  1 file changed, 45 insertions(+)
> 
> diff --git a/drivers/video/fbdev/omap2/dss/hdmi4.c b/drivers/video/fbdev/omap2/dss/hdmi4.c
> index 342ddb4..48f11f8 100644
> --- a/drivers/video/fbdev/omap2/dss/hdmi4.c
> +++ b/drivers/video/fbdev/omap2/dss/hdmi4.c
> @@ -34,6 +34,11 @@
>  #include <linux/regulator/consumer.h>
>  #include <video/omapdss.h>
>  
> +#if defined(CONFIG_OMAP4_DSS_HDMI_AUDIO)

No need for the ifdef here either.

> +#include <sound/soc.h>
> +#include <sound/soc-dai.h>
> +#endif
> +
>  #include "hdmi4_core.h"
>  #include "dss.h"
>  #include "dss_features.h"
> @@ -52,6 +57,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;
> @@ -671,6 +679,21 @@ err:
>  	return r;
>  }
>  
> +#if defined(CONFIG_OMAP4_DSS_HDMI_AUDIO)
> +static struct snd_soc_dai_driver omap_hdmi_dai = {
> +	.name = "omap4-hdmi-dai",
> +	.playback = {
> +		.channels_min = 2,
> +		.channels_max = 8,
> +		.rates = (SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 |
> +			  SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_88200 |
> +			  SNDRV_PCM_RATE_96000 | SNDRV_PCM_RATE_176400 |
> +			  SNDRV_PCM_RATE_192000),
> +		.formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_LE,
> +	},
> +};
> +#endif
> +
>  /* HDMI HW IP initialisation */
>  static int omapdss_hdmihw_probe(struct platform_device *pdev)
>  {
> @@ -727,6 +750,25 @@ static int omapdss_hdmihw_probe(struct platform_device *pdev)
>  
>  	hdmi_init_output(pdev);
>  
> +#if defined(CONFIG_OMAP4_DSS_HDMI_AUDIO)
> +	/* drvdata is only used by HDMI audio */
> +	hdmi.audio.hdmi_lock = &hdmi.lock;
> +	hdmi.audio.wp = &hdmi.wp;
> +	hdmi.audio.core = &hdmi.core;
> +	hdmi.audio.cfg = &hdmi.cfg;
> +	hdmi.audio.hdmi_dai_drv = &omap_hdmi_dai;
> +	hdmi.audio.audio_start = hdmi4_audio_start;
> +	hdmi.audio.audio_stop = hdmi4_audio_stop;
> +	hdmi.audio.audio_config = hdmi4_audio_config;
> +	dev_set_drvdata(&pdev->dev, &hdmi.audio);
> +	r = hdmi_audio_register(pdev);
> +	if (r) {
> +		DSSERR("Registering HDMI audio failed\n");
> +		hdmi_uninit_output(pdev);
> +		pm_runtime_disable(&pdev->dev);
> +		return r;
> +	}
> +#endif

I don't think it's a good idea to reserve the driver data for audio. We
need to change the hdmi drivers sooner or later to support multiple
instances, and at that point having drvdata for audio will cause problems.

If you don't want to make the hdmi struct public yet, maybe just add a
function to this file which takes a pointer to the hdmi struct and
returns the audio part. That way you can set the whole hdmi struct as
driver data, which should be future safe.

 Tomi



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [PATCH 06/12] OMAPDSS: hdmi4: Register HDMI audio ASoC drivers from HDMI driver
@ 2014-06-27 11:39     ` Tomi Valkeinen
  0 siblings, 0 replies; 60+ messages in thread
From: Tomi Valkeinen @ 2014-06-27 11:39 UTC (permalink / raw)
  To: Jyri Sarha, alsa-devel, linux-fbdev, linux-omap
  Cc: peter.ujfalusi, broonie, liam.r.girdwood, detheridge, jyri.sarha

[-- Attachment #1: Type: text/plain, Size: 3243 bytes --]

On 26/06/14 22:20, Jyri Sarha wrote:
> Add audio datamember to hdmi struct and call register and unregister
> functions form hdmi_audio.c. Register function registers the
> integrated cpu dai, dummy HDMI codec, and simple-card machine driver
> for complete HDMI audio support.
> 
> Signed-off-by: Jyri Sarha <jsarha@ti.com>
> ---
>  drivers/video/fbdev/omap2/dss/hdmi4.c |   45 +++++++++++++++++++++++++++++++++
>  1 file changed, 45 insertions(+)
> 
> diff --git a/drivers/video/fbdev/omap2/dss/hdmi4.c b/drivers/video/fbdev/omap2/dss/hdmi4.c
> index 342ddb4..48f11f8 100644
> --- a/drivers/video/fbdev/omap2/dss/hdmi4.c
> +++ b/drivers/video/fbdev/omap2/dss/hdmi4.c
> @@ -34,6 +34,11 @@
>  #include <linux/regulator/consumer.h>
>  #include <video/omapdss.h>
>  
> +#if defined(CONFIG_OMAP4_DSS_HDMI_AUDIO)

No need for the ifdef here either.

> +#include <sound/soc.h>
> +#include <sound/soc-dai.h>
> +#endif
> +
>  #include "hdmi4_core.h"
>  #include "dss.h"
>  #include "dss_features.h"
> @@ -52,6 +57,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;
> @@ -671,6 +679,21 @@ err:
>  	return r;
>  }
>  
> +#if defined(CONFIG_OMAP4_DSS_HDMI_AUDIO)
> +static struct snd_soc_dai_driver omap_hdmi_dai = {
> +	.name = "omap4-hdmi-dai",
> +	.playback = {
> +		.channels_min = 2,
> +		.channels_max = 8,
> +		.rates = (SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 |
> +			  SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_88200 |
> +			  SNDRV_PCM_RATE_96000 | SNDRV_PCM_RATE_176400 |
> +			  SNDRV_PCM_RATE_192000),
> +		.formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_LE,
> +	},
> +};
> +#endif
> +
>  /* HDMI HW IP initialisation */
>  static int omapdss_hdmihw_probe(struct platform_device *pdev)
>  {
> @@ -727,6 +750,25 @@ static int omapdss_hdmihw_probe(struct platform_device *pdev)
>  
>  	hdmi_init_output(pdev);
>  
> +#if defined(CONFIG_OMAP4_DSS_HDMI_AUDIO)
> +	/* drvdata is only used by HDMI audio */
> +	hdmi.audio.hdmi_lock = &hdmi.lock;
> +	hdmi.audio.wp = &hdmi.wp;
> +	hdmi.audio.core = &hdmi.core;
> +	hdmi.audio.cfg = &hdmi.cfg;
> +	hdmi.audio.hdmi_dai_drv = &omap_hdmi_dai;
> +	hdmi.audio.audio_start = hdmi4_audio_start;
> +	hdmi.audio.audio_stop = hdmi4_audio_stop;
> +	hdmi.audio.audio_config = hdmi4_audio_config;
> +	dev_set_drvdata(&pdev->dev, &hdmi.audio);
> +	r = hdmi_audio_register(pdev);
> +	if (r) {
> +		DSSERR("Registering HDMI audio failed\n");
> +		hdmi_uninit_output(pdev);
> +		pm_runtime_disable(&pdev->dev);
> +		return r;
> +	}
> +#endif

I don't think it's a good idea to reserve the driver data for audio. We
need to change the hdmi drivers sooner or later to support multiple
instances, and at that point having drvdata for audio will cause problems.

If you don't want to make the hdmi struct public yet, maybe just add a
function to this file which takes a pointer to the hdmi struct and
returns the audio part. That way you can set the whole hdmi struct as
driver data, which should be future safe.

 Tomi



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [PATCH 07/12] OMAPDSS: Kconfig: Select audio dependencies if OMAP5_DSS_HDMI_AUDIO=y
  2014-06-26 19:20   ` Jyri Sarha
@ 2014-06-27 11:49     ` Tomi Valkeinen
  -1 siblings, 0 replies; 60+ messages in thread
From: Tomi Valkeinen @ 2014-06-27 11:49 UTC (permalink / raw)
  To: Jyri Sarha, alsa-devel, linux-fbdev, linux-omap
  Cc: peter.ujfalusi, broonie, liam.r.girdwood, detheridge, jyri.sarha

[-- Attachment #1: Type: text/plain, Size: 1559 bytes --]

On 26/06/14 22:20, Jyri Sarha wrote:
> Adds help section and SND_SOC dependency to OMAP4_DSS_HDMI_AUDIO.
> Selects SND_OMAP_SOC, SND_SOC_HDMI_CODEC, and SND_SIMPLE_CARD if
> OMAP4_DSS_HDMI_AUDIO is enabled.
> 
> Signed-off-by: Jyri Sarha <jsarha@ti.com>
> ---
>  drivers/video/fbdev/omap2/dss/Kconfig |   16 ++++++++++++----
>  1 file changed, 12 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/video/fbdev/omap2/dss/Kconfig b/drivers/video/fbdev/omap2/dss/Kconfig
> index 871f722..1cce26c 100644
> --- a/drivers/video/fbdev/omap2/dss/Kconfig
> +++ b/drivers/video/fbdev/omap2/dss/Kconfig
> @@ -6,9 +6,9 @@ menuconfig OMAP2_DSS
>  	select VIDEOMODE_HELPERS
>  	select OMAP2_DSS_INIT
>  	select HDMI
> -	select SND_OMAP_SOC if OMAP4_DSS_HDMI_AUDIO
> -	select SND_SOC_HDMI_CODEC if OMAP4_DSS_HDMI_AUDIO
> -	select SND_SIMPLE_CARD if OMAP4_DSS_HDMI_AUDIO
> +	select SND_OMAP_SOC if OMAP4_DSS_HDMI_AUDIO || OMAP5_DSS_HDMI_AUDIO
> +	select SND_SOC_HDMI_CODEC if OMAP4_DSS_HDMI_AUDIO || OMAP5_DSS_HDMI_AUDIO
> +	select SND_SIMPLE_CARD if OMAP4_DSS_HDMI_AUDIO || OMAP5_DSS_HDMI_AUDIO
>          help
>  	  OMAP2+ Display Subsystem support.
>  
> @@ -99,8 +99,16 @@ config OMAP5_DSS_HDMI
>  	  specification.
>  
>  config OMAP5_DSS_HDMI_AUDIO
> +	bool "HDMI audio support for OMAP5"
>  	depends on OMAP5_DSS_HDMI
> -	bool
> +	depends on SND_SOC=y || OMAP2_DSS = SND_SOC
> +	default y

These selects and depends ons make me feel a bit uneasy, but I don't
have any idea how to deal with it in a nicer way...

 Tomi



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [PATCH 07/12] OMAPDSS: Kconfig: Select audio dependencies if OMAP5_DSS_HDMI_AUDIO=y
@ 2014-06-27 11:49     ` Tomi Valkeinen
  0 siblings, 0 replies; 60+ messages in thread
From: Tomi Valkeinen @ 2014-06-27 11:49 UTC (permalink / raw)
  To: Jyri Sarha, alsa-devel, linux-fbdev, linux-omap
  Cc: peter.ujfalusi, broonie, liam.r.girdwood, detheridge, jyri.sarha

[-- Attachment #1: Type: text/plain, Size: 1559 bytes --]

On 26/06/14 22:20, Jyri Sarha wrote:
> Adds help section and SND_SOC dependency to OMAP4_DSS_HDMI_AUDIO.
> Selects SND_OMAP_SOC, SND_SOC_HDMI_CODEC, and SND_SIMPLE_CARD if
> OMAP4_DSS_HDMI_AUDIO is enabled.
> 
> Signed-off-by: Jyri Sarha <jsarha@ti.com>
> ---
>  drivers/video/fbdev/omap2/dss/Kconfig |   16 ++++++++++++----
>  1 file changed, 12 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/video/fbdev/omap2/dss/Kconfig b/drivers/video/fbdev/omap2/dss/Kconfig
> index 871f722..1cce26c 100644
> --- a/drivers/video/fbdev/omap2/dss/Kconfig
> +++ b/drivers/video/fbdev/omap2/dss/Kconfig
> @@ -6,9 +6,9 @@ menuconfig OMAP2_DSS
>  	select VIDEOMODE_HELPERS
>  	select OMAP2_DSS_INIT
>  	select HDMI
> -	select SND_OMAP_SOC if OMAP4_DSS_HDMI_AUDIO
> -	select SND_SOC_HDMI_CODEC if OMAP4_DSS_HDMI_AUDIO
> -	select SND_SIMPLE_CARD if OMAP4_DSS_HDMI_AUDIO
> +	select SND_OMAP_SOC if OMAP4_DSS_HDMI_AUDIO || OMAP5_DSS_HDMI_AUDIO
> +	select SND_SOC_HDMI_CODEC if OMAP4_DSS_HDMI_AUDIO || OMAP5_DSS_HDMI_AUDIO
> +	select SND_SIMPLE_CARD if OMAP4_DSS_HDMI_AUDIO || OMAP5_DSS_HDMI_AUDIO
>          help
>  	  OMAP2+ Display Subsystem support.
>  
> @@ -99,8 +99,16 @@ config OMAP5_DSS_HDMI
>  	  specification.
>  
>  config OMAP5_DSS_HDMI_AUDIO
> +	bool "HDMI audio support for OMAP5"
>  	depends on OMAP5_DSS_HDMI
> -	bool
> +	depends on SND_SOC=y || OMAP2_DSS = SND_SOC
> +	default y

These selects and depends ons make me feel a bit uneasy, but I don't
have any idea how to deal with it in a nicer way...

 Tomi



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [PATCH 04/12] OMAPDSS: hdmi_audio: Integrated ASoC DAI component driver implementation
  2014-06-26 19:20   ` Jyri Sarha
@ 2014-06-27 11:57     ` Tomi Valkeinen
  -1 siblings, 0 replies; 60+ messages in thread
From: Tomi Valkeinen @ 2014-06-27 11:57 UTC (permalink / raw)
  To: Jyri Sarha, alsa-devel, linux-fbdev, linux-omap
  Cc: peter.ujfalusi, broonie, liam.r.girdwood, detheridge, jyri.sarha

[-- Attachment #1: Type: text/plain, Size: 1806 bytes --]

On 26/06/14 22:20, Jyri Sarha wrote:
> Integrate ASoC DAI component driver in to the OMAP hdmi driver. The
> patch also updates the relevant entry in ti,omap5-dss DT binding
> document. The driver registers a dummy hdmi codec driver and a
> simple-card driver to produce a fully functional ALSA device. The DAI
> driver is implemented in hdmi_audio.c, but it still needs to be
> registered from hdmi4.c or hdmi5.c.
> 
> Signed-off-by: Jyri Sarha <jsarha@ti.com>
> ---
>  drivers/video/fbdev/omap2/dss/Makefile     |    2 +
>  drivers/video/fbdev/omap2/dss/hdmi.h       |   38 +++-
>  drivers/video/fbdev/omap2/dss/hdmi_audio.c |  317 ++++++++++++++++++++++++++++
>  3 files changed, 355 insertions(+), 2 deletions(-)
>  create mode 100644 drivers/video/fbdev/omap2/dss/hdmi_audio.c
> 
> diff --git a/drivers/video/fbdev/omap2/dss/Makefile b/drivers/video/fbdev/omap2/dss/Makefile
> index 245f933..8260987 100644
> --- a/drivers/video/fbdev/omap2/dss/Makefile
> +++ b/drivers/video/fbdev/omap2/dss/Makefile
> @@ -14,5 +14,7 @@ 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
>  omapdss-$(CONFIG_OMAP4_DSS_HDMI) += hdmi4.o hdmi4_core.o
> +omapdss-$(CONFIG_OMAP4_DSS_HDMI_AUDIO) += hdmi_audio.o
>  omapdss-$(CONFIG_OMAP5_DSS_HDMI) += hdmi5.o hdmi5_core.o
> +omapdss-$(CONFIG_OMAP5_DSS_HDMI_AUDIO) += hdmi_audio.o

This adds the hdmi_audio.o twice. I'm not sure what the linker does, but
I don't think that's correct.

Maybe have a internal CONFIG_OMAP_DSS_HDMI_AUDIO option, which is
selected if OMAP4 or OMAP5 HDMI AUDIO is selected by the user.

That same internal option could be used in the code also (where is
applies), instead of "if OMAP4_AUDIO || OMAP5_AUDIO".

 Tomi



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [PATCH 04/12] OMAPDSS: hdmi_audio: Integrated ASoC DAI component driver implementation
@ 2014-06-27 11:57     ` Tomi Valkeinen
  0 siblings, 0 replies; 60+ messages in thread
From: Tomi Valkeinen @ 2014-06-27 11:57 UTC (permalink / raw)
  To: Jyri Sarha, alsa-devel, linux-fbdev, linux-omap
  Cc: peter.ujfalusi, broonie, liam.r.girdwood, detheridge, jyri.sarha

[-- Attachment #1: Type: text/plain, Size: 1806 bytes --]

On 26/06/14 22:20, Jyri Sarha wrote:
> Integrate ASoC DAI component driver in to the OMAP hdmi driver. The
> patch also updates the relevant entry in ti,omap5-dss DT binding
> document. The driver registers a dummy hdmi codec driver and a
> simple-card driver to produce a fully functional ALSA device. The DAI
> driver is implemented in hdmi_audio.c, but it still needs to be
> registered from hdmi4.c or hdmi5.c.
> 
> Signed-off-by: Jyri Sarha <jsarha@ti.com>
> ---
>  drivers/video/fbdev/omap2/dss/Makefile     |    2 +
>  drivers/video/fbdev/omap2/dss/hdmi.h       |   38 +++-
>  drivers/video/fbdev/omap2/dss/hdmi_audio.c |  317 ++++++++++++++++++++++++++++
>  3 files changed, 355 insertions(+), 2 deletions(-)
>  create mode 100644 drivers/video/fbdev/omap2/dss/hdmi_audio.c
> 
> diff --git a/drivers/video/fbdev/omap2/dss/Makefile b/drivers/video/fbdev/omap2/dss/Makefile
> index 245f933..8260987 100644
> --- a/drivers/video/fbdev/omap2/dss/Makefile
> +++ b/drivers/video/fbdev/omap2/dss/Makefile
> @@ -14,5 +14,7 @@ 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
>  omapdss-$(CONFIG_OMAP4_DSS_HDMI) += hdmi4.o hdmi4_core.o
> +omapdss-$(CONFIG_OMAP4_DSS_HDMI_AUDIO) += hdmi_audio.o
>  omapdss-$(CONFIG_OMAP5_DSS_HDMI) += hdmi5.o hdmi5_core.o
> +omapdss-$(CONFIG_OMAP5_DSS_HDMI_AUDIO) += hdmi_audio.o

This adds the hdmi_audio.o twice. I'm not sure what the linker does, but
I don't think that's correct.

Maybe have a internal CONFIG_OMAP_DSS_HDMI_AUDIO option, which is
selected if OMAP4 or OMAP5 HDMI AUDIO is selected by the user.

That same internal option could be used in the code also (where is
applies), instead of "if OMAP4_AUDIO || OMAP5_AUDIO".

 Tomi



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [PATCH 04/12] OMAPDSS: hdmi_audio: Integrated ASoC DAI component driver implementation
  2014-06-27 11:57     ` Tomi Valkeinen
@ 2014-06-27 12:06       ` Jyri Sarha
  -1 siblings, 0 replies; 60+ messages in thread
From: Jyri Sarha @ 2014-06-27 12:06 UTC (permalink / raw)
  To: Tomi Valkeinen, alsa-devel, linux-fbdev, linux-omap
  Cc: peter.ujfalusi, broonie, liam.r.girdwood, detheridge, jyri.sarha

On 06/27/2014 02:57 PM, Tomi Valkeinen wrote:
> On 26/06/14 22:20, Jyri Sarha wrote:
...
>> --- a/drivers/video/fbdev/omap2/dss/Makefile
>> +++ b/drivers/video/fbdev/omap2/dss/Makefile
>> @@ -14,5 +14,7 @@ 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
>>   omapdss-$(CONFIG_OMAP4_DSS_HDMI) += hdmi4.o hdmi4_core.o
>> +omapdss-$(CONFIG_OMAP4_DSS_HDMI_AUDIO) += hdmi_audio.o
>>   omapdss-$(CONFIG_OMAP5_DSS_HDMI) += hdmi5.o hdmi5_core.o
>> +omapdss-$(CONFIG_OMAP5_DSS_HDMI_AUDIO) += hdmi_audio.o
>
> This adds the hdmi_audio.o twice. I'm not sure what the linker does, but
> I don't think that's correct.
>

Well, it works, but it is ugly.

> Maybe have a internal CONFIG_OMAP_DSS_HDMI_AUDIO option, which is
> selected if OMAP4 or OMAP5 HDMI AUDIO is selected by the user.
>
> That same internal option could be used in the code also (where is
> applies), instead of "if OMAP4_AUDIO || OMAP5_AUDIO".
>

I'll implement your suggestion.

Cheers,
Jyri




^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [PATCH 04/12] OMAPDSS: hdmi_audio: Integrated ASoC DAI component driver implementation
@ 2014-06-27 12:06       ` Jyri Sarha
  0 siblings, 0 replies; 60+ messages in thread
From: Jyri Sarha @ 2014-06-27 12:06 UTC (permalink / raw)
  To: Tomi Valkeinen, alsa-devel, linux-fbdev, linux-omap
  Cc: peter.ujfalusi, broonie, liam.r.girdwood, detheridge, jyri.sarha

On 06/27/2014 02:57 PM, Tomi Valkeinen wrote:
> On 26/06/14 22:20, Jyri Sarha wrote:
...
>> --- a/drivers/video/fbdev/omap2/dss/Makefile
>> +++ b/drivers/video/fbdev/omap2/dss/Makefile
>> @@ -14,5 +14,7 @@ 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
>>   omapdss-$(CONFIG_OMAP4_DSS_HDMI) += hdmi4.o hdmi4_core.o
>> +omapdss-$(CONFIG_OMAP4_DSS_HDMI_AUDIO) += hdmi_audio.o
>>   omapdss-$(CONFIG_OMAP5_DSS_HDMI) += hdmi5.o hdmi5_core.o
>> +omapdss-$(CONFIG_OMAP5_DSS_HDMI_AUDIO) += hdmi_audio.o
>
> This adds the hdmi_audio.o twice. I'm not sure what the linker does, but
> I don't think that's correct.
>

Well, it works, but it is ugly.

> Maybe have a internal CONFIG_OMAP_DSS_HDMI_AUDIO option, which is
> selected if OMAP4 or OMAP5 HDMI AUDIO is selected by the user.
>
> That same internal option could be used in the code also (where is
> applies), instead of "if OMAP4_AUDIO || OMAP5_AUDIO".
>

I'll implement your suggestion.

Cheers,
Jyri




^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [PATCH 04/12] OMAPDSS: hdmi_audio: Integrated ASoC DAI component driver implementation
  2014-06-26 19:20   ` Jyri Sarha
@ 2014-06-27 12:11     ` Tomi Valkeinen
  -1 siblings, 0 replies; 60+ messages in thread
From: Tomi Valkeinen @ 2014-06-27 12:11 UTC (permalink / raw)
  To: Jyri Sarha, alsa-devel, linux-fbdev, linux-omap
  Cc: peter.ujfalusi, broonie, liam.r.girdwood, detheridge, jyri.sarha

[-- Attachment #1: Type: text/plain, Size: 1379 bytes --]

On 26/06/14 22:20, Jyri Sarha wrote:
> Integrate ASoC DAI component driver in to the OMAP hdmi driver. The
> patch also updates the relevant entry in ti,omap5-dss DT binding
> document. The driver registers a dummy hdmi codec driver and a
> simple-card driver to produce a fully functional ALSA device. The DAI
> driver is implemented in hdmi_audio.c, but it still needs to be
> registered from hdmi4.c or hdmi5.c.
> 
> Signed-off-by: Jyri Sarha <jsarha@ti.com>
> ---

<snip>

> +static const struct snd_soc_dai_ops hdmi_dai_ops = {
> +	.startup	= hdmi_dai_startup,
> +	.hw_params	= hdmi_dai_hw_params,
> +	.prepare	= hdmi_dai_prepare,
> +	.trigger	= hdmi_dai_trigger,
> +	.shutdown	= hdmi_dai_shutdown,
> +};
> +
> +static const struct snd_soc_component_driver omap_hdmi_component = {
> +	.name = "omapdss_hdmi",
> +};
> +
> +static struct asoc_simple_card_info card_info = {
> +	.name = "HDMI",
> +	.card = "OMAPHDMI",
> +	.codec_dai.name = "hdmi-hifi",
> +};

The above is not const. That, and the contents of the struct make me
wonder, what happens if we have two HDMI instances?

I know the core driver doesn't work with multiple instances yet, but as
I mentioned, it has to be done sooner or later. And on the core driver
side it should be quite straightforward.

I'd rather not introduce new restrictions for that goal.

 Tomi



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [PATCH 04/12] OMAPDSS: hdmi_audio: Integrated ASoC DAI component driver implementation
@ 2014-06-27 12:11     ` Tomi Valkeinen
  0 siblings, 0 replies; 60+ messages in thread
From: Tomi Valkeinen @ 2014-06-27 12:11 UTC (permalink / raw)
  To: Jyri Sarha, alsa-devel, linux-fbdev, linux-omap
  Cc: peter.ujfalusi, broonie, liam.r.girdwood, detheridge, jyri.sarha

[-- Attachment #1: Type: text/plain, Size: 1379 bytes --]

On 26/06/14 22:20, Jyri Sarha wrote:
> Integrate ASoC DAI component driver in to the OMAP hdmi driver. The
> patch also updates the relevant entry in ti,omap5-dss DT binding
> document. The driver registers a dummy hdmi codec driver and a
> simple-card driver to produce a fully functional ALSA device. The DAI
> driver is implemented in hdmi_audio.c, but it still needs to be
> registered from hdmi4.c or hdmi5.c.
> 
> Signed-off-by: Jyri Sarha <jsarha@ti.com>
> ---

<snip>

> +static const struct snd_soc_dai_ops hdmi_dai_ops = {
> +	.startup	= hdmi_dai_startup,
> +	.hw_params	= hdmi_dai_hw_params,
> +	.prepare	= hdmi_dai_prepare,
> +	.trigger	= hdmi_dai_trigger,
> +	.shutdown	= hdmi_dai_shutdown,
> +};
> +
> +static const struct snd_soc_component_driver omap_hdmi_component = {
> +	.name = "omapdss_hdmi",
> +};
> +
> +static struct asoc_simple_card_info card_info = {
> +	.name = "HDMI",
> +	.card = "OMAPHDMI",
> +	.codec_dai.name = "hdmi-hifi",
> +};

The above is not const. That, and the contents of the struct make me
wonder, what happens if we have two HDMI instances?

I know the core driver doesn't work with multiple instances yet, but as
I mentioned, it has to be done sooner or later. And on the core driver
side it should be quite straightforward.

I'd rather not introduce new restrictions for that goal.

 Tomi



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [PATCH 09/12] ASoC: omap: Remove obsolete HDMI audio code and Kconfig options
  2014-06-26 19:21   ` Jyri Sarha
@ 2014-06-27 12:17     ` Mark Brown
  -1 siblings, 0 replies; 60+ messages in thread
From: Mark Brown @ 2014-06-27 12:17 UTC (permalink / raw)
  To: Jyri Sarha
  Cc: alsa-devel, linux-fbdev, linux-omap, peter.ujfalusi,
	liam.r.girdwood, tomi.valkeinen, detheridge, jyri.sarha

[-- Attachment #1: Type: text/plain, Size: 353 bytes --]

On Thu, Jun 26, 2014 at 10:21:00PM +0300, Jyri Sarha wrote:
> Removes omap-hdmi DAI driver, omap-hdmi-card driver, the related
> Kconfig options, and Makefile entries. The HDMI DAI drivers has been
> integrated directly to OMAP4+ HDMI drivers and simple-card driver is
> used instead of omap-hdmi-card driver.

Acked-by: Mark Brown <broonie@linaro.org>

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [PATCH 09/12] ASoC: omap: Remove obsolete HDMI audio code and Kconfig options
@ 2014-06-27 12:17     ` Mark Brown
  0 siblings, 0 replies; 60+ messages in thread
From: Mark Brown @ 2014-06-27 12:17 UTC (permalink / raw)
  To: Jyri Sarha
  Cc: alsa-devel, linux-fbdev, linux-omap, peter.ujfalusi,
	liam.r.girdwood, tomi.valkeinen, detheridge, jyri.sarha

[-- Attachment #1: Type: text/plain, Size: 353 bytes --]

On Thu, Jun 26, 2014 at 10:21:00PM +0300, Jyri Sarha wrote:
> Removes omap-hdmi DAI driver, omap-hdmi-card driver, the related
> Kconfig options, and Makefile entries. The HDMI DAI drivers has been
> integrated directly to OMAP4+ HDMI drivers and simple-card driver is
> used instead of omap-hdmi-card driver.

Acked-by: Mark Brown <broonie@linaro.org>

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [PATCH 04/12] OMAPDSS: hdmi_audio: Integrated ASoC DAI component driver implementation
  2014-06-27 12:11     ` Tomi Valkeinen
@ 2014-06-27 12:26       ` Jyri Sarha
  -1 siblings, 0 replies; 60+ messages in thread
From: Jyri Sarha @ 2014-06-27 12:26 UTC (permalink / raw)
  To: Tomi Valkeinen, alsa-devel, linux-fbdev, linux-omap
  Cc: peter.ujfalusi, broonie, liam.r.girdwood, detheridge, jyri.sarha

On 06/27/2014 03:11 PM, Tomi Valkeinen wrote:
> On 26/06/14 22:20, Jyri Sarha wrote:
...
>> +static struct asoc_simple_card_info card_info = {
>> +	.name = "HDMI",
>> +	.card = "OMAPHDMI",
>> +	.codec_dai.name = "hdmi-hifi",
>> +};
>
> The above is not const. That, and the contents of the struct make me
> wonder, what happens if we have two HDMI instances?
>
> I know the core driver doesn't work with multiple instances yet, but as
> I mentioned, it has to be done sooner or later. And on the core driver
> side it should be quite straightforward.
>
> I'd rather not introduce new restrictions for that goal.
>

Ok, I'll alloc that with devm_kzalloc().

Cheers,
Jyri

^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [PATCH 04/12] OMAPDSS: hdmi_audio: Integrated ASoC DAI component driver implementation
@ 2014-06-27 12:26       ` Jyri Sarha
  0 siblings, 0 replies; 60+ messages in thread
From: Jyri Sarha @ 2014-06-27 12:26 UTC (permalink / raw)
  To: Tomi Valkeinen, alsa-devel, linux-fbdev, linux-omap
  Cc: peter.ujfalusi, broonie, liam.r.girdwood, detheridge, jyri.sarha

On 06/27/2014 03:11 PM, Tomi Valkeinen wrote:
> On 26/06/14 22:20, Jyri Sarha wrote:
...
>> +static struct asoc_simple_card_info card_info = {
>> +	.name = "HDMI",
>> +	.card = "OMAPHDMI",
>> +	.codec_dai.name = "hdmi-hifi",
>> +};
>
> The above is not const. That, and the contents of the struct make me
> wonder, what happens if we have two HDMI instances?
>
> I know the core driver doesn't work with multiple instances yet, but as
> I mentioned, it has to be done sooner or later. And on the core driver
> side it should be quite straightforward.
>
> I'd rather not introduce new restrictions for that goal.
>

Ok, I'll alloc that with devm_kzalloc().

Cheers,
Jyri

^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [PATCH 04/12] OMAPDSS: hdmi_audio: Integrated ASoC DAI component driver implementation
  2014-06-27 12:26       ` Jyri Sarha
@ 2014-06-27 13:06         ` Tomi Valkeinen
  -1 siblings, 0 replies; 60+ messages in thread
From: Tomi Valkeinen @ 2014-06-27 13:06 UTC (permalink / raw)
  To: Jyri Sarha, alsa-devel, linux-fbdev, linux-omap
  Cc: peter.ujfalusi, liam.r.girdwood, detheridge, broonie, jyri.sarha

[-- Attachment #1: Type: text/plain, Size: 900 bytes --]

On 27/06/14 15:26, Jyri Sarha wrote:
> On 06/27/2014 03:11 PM, Tomi Valkeinen wrote:
>> On 26/06/14 22:20, Jyri Sarha wrote:
> ...
>>> +static struct asoc_simple_card_info card_info = {
>>> +    .name = "HDMI",
>>> +    .card = "OMAPHDMI",
>>> +    .codec_dai.name = "hdmi-hifi",
>>> +};
>>
>> The above is not const. That, and the contents of the struct make me
>> wonder, what happens if we have two HDMI instances?
>>
>> I know the core driver doesn't work with multiple instances yet, but as
>> I mentioned, it has to be done sooner or later. And on the core driver
>> side it should be quite straightforward.
>>
>> I'd rather not introduce new restrictions for that goal.
>>
> 
> Ok, I'll alloc that with devm_kzalloc().

Do the strings in the struct need to be unique? If so, you probably need
to append something to them based on the hdmi device instance.

 Tomi



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [PATCH 04/12] OMAPDSS: hdmi_audio: Integrated ASoC DAI component driver implementation
@ 2014-06-27 13:06         ` Tomi Valkeinen
  0 siblings, 0 replies; 60+ messages in thread
From: Tomi Valkeinen @ 2014-06-27 13:06 UTC (permalink / raw)
  To: Jyri Sarha, alsa-devel, linux-fbdev, linux-omap
  Cc: peter.ujfalusi, liam.r.girdwood, detheridge, broonie, jyri.sarha


[-- Attachment #1.1: Type: text/plain, Size: 900 bytes --]

On 27/06/14 15:26, Jyri Sarha wrote:
> On 06/27/2014 03:11 PM, Tomi Valkeinen wrote:
>> On 26/06/14 22:20, Jyri Sarha wrote:
> ...
>>> +static struct asoc_simple_card_info card_info = {
>>> +    .name = "HDMI",
>>> +    .card = "OMAPHDMI",
>>> +    .codec_dai.name = "hdmi-hifi",
>>> +};
>>
>> The above is not const. That, and the contents of the struct make me
>> wonder, what happens if we have two HDMI instances?
>>
>> I know the core driver doesn't work with multiple instances yet, but as
>> I mentioned, it has to be done sooner or later. And on the core driver
>> side it should be quite straightforward.
>>
>> I'd rather not introduce new restrictions for that goal.
>>
> 
> Ok, I'll alloc that with devm_kzalloc().

Do the strings in the struct need to be unique? If so, you probably need
to append something to them based on the hdmi device instance.

 Tomi



[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [PATCH 04/12] OMAPDSS: hdmi_audio: Integrated ASoC DAI component driver implementation
  2014-06-27 13:06         ` Tomi Valkeinen
@ 2014-06-27 15:33           ` Jyri Sarha
  -1 siblings, 0 replies; 60+ messages in thread
From: Jyri Sarha @ 2014-06-27 15:33 UTC (permalink / raw)
  To: Tomi Valkeinen, alsa-devel, linux-fbdev, linux-omap
  Cc: peter.ujfalusi, broonie, liam.r.girdwood, detheridge, jyri.sarha

On 06/27/2014 04:06 PM, Tomi Valkeinen wrote:
> On 27/06/14 15:26, Jyri Sarha wrote:
>> On 06/27/2014 03:11 PM, Tomi Valkeinen wrote:
>>> On 26/06/14 22:20, Jyri Sarha wrote:
>> ...
>>>> +static struct asoc_simple_card_info card_info = {
>>>> +    .name = "HDMI",
>>>> +    .card = "OMAPHDMI",
>>>> +    .codec_dai.name = "hdmi-hifi",
>>>> +};
>>>
>>> The above is not const. That, and the contents of the struct make me
>>> wonder, what happens if we have two HDMI instances?
>>>
>>> I know the core driver doesn't work with multiple instances yet, but as
>>> I mentioned, it has to be done sooner or later. And on the core driver
>>> side it should be quite straightforward.
>>>
>>> I'd rather not introduce new restrictions for that goal.
>>>
>>
>> Ok, I'll alloc that with devm_kzalloc().
>
> Do the strings in the struct need to be unique? If so, you probably need
> to append something to them based on the hdmi device instance.
>

I dont think they need to be unique, but it anyway makes sense to embed 
the HDMI device name into the audio device name, so I'll add it.

BTW, platform_device_register_data() memdups the platform data, so a 
stack variable should be Ok for asoc_simple_card_info.

Cheers,
Jyri

^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [PATCH 04/12] OMAPDSS: hdmi_audio: Integrated ASoC DAI component driver implementation
@ 2014-06-27 15:33           ` Jyri Sarha
  0 siblings, 0 replies; 60+ messages in thread
From: Jyri Sarha @ 2014-06-27 15:33 UTC (permalink / raw)
  To: Tomi Valkeinen, alsa-devel, linux-fbdev, linux-omap
  Cc: peter.ujfalusi, broonie, liam.r.girdwood, detheridge, jyri.sarha

On 06/27/2014 04:06 PM, Tomi Valkeinen wrote:
> On 27/06/14 15:26, Jyri Sarha wrote:
>> On 06/27/2014 03:11 PM, Tomi Valkeinen wrote:
>>> On 26/06/14 22:20, Jyri Sarha wrote:
>> ...
>>>> +static struct asoc_simple_card_info card_info = {
>>>> +    .name = "HDMI",
>>>> +    .card = "OMAPHDMI",
>>>> +    .codec_dai.name = "hdmi-hifi",
>>>> +};
>>>
>>> The above is not const. That, and the contents of the struct make me
>>> wonder, what happens if we have two HDMI instances?
>>>
>>> I know the core driver doesn't work with multiple instances yet, but as
>>> I mentioned, it has to be done sooner or later. And on the core driver
>>> side it should be quite straightforward.
>>>
>>> I'd rather not introduce new restrictions for that goal.
>>>
>>
>> Ok, I'll alloc that with devm_kzalloc().
>
> Do the strings in the struct need to be unique? If so, you probably need
> to append something to them based on the hdmi device instance.
>

I dont think they need to be unique, but it anyway makes sense to embed 
the HDMI device name into the audio device name, so I'll add it.

BTW, platform_device_register_data() memdups the platform data, so a 
stack variable should be Ok for asoc_simple_card_info.

Cheers,
Jyri

^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [PATCH 06/12] OMAPDSS: hdmi4: Register HDMI audio ASoC drivers from HDMI driver
  2014-06-27 11:39     ` Tomi Valkeinen
@ 2014-06-27 15:33       ` Jyri Sarha
  -1 siblings, 0 replies; 60+ messages in thread
From: Jyri Sarha @ 2014-06-27 15:33 UTC (permalink / raw)
  To: Tomi Valkeinen, alsa-devel, linux-fbdev, linux-omap
  Cc: peter.ujfalusi, broonie, liam.r.girdwood, detheridge, jyri.sarha

On 06/27/2014 02:39 PM, Tomi Valkeinen wrote:
> On 26/06/14 22:20, Jyri Sarha wrote:
...
>> +#if defined(CONFIG_OMAP4_DSS_HDMI_AUDIO)
>> +	/* drvdata is only used by HDMI audio */
>> +	hdmi.audio.hdmi_lock = &hdmi.lock;
>> +	hdmi.audio.wp = &hdmi.wp;
>> +	hdmi.audio.core = &hdmi.core;
>> +	hdmi.audio.cfg = &hdmi.cfg;
>> +	hdmi.audio.hdmi_dai_drv = &omap_hdmi_dai;
>> +	hdmi.audio.audio_start = hdmi4_audio_start;
>> +	hdmi.audio.audio_stop = hdmi4_audio_stop;
>> +	hdmi.audio.audio_config = hdmi4_audio_config;
>> +	dev_set_drvdata(&pdev->dev, &hdmi.audio);
>> +	r = hdmi_audio_register(pdev);
>> +	if (r) {
>> +		DSSERR("Registering HDMI audio failed\n");
>> +		hdmi_uninit_output(pdev);
>> +		pm_runtime_disable(&pdev->dev);
>> +		return r;
>> +	}
>> +#endif
>
> I don't think it's a good idea to reserve the driver data for audio. We
> need to change the hdmi drivers sooner or later to support multiple
> instances, and at that point having drvdata for audio will cause problems.
>
> If you don't want to make the hdmi struct public yet, maybe just add a
> function to this file which takes a pointer to the hdmi struct and
> returns the audio part. That way you can set the whole hdmi struct as
> driver data, which should be future safe.
>

Adding a function is not as simple as that because the OMAP4 and OMAP5 
structs are subtly different and hdmi_audio.c is common to both. I'll 
make the minimal changes to make the struct public.

Cheers,
Jyri

^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [PATCH 06/12] OMAPDSS: hdmi4: Register HDMI audio ASoC drivers from HDMI driver
@ 2014-06-27 15:33       ` Jyri Sarha
  0 siblings, 0 replies; 60+ messages in thread
From: Jyri Sarha @ 2014-06-27 15:33 UTC (permalink / raw)
  To: Tomi Valkeinen, alsa-devel, linux-fbdev, linux-omap
  Cc: peter.ujfalusi, broonie, liam.r.girdwood, detheridge, jyri.sarha

On 06/27/2014 02:39 PM, Tomi Valkeinen wrote:
> On 26/06/14 22:20, Jyri Sarha wrote:
...
>> +#if defined(CONFIG_OMAP4_DSS_HDMI_AUDIO)
>> +	/* drvdata is only used by HDMI audio */
>> +	hdmi.audio.hdmi_lock = &hdmi.lock;
>> +	hdmi.audio.wp = &hdmi.wp;
>> +	hdmi.audio.core = &hdmi.core;
>> +	hdmi.audio.cfg = &hdmi.cfg;
>> +	hdmi.audio.hdmi_dai_drv = &omap_hdmi_dai;
>> +	hdmi.audio.audio_start = hdmi4_audio_start;
>> +	hdmi.audio.audio_stop = hdmi4_audio_stop;
>> +	hdmi.audio.audio_config = hdmi4_audio_config;
>> +	dev_set_drvdata(&pdev->dev, &hdmi.audio);
>> +	r = hdmi_audio_register(pdev);
>> +	if (r) {
>> +		DSSERR("Registering HDMI audio failed\n");
>> +		hdmi_uninit_output(pdev);
>> +		pm_runtime_disable(&pdev->dev);
>> +		return r;
>> +	}
>> +#endif
>
> I don't think it's a good idea to reserve the driver data for audio. We
> need to change the hdmi drivers sooner or later to support multiple
> instances, and at that point having drvdata for audio will cause problems.
>
> If you don't want to make the hdmi struct public yet, maybe just add a
> function to this file which takes a pointer to the hdmi struct and
> returns the audio part. That way you can set the whole hdmi struct as
> driver data, which should be future safe.
>

Adding a function is not as simple as that because the OMAP4 and OMAP5 
structs are subtly different and hdmi_audio.c is common to both. I'll 
make the minimal changes to make the struct public.

Cheers,
Jyri

^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [PATCH 01/12] ARM: OMAP2+: Remove non working OMAP HDMI audio initialization
  2014-06-26 19:20   ` Jyri Sarha
@ 2014-07-07 11:46     ` Tony Lindgren
  -1 siblings, 0 replies; 60+ messages in thread
From: Tony Lindgren @ 2014-07-07 11:46 UTC (permalink / raw)
  To: Jyri Sarha
  Cc: alsa-devel, linux-fbdev, linux-omap, peter.ujfalusi, broonie,
	liam.r.girdwood, tomi.valkeinen, detheridge, jyri.sarha

* Jyri Sarha <jsarha@ti.com> [140626 12:26]:
> 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.

Is this OK to queue for v3.17 or do we need this for v3.16-rc series?

Regards,

Tony
 
> Signed-off-by: Jyri Sarha <jsarha@ti.com>
> ---
>  arch/arm/mach-omap2/devices.c |   28 ----------------------------
>  1 file changed, 28 deletions(-)
> 
> diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
> index 592ba0a..b6f8f34 100644
> --- a/arch/arm/mach-omap2/devices.c
> +++ b/arch/arm/mach-omap2/devices.c
> @@ -297,33 +297,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>
> @@ -459,7 +432,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()) {
> -- 
> 1.7.9.5
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [PATCH 01/12] ARM: OMAP2+: Remove non working OMAP HDMI audio initialization
@ 2014-07-07 11:46     ` Tony Lindgren
  0 siblings, 0 replies; 60+ messages in thread
From: Tony Lindgren @ 2014-07-07 11:46 UTC (permalink / raw)
  To: Jyri Sarha
  Cc: alsa-devel, linux-fbdev, linux-omap, peter.ujfalusi, broonie,
	liam.r.girdwood, tomi.valkeinen, detheridge, jyri.sarha

* Jyri Sarha <jsarha@ti.com> [140626 12:26]:
> 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.

Is this OK to queue for v3.17 or do we need this for v3.16-rc series?

Regards,

Tony
 
> Signed-off-by: Jyri Sarha <jsarha@ti.com>
> ---
>  arch/arm/mach-omap2/devices.c |   28 ----------------------------
>  1 file changed, 28 deletions(-)
> 
> diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
> index 592ba0a..b6f8f34 100644
> --- a/arch/arm/mach-omap2/devices.c
> +++ b/arch/arm/mach-omap2/devices.c
> @@ -297,33 +297,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>
> @@ -459,7 +432,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()) {
> -- 
> 1.7.9.5
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [PATCH 01/12] ARM: OMAP2+: Remove non working OMAP HDMI audio initialization
  2014-07-07 11:46     ` Tony Lindgren
@ 2014-07-08  7:30       ` Peter Ujfalusi
  -1 siblings, 0 replies; 60+ messages in thread
From: Peter Ujfalusi @ 2014-07-08  7:30 UTC (permalink / raw)
  To: Tony Lindgren, Jyri Sarha
  Cc: alsa-devel, linux-fbdev, linux-omap, broonie, liam.r.girdwood,
	tomi.valkeinen, detheridge, jyri.sarha

Hi Tony,

On 07/07/2014 02:46 PM, Tony Lindgren wrote:
> * Jyri Sarha <jsarha@ti.com> [140626 12:26]:
>> 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.
> 
> Is this OK to queue for v3.17 or do we need this for v3.16-rc series?

Jyri is away currently, but I think it would be great if this patch goes in
for 3.16. The patch does not introduce regression since the OMAP4/5 HDMI is in
non working state in the kernel so removing the platform device right now will
ease up the merger of the new and working code.

Regards,
Péter

> 
> Regards,
> 
> Tony
>  
>> Signed-off-by: Jyri Sarha <jsarha@ti.com>
>> ---
>>  arch/arm/mach-omap2/devices.c |   28 ----------------------------
>>  1 file changed, 28 deletions(-)
>>
>> diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
>> index 592ba0a..b6f8f34 100644
>> --- a/arch/arm/mach-omap2/devices.c
>> +++ b/arch/arm/mach-omap2/devices.c
>> @@ -297,33 +297,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>
>> @@ -459,7 +432,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()) {
>> -- 
>> 1.7.9.5
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>>



^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [PATCH 01/12] ARM: OMAP2+: Remove non working OMAP HDMI audio initialization
@ 2014-07-08  7:30       ` Peter Ujfalusi
  0 siblings, 0 replies; 60+ messages in thread
From: Peter Ujfalusi @ 2014-07-08  7:30 UTC (permalink / raw)
  To: Tony Lindgren, Jyri Sarha
  Cc: alsa-devel, linux-fbdev, linux-omap, broonie, liam.r.girdwood,
	tomi.valkeinen, detheridge, jyri.sarha

Hi Tony,

On 07/07/2014 02:46 PM, Tony Lindgren wrote:
> * Jyri Sarha <jsarha@ti.com> [140626 12:26]:
>> 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.
> 
> Is this OK to queue for v3.17 or do we need this for v3.16-rc series?

Jyri is away currently, but I think it would be great if this patch goes in
for 3.16. The patch does not introduce regression since the OMAP4/5 HDMI is in
non working state in the kernel so removing the platform device right now will
ease up the merger of the new and working code.

Regards,
Péter

> 
> Regards,
> 
> Tony
>  
>> Signed-off-by: Jyri Sarha <jsarha@ti.com>
>> ---
>>  arch/arm/mach-omap2/devices.c |   28 ----------------------------
>>  1 file changed, 28 deletions(-)
>>
>> diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
>> index 592ba0a..b6f8f34 100644
>> --- a/arch/arm/mach-omap2/devices.c
>> +++ b/arch/arm/mach-omap2/devices.c
>> @@ -297,33 +297,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>
>> @@ -459,7 +432,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()) {
>> -- 
>> 1.7.9.5
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>>


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

^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [PATCH 01/12] ARM: OMAP2+: Remove non working OMAP HDMI audio initialization
  2014-07-08  7:30       ` Peter Ujfalusi
@ 2014-07-08  8:09         ` Tony Lindgren
  -1 siblings, 0 replies; 60+ messages in thread
From: Tony Lindgren @ 2014-07-08  8:09 UTC (permalink / raw)
  To: Peter Ujfalusi
  Cc: Jyri Sarha, alsa-devel, linux-fbdev, linux-omap, broonie,
	liam.r.girdwood, tomi.valkeinen, detheridge, jyri.sarha

* Peter Ujfalusi <peter.ujfalusi@ti.com> [140708 00:32]:
> Hi Tony,
> 
> On 07/07/2014 02:46 PM, Tony Lindgren wrote:
> > * Jyri Sarha <jsarha@ti.com> [140626 12:26]:
> >> 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.
> > 
> > Is this OK to queue for v3.17 or do we need this for v3.16-rc series?
> 
> Jyri is away currently, but I think it would be great if this patch goes in
> for 3.16. The patch does not introduce regression since the OMAP4/5 HDMI is in
> non working state in the kernel so removing the platform device right now will
> ease up the merger of the new and working code.

OK, will apply it into omap-for-v3.16/fixes as it just removes broken code.

Regards,

Tony

^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [PATCH 01/12] ARM: OMAP2+: Remove non working OMAP HDMI audio initialization
@ 2014-07-08  8:09         ` Tony Lindgren
  0 siblings, 0 replies; 60+ messages in thread
From: Tony Lindgren @ 2014-07-08  8:09 UTC (permalink / raw)
  To: Peter Ujfalusi
  Cc: Jyri Sarha, alsa-devel, linux-fbdev, linux-omap, broonie,
	liam.r.girdwood, tomi.valkeinen, detheridge, jyri.sarha

* Peter Ujfalusi <peter.ujfalusi@ti.com> [140708 00:32]:
> Hi Tony,
> 
> On 07/07/2014 02:46 PM, Tony Lindgren wrote:
> > * Jyri Sarha <jsarha@ti.com> [140626 12:26]:
> >> 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.
> > 
> > Is this OK to queue for v3.17 or do we need this for v3.16-rc series?
> 
> Jyri is away currently, but I think it would be great if this patch goes in
> for 3.16. The patch does not introduce regression since the OMAP4/5 HDMI is in
> non working state in the kernel so removing the platform device right now will
> ease up the merger of the new and working code.

OK, will apply it into omap-for-v3.16/fixes as it just removes broken code.

Regards,

Tony

^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [PATCH 01/12] ARM: OMAP2+: Remove non working OMAP HDMI audio initialization
  2014-07-08  8:09         ` Tony Lindgren
@ 2014-07-15 19:25           ` Jyri Sarha
  -1 siblings, 0 replies; 60+ messages in thread
From: Jyri Sarha @ 2014-07-15 19:25 UTC (permalink / raw)
  To: Tony Lindgren, Peter Ujfalusi
  Cc: alsa-devel, linux-fbdev, linux-omap, broonie, liam.r.girdwood,
	tomi.valkeinen, detheridge, jyri.sarha

On 07/08/2014 11:09 AM, Tony Lindgren wrote:
> * Peter Ujfalusi <peter.ujfalusi@ti.com> [140708 00:32]:
>> Hi Tony,
>>
>> On 07/07/2014 02:46 PM, Tony Lindgren wrote:
>>> * Jyri Sarha <jsarha@ti.com> [140626 12:26]:
>>>> 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.
>>>
>>> Is this OK to queue for v3.17 or do we need this for v3.16-rc series?
>>
>> Jyri is away currently, but I think it would be great if this patch goes in
>> for 3.16. The patch does not introduce regression since the OMAP4/5 HDMI is in
>> non working state in the kernel so removing the platform device right now will
>> ease up the merger of the new and working code.
>
> OK, will apply it into omap-for-v3.16/fixes as it just removes broken code.
>

Thanks Tony and Peter!



^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [PATCH 01/12] ARM: OMAP2+: Remove non working OMAP HDMI audio initialization
@ 2014-07-15 19:25           ` Jyri Sarha
  0 siblings, 0 replies; 60+ messages in thread
From: Jyri Sarha @ 2014-07-15 19:25 UTC (permalink / raw)
  To: Tony Lindgren, Peter Ujfalusi
  Cc: alsa-devel, linux-fbdev, linux-omap, broonie, liam.r.girdwood,
	tomi.valkeinen, detheridge, jyri.sarha

On 07/08/2014 11:09 AM, Tony Lindgren wrote:
> * Peter Ujfalusi <peter.ujfalusi@ti.com> [140708 00:32]:
>> Hi Tony,
>>
>> On 07/07/2014 02:46 PM, Tony Lindgren wrote:
>>> * Jyri Sarha <jsarha@ti.com> [140626 12:26]:
>>>> 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.
>>>
>>> Is this OK to queue for v3.17 or do we need this for v3.16-rc series?
>>
>> Jyri is away currently, but I think it would be great if this patch goes in
>> for 3.16. The patch does not introduce regression since the OMAP4/5 HDMI is in
>> non working state in the kernel so removing the platform device right now will
>> ease up the merger of the new and working code.
>
> OK, will apply it into omap-for-v3.16/fixes as it just removes broken code.
>

Thanks Tony and Peter!



^ permalink raw reply	[flat|nested] 60+ messages in thread

end of thread, other threads:[~2014-07-15 19:25 UTC | newest]

Thread overview: 60+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-26 19:20 [PATCH 00/12] Rework OMAP4+ HDMI audio support Jyri Sarha
2014-06-26 19:20 ` Jyri Sarha
2014-06-26 19:20 ` [PATCH 01/12] ARM: OMAP2+: Remove non working OMAP HDMI audio initialization Jyri Sarha
2014-06-26 19:20   ` Jyri Sarha
2014-07-07 11:46   ` Tony Lindgren
2014-07-07 11:46     ` Tony Lindgren
2014-07-08  7:30     ` Peter Ujfalusi
2014-07-08  7:30       ` Peter Ujfalusi
2014-07-08  8:09       ` Tony Lindgren
2014-07-08  8:09         ` Tony Lindgren
2014-07-15 19:25         ` Jyri Sarha
2014-07-15 19:25           ` Jyri Sarha
2014-06-26 19:20 ` [PATCH 02/12] OMAPDSS: hdmi.h: Add HDMI_AUDIO_LAYOUT_6CH enum value Jyri Sarha
2014-06-26 19:20   ` Jyri Sarha
2014-06-26 19:20 ` [PATCH 03/12] OMAPDSS: hdmi_wp: Add function for getting hdmi_wp physical base address Jyri Sarha
2014-06-26 19:20   ` Jyri Sarha
2014-06-27 10:41   ` Tomi Valkeinen
2014-06-27 10:41     ` Tomi Valkeinen
2014-06-27 11:35     ` Jyri Sarha
2014-06-27 11:35       ` Jyri Sarha
2014-06-26 19:20 ` [PATCH 04/12] OMAPDSS: hdmi_audio: Integrated ASoC DAI component driver implementation Jyri Sarha
2014-06-26 19:20   ` Jyri Sarha
2014-06-27 11:10   ` Tomi Valkeinen
2014-06-27 11:10     ` Tomi Valkeinen
2014-06-27 11:57   ` Tomi Valkeinen
2014-06-27 11:57     ` Tomi Valkeinen
2014-06-27 12:06     ` Jyri Sarha
2014-06-27 12:06       ` Jyri Sarha
2014-06-27 12:11   ` Tomi Valkeinen
2014-06-27 12:11     ` Tomi Valkeinen
2014-06-27 12:26     ` Jyri Sarha
2014-06-27 12:26       ` Jyri Sarha
2014-06-27 13:06       ` Tomi Valkeinen
2014-06-27 13:06         ` Tomi Valkeinen
2014-06-27 15:33         ` Jyri Sarha
2014-06-27 15:33           ` Jyri Sarha
2014-06-26 19:20 ` [PATCH 05/12] OMAPDSS: Kconfig: Select audio dependencies if OMAP4_DSS_HDMI_AUDIO=y Jyri Sarha
2014-06-26 19:20   ` Jyri Sarha
2014-06-26 19:20 ` [PATCH 06/12] OMAPDSS: hdmi4: Register HDMI audio ASoC drivers from HDMI driver Jyri Sarha
2014-06-26 19:20   ` Jyri Sarha
2014-06-27 11:39   ` Tomi Valkeinen
2014-06-27 11:39     ` Tomi Valkeinen
2014-06-27 15:33     ` Jyri Sarha
2014-06-27 15:33       ` Jyri Sarha
2014-06-26 19:20 ` [PATCH 07/12] OMAPDSS: Kconfig: Select audio dependencies if OMAP5_DSS_HDMI_AUDIO=y Jyri Sarha
2014-06-26 19:20   ` Jyri Sarha
2014-06-27 11:49   ` Tomi Valkeinen
2014-06-27 11:49     ` Tomi Valkeinen
2014-06-26 19:20 ` [PATCH 08/12] OMAPDSS: hdmi5: Register HDMI audio ASoC drivers from HDMI driver Jyri Sarha
2014-06-26 19:20   ` Jyri Sarha
2014-06-26 19:21 ` [PATCH 09/12] ASoC: omap: Remove obsolete HDMI audio code and Kconfig options Jyri Sarha
2014-06-26 19:21   ` Jyri Sarha
2014-06-27 12:17   ` Mark Brown
2014-06-27 12:17     ` Mark Brown
2014-06-26 19:21 ` [PATCH 10/12] OMAPDSS: hdmi4: Remove callbacks for an external ASoC DAI driver Jyri Sarha
2014-06-26 19:21   ` Jyri Sarha
2014-06-26 19:21 ` [PATCH 11/12] OMAPDSS: hdmi5: " Jyri Sarha
2014-06-26 19:21   ` Jyri Sarha
2014-06-26 19:21 ` [PATCH 12/12] OMAPDSS: Remove all references to obsolete HDMI audio callbacks Jyri Sarha
2014-06-26 19:21   ` Jyri Sarha

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.