struct device_node *node;
struct device_node *np;
struct device_node *codec;
+ struct asoc_simple_card_data adata;
bool is_fe;
int ret, loop;
int dai_idx, link_idx, conf_idx;
}
do {
+ memset(&adata, 0, sizeof(adata));
+ for_each_child_of_node(node, np)
+ asoc_simple_card_get_conversion(dev, np, &adata);
+
/* DPCM */
- if (of_get_child_count(node) > 2) {
+ if (of_get_child_count(node) > 2 ||
+ adata.convert_rate || adata.convert_channels) {
for_each_child_of_node(node, np) {
codec = of_get_child_by_name(node,
loop ? "codec" :
top, node, np, codec, priv,
&dai_idx, link_idx++, &conf_idx,
is_fe, !loop);
+ if (ret < 0)
+ return ret;
}
} else {
ret = asoc_simple_card_dai_link_of(
top, node, priv,
&dai_idx, link_idx++, !loop);
+ if (ret < 0)
+ return ret;
}
- if (ret < 0)
- return ret;
node = of_get_next_child(top, node);
} while (loop && node);
{
struct device_node *top = dev->of_node;
struct device_node *node;
+ struct device_node *np;
+ struct asoc_simple_card_data adata;
int loop;
int num;
* => 6 links = 0xCPU-Codec + 4xCPU-dummy + 2xdummy-Codec
* => 6 DAIs = 4xCPU + 2xCodec
* => 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
*/
if (!top) {
(*link_num) = 1;
}
do {
+ memset(&adata, 0, sizeof(adata));
+ for_each_child_of_node(node, np)
+ asoc_simple_card_get_conversion(dev, np, &adata);
+
num = of_get_child_count(node);
(*dais_num) += num;
- if (num > 2) {
+ if (num > 2 ||
+ adata.convert_rate || adata.convert_channels) {
(*link_num) += num;
(*ccnf_num)++;
} else {