diff mbox series

[7/9] ASoC: meson: switch to use snd_soc_daifmt_parse_format/clock_provider()

Message ID 87v96pciyu.wl-kuninori.morimoto.gx@renesas.com
State New
Headers show
Series ASoC: tidyup snd_soc_of_parse_daifmt() | expand

Commit Message

Kuninori Morimoto June 8, 2021, 12:12 a.m. UTC
From: Kuninori Morimoto <kuninori.morimoto.gx@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@renesas.com>
---
 sound/soc/meson/meson-card-utils.c | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)
diff mbox series

Patch

diff --git a/sound/soc/meson/meson-card-utils.c b/sound/soc/meson/meson-card-utils.c
index 300ac8be46ef..60959e2c71b8 100644
--- a/sound/soc/meson/meson-card-utils.c
+++ b/sound/soc/meson/meson-card-utils.c
@@ -119,18 +119,13 @@  unsigned int meson_card_parse_daifmt(struct device_node *node,
 	struct device_node *framemaster = NULL;
 	unsigned int daifmt;
 
-	daifmt = snd_soc_of_parse_daifmt(node, "",
-					 &bitclkmaster, &framemaster);
-	daifmt &= ~SND_SOC_DAIFMT_MASTER_MASK;
+	snd_soc_daifmt_parse_clock_provider(node, "", &bitclkmaster, &framemaster);
 
 	/* If no master is provided, default to cpu master */
-	if (!bitclkmaster || bitclkmaster == cpu_node) {
-		daifmt |= (!framemaster || framemaster == cpu_node) ?
-			SND_SOC_DAIFMT_CBS_CFS : SND_SOC_DAIFMT_CBS_CFM;
-	} else {
-		daifmt |= (!framemaster || framemaster == cpu_node) ?
-			SND_SOC_DAIFMT_CBM_CFS : SND_SOC_DAIFMT_CBM_CFM;
-	}
+	daifmt = snd_soc_daifmt_parse_format(node, "") |
+		 snd_soc_daifmt_clock_provider_pickup(
+			((bitclkmaster && bitclkmaster != cpu_node) << 4) +
+			 (framemaster  && framemaster  != cpu_node));
 
 	of_node_put(bitclkmaster);
 	of_node_put(framemaster);