mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-12 21:44:06 +08:00
c3a15c92a6
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>
36 lines
1.0 KiB
C
36 lines
1.0 KiB
C
/* SPDX-License-Identifier: GPL-2.0
|
|
*
|
|
* ASoC audio graph card support
|
|
*
|
|
*/
|
|
|
|
#ifndef __GRAPH_CARD_H
|
|
#define __GRAPH_CARD_H
|
|
|
|
#include <sound/simple_card_utils.h>
|
|
|
|
typedef int (*GRAPH2_CUSTOM)(struct asoc_simple_priv *priv,
|
|
struct device_node *lnk,
|
|
struct link_info *li);
|
|
|
|
struct graph2_custom_hooks {
|
|
int (*hook_pre)(struct asoc_simple_priv *priv);
|
|
int (*hook_post)(struct asoc_simple_priv *priv);
|
|
GRAPH2_CUSTOM custom_normal;
|
|
GRAPH2_CUSTOM custom_dpcm;
|
|
GRAPH2_CUSTOM custom_c2c;
|
|
};
|
|
|
|
int audio_graph_parse_of(struct asoc_simple_priv *priv, struct device *dev);
|
|
int audio_graph2_parse_of(struct asoc_simple_priv *priv, struct device *dev,
|
|
struct graph2_custom_hooks *hooks);
|
|
|
|
int audio_graph2_link_normal(struct asoc_simple_priv *priv,
|
|
struct device_node *lnk, struct link_info *li);
|
|
int audio_graph2_link_dpcm(struct asoc_simple_priv *priv,
|
|
struct device_node *lnk, struct link_info *li);
|
|
int audio_graph2_link_c2c(struct asoc_simple_priv *priv,
|
|
struct device_node *lnk, struct link_info *li);
|
|
|
|
#endif /* __GRAPH_CARD_H */
|