[alsa-devel] [RFC][PATCH] ASoC: add simple-graph-card document

Sylwester Nawrocki s.nawrocki at samsung.com
Wed Jan 25 11:27:24 CET 2017


On 01/25/2017 01:09 AM, Kuninori Morimoto wrote:
>> It seems the graph based binding could cover above both cases.  Apologies
>> if this has been explained before, but what are main reasons for introducing
>> the graph based binding?
>
> The big reason why I want to introduce OF-graph simple card is that
> I need to support HDMI sound. HDMI video side is already using
> OF-graph base DT binding. So it is useful if HDMI sound side can follow
> same style.

OK, thanks, as I understood something which covers more than simple
CPU<->CODEC point-to-point connections is needed.

I have also been working on adding proper HDMI audio support for Exynos. 
One issue I can see with proposed binding is that when we use the graph 
binding for both video and audio with a device that supports both, 
e.g. HDMI transmitter we need to somehow differentiate the purpose 
of each port.  To avoid the sound subsystem parsing video port/endpoint 
nodes and the other way around.

For instance in arch/arm/boot/dts/rk3036.dtsi we have already:

	hdmi: hdmi at 20034000 {
		compatible = "rockchip,rk3036-inno-hdmi";
		reg = <0x20034000 0x4000>;
		...

		hdmi_in: port {
			#address-cells = <1>;
			#size-cells = <0>;
			hdmi_in_vop: endpoint at 0 {
				reg = <0>;
				remote-endpoint = <&vop_out_hdmi>;
			};
		};
	};

And with the sound binding added it could have become:

	hdmi: hdmi at 20034000 {
		compatible = "rockchip,rk3036-inno-hdmi";
		..
		ports {
			#address-cells = <1>;
			#size-cells = <0>;

			/* video */
			hdmi_in: port at 0 {
				reg = <0>;
				hdmi_in_vop: endpoint {
					remote-endpoint = <&vop_out_hdmi>;
				};
			};

			/* audio */
			hdmi_audio_out: port@? {
				reg = <?>;	
				endpoint {
					remote-endpoint = <&i2s>;
				};
			};
	};

	i2s: i2s at 10220000 {
		compatible = "rockchip,rk3036-i2s", "rockchip,rk3066-i2s";
		reg = <0x10220000 0x4000>;
		...
	};

Now within individual device bindings the type of the port (audio, 
video) could be determined by reg property, by assigning specific 
values for video and audio.  But if we wanted to make this more generic 
we would probably need something like a property determining the port's 
purpose, e.g.

	type = "audio";

Regarding compatible string for the card, how about "soc-sound-card-v1"
instead of "asoc-simple-graph-card" ? Or "soc-simple-graph-card"? 
Appending version now could let us avoid inventing funny names when 
it turns we need some different binding in future.


More information about the Alsa-devel mailing list