Commit de2949fe authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Mark Brown

ASoC: audio-graph-card: add 1 CPU : 1 Codec support again

audio-graph-card is now supporting normal sound and DPCM sound.
For DPCM sound, original sound card (= audio-graph-scu) had been
supported 1 CPU : 1 Codec connection which uses hw_params_fixup()
for convert-rate/channel.
But, merged audio-graph-card is completely forgeting about it.

This patch re-support it.
Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent b31daa15
...@@ -408,6 +408,7 @@ static int asoc_graph_card_parse_of(struct graph_card_data *priv) ...@@ -408,6 +408,7 @@ static int asoc_graph_card_parse_of(struct graph_card_data *priv)
struct device_node *codec_ep = NULL; struct device_node *codec_ep = NULL;
struct device_node *codec_port = NULL; struct device_node *codec_port = NULL;
struct device_node *codec_port_old = NULL; struct device_node *codec_port_old = NULL;
struct asoc_simple_card_data adata;
int rc, ret; int rc, ret;
int link_idx, dai_idx, conf_idx; int link_idx, dai_idx, conf_idx;
int cpu; int cpu;
...@@ -453,7 +454,13 @@ static int asoc_graph_card_parse_of(struct graph_card_data *priv) ...@@ -453,7 +454,13 @@ static int asoc_graph_card_parse_of(struct graph_card_data *priv)
dev_dbg(dev, "%pOFf <-> %pOFf\n", cpu_ep, codec_ep); dev_dbg(dev, "%pOFf <-> %pOFf\n", cpu_ep, codec_ep);
if (of_get_child_count(codec_port) > 1) { memset(&adata, 0, sizeof(adata));
asoc_graph_card_get_conversion(dev, codec_ep, &adata);
asoc_graph_card_get_conversion(dev, cpu_ep, &adata);
if ((of_get_child_count(codec_port) > 1) ||
adata.convert_rate ||
adata.convert_channels) {
/* /*
* for DPCM sound * for DPCM sound
*/ */
...@@ -495,7 +502,7 @@ static void asoc_graph_get_dais_count(struct device *dev, ...@@ -495,7 +502,7 @@ static void asoc_graph_get_dais_count(struct device *dev,
struct device_node *codec_ep; struct device_node *codec_ep;
struct device_node *codec_port; struct device_node *codec_port;
struct device_node *codec_port_old; struct device_node *codec_port_old;
struct device_node *codec_port_old2; struct asoc_simple_card_data adata;
int rc; int rc;
/* /*
...@@ -534,9 +541,17 @@ static void asoc_graph_get_dais_count(struct device *dev, ...@@ -534,9 +541,17 @@ static void asoc_graph_get_dais_count(struct device *dev,
* => 6 links = 0xCPU-Codec + 4xCPU-dummy + 2xdummy-Codec * => 6 links = 0xCPU-Codec + 4xCPU-dummy + 2xdummy-Codec
* => 6 DAIs = 4xCPU + 2xCodec * => 6 DAIs = 4xCPU + 2xCodec
* => 2 ccnf = 2xdummy-Codec * => 2 ccnf = 2xdummy-Codec
*
* ex4)
* CPU0 --- Codec0 (convert-rate) link : 3
* CPU1 --- Codec1 dais : 4
* ccnf : 1
*
* => 3 links = 1xCPU-Codec + 1xCPU-dummy + 1xdummy-Codec
* => 4 DAIs = 2xCPU + 2xCodec
* => 1 ccnf = 1xdummy-Codec
*/ */
codec_port_old = NULL; codec_port_old = NULL;
codec_port_old2 = NULL;
of_for_each_phandle(&it, rc, node, "dais", NULL, 0) { of_for_each_phandle(&it, rc, node, "dais", NULL, 0) {
cpu_port = it.node; cpu_port = it.node;
cpu_ep = NULL; cpu_ep = NULL;
...@@ -554,17 +569,22 @@ static void asoc_graph_get_dais_count(struct device *dev, ...@@ -554,17 +569,22 @@ static void asoc_graph_get_dais_count(struct device *dev,
(*link_num)++; (*link_num)++;
(*dais_num)++; (*dais_num)++;
if (codec_port_old == codec_port) { memset(&adata, 0, sizeof(adata));
if (codec_port_old2 != codec_port_old) { asoc_graph_card_get_conversion(dev, codec_ep, &adata);
(*link_num)++; asoc_graph_card_get_conversion(dev, cpu_ep, &adata);
(*ccnf_num)++;
}
codec_port_old2 = codec_port_old; if ((of_get_child_count(codec_port) > 1) ||
adata.convert_rate || adata.convert_channels) {
if (codec_port_old == codec_port)
continue; continue;
}
(*link_num)++;
(*ccnf_num)++;
(*dais_num)++;
} else {
(*dais_num)++; (*dais_num)++;
}
codec_port_old = codec_port; codec_port_old = codec_port;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment