[alsa-devel] Question about OF-graph ports

Kuninori Morimoto kuninori.morimoto.gx at renesas.com
Thu Jan 19 07:07:43 CET 2017


Hi Rob, Mark
and ALSA SoC ML

I'm working for OF-graph base sound card support.
Now I want to know 1 things which can't solve by myself.
It is OF-graph ports

ALSA SoC needs CPU, Codec, and Sound Card.
If CPU <-> Card <-> Codec case, OF-graph will be

	card {
		ports {
			port at 0 {
				card_in: endpoint {
					remote-endpoint = <&cpu_out>;
				};
			};
			port at 1 {
				card_out: endpoint {
					remote-endpoint = <&codec_in>;
				};
			};
		};
	};

	cpu {
		port {
			cpu_out: endpoint {
				remote-endpoint = <&card_in>;
			};
		};
	};

	codec {
		port {
			codec_in: endpoint {
				remote-endpoint = <&card_out>;
			};
		};
	};

This is OK.
If CPU has many ports, then ALSA SoC requests 1 Card which has many
DAIs (= Digital Audio Interface).
This case, cpu will have "ports" and many "port", this is OK.

	SoC.0              Codec0
	SoC.1 <-> Card <-> Codec1
	SoC.2              Codec2

In "card", CPU/Codec pair is indicated by "ports" now
(= port0 is CPU, port1 is Codec, etc)

My question is in this case, how to know CPU/Codec pair on "card" ?
Can we have *multi ports*, like this ?

card {
	ports {
		ports at 0 {
			port at 0 { /* SoC.0 */ };
			port at 1 { /* Codec0*/ };
		};
		ports at 1 {
			port at 0 { /* SoC.1 */ };
			port at 1 { /* Codec1*/ };
		};
		ports at 2 {
			port at 0 { /* SoC.2 */ };
			port at 1 { /* Codec2*/ };
		};
	};
};

Or can I use grouping, like this ?

card {
	group =	<port at 0 port at 1>,
		<port at 2 port at 3>,
		<port at 4 port at 5>;
	ports {
		port at 0 { /* SoC.0 */ };
		port at 1 { /* SoC.1 */ };
		port at 2 { /* SoC.2 */ };
		port at 3 { /* Codec0*/ };
		port at 4 { /* Codec1*/ };
		port at 5 { /* Codec2*/ };
	};
};

Best regards
---
Kuninori Morimoto


More information about the Alsa-devel mailing list