OSDN Git Service

ASoC: audio-graph-card2: add Codec2Codec support
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tue, 12 Oct 2021 04:55:33 +0000 (13:55 +0900)
committerMark Brown <broonie@kernel.org>
Fri, 15 Oct 2021 15:10:41 +0000 (16:10 +0100)
commitc3a15c92a67b701751c2680fa894d832570f7e7b
tree1ed0b1e1517408e17624ca1731759b46b5576a59
parentf03beb55a831bc7575b3c8882bf8fa6c81198eca
ASoC: audio-graph-card2: add Codec2Codec support

This patch adds Codec2Codec support to audio-graph-card2.
It can use Codec2Codec but very simple case only for now.
It doesn't have "SWITCH" control yet, thus it start automatically
when it was probed, and can't stop, so far.
Thus it needs to be updated around widgets/routing handling,
and you need to understand that it is under experimental.

Codec has SND_SOC_DAPM_INPUT() (= IN) / SND_SOC_DAPM_OUTPUT(= OUT)
widgets in below case.

It is assuming 2channel, S32_LE format for now.
It needs to be updated, too.

It needs "codec2codec" node (= B), needs to have routing (= A),
need to indicate CPU side at links (= X).
ports@0 is for CPU side (= X), port@1 is Codec side (= Y).
It needs to have "rate" (= C)

+--+
|  |<-- Codec0 <-- IN
|  |--> Codec1 --> OUT
+--+

sound {
compatible = "audio-graph-card2";

(A) routing = "OUT" ,"DAI1 Playback",
  "DAI0 Capture", "IN";

(X) links = <&c2c>;

(B) codec2codec {
ports {
(C) rate = <48000>;
(X) c2c: port@0 { c2cf_ep: endpoint { remote-endpoint = <&codec0_ep>; }; };
(Y) port@1 { c2cb_ep: endpoint { remote-endpoint = <&codec1_ep>; }; };
};
};

Codec {
ports {
port@0 {
 bitclock-master;
 frame-master;
 codec0_ep: endpoint { remote-endpoint = <&c2cf_ep>; }; };
port@1 { codec1_ep: endpoint { remote-endpoint = <&c2cb_ep>; }; };
};
};

Link: https://lore.kernel.org/r/87k0xszlep.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87y26ylu4a.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
include/sound/graph_card.h
sound/soc/generic/audio-graph-card2.c