All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
To: Liam Girdwood <lgirdwood@gmail.com>, Mark Brown <broonie@kernel.org>
Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>,
	Timur Tabi <timur@kernel.org>, Xiubo Li <Xiubo.Lee@gmail.com>,
	Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
	Shengjiu Wang <shengjiu.wang@gmail.com>,
	Sameer Pujar <spujar@nvidia.com>,
	Neil Armstrong <narmstrong@baylibre.com>,
	Nicolas Ferre <nicolas.ferre@microchip.com>,
	Nicolin Chen <nicoleotsuka@gmail.com>,
	Ludovic Desroches <ludovic.desroches@microchip.com>,
	Kevin Hilman <khilman@baylibre.com>,
	Codrin Ciubotariu <codrin.ciubotariu@microchip.com>,
	alsa-devel@alsa-project.org, Fabio Estevam <festevam@gmail.com>,
	Jerome Brunet <jbrunet@baylibre.com>
Subject: [PATCH 8/9] ASoC: simple-card-utils: switch to use snd_soc_daifmt_parse_format/clock_provider()
Date: 08 Jun 2021 09:12:47 +0900	[thread overview]
Message-ID: <87tum9ciyp.wl-kuninori.morimoto.gx@renesas.com> (raw)
In-Reply-To: <875yypdxlm.wl-kuninori.morimoto.gx@renesas.com>

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/generic/simple-card-utils.c | 19 ++++++++-----------
 1 file changed, 8 insertions(+), 11 deletions(-)

diff --git a/sound/soc/generic/simple-card-utils.c b/sound/soc/generic/simple-card-utils.c
index fa1247f0dda1..de23e6e7f3f3 100644
--- a/sound/soc/generic/simple-card-utils.c
+++ b/sound/soc/generic/simple-card-utils.c
@@ -60,10 +60,9 @@ int asoc_simple_parse_daifmt(struct device *dev,
 	struct device_node *bitclkmaster = NULL;
 	struct device_node *framemaster = NULL;
 	unsigned int daifmt;
+	unsigned int bit_frame;
 
-	daifmt = snd_soc_of_parse_daifmt(node, prefix,
-					 &bitclkmaster, &framemaster);
-	daifmt &= ~SND_SOC_DAIFMT_MASTER_MASK;
+	snd_soc_daifmt_parse_clock_provider(node, prefix, &bitclkmaster, &framemaster);
 
 	if (!bitclkmaster && !framemaster) {
 		/*
@@ -73,17 +72,15 @@ int asoc_simple_parse_daifmt(struct device *dev,
 		 */
 		dev_dbg(dev, "Revert to legacy daifmt parsing\n");
 
-		daifmt = snd_soc_of_parse_daifmt(codec, NULL, NULL, NULL) |
-			(daifmt & ~SND_SOC_DAIFMT_CLOCK_MASK);
+		bit_frame = snd_soc_daifmt_parse_clock_provider(codec, NULL, NULL, NULL);
 	} else {
-		if (codec == bitclkmaster)
-			daifmt |= (codec == framemaster) ?
-				SND_SOC_DAIFMT_CBM_CFM : SND_SOC_DAIFMT_CBM_CFS;
-		else
-			daifmt |= (codec == framemaster) ?
-				SND_SOC_DAIFMT_CBS_CFM : SND_SOC_DAIFMT_CBS_CFS;
+		bit_frame = ((codec == bitclkmaster) << 4) +
+			     (codec == framemaster);
 	}
 
+	daifmt = snd_soc_daifmt_parse_format(node, prefix) |
+		 snd_soc_daifmt_clock_provider_pickup(bit_frame);
+
 	of_node_put(bitclkmaster);
 	of_node_put(framemaster);
 
-- 
2.25.1


  parent reply	other threads:[~2021-06-08  0:15 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-08  0:11 [PATCH 0/9] ASoC: tidyup snd_soc_of_parse_daifmt() Kuninori Morimoto
2021-06-08  0:11 ` [PATCH 1/9] ASoC: soc-core: don't use discriminatory terms on snd_soc_runtime_get_dai_fmt() Kuninori Morimoto
2021-06-08  0:11 ` [PATCH 2/9] ASoC: soc-core: add snd_soc_daifmt_clock_provider_pickup() Kuninori Morimoto
2021-06-08  0:12 ` [PATCH 3/9] ASoC: soc-core: add snd_soc_daifmt_clock_provider_fliped() Kuninori Morimoto
2021-06-08  0:12 ` [PATCH 4/9] ASoC: soc-core: add snd_soc_daifmt_parse_format/clock_provider() Kuninori Morimoto
2021-06-08  0:12 ` [PATCH 5/9] ASoC: atmel: switch to use snd_soc_daifmt_parse_format/clock_provider() Kuninori Morimoto
2021-06-08  0:12 ` [PATCH 6/9] ASoC: fsl: " Kuninori Morimoto
2021-06-08  7:50   ` Jerome Brunet
2021-06-08 12:34     ` Mark Brown
2021-06-08 23:50       ` Kuninori Morimoto
2021-06-08  0:12 ` [PATCH 7/9] ASoC: meson: " Kuninori Morimoto
2021-06-08  0:12 ` Kuninori Morimoto [this message]
2021-06-08  0:12 ` [PATCH 9/9] ASoC: soc-core: remove snd_soc_of_parse_daifmt() Kuninori Morimoto
2021-06-08 16:06 ` (subset) [PATCH 0/9] ASoC: tidyup snd_soc_of_parse_daifmt() Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87tum9ciyp.wl-kuninori.morimoto.gx@renesas.com \
    --to=kuninori.morimoto.gx@renesas.com \
    --cc=Xiubo.Lee@gmail.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=codrin.ciubotariu@microchip.com \
    --cc=festevam@gmail.com \
    --cc=jbrunet@baylibre.com \
    --cc=khilman@baylibre.com \
    --cc=lgirdwood@gmail.com \
    --cc=ludovic.desroches@microchip.com \
    --cc=martin.blumenstingl@googlemail.com \
    --cc=narmstrong@baylibre.com \
    --cc=nicolas.ferre@microchip.com \
    --cc=nicoleotsuka@gmail.com \
    --cc=shengjiu.wang@gmail.com \
    --cc=spujar@nvidia.com \
    --cc=timur@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.