[PATCH 7/9] ASoC: meson: switch to use snd_soc_daifmt_parse_format/clock_provider()
Kuninori Morimoto
kuninori.morimoto.gx at renesas.com
Tue Jun 8 02:12:41 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 | 15 +++++----------
1 file changed, 5 insertions(+), 10 deletions(-)
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);
--
2.25.1
More information about the Alsa-devel
mailing list