summaryrefslogtreecommitdiff
path: root/sound/soc/generic/simple-card.c
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2018-12-20 10:46:42 +0900
committerMark Brown <broonie@kernel.org>2019-01-03 16:34:27 +0000
commit7e5e1f8bbaa82e6877d8bc121cb1b44cb1ce7ddf (patch)
tree028482cbab29bd35344f170bb8f7fdaa73d2fb28 /sound/soc/generic/simple-card.c
parent97fe6ca4146583d8dccdde51c143c52b385c2682 (diff)
ASoC: simple-card: add asoc_simple_card_get_conversion()
simple-card is now supporting normal sound and DPCM sound. For DPCM sound, original sound card (= simple-scu-card) had been supported 1 CPU : 1 Codec connection which uses hw_params_fixup() for convert-rate/channel. But, merged simple-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_simple_card_get_conversion() as preparation Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/generic/simple-card.c')
-rw-r--r--sound/soc/generic/simple-card.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c
index 37e001cf9cd1..52048069b25a 100644
--- a/sound/soc/generic/simple-card.c
+++ b/sound/soc/generic/simple-card.c
@@ -165,6 +165,21 @@ static int asoc_simple_card_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd,
return 0;
}
+static void asoc_simple_card_get_conversion(struct device *dev,
+ struct device_node *np,
+ struct asoc_simple_card_data *adata)
+{
+ struct device_node *top = dev->of_node;
+ struct device_node *node = of_get_parent(np);
+
+ asoc_simple_card_parse_convert(dev, top, PREFIX, adata);
+ asoc_simple_card_parse_convert(dev, node, PREFIX, adata);
+ asoc_simple_card_parse_convert(dev, node, NULL, adata);
+ asoc_simple_card_parse_convert(dev, np, NULL, adata);
+
+ of_node_put(node);
+}
+
static int asoc_simple_card_dai_link_of_dpcm(struct device_node *top,
struct device_node *node,
struct device_node *np,
@@ -260,9 +275,7 @@ static int asoc_simple_card_dai_link_of_dpcm(struct device_node *top,
"prefix");
}
- asoc_simple_card_parse_convert(dev, top, PREFIX, &dai_props->adata);
- asoc_simple_card_parse_convert(dev, node, prefix, &dai_props->adata);
- asoc_simple_card_parse_convert(dev, np, NULL, &dai_props->adata);
+ asoc_simple_card_get_conversion(dev, np, &dai_props->adata);
ret = asoc_simple_card_of_parse_tdm(np, dai);
if (ret)