Skip to contentSkip to conversation

Beaglebone-Black HDMI audio

PATCH In review Jyri Sarha 8 participants 19 messages Sep 16, 2014 – Sep 29, 2014 2 messages not in the archive

Subsystems (8)
lore
Share & tools
lore

Jyri Sarha

author
#0 lore raw

v3 cover Beaglebone-Black HDMI audio

Changes since v2:
- Change compatible property from "ti,gpio-clock" to "ti,gpio-gate-clock"
- Some minor cleanups

The code has a functional dependency to:
http://www.mail-archive.com/[email protected]/msg109264.html

Without the above patch the audio card does not probe.

The code has been rebased on top of Linux 3.17-rc5. The patches bellow, the above dependency, and couple of commits to add BBB HDMI audio support to omap2plus_defconfig can be pulled from:

https://github.com/jsarha/linux.git linux-master-bbb-hdmi-audio

Cheers,
Jyri

Jyri Sarha (5):
clk: ti: add "ti,gpio-gate-clock" controlled clock drm/tilcdc: Add I2S HDMI audio config for tda998x
ASoC: davinci-evm: HDMI audio support for TDA998x trough McASP I2S
bus
ASoC: davinci: HDMI audio build for AM33XX and TDA998x
ARM: dts: am335x-boneblack: Add HDMI audio support

 .../bindings/clock/ti/gpio-gate-clock.txt          |   21 ++
 .../bindings/sound/davinci-evm-audio.txt           |    6 +-
 arch/arm/boot/dts/am335x-boneblack.dts             |   52 +++++
 drivers/clk/ti/Makefile                            |    2 +-
 drivers/clk/ti/gpio.c                              |  202 ++++++++++++++++++++
 drivers/gpu/drm/tilcdc/tilcdc_slave.c              |   24 ++-
 sound/soc/davinci/Kconfig                          |   12 ++
 sound/soc/davinci/davinci-evm.c                    |   82 +++++++-
 8 files changed, 395 insertions(+), 6 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/clock/ti/gpio-gate-clock.txt
 create mode 100644 drivers/clk/ti/gpio.c
Signature · 1 line
1.7.9.5
author
#1 lore raw

PATCH v3 1/5 clk: ti: add "ti,gpio-gate-clock" controlled clock

The added ti,gpio-gate-clock is a basic clock that can be enabled and disabled trough a gpio output. The DT binding document for the clock is also added. For EPROBE_DEFER handling the registering of the clock has to be delayed until of_clk_get() call time.

---
 .../bindings/clock/ti/gpio-gate-clock.txt          |   21 ++
 drivers/clk/ti/Makefile                            |    2 +-
 drivers/clk/ti/gpio.c                              |  202 ++++++++++++++++++++
 3 files changed, 224 insertions(+), 1 deletion(-)
 create mode 100644 Documentation/devicetree/bindings/clock/ti/gpio-gate-clock.txt
 create mode 100644 drivers/clk/ti/gpio.c
Documentation/devicetree/bindings/clock/ti/gpio-gate-clock.txt new file +21 -0
new file mode 100644
index 0000000..6156f82
@@ -0,0 +1,21 @@
+Binding for simple gpio controlled clock.
+
+This binding uses the common clock binding[1].
+
+[1] Documentation/devicetree/bindings/clock/clock-bindings.txt
+
+Required properties:
+- compatible : shall be "ti,gpio-gate-clock".
+- #clock-cells : from common clock binding; shall be set to 0.
+- enable-gpios : GPIO reference for enabling and disabling the clock.
+
+Optional properties:
+- clocks: Maximum of one parent clock is supported.
+
+Example:
+	clock {
+		compatible = "ti,gpio-gate-clock";
+		clocks = <&parentclk>;
+		#clock-cells = <0>;
+		enable-gpios = <&gpio 1 GPIO_ACTIVE_HIGH>;
+	};
drivers/clk/ti/Makefile +1 -1
index ed4d0aa..88074d3 100644
@@ -1,7 +1,7 @@
 ifneq ($(CONFIG_OF),)
 obj-y					+= clk.o autoidle.o clockdomain.o
 clk-common				= dpll.o composite.o divider.o gate.o \
-					  fixed-factor.o mux.o apll.o
+					  fixed-factor.o mux.o apll.o gpio.o
 obj-$(CONFIG_SOC_AM33XX)		+= $(clk-common) clk-33xx.o
 obj-$(CONFIG_ARCH_OMAP2)		+= $(clk-common) interface.o clk-2xxx.o
 obj-$(CONFIG_ARCH_OMAP3)		+= $(clk-common) interface.o clk-3xxx.o
drivers/clk/ti/gpio.c new file +202 -0

202 lines not on this page · raw message

Signature · 1 line
1.7.9.5
#2 lore raw

Re: [PATCH v3 1/5] clk: ti: add "ti,gpio-gate-clock" controlled clock

Quoted 5 lines · Jyri Sarha

The added ti,gpio-gate-clock is a basic clock that can be enabled and disabled trough a gpio output. The DT binding document for the clock is also added. For EPROBE_DEFER handling the registering of the clock has to be delayed until of_clk_get() call time.

Quoted 8 lines
---
 .../bindings/clock/ti/gpio-gate-clock.txt          |   21 ++
 drivers/clk/ti/Makefile                            |    2 +-
 drivers/clk/ti/gpio.c                              |  202 ++++++++++++++++++++
 3 files changed, 224 insertions(+), 1 deletion(-)
 create mode 100644 Documentation/devicetree/bindings/clock/ti/gpio-gate-clock.txt
 create mode 100644 drivers/clk/ti/gpio.c

Why is this a TI clock? Sounds like a generic one to me.

In any case, this should go through Mike.

Tomi

#3 lore raw

Re: [PATCH v3 1/5] clk: ti: add "ti,gpio-gate-clock" controlled clock

Quoted 15 lines · Tomi Valkeinen
Quoted 5 lines · Jyri Sarha

The added ti,gpio-gate-clock is a basic clock that can be enabled and disabled trough a gpio output. The DT binding document for the clock is also added. For EPROBE_DEFER handling the registering of the clock has to be delayed until of_clk_get() call time.

Quoted 8 lines
---
 .../bindings/clock/ti/gpio-gate-clock.txt          |   21 ++
 drivers/clk/ti/Makefile                            |    2 +-
 drivers/clk/ti/gpio.c                              |  202 ++++++++++++++++++++
 3 files changed, 224 insertions(+), 1 deletion(-)
 create mode 100644 Documentation/devicetree/bindings/clock/ti/gpio-gate-clock.txt
 create mode 100644 drivers/clk/ti/gpio.c
Quoted 1 line

Why is this a TI clock? Sounds like a generic one to me.

Like thread: https://lkml.org/lkml/2014/9/5/284 ?

Quoted 3 lines

In any case, this should go through Mike.

yep - should have been posted independent of this series :).

Signature · 2 lines
Regards,
Nishanth Menon
#4 lore raw

Re: [PATCH v3 1/5] clk: ti: add "ti,gpio-gate-clock" controlled clock

Quoted 16 lines · Nishanth Menon
Quoted 15 lines · Tomi Valkeinen
Quoted 13 lines · Jyri Sarha

The added ti,gpio-gate-clock is a basic clock that can be enabled and disabled trough a gpio output. The DT binding document for the clock is also added. For EPROBE_DEFER handling the registering of the clock has to be delayed until of_clk_get() call time.

---
 .../bindings/clock/ti/gpio-gate-clock.txt          |   21 ++
 drivers/clk/ti/Makefile                            |    2 +-
 drivers/clk/ti/gpio.c                              |  202 ++++++++++++++++++++
 3 files changed, 224 insertions(+), 1 deletion(-)
 create mode 100644 Documentation/devicetree/bindings/clock/ti/gpio-gate-clock.txt
 create mode 100644 drivers/clk/ti/gpio.c
Quoted 3 lines
Quoted 1 line

Why is this a TI clock? Sounds like a generic one to me.

Like thread: https://lkml.org/lkml/2014/9/5/284 ?

Right, I should've read the earlier versions before making any smart comments =).

Tomi

#5 lore raw

Re: [PATCH v3 1/5] clk: ti: add "ti,gpio-gate-clock" controlled clock

Quoting Tomi Valkeinen (2014-09-19 06:25:48)

Quoted 17 lines · Nishanth Menon
Quoted 16 lines · Tomi Valkeinen
Quoted 15 lines · Jyri Sarha
Quoted 13 lines

The added ti,gpio-gate-clock is a basic clock that can be enabled and disabled trough a gpio output. The DT binding document for the clock is also added. For EPROBE_DEFER handling the registering of the clock has to be delayed until of_clk_get() call time.

---
 .../bindings/clock/ti/gpio-gate-clock.txt          |   21 ++
 drivers/clk/ti/Makefile                            |    2 +-
 drivers/clk/ti/gpio.c                              |  202 ++++++++++++++++++++
 3 files changed, 224 insertions(+), 1 deletion(-)
 create mode 100644 Documentation/devicetree/bindings/clock/ti/gpio-gate-clock.txt
 create mode 100644 drivers/clk/ti/gpio.c
Quoted 6 lines
Quoted 3 lines
Quoted 1 line

Why is this a TI clock? Sounds like a generic one to me.

Like thread: https://lkml.org/lkml/2014/9/5/284 ?

Right, I should've read the earlier versions before making any smart comments =).

No supporters cropped up for the generic gpio clock, but the design is common enough to merit a common clock type. And all of that stuff I said about the machine-specific ops isn't that relevant since it is hidden behing the gpio api.

Regards,
Mike

Quoted 4 lines

Tomi

author
#6 lore raw

PATCH v3 2/5 drm/tilcdc: Add I2S HDMI audio config for tda998x

In reply to Jyri Sarha

The configuration is needed for HDMI audio. The "swap" and "mirr" parameters have to be correctly set in the configuration in order to have proper colors in the HDMI picture.

---
 drivers/gpu/drm/tilcdc/tilcdc_slave.c |   24 +++++++++++++++++++++++-
 1 file changed, 23 insertions(+), 1 deletion(-)
drivers/gpu/drm/tilcdc/tilcdc_slave.c +23 -1
index 3775fd4..5dd8d78 100644
@@ -19,6 +19,7 @@
 #include <linux/pinctrl/pinmux.h>
 #include <linux/pinctrl/consumer.h>
 #include <drm/drm_encoder_slave.h>
+#include <drm/i2c/tda998x.h>
 
 #include "tilcdc_drv.h"
 
@@ -111,8 +112,29 @@ static const struct drm_encoder_helper_funcs slave_encoder_helper_funcs = {
 		.restore        = drm_i2c_encoder_restore,
 };
 
+static struct tda998x_encoder_params tda998x_pdata = {
+	.swap_b = 0x3,
+	.mirr_b = 0x0,
+	.swap_a = 0x2,
+	.mirr_a = 0x0,
+	.swap_d = 0x1,
+	.mirr_d = 0x0,
+	.swap_c = 0x0,
+	.mirr_c = 0x0,
+	.swap_f = 0x5,
+	.mirr_f = 0x0,
+	.swap_e = 0x4,
+	.mirr_e = 0x0,
+	.audio_cfg = 0x3,	/* I2S mode */
+	.audio_clk_cfg = 1,	/* select clock pin */
+	.audio_frame[1] = 1,	/* channels - 1 */
+	.audio_format = AFMT_I2S,
+	.audio_sample_rate = 48000,
+};
+
 static const struct i2c_board_info info = {
-		I2C_BOARD_INFO("tda998x", 0x70)
+		I2C_BOARD_INFO("tda998x", 0x70),
+		.platform_data = &tda998x_pdata,
 };
 
 static struct drm_encoder *slave_encoder_create(struct drm_device *dev,
Signature · 1 line
1.7.9.5

A message that is not in the archive (sent off-list or not yet received): [email protected]

#8 lore raw

PATCH v3 3/5 ASoC: davinci-evm: HDMI audio support for TDA998x trough McASP I2S bus

Add machine driver support for BeagleBone-Black HDMI audio. BBB has NXP TDA998X HDMI transmitter connected to McASP port in I2S mode. The 44100 Hz sample-rate and it's multiples can not be accurately produced on BBB. The only supported sample format is SNDRV_PCM_FORMAT_S32_LE. The 8 least significant bits are ignored.

---
 .../bindings/sound/davinci-evm-audio.txt           |    6 +-
 sound/soc/davinci/davinci-evm.c                    |   82 +++++++++++++++++++-
 2 files changed, 84 insertions(+), 4 deletions(-)
Documentation/devicetree/bindings/sound/davinci-evm-audio.txt +4 -2
index 963e100..7560146 100644
@@ -1,7 +1,9 @@
-* Texas Instruments SoC audio setups with TLV320AIC3X Codec
+* TI SoC audio using McASP to connect to TLV320AIC3X or HDMI endcoder
 
 Required properties:
-- compatible : "ti,da830-evm-audio" : forDM365/DA8xx/OMAPL1x/AM33xx
+- compatible: should contain one of:
+    * "ti,da830-evm-audio" for DM365/DA8xx/OMAPL1x/AM33xx with TLV320AIC3X
+    * "ti,beaglebone-black-audio" for Beaglebone-black HDMI audio
 - ti,model : The user-visible name of this sound complex.
 - ti,audio-codec : The phandle of the TLV320AIC3x audio codec
 - ti,mcasp-controller : The phandle of the McASP controller
sound/soc/davinci/davinci-evm.c +80 -2

121 lines not on this page · raw message

Signature · 6 lines
1.7.9.5

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

PATCH v3 5/5 ARM: dts: am335x-boneblack: Add HDMI audio support

In reply to a message not in the archive

Adds mcasp0_pins, clk_mcasp0_fixed, clk_mcasp0, mcasp0, hdmi_audio, and sound nodes.

---
 arch/arm/boot/dts/am335x-boneblack.dts |   52 ++++++++++++++++++++++++++++++++
 1 file changed, 52 insertions(+)
arch/arm/boot/dts/am335x-boneblack.dts +52 -0
index 305975d..1487f7c 100644
@@ -59,12 +59,35 @@
 			0x1b0 0x03      /* xdma_event_intr0, OMAP_MUX_MODE3 | AM33XX_PIN_OUTPUT */
 		>;
 	};
+
+	mcasp0_pins: mcasp0_pins {
+		pinctrl-single,pins = <
+			0x1ac (PIN_INPUT_PULLUP | MUX_MODE0)	/* mcasp0_ahclkx.mcasp0_ahclkx */
+			0x19c (PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* mcasp0_ahclkr.mcasp0_axr2 */
+			0x194 (PIN_OUTPUT_PULLUP | MUX_MODE0)	/* mcasp0_fsx.mcasp0_fsx */
+			0x190 (PIN_OUTPUT_PULLDOWN | MUX_MODE0)	/* mcasp0_aclkx.mcasp0_aclkx */
+			0x06c (PIN_OUTPUT_PULLDOWN | MUX_MODE7)	/* gpmc_a11.GPIO1_27 */
+		>;
+	};
 };
 
 &lcdc {
 	status = "okay";
 };
 
+&mcasp0	{
+	pinctrl-names = "default";
+	pinctrl-0 = <&mcasp0_pins>;
+	status = "okay";
+	op-mode = <0>;	/* MCASP_IIS_MODE */
+	tdm-slots = <2>;
+	serial-dir = <	/* 0: INACTIVE, 1: TX, 2: RX */
+			0 0 1 0
+		>;
+	tx-num-evt = <1>;
+	rx-num-evt = <1>;
+};
+
 / {
 	hdmi {
 		compatible = "ti,tilcdc,slave";
@@ -74,4 +97,33 @@
 		pinctrl-1 = <&nxp_hdmi_bonelt_off_pins>;
 		status = "okay";
 	};
+
+	clk_mcasp0_fixed: clk_mcasp0_fixed {
+	      #clock-cells = <0>;
+	      compatible = "fixed-clock";
+	      clock-frequency = <24576000>;
+	};
+
+	clk_mcasp0: clk_mcasp0 {
+	      #clock-cells = <0>;
+	      compatible = "ti,gpio-gate-clock";
+	      clocks = <&clk_mcasp0_fixed>;
+	      enable-gpios = <&gpio1 27 0>; /* BeagleBone Black Clk enable on GPIO1_27 */
+	};
+
+	hdmi_audio: hdmi_audio@0 {
+	       compatible = "linux,hdmi-audio";
+	       status = "okay";
+	};
+
+	sound {
+		compatible = "ti,beaglebone-black-audio";
+		ti,model = "TI BeagleBone Black";
+		ti,audio-codec = <&hdmi_audio>;
+		ti,mcasp-controller = <&mcasp0>;
+		ti,audio-routing =
+			"HDMI Out",	"TX";
+		clocks = <&clk_mcasp0>;
+		clock-names = "mclk";
+	};
 };
Signature · 6 lines
1.7.9.5

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

Re: [PATCH v3 5/5] ARM: dts: am335x-boneblack: Add HDMI audio support

This patch is invalid now that Mike Turquette took the generic clk-gpio-gate in. The other patches in the series are still Ok.

I'll mail a new dts patch shortly.

Best regards,
Jyri

Quoted 83 lines · Jyri Sarha

Adds mcasp0_pins, clk_mcasp0_fixed, clk_mcasp0, mcasp0, hdmi_audio, and sound nodes.

---
  arch/arm/boot/dts/am335x-boneblack.dts |   52 ++++++++++++++++++++++++++++++++
  1 file changed, 52 insertions(+)
arch/arm/boot/dts/am335x-boneblack.dts +52 -0
index 305975d..1487f7c 100644
@@ -59,12 +59,35 @@
  			0x1b0 0x03      /* xdma_event_intr0, OMAP_MUX_MODE3 | AM33XX_PIN_OUTPUT */
  		>;
  	};
+
+	mcasp0_pins: mcasp0_pins {
+		pinctrl-single,pins = <
+			0x1ac (PIN_INPUT_PULLUP | MUX_MODE0)	/* mcasp0_ahclkx.mcasp0_ahclkx */
+			0x19c (PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* mcasp0_ahclkr.mcasp0_axr2 */
+			0x194 (PIN_OUTPUT_PULLUP | MUX_MODE0)	/* mcasp0_fsx.mcasp0_fsx */
+			0x190 (PIN_OUTPUT_PULLDOWN | MUX_MODE0)	/* mcasp0_aclkx.mcasp0_aclkx */
+			0x06c (PIN_OUTPUT_PULLDOWN | MUX_MODE7)	/* gpmc_a11.GPIO1_27 */
+		>;
+	};
  };
 
  &lcdc {
  	status = "okay";
  };
 
+&mcasp0	{
+	pinctrl-names = "default";
+	pinctrl-0 = <&mcasp0_pins>;
+	status = "okay";
+	op-mode = <0>;	/* MCASP_IIS_MODE */
+	tdm-slots = <2>;
+	serial-dir = <	/* 0: INACTIVE, 1: TX, 2: RX */
+			0 0 1 0
+		>;
+	tx-num-evt = <1>;
+	rx-num-evt = <1>;
+};
+
  / {
  	hdmi {
  		compatible = "ti,tilcdc,slave";
@@ -74,4 +97,33 @@
  		pinctrl-1 = <&nxp_hdmi_bonelt_off_pins>;
  		status = "okay";
  	};
+
+	clk_mcasp0_fixed: clk_mcasp0_fixed {
+	      #clock-cells = <0>;
+	      compatible = "fixed-clock";
+	      clock-frequency = <24576000>;
+	};
+
+	clk_mcasp0: clk_mcasp0 {
+	      #clock-cells = <0>;
+	      compatible = "ti,gpio-gate-clock";
+	      clocks = <&clk_mcasp0_fixed>;
+	      enable-gpios = <&gpio1 27 0>; /* BeagleBone Black Clk enable on GPIO1_27 */
+	};
+
+	hdmi_audio: hdmi_audio@0 {
+	       compatible = "linux,hdmi-audio";
+	       status = "okay";
+	};
+
+	sound {
+		compatible = "ti,beaglebone-black-audio";
+		ti,model = "TI BeagleBone Black";
+		ti,audio-codec = <&hdmi_audio>;
+		ti,mcasp-controller = <&mcasp0>;
+		ti,audio-routing =
+			"HDMI Out",	"TX";
+		clocks = <&clk_mcasp0>;
+		clock-names = "mclk";
+	};
  };
author
#11 lore raw

PATCH v3 4/5 ASoC: davinci: HDMI audio build for AM33XX and TDA998x

In reply to Jyri Sarha

Adds configuration option for HDMI audio support for AM33XX based boards with NXP TDA998x HDMI transmitter. The audio is connected to NXP TDA998x trough McASP running in i2s mode.

---
 sound/soc/davinci/Kconfig |   12 ++++++++++++
 1 file changed, 12 insertions(+)
sound/soc/davinci/Kconfig +12 -0
index d69510c..0c8f143 100644
@@ -43,6 +43,18 @@ config SND_AM33XX_SOC_EVM
 	  AM335X-EVMSK, and BeagelBone with AudioCape boards have this
 	  setup.
 
+config SND_AM335X_SOC_NXPTDA_EVM
+	tristate "HDMI Audio for the AM33XX chip based boards with TDA998x"
+	depends on SND_EDMA_SOC && SOC_AM33XX && DRM_I2C_NXP_TDA998X
+	select SND_SOC_HDMI_CODEC
+	select SND_DAVINCI_SOC_MCASP
+	select SND_DAVINCI_SOC_GENERIC_EVM
+	help
+	  Say Y or M if you want to add support for HDMI SoC audio on
+	  AM33XX boards with NXP TDA998x HDMI transmitter. For example
+	  BeagleBoneBack. The audio is connected to NXP TDA998x trough
+	  McASP running in i2s mode.
+
 config SND_DAVINCI_SOC_EVM
 	tristate "SoC Audio support for DaVinci DM6446, DM355 or DM365 EVM"
 	depends on SND_DAVINCI_SOC && I2C
Signature · 1 line
1.7.9.5
maintainer
#12 lore raw

Re: [PATCH v3 4/5] ASoC: davinci: HDMI audio build for AM33XX and TDA998x

Quoted 3 lines · Jyri Sarha

Adds configuration option for HDMI audio support for AM33XX based boards with NXP TDA998x HDMI transmitter. The audio is connected to NXP TDA998x trough McASP running in i2s mode.

So, Jean-Francois is also trying to do things with the TDA998x - what's the story with that, is this joined up at all?

author
#13 lore raw

Re: [PATCH v3 4/5] ASoC: davinci: HDMI audio build for AM33XX and TDA998x

Quoted 8 lines · Mark Brown
Quoted 3 lines · Jyri Sarha

Adds configuration option for HDMI audio support for AM33XX based boards with NXP TDA998x HDMI transmitter. The audio is connected to NXP TDA998x trough McASP running in i2s mode.

So, Jean-Francois is also trying to do things with the TDA998x - what's the story with that, is this joined up at all?

Not really. This basic functionality does not touch tda998x at all on the fly, but just sets i2s configuation in the beginning and bangs the bits trough McASP. But as long as the old platform data for tda998x still works after Jean-Francois' patches I should be safe.

The problem with the Jean-Francois' patches is the DT support. The BBB HDMI video is implemented trough tilcdc-slave mechanism without a DT node for the tda encoder, which renders Jean-Francois' approach unusable for BBB.

The whole tilcdc slave approach may not be the most elegant way to use the tda driver, but it does not look like it is going to change any time soon.

Best regards,
Jyri

ps. I have been thinking on something similar to Jean-Francois' patch for SiI9022 which I have been working on lately. Also I have been wondering if it would be possible to come up with a generic ASoC codec component driver or library that could be used with any HDMI encoder to produce the ASoC codec component. Unfortunately I am in too early stage to produce anything more concrete.

#14 lore raw

Re: [PATCH v3 4/5] ASoC: davinci: HDMI audio build for AM33XX and TDA998x

Quoted 7 lines · On Thu, 18 Sep 2014 00:13:09 +0300 Jyri Sarha <[email protected]> wrote:
Quoted 2 lines

So, Jean-Francois is also trying to do things with the TDA998x - what's the story with that, is this joined up at all?

Not really. This basic functionality does not touch tda998x at all on the fly, but just sets i2s configuation in the beginning and bangs the bits trough McASP. But as long as the old platform data for tda998x still works after Jean-Francois' patches I should be safe.

It should. And you may test it.

Quoted 4 lines

The problem with the Jean-Francois' patches is the DT support. The BBB HDMI video is implemented trough tilcdc-slave mechanism without a DT node for the tda encoder, which renders Jean-Francois' approach unusable for BBB.

I used the TDA998x with DT support for a long time with a hack by using parts of drm_i2c_encoder_init(). Now, I think that this function could be used as it is just setting no platform_data in info.

Quoted 3 lines

The whole tilcdc slave approach may not be the most elegant way to use the tda driver, but it does not look like it is going to change any time soon.

Right: I proposed a patch for that and it was rejected.

Quoted 9 lines

Best regards,
Jyri

ps. I have been thinking on something similar to Jean-Francois' patch for SiI9022 which I have been working on lately. Also I have been wondering if it would be possible to come up with a generic ASoC codec component driver or library that could be used with any HDMI encoder to produce the ASoC codec component. Unfortunately I am in too early stage to produce anything more concrete.

Here are some thoughts about this topic.

The video and audio worlds don't know about each other. The only solution I found is to let the encoder create the codec as a child device. Then, the codec knows from which encoder it depends. This could have been done using Russell's components, but the codec should have been declared in the DT. This is not useful.

The codec interacts with the encoder in 2 ways:
- it uses the HDMI parameters retrieved by the encoder,
- it gives the audio source type to the encoder.
I used exported functions for that, but, for a generic codec, theses functions could be given through the codec platform_data.

The codec declares the DAI(s) prior to know the encoder. The DAI table must be in the codec because of the snd_soc_dai_ops.
For a generic codec, this DAI table could be built dynamically from information (name, id) also given through the codec platform_data.

Signature · 6 lines
Ken ar c'hentañ	|	      ** Breizh ha Linux atav! **
Jef		|		http://moinejf.free.fr/
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
author
#15 lore raw

Re: [PATCH v3 4/5] ASoC: davinci: HDMI audio build for AM33XX and TDA998x

Quoted 6 lines · Jean-Francois Moine
Quoted 3 lines · On Thu, 18 Sep 2014 00:13:09 +0300 Jyri Sarha <[email protected]> wrote:
Quoted 2 lines

So, Jean-Francois is also trying to do things with the TDA998x - what's the story with that, is this joined up at all?

Quoted 7 lines
Quoted 4 lines

Not really. This basic functionality does not touch tda998x at all on the fly, but just sets i2s configuation in the beginning and bangs the bits trough McASP. But as long as the old platform data for tda998x still works after Jean-Francois' patches I should be safe.

It should. And you may test it.

I tested by BBB HDMI audio patches with "[PATCH v5] ASoC: tda998x: Add a codec to the HDMI transmitter", and it works otherwise, but the default for CTS_N_K has changed from 3 to 2. I just needed to change the supported format from S32_LE to S24_LE to compensate the change.

Quoted 9 lines
Quoted 4 lines

The problem with the Jean-Francois' patches is the DT support. The BBB HDMI video is implemented trough tilcdc-slave mechanism without a DT node for the tda encoder, which renders Jean-Francois' approach unusable for BBB.

I used the TDA998x with DT support for a long time with a hack by using parts of drm_i2c_encoder_init(). Now, I think that this function could be used as it is just setting no platform_data in info.

Quoted 6 lines
Quoted 3 lines

The whole tilcdc slave approach may not be the most elegant way to use the tda driver, but it does not look like it is going to change any time soon.

Right: I proposed a patch for that and it was rejected.

The tilcdc is not actively maintained by anybody ATM and that is why it is so hard to make any bigger changes to it. I hope we can change this at some point, but for now I am just trying to get a simple HDMI audio working on BBB with minimal changes.

Quoted 10 lines
Quoted 9 lines

Best regards,
Jyri

ps. I have been thinking on something similar to Jean-Francois' patch for SiI9022 which I have been working on lately. Also I have been wondering if it would be possible to come up with a generic ASoC codec component driver or library that could be used with any HDMI encoder to produce the ASoC codec component. Unfortunately I am in too early stage to produce anything more concrete.

Quoted 8 lines

Here are some thoughts about this topic.

The video and audio worlds don't know about each other. The only solution I found is to let the encoder create the codec as a child device. Then, the codec knows from which encoder it depends. This could have been done using Russell's components, but the codec should have been declared in the DT. This is not useful.

There is anothere option of putting the ASoC codec code into an ASoC library module and registering the ASoC codec component under the HDMI encoder device. However, this approach does not allow building the ASoC as modules if the HDMI encoder driver is built in. So a separate platform device for the codec component is probably better.

Quoted 11 lines

The codec interacts with the encoder in 2 ways:
- it uses the HDMI parameters retrieved by the encoder,
- it gives the audio source type to the encoder.
I used exported functions for that, but, for a generic codec, theses functions could be given through the codec platform_data.

The codec declares the DAI(s) prior to know the encoder. The DAI table must be in the codec because of the snd_soc_dai_ops.
For a generic codec, this DAI table could be built dynamically from information (name, id) also given through the codec platform_data.

This is pretty much what I have been thinking too. The API between the generic ASoC HDMI codec could use already existing the linux headers derived HDMI standard. The ASoC side code should build the hdmi audio infoframe and configure the stream header bits etc, so basically do all the generic stuff coming from HDMI standard. Writing the bits to the appropriate registers in the encoder chip would be left to the HDMI encoder driver.

Best regards,
Jyri

maintainer
#16 lore raw
In reply to Jyri Sarha
Quoted 7 lines · Jyri Sarha

Changes since v2:
- Change compatible property from "ti,gpio-clock" to "ti,gpio-gate-clock"
- Some minor cleanups

The code has a functional dependency to:
http://www.mail-archive.com/[email protected]/msg109264.html

Quoted 7 lines

Without the above patch the audio card does not probe.

The code has been rebased on top of Linux 3.17-rc5. The patches bellow, the above dependency, and couple of commits to add BBB HDMI audio support to omap2plus_defconfig can be pulled from:

https://github.com/jsarha/linux.git linux-master-bbb-hdmi-audio

How do you intend to get this merge, sending patchsets like this without indication to maintainers on a merge strategy is kinda messy.

I'm not sure how maintained tilcdc is.

Dave.

Quoted 31 lines

Cheers,
Jyri

Jyri Sarha (5):
clk: ti: add "ti,gpio-gate-clock" controlled clock drm/tilcdc: Add I2S HDMI audio config for tda998x
ASoC: davinci-evm: HDMI audio support for TDA998x trough McASP I2S
bus
ASoC: davinci: HDMI audio build for AM33XX and TDA998x
ARM: dts: am335x-boneblack: Add HDMI audio support

 .../bindings/clock/ti/gpio-gate-clock.txt          |   21 ++
 .../bindings/sound/davinci-evm-audio.txt           |    6 +-
 arch/arm/boot/dts/am335x-boneblack.dts             |   52 +++++
 drivers/clk/ti/Makefile                            |    2 +-
 drivers/clk/ti/gpio.c                              |  202 ++++++++++++++++++++
 drivers/gpu/drm/tilcdc/tilcdc_slave.c              |   24 ++-
 sound/soc/davinci/Kconfig                          |   12 ++
 sound/soc/davinci/davinci-evm.c                    |   82 +++++++-
 8 files changed, 395 insertions(+), 6 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/clock/ti/gpio-gate-clock.txt
 create mode 100644 drivers/clk/ti/gpio.c

--
1.7.9.5

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

A message that is not in the archive (sent off-list or not yet received): CAPM=9txRReSdcB5j+0dKmrDNM94zANu-q7ZfWHtP2iA54Dieig-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#18 lore raw
Quoted 14 lines · Dave Airlie
Quoted 13 lines · Jyri Sarha

Changes since v2:
- Change compatible property from "ti,gpio-clock" to "ti,gpio-gate-clock"
- Some minor cleanups

The code has a functional dependency to:
http://www.mail-archive.com/[email protected]/msg109264.html

Without the above patch the audio card does not probe.

The code has been rebased on top of Linux 3.17-rc5. The patches bellow, the above dependency, and couple of commits to add BBB HDMI audio support to omap2plus_defconfig can be pulled from:

Quoted 7 lines
Quoted 1 line

https://github.com/jsarha/linux.git linux-master-bbb-hdmi-audio

How do you intend to get this merge, sending patchsets like this without indication to maintainers on a merge strategy is kinda messy.

I'm not sure how maintained tilcdc is.

Well, it is used but AFAIK the people who have been working with it the most have left TI. I think eventually someone at TI needs to take it over, but I do not know anything about that.

I was hoping that because the change to tilcdc is quite minimal it could go in via you. I am sure I could get a reviewed-by and tested-by from from Darren how has bit more experience with tilcdc and maybe from Tomi too if that helps. (Adding Tomi to cc).

The "drm/tilcdc: Add I2S HDMI audio config for tda998x"-patch itself just adds the audio configuration to pda998x pdata and fills the swap, and mirr parameters with default values (they are usually coming in hard coded at the beginning of tda998x_create()).

Best regards,
Jyri
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#19 lore raw
Quoted 34 lines · Jyri Sarha
Quoted 16 lines · Dave Airlie
Quoted 15 lines · Jyri Sarha

Changes since v2:
- Change compatible property from "ti,gpio-clock" to "ti,gpio-gate-clock"
- Some minor cleanups

The code has a functional dependency to:
http://www.mail-archive.com/[email protected]/msg109264.html

Without the above patch the audio card does not probe.

The code has been rebased on top of Linux 3.17-rc5. The patches bellow, the above dependency, and couple of commits to add BBB HDMI audio
support to omap2plus_defconfig can be pulled from:

Quoted 7 lines
Quoted 1 line

https://github.com/jsarha/linux.git linux-master-bbb-hdmi-audio

How do you intend to get this merge, sending patchsets like this without indication to maintainers on a merge strategy is kinda messy.

I'm not sure how maintained tilcdc is.

Well, it is used but AFAIK the people who have been working with it the most have left TI. I think eventually someone at TI needs to take it over, but I do not know anything about that.

I was hoping that because the change to tilcdc is quite minimal it could go in via you. I am sure I could get a reviewed-by and tested-by from from Darren how has bit more experience with tilcdc and maybe from Tomi too if that helps. (Adding Tomi to cc).

Quoted 4 lines

The "drm/tilcdc: Add I2S HDMI audio config for tda998x"-patch itself just adds the audio configuration to pda998x pdata and fills the swap, and mirr parameters with default values (they are usually coming in hard coded at the beginning of tda998x_create()).

I think Dave's point was that the series touches three different subsystems, and you didn't give any thoughts about how this could be merged.

Must this be merged in one piece, because xxx depends on yyy etc? Can these all be merged separately, via respective trees? If in one piece, you could ask acks from Mr x and Mr y, for the parts they maintain. Etc. And of course, it'd be good to include all the maintainers (At least Mike was missing).

I think the clock patch could be handled totally separate, as it's in no way related to HDMI. The video and audio part may be handled together, if they have dependencies.

Tomi

author
#20 lore raw
Quoted 49 lines · Tomi Valkeinen
Quoted 34 lines · Jyri Sarha
Quoted 16 lines · Dave Airlie
Quoted 15 lines · Jyri Sarha

Changes since v2:
- Change compatible property from "ti,gpio-clock" to "ti,gpio-gate-clock"
- Some minor cleanups

The code has a functional dependency to:
http://www.mail-archive.com/[email protected]/msg109264.html

Without the above patch the audio card does not probe.

The code has been rebased on top of Linux 3.17-rc5. The patches bellow, the above dependency, and couple of commits to add BBB HDMI audio
support to omap2plus_defconfig can be pulled from:

Quoted 7 lines
Quoted 1 line

https://github.com/jsarha/linux.git linux-master-bbb-hdmi-audio

How do you intend to get this merge, sending patchsets like this without indication to maintainers on a merge strategy is kinda messy.

I'm not sure how maintained tilcdc is.

Well, it is used but AFAIK the people who have been working with it the most have left TI. I think eventually someone at TI needs to take it over, but I do not know anything about that.

I was hoping that because the change to tilcdc is quite minimal it could go in via you. I am sure I could get a reviewed-by and tested-by from from Darren how has bit more experience with tilcdc and maybe from Tomi too if that helps. (Adding Tomi to cc).

Quoted 4 lines

The "drm/tilcdc: Add I2S HDMI audio config for tda998x"-patch itself just adds the audio configuration to pda998x pdata and fills the swap, and mirr parameters with default values (they are usually coming in hard coded at the beginning of tda998x_create()).

I think Dave's point was that the series touches three different subsystems, and you didn't give any thoughts about how this could be merged.

Must this be merged in one piece, because xxx depends on yyy etc? Can these all be merged separately, via respective trees? If in one piece, you could ask acks from Mr x and Mr y, for the parts they maintain. Etc. And of course, it'd be good to include all the maintainers (At least Mike was missing).

Quoted 4 lines

I think the clock patch could be handled totally separate, as it's in no way related to HDMI. The video and audio part may be handled together, if they have dependencies.

There should be no build time breakage no matter what is the merging order. The BBB HDMI audio functionality simply does not work before all the pieces are in.

1. The audio device does not probe if the ti,gpio-gate-clock is misssing.
2. The audio device probes, but there is no sound coming out if the tilcdc_slave change is missing.
3. Without ASoC or DTS changes there is no audio device.

Best regards,
Jyri