[PATCH v2 6/8] ASoC: meson: switch to use snd_soc_daifmt_parse_format/clock_provider()

Kuninori Morimoto kuninori.morimoto.gx at renesas.com
Wed Jun 9 04:16:24 CEST 2021


From: Kuninori Morimoto <kuninori.morimoto.gx at renesas.com>

This patch switch to use snd_soc_daifmt_parse_format/clock_provider() from
snd_soc_of_parse_daifmt().

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx at renesas.com>
---
 sound/soc/meson/meson-card-utils.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/sound/soc/meson/meson-card-utils.c b/sound/soc/meson/meson-card-utils.c
index 300ac8be46ef..779ac282e36d 100644
--- a/sound/soc/meson/meson-card-utils.c
+++ b/sound/soc/meson/meson-card-utils.c
@@ -118,24 +118,25 @@ unsigned int meson_card_parse_daifmt(struct device_node *node,
 	struct device_node *bitclkmaster = NULL;
 	struct device_node *framemaster = NULL;
 	unsigned int daifmt;
+	unsigned int daiclk;
 
-	daifmt = snd_soc_of_parse_daifmt(node, "",
-					 &bitclkmaster, &framemaster);
-	daifmt &= ~SND_SOC_DAIFMT_MASTER_MASK;
+	daifmt = snd_soc_daifmt_parse_format(node, NULL);
+
+	snd_soc_daifmt_parse_clock_provider_as_phandle(node, NULL, &bitclkmaster, &framemaster);
 
 	/* If no master is provided, default to cpu master */
 	if (!bitclkmaster || bitclkmaster == cpu_node) {
-		daifmt |= (!framemaster || framemaster == cpu_node) ?
+		daiclk = (!framemaster || framemaster == cpu_node) ?
 			SND_SOC_DAIFMT_CBS_CFS : SND_SOC_DAIFMT_CBS_CFM;
 	} else {
-		daifmt |= (!framemaster || framemaster == cpu_node) ?
+		daiclk = (!framemaster || framemaster == cpu_node) ?
 			SND_SOC_DAIFMT_CBM_CFS : SND_SOC_DAIFMT_CBM_CFM;
 	}
 
 	of_node_put(bitclkmaster);
 	of_node_put(framemaster);
 
-	return daifmt;
+	return daifmt | daiclk;
 }
 EXPORT_SYMBOL_GPL(meson_card_parse_daifmt);
 
-- 
2.25.1



More information about the Alsa-devel mailing list