Unverified Commit 4da4a746 authored by Mark Brown's avatar Mark Brown
Browse files

ASoC: add multi Component support

Merge series from Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>:

On below HW case, we would like to use it as "2 Cards",
but unfortunately it is impossible in intuitive way,
or possible but not intuitive way.
In reality, it is handled as "1 big Card" today.

	+-- basic board --------+
	|+--------+             |
	|| CPU ch0| <--> CodecA |
	||     ch1| <-+         |
	|+--------+   |         |
	+-------------|---------+
	+-- expansion board ----+
	|             |         |
	|             +-> CodecB|
	+-----------------------+

To handling it as intuitive "2 Cards", this patch-set
adds multi Component support.

To enable this patch-set, I included [01/15] patch into this patch-set
which is posted but not yet accepted.
parents c1325a2d 970dc991
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -192,9 +192,8 @@ int asoc_simple_remove(struct platform_device *pdev);

int asoc_graph_card_probe(struct snd_soc_card *card);
int asoc_graph_is_ports0(struct device_node *port);
int asoc_graph_parse_dai(struct device_node *ep,
			 struct snd_soc_dai_link_component *dlc,
			 int *is_single_link);
int asoc_graph_parse_dai(struct device *dev, struct device_node *ep,
			 struct snd_soc_dai_link_component *dlc, int *is_single_link);

#ifdef DEBUG
static inline void asoc_simple_debug_dai(struct asoc_simple_priv *priv,
+3 −0
Original line number Diff line number Diff line
@@ -271,6 +271,8 @@ int snd_soc_dai_compr_get_metadata(struct snd_soc_dai *dai,
				   struct snd_compr_stream *cstream,
				   struct snd_compr_metadata *metadata);

const char *snd_soc_dai_name_get(struct snd_soc_dai *dai);

struct snd_soc_dai_ops {
	/*
	 * DAI clocking configuration, all optional.
@@ -397,6 +399,7 @@ struct snd_soc_dai_driver {
	unsigned int id;
	unsigned int base;
	struct snd_soc_dobj dobj;
	struct of_phandle_args *dai_args;

	/* DAI driver callbacks */
	int (*probe)(struct snd_soc_dai *dai);
+6 −0
Original line number Diff line number Diff line
@@ -651,6 +651,7 @@ struct snd_soc_dai_link_component {
	const char *name;
	struct device_node *of_node;
	const char *dai_name;
	struct of_phandle_args *dai_args;
};

struct snd_soc_dai_link_codec_ch_map {
@@ -1335,6 +1336,11 @@ int snd_soc_add_pcm_runtimes(struct snd_soc_card *card,
void snd_soc_remove_pcm_runtime(struct snd_soc_card *card,
				struct snd_soc_pcm_runtime *rtd);

void snd_soc_dlc_use_cpu_as_platform(struct snd_soc_dai_link_component *platforms,
				     struct snd_soc_dai_link_component *cpus);
struct of_phandle_args *snd_soc_copy_dai_args(struct device *dev,
					      struct of_phandle_args *args);
struct snd_soc_dai *snd_soc_get_dai_via_args(struct of_phandle_args *dai_args);
struct snd_soc_dai *snd_soc_register_dai(struct snd_soc_component *component,
					 struct snd_soc_dai_driver *dai_drv,
					 bool legacy_dai_naming);
+1 −1
Original line number Diff line number Diff line
@@ -126,7 +126,7 @@ static int graph_parse_node(struct asoc_simple_priv *priv,

	graph_parse_mclk_fs(top, ep, dai_props);

	ret = asoc_graph_parse_dai(ep, dlc, cpu);
	ret = asoc_graph_parse_dai(dev, ep, dlc, cpu);
	if (ret < 0)
		return ret;

+1 −1
Original line number Diff line number Diff line
@@ -407,7 +407,7 @@ static int __graph_parse_node(struct asoc_simple_priv *priv,

	graph_parse_mclk_fs(ep, dai_props);

	ret = asoc_graph_parse_dai(ep, dlc, &is_single_links);
	ret = asoc_graph_parse_dai(dev, ep, dlc, &is_single_links);
	if (ret < 0)
		return ret;

Loading