alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
To: Bard liao <yung-chuan.liao@linux.intel.com>,
	broonie@kernel.org, tiwai@suse.de
Cc: liam.r.girdwood@linux.intel.com, alsa-devel@alsa-project.org,
	bard.liao@intel.com, kuninori.morimoto.gx@renesas.com
Subject: Re: [alsa-devel] [PATCH RFC v3 3/4] ASoC: Add multiple CPU DAI support in DAPM
Date: Fri, 17 Jan 2020 05:19:22 -0600	[thread overview]
Message-ID: <9c698222-609d-c036-7a60-878105e2fb59@linux.intel.com> (raw)
In-Reply-To: <20200116202620.7401-4-yung-chuan.liao@linux.intel.com>



On 1/16/20 2:26 PM, Bard liao wrote:
> From: Shreyas NC <shreyas.nc@intel.com>
> 
> DAPM handles DAIs during soc_dapm_stream_event() and during addition
> and creation of DAI widgets i.e., dapm_add_valid_dai_widget() and
> dapm_connect_dai_link_widgets().
> 
> Extend these functions to handle multiple cpu dai.
> 
> Signed-off-by: Vinod Koul <vkoul@kernel.org>
> Signed-off-by: Shreyas NC <shreyas.nc@intel.com>
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
> ---
>   sound/soc/soc-dapm.c | 131 +++++++++++++++++++++++++------------------
>   1 file changed, 75 insertions(+), 56 deletions(-)
> 
> diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
> index 442846f12cd4..7a0538b45faf 100644
> --- a/sound/soc/soc-dapm.c
> +++ b/sound/soc/soc-dapm.c
> @@ -4274,16 +4274,15 @@ int snd_soc_dapm_link_dai_widgets(struct snd_soc_card *card)
>   	return 0;
>   }
>   
> -static void dapm_connect_dai_link_widgets(struct snd_soc_card *card,
> -					  struct snd_soc_pcm_runtime *rtd)
> +static void dapm_add_valid_dai_widget(struct snd_soc_card *card,
> +				      struct snd_soc_pcm_runtime *rtd,
> +				      struct snd_soc_dai *codec_dai,
> +				      struct snd_soc_dai *cpu_dai)

[...]

> +static void dapm_connect_dai_link_widgets(struct snd_soc_card *card,
> +					  struct snd_soc_pcm_runtime *rtd)
> +{
> +	struct snd_soc_dai *codec_dai;
> +	int i;
> +
> +	if (rtd->num_cpus > 1) {
> +		if (rtd->num_codecs == rtd->num_cpus)
> +			for_each_rtd_codec_dai(rtd, i, codec_dai)
> +				dapm_add_valid_dai_widget(card, rtd,
> +							  codec_dai,
> +							  rtd->cpu_dais[i]);
> +		else
> +			dev_err(card->dev,
> +				"N cpus to M codecs link is not supported yet\n");
> +	} else {
> +		for_each_rtd_codec_dai(rtd, i, codec_dai)
> +			dapm_add_valid_dai_widget(card, rtd,
> +						  codec_dai, rtd->cpu_dais[0]);


I would suggest introducing the new helper in an earlier patch, then the 
addition of the multi-cpu-dai case would be a lot easier to review - and 
make sure there's no regression.

This patch is difficult to double-check with too many unrelated code 
moves due to the new helper.

>   	}
>   }
>   
> @@ -4417,9 +4434,11 @@ static void soc_dapm_stream_event(struct snd_soc_pcm_runtime *rtd, int stream,
>   	int event)
>   {
>   	struct snd_soc_dai *codec_dai;
> +	struct snd_soc_dai *cpu_dai;
>   	int i;
>   
> -	soc_dapm_dai_stream_event(rtd->cpu_dai, stream, event);
> +	for_each_rtd_cpu_dai(rtd, i, cpu_dai)
> +		soc_dapm_dai_stream_event(cpu_dai, stream, event);
>   	for_each_rtd_codec_dai(rtd, i, codec_dai)
>   		soc_dapm_dai_stream_event(codec_dai, stream, event);
>   
> 
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

  reply	other threads:[~2020-01-17 11:32 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-16 20:26 [alsa-devel] [PATCH RFC v3 0/4] ASoC: Add Multi CPU DAI support Bard liao
2020-01-16 20:26 ` [alsa-devel] [PATCH RFC v3 1/4] ASoC: Add initial support for multiple CPU DAIs Bard liao
2020-01-16 20:26 ` [alsa-devel] [PATCH RFC v3 2/4] ASoC: Add multiple CPU DAI support for PCM ops Bard liao
2020-01-17 11:10   ` Pierre-Louis Bossart
2020-01-20 11:01     ` Liao, Bard
2020-01-16 20:26 ` [alsa-devel] [PATCH RFC v3 3/4] ASoC: Add multiple CPU DAI support in DAPM Bard liao
2020-01-17 11:19   ` Pierre-Louis Bossart [this message]
2020-01-16 20:26 ` [alsa-devel] [PATCH RFC v3 4/4] ASoC: return error if the function is not support multi cpu yet Bard liao
2020-01-17 11:24   ` Pierre-Louis Bossart
2020-01-17 11:27 ` [alsa-devel] [PATCH RFC v3 0/4] ASoC: Add Multi CPU DAI support Pierre-Louis Bossart

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=9c698222-609d-c036-7a60-878105e2fb59@linux.intel.com \
    --to=pierre-louis.bossart@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=bard.liao@intel.com \
    --cc=broonie@kernel.org \
    --cc=kuninori.morimoto.gx@renesas.com \
    --cc=liam.r.girdwood@linux.intel.com \
    --cc=tiwai@suse.de \
    --cc=yung-chuan.liao@linux.intel.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).