Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Cc: Linux-ALSA <alsa-devel@alsa-project.org>
Subject: Re: [PATCH 4/8] ASoC: soc-pcm: add soc_pcm_care_symmetry()
Date: Tue, 2 Mar 2021 13:10:51 +0000	[thread overview]
Message-ID: <20210302131051.GE4522@sirena.org.uk> (raw)
In-Reply-To: <87o8g2qqaw.wl-kuninori.morimoto.gx@renesas.com>

[-- Attachment #1: Type: text/plain, Size: 2155 bytes --]

On Tue, Mar 02, 2021 at 10:48:07AM +0900, Kuninori Morimoto wrote:

> -static bool soc_pcm_has_symmetry(struct snd_pcm_substream *substream)
> +static void soc_pcm_care_symmetry(struct snd_pcm_substream *substream)
>  {
>  	struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
>  	struct snd_soc_dai_link *link = rtd->dai_link;
> @@ -423,7 +423,8 @@ static bool soc_pcm_has_symmetry(struct snd_pcm_substream *substream)
>  			dai->driver->symmetric_channels ||
>  			dai->driver->symmetric_sample_bits;
>  
> -	return symmetry;
> +	if (symmetry)
> +		substream->runtime->hw.info |= SNDRV_PCM_INFO_JOINT_DUPLEX;

The idea makes sense but I'm not sure about the name here - perhaps
soc_pcm_update_symmetry() might work better?  It's not super clear but
does look more natural.

>  }
>  
>  static void soc_pcm_set_msb(struct snd_pcm_substream *substream, int bits)
> @@ -735,8 +736,7 @@ static int soc_pcm_open(struct snd_pcm_substream *substream)
>  	/* Check that the codec and cpu DAIs are compatible */
>  	soc_pcm_init_runtime_hw(substream);
>  
> -	if (soc_pcm_has_symmetry(substream))
> -		runtime->hw.info |= SNDRV_PCM_INFO_JOINT_DUPLEX;
> +	soc_pcm_care_symmetry(substream);
>  
>  	ret = -EINVAL;
>  	if (!runtime->hw.rates) {
> @@ -1681,8 +1681,7 @@ static int dpcm_apply_symmetry(struct snd_pcm_substream *fe_substream,
>  	int i;
>  
>  	/* apply symmetry for FE */
> -	if (soc_pcm_has_symmetry(fe_substream))
> -		fe_substream->runtime->hw.info |= SNDRV_PCM_INFO_JOINT_DUPLEX;
> +	soc_pcm_care_symmetry(fe_substream);
>  
>  	for_each_rtd_cpu_dais (fe, i, fe_cpu_dai) {
>  		/* Symmetry only applies if we've got an active stream. */
> @@ -1707,8 +1706,7 @@ static int dpcm_apply_symmetry(struct snd_pcm_substream *fe_substream,
>  		if (rtd->dai_link->be_hw_params_fixup)
>  			continue;
>  
> -		if (soc_pcm_has_symmetry(be_substream))
> -			be_substream->runtime->hw.info |= SNDRV_PCM_INFO_JOINT_DUPLEX;
> +		soc_pcm_care_symmetry(be_substream);
>  
>  		/* Symmetry only applies if we've got an active stream. */
>  		for_each_rtd_dais(rtd, i, dai) {
> -- 
> 2.25.1
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2021-03-02 13:13 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-02  1:47 [PATCH 0/8] ASoC: soc-pcm: cleanup each functions Kuninori Morimoto
2021-03-02  1:47 ` [PATCH 1/8] ASoC: soc-pcm: check DAI activity under soc_pcm_apply_symmetry() Kuninori Morimoto
2021-03-02  1:47 ` [PATCH 2/8] ASoC: soc-pcm: add soc_cpu/codec_dai_name() macro Kuninori Morimoto
2021-03-02 13:04   ` Mark Brown
2021-03-04 22:04     ` Kuninori Morimoto
2021-03-02  1:48 ` [PATCH 3/8] ASoC: soc-pcm: direct copy at snd_soc_set_runtime_hwparams() Kuninori Morimoto
2021-03-02  1:48 ` [PATCH 4/8] ASoC: soc-pcm: add soc_pcm_care_symmetry() Kuninori Morimoto
2021-03-02 13:10   ` Mark Brown [this message]
2021-03-04 22:06     ` Kuninori Morimoto
2021-03-02  1:48 ` [PATCH 5/8] ASoC: soc-pcm: add soc_hw_sanity_check() Kuninori Morimoto
2021-03-02  1:48 ` [PATCH 6/8] ASoC: soc-pcm: fixup dpcm_be_dai_startup() user count Kuninori Morimoto
2021-03-02  1:48 ` [PATCH 7/8] ASoC: soc-pcm: remove unneeded !rtd->dai_link check Kuninori Morimoto
2021-03-02  1:48 ` [PATCH 8/8] ASoC: soc-pcm: share DPCM BE DAI stop operation 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=20210302131051.GE4522@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=kuninori.morimoto.gx@renesas.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