ASoC: audio-graph-card: add asoc_graph_card_get_conversion()

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.

To re-support 1 CPU : 1 Codec DPCM for hw_params_fixup(),
it need to judge whether it is DPCM by checking convert-rate/channel.
For this purpose, this patch adds asoc_graph_card_get_conversion()
as preparation

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Kuninori Morimoto 2018-12-20 10:45:48 +09:00 committed by Mark Brown
parent a0c426fe14
commit 40dfae169a
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0

View File

@ -169,6 +169,22 @@ static int asoc_graph_card_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd,
return 0;
}
static void asoc_graph_card_get_conversion(struct device *dev,
struct device_node *ep,
struct asoc_simple_card_data *adata)
{
struct device_node *top = dev->of_node;
struct device_node *port = of_get_parent(ep);
struct device_node *ports = of_get_parent(port);
struct device_node *node = of_graph_get_port_parent(ep);
asoc_simple_card_parse_convert(dev, top, NULL, adata);
asoc_simple_card_parse_convert(dev, node, PREFIX, adata);
asoc_simple_card_parse_convert(dev, ports, NULL, adata);
asoc_simple_card_parse_convert(dev, port, NULL, adata);
asoc_simple_card_parse_convert(dev, ep, NULL, adata);
}
static int asoc_graph_card_dai_link_of_dpcm(struct device_node *top,
struct device_node *cpu_ep,
struct device_node *codec_ep,
@ -194,11 +210,7 @@ static int asoc_graph_card_dai_link_of_dpcm(struct device_node *top,
of_property_read_u32(port, "mclk-fs", &dai_props->mclk_fs);
of_property_read_u32(ep, "mclk-fs", &dai_props->mclk_fs);
asoc_simple_card_parse_convert(dev, top, NULL, &dai_props->adata);
asoc_simple_card_parse_convert(dev, node, PREFIX, &dai_props->adata);
asoc_simple_card_parse_convert(dev, ports, NULL, &dai_props->adata);
asoc_simple_card_parse_convert(dev, port, NULL, &dai_props->adata);
asoc_simple_card_parse_convert(dev, ep, NULL, &dai_props->adata);
asoc_graph_card_get_conversion(dev, ep, &dai_props->adata);
of_node_put(ports);
of_node_put(port);