All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jerome Brunet <jbrunet@baylibre.com>
To: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>,
	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>
Subject: Re: [PATCH v2 6/8] ASoC: meson: switch to use snd_soc_daifmt_parse_format/clock_provider()
Date: Wed, 09 Jun 2021 09:11:44 +0200	[thread overview]
Message-ID: <1ja6nz1phr.fsf@starbuckisacylon.baylibre.com> (raw)
In-Reply-To: <874ke7dbpj.wl-kuninori.morimoto.gx@renesas.com>


On Wed 09 Jun 2021 at 04:16, Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> wrote:

> 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 | 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;

Why did you need to add this local ? 

>  
> -	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);
>

Thanks for this

>  	/* 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;

These 3 last changes does seem to necessary

>  }
>  EXPORT_SYMBOL_GPL(meson_card_parse_daifmt);


  reply	other threads:[~2021-06-09  7:12 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-09  2:07 [PATCH v2 0/8] ASoC: tidyup snd_soc_of_parse_daifmt() Kuninori Morimoto
2021-06-09  2:13 ` [PATCH v2 1/8] ASoC: soc-core: add snd_soc_daifmt_clock_provider_from_bitmap() Kuninori Morimoto
2021-06-09  2:14 ` [PATCH v2 2/8] ASoC: soc-core: add snd_soc_daifmt_clock_provider_fliped() Kuninori Morimoto
2021-06-09  2:15 ` [PATCH v2 3/8] ASoC: soc-core: add snd_soc_daifmt_parse_format/clock_provider() Kuninori Morimoto
2021-06-09  2:15 ` [PATCH v2 4/8] ASoC: atmel: switch to use snd_soc_daifmt_parse_format/clock_provider() Kuninori Morimoto
2021-06-09  2:16 ` [PATCH v2 5/8] ASoC: fsl: " Kuninori Morimoto
2021-06-09  2:16 ` [PATCH v2 6/8] ASoC: meson: " Kuninori Morimoto
2021-06-09  7:11   ` Jerome Brunet [this message]
2021-06-09 23:02     ` Kuninori Morimoto
2021-06-09  2:16 ` [PATCH v2 7/8] ASoC: simple-card-utils: " Kuninori Morimoto
2021-06-09  2:17 ` [PATCH v2 8/8] ASoC: soc-core: remove snd_soc_of_parse_daifmt() Kuninori Morimoto
2021-06-09  5:27 ` [PATCH v2 9/8] ASoC: soc-core: add comment of return value for snd_soc_daifmt_parse_clock_provider_raw() Kuninori Morimoto

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=1ja6nz1phr.fsf@starbuckisacylon.baylibre.com \
    --to=jbrunet@baylibre.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=khilman@baylibre.com \
    --cc=kuninori.morimoto.gx@renesas.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.