Skip to content
Permalink
Browse files
ASoC: add Rich Graph Card driver
We already have audio-graph-card which is Of-graph base of general
sound card driver.

It is supporting DPCM connection, but was forcibly expanded.
Thus, it is very difficult to add new features on it, for example
Multi CPU/Codec support, Codec2Codec support, etc.

This patch adds more flexible new Rich Graph Card driver for it.
audio-graph-card and rich-graph-card are similar, but don't have
full compatibility.

Rich Graph Card supports very generic connection, but some users
want to have its own settings, for example PLL settings, etc.
For such case, it has customizing support.
In users own driver, it can use Rich Graph Card parsing by using
rich_graph_parse_of(), and doing its own customizing.

Because Rich Graph Card is still under experimental stage,
it will indicate such warning when probing, and the DT syntax
might be changed.

Link: https://lore.kernel.org/r/87k0xszlep.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
  • Loading branch information
morimoto committed Sep 10, 2021
1 parent 7375148 commit da849e8bdf0863f2f3e2bb25428b6293639cfacd
Show file tree
Hide file tree
Showing 4 changed files with 694 additions and 0 deletions.
@@ -9,6 +9,21 @@

#include <sound/simple_card_utils.h>

typedef int (*GRAPH_CUSTOM)(struct asoc_simple_priv *priv,
struct device_node *lnk,
struct link_info *li);

struct graph_custom_hooks {
int (*hook_pre)(struct asoc_simple_priv *priv);
int (*hook_post)(struct asoc_simple_priv *priv);
GRAPH_CUSTOM custom_normal;
};

int audio_graph_parse_of(struct asoc_simple_priv *priv, struct device *dev);
int rich_graph_parse_of(struct asoc_simple_priv *priv, struct device *dev,
struct graph_custom_hooks *hooks);

int rich_graph_link_normal(struct asoc_simple_priv *priv,
struct device_node *lnk, struct link_info *li);

#endif /* __GRAPH_CARD_H */
@@ -18,6 +18,14 @@ config SND_AUDIO_GRAPH_CARD
with OF-graph DT bindings.
It also support DPCM of multi CPU single Codec ststem.

config SND_RICH_GRAPH_CARD
tristate "ASoC Rich Graph Card support"
depends on OF
select SND_SIMPLE_CARD_UTILS
help
This option enables generic rich graph card support
with OF-graph DT bindings.

config SND_TEST_COMPONENT
tristate "ASoC Test component sound support"
depends on OF
@@ -2,9 +2,11 @@
snd-soc-simple-card-utils-objs := simple-card-utils.o
snd-soc-simple-card-objs := simple-card.o
snd-soc-audio-graph-card-objs := audio-graph-card.o
snd-soc-rich-graph-card-objs := rich-graph-card.o
snd-soc-test-component-objs := test-component.o

obj-$(CONFIG_SND_SIMPLE_CARD_UTILS) += snd-soc-simple-card-utils.o
obj-$(CONFIG_SND_SIMPLE_CARD) += snd-soc-simple-card.o
obj-$(CONFIG_SND_AUDIO_GRAPH_CARD) += snd-soc-audio-graph-card.o
obj-$(CONFIG_SND_RICH_GRAPH_CARD) += snd-soc-rich-graph-card.o
obj-$(CONFIG_SND_TEST_COMPONENT) += snd-soc-test-component.o

0 comments on commit da849e8

Please sign in to comment.