All of lore.kernel.org
 help / color / mirror / Atom feed
From: Charles Keepax <ckeepax@opensource.cirrus.com>
To: Shreyas NC <shreyas.nc@intel.com>
Cc: alsa-devel@alsa-project.org, lars@metafoo.de,
	kuninori.morimoto.gx@renesas.com, patches.audio@intel.com,
	liam.r.girdwood@linux.intel.com, broonie@kernel.org
Subject: Re: [PATCH 1/3] ASoC: Add initial support for multiple CPU DAIs
Date: Fri, 9 Mar 2018 14:50:43 +0000	[thread overview]
Message-ID: <20180309145043.lmdw5r3x7rhplk6x@localhost.localdomain> (raw)
In-Reply-To: <1520334030-8018-2-git-send-email-shreyas.nc@intel.com>

On Tue, Mar 06, 2018 at 04:30:28PM +0530, Shreyas NC wrote:
> For usecases where a stream consists of multiple BE CPU DAIs,
> DAI Link should support the same.
> 
> This patch adds initial support for multiple CPU DAIs in ASoC for
> card instantiation, suspend and resume functions.
> 
> This support is added only for BE DAI Links. Support for FE and
> Codec-Codec Links is not added.
> 
> Signed-off-by: Shreyas NC <shreyas.nc@intel.com>
> ---
> @@ -679,13 +687,17 @@ int snd_soc_suspend(struct device *dev)
>  		card->suspend_pre(card);
>  
>  	list_for_each_entry(rtd, &card->rtd_list, list) {
> -		struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
> +		struct snd_soc_dai *cpu_dai;
>  
>  		if (rtd->dai_link->ignore_suspend)
>  			continue;
>  
> -		if (cpu_dai->driver->suspend && !cpu_dai->driver->bus_control)
> -			cpu_dai->driver->suspend(cpu_dai);
> +		for (i = 0; i < rtd->num_cpu_dai; i++) {
> +			cpu_dai = rtd->cpu_dais[i];
> +			if (cpu_dai->driver->suspend &&
> +					!cpu_dai->driver->bus_control)
> +				cpu_dai->driver->suspend(cpu_dai);
> +		}
>  	}
>  
>  	/* close any waiting streams */
> @@ -793,13 +805,18 @@ static void soc_resume_deferred(struct work_struct *work)

Is there not another call to cpu_dai->driver->suspend at the
bottom of snd_soc_suspend you need to handle?

> @@ -1680,9 +1760,11 @@ static int soc_probe_link_dais(struct snd_soc_card *card,
>  	/* set default power off timeout */
>  	rtd->pmdown_time = pmdown_time;
>  
> -	ret = soc_probe_dai(cpu_dai, order);
> -	if (ret)
> -		return ret;
> +	for (i = 0; i < rtd->num_cpu_dai; i++) {
> +		ret = soc_probe_dai(rtd->cpu_dais[i], order);
> +		if (ret)
> +			return ret;
> +	}
>  
>  	/* probe the CODEC DAI */
>  	for (i = 0; i < rtd->num_codecs; i++) {
> @@ -1718,9 +1800,9 @@ static int soc_probe_link_dais(struct snd_soc_card *card,
>  		soc_dpcm_debugfs_add(rtd);
>  #endif
>  
> -	if (cpu_dai->driver->compress_new) {
> +	if (rtd->cpu_dais[0]->driver->compress_new) {
>  		/*create compress_device"*/
> -		ret = cpu_dai->driver->compress_new(rtd, rtd->num);
> +		ret = rtd->cpu_dais[0]->driver->compress_new(rtd, rtd->num);
>  		if (ret < 0) {
>  			dev_err(card->dev, "ASoC: can't create compress %s\n",
>  					 dai_link->stream_name);

Is it worth throwing an error or printing a warning to say that
we don't support multiple DAIs on the compressed framework? Not
sure if here is were we should do that though.

> @@ -1736,7 +1818,8 @@ static int soc_probe_link_dais(struct snd_soc_card *card,
>  				       dai_link->stream_name, ret);
>  				return ret;
>  			}
> -			ret = soc_link_dai_pcm_new(&cpu_dai, 1, rtd);
> +			ret = soc_link_dai_pcm_new(rtd->cpu_dais,
> +					rtd->num_cpu_dai, rtd);
>  			if (ret < 0)
>  				return ret;
>  			ret = soc_link_dai_pcm_new(rtd->codec_dais,
> @@ -2361,10 +2444,11 @@ int snd_soc_poweroff(struct device *dev)

Do we need to update the handling in snd_soc_runtime_set_dai_fmt?
Seems like we skipped over that.

Thanks,
Charles

  reply	other threads:[~2018-03-09 14:50 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-06 11:00 [PATCH 0/3] ASoC: Add Multi CPU DAI support Shreyas NC
2018-03-06 11:00 ` [PATCH 1/3] ASoC: Add initial support for multiple CPU DAIs Shreyas NC
2018-03-09 14:50   ` Charles Keepax [this message]
2018-03-12  5:02     ` Shreyas NC
2018-03-06 11:00 ` [PATCH 2/3] ASoC: Add Multi CPU DAI support for PCM ops Shreyas NC
2018-03-09 15:53   ` Charles Keepax
2018-03-12  5:36     ` Shreyas NC
2018-03-06 11:00 ` [PATCH 3/3] ASoC: Add Multi CPU DAI support in DAPM Shreyas NC
2018-03-09 16:31   ` Charles Keepax
2018-03-12  5:37     ` Shreyas NC
2018-03-12  9:21       ` Charles Keepax

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=20180309145043.lmdw5r3x7rhplk6x@localhost.localdomain \
    --to=ckeepax@opensource.cirrus.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=kuninori.morimoto.gx@renesas.com \
    --cc=lars@metafoo.de \
    --cc=liam.r.girdwood@linux.intel.com \
    --cc=patches.audio@intel.com \
    --cc=shreyas.nc@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 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.