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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

> From: Kuninori Morimoto <kuninori.morimoto.gx@xxxxxxxxxxx>
>
> 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@xxxxxxxxxxx>
> ---
>  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);




[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Pulse Audio]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux