summaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2018-12-13 21:32:36 -0500
committerMark Brown <broonie@kernel.org>2018-12-14 06:47:34 -0500
commit7ced65ffb82fa58c6e314c16770288fe9ce3dfc8 (patch)
treefd6654f05c80453b38496cd6437f665107ce39c7 /sound
parent56eb818191fbe4b93bbe6e884f96061013c9a6ab (diff)
ASoC: audio-graph-card: tidyup convert_rate/channel method
Current audio-graph-card is handling "convert_rate/channel" by many ways. But, it is not useful and readable. We want to do is that allow having it everywere. This patch support it. It will be overwrote if lower node has it. sound { convert-channels = <xxx>; // initial }; codec { audio-graph-card,convert-channels = <xxx>; // overwrite ports { convert_channels = <xxx>; // overwrite port { convert_channels = <xxx>; // overwrite endpoint { convert_channels = <xxx>; // overwrite }; }; }; }; Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/generic/audio-graph-card.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/sound/soc/generic/audio-graph-card.c b/sound/soc/generic/audio-graph-card.c
index 7e32380e7a6f..368b8ae463af 100644
--- a/sound/soc/generic/audio-graph-card.c
+++ b/sound/soc/generic/audio-graph-card.c
@@ -35,7 +35,6 @@ struct graph_card_data {
35 struct asoc_simple_jack mic_jack; 35 struct asoc_simple_jack mic_jack;
36 struct snd_soc_dai_link *dai_link; 36 struct snd_soc_dai_link *dai_link;
37 struct asoc_simple_dai *dais; 37 struct asoc_simple_dai *dais;
38 struct asoc_simple_card_data adata;
39 struct snd_soc_codec_conf *codec_conf; 38 struct snd_soc_codec_conf *codec_conf;
40 struct gpio_desc *pa_gpio; 39 struct gpio_desc *pa_gpio;
41}; 40};
@@ -167,9 +166,6 @@ static int asoc_graph_card_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd,
167 166
168 asoc_simple_card_convert_fixup(&dai_props->adata, params); 167 asoc_simple_card_convert_fixup(&dai_props->adata, params);
169 168
170 /* overwrite by top level adata if exist */
171 asoc_simple_card_convert_fixup(&priv->adata, params);
172
173 return 0; 169 return 0;
174} 170}
175 171
@@ -197,6 +193,13 @@ static int asoc_graph_card_dai_link_of_dpcm(struct device_node *top,
197 of_property_read_u32(ports, "mclk-fs", &dai_props->mclk_fs); 193 of_property_read_u32(ports, "mclk-fs", &dai_props->mclk_fs);
198 of_property_read_u32(port, "mclk-fs", &dai_props->mclk_fs); 194 of_property_read_u32(port, "mclk-fs", &dai_props->mclk_fs);
199 of_property_read_u32(ep, "mclk-fs", &dai_props->mclk_fs); 195 of_property_read_u32(ep, "mclk-fs", &dai_props->mclk_fs);
196
197 asoc_simple_card_parse_convert(dev, top, NULL, &dai_props->adata);
198 asoc_simple_card_parse_convert(dev, node, PREFIX, &dai_props->adata);
199 asoc_simple_card_parse_convert(dev, ports, NULL, &dai_props->adata);
200 asoc_simple_card_parse_convert(dev, port, NULL, &dai_props->adata);
201 asoc_simple_card_parse_convert(dev, ep, NULL, &dai_props->adata);
202
200 of_node_put(ports); 203 of_node_put(ports);
201 of_node_put(port); 204 of_node_put(port);
202 205
@@ -276,8 +279,6 @@ static int asoc_graph_card_dai_link_of_dpcm(struct device_node *top,
276 PREFIX "prefix"); 279 PREFIX "prefix");
277 } 280 }
278 281
279 asoc_simple_card_parse_convert(dev, node, PREFIX, &dai_props->adata);
280
281 ret = asoc_simple_card_of_parse_tdm(ep, dai); 282 ret = asoc_simple_card_of_parse_tdm(ep, dai);
282 if (ret) 283 if (ret)
283 return ret; 284 return ret;
@@ -409,8 +410,6 @@ static int asoc_graph_card_parse_of(struct graph_card_data *priv)
409 if (ret < 0) 410 if (ret < 0)
410 return ret; 411 return ret;
411 412
412 asoc_simple_card_parse_convert(dev, node, NULL, &priv->adata);
413
414 link_idx = 0; 413 link_idx = 0;
415 dai_idx = 0; 414 dai_idx = 0;
416 conf_idx = 0; 415 conf_idx = 0;