• Kuninori Morimoto's avatar
    ASoC: audio-graph-card2: add Codec2Codec support · c3a15c92
    Kuninori Morimoto authored
    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.comSigned-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
    Link: https://lore.kernel.org/r/87y26ylu4a.wl-kuninori.morimoto.gx@renesas.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
    c3a15c92
graph_card.h 1.04 KB