Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
To: Brent Lu <brent.lu@intel.com>, alsa-devel@alsa-project.org
Cc: Cezary Rojewski <cezary.rojewski@intel.com>,
	linux-kernel@vger.kernel.org, Jie Yang <yang.jie@linux.intel.com>,
	Takashi Iwai <tiwai@suse.com>,
	Liam Girdwood <liam.r.girdwood@linux.intel.com>,
	Mark Brown <broonie@kernel.org>, xliu <xiang.liu@cirrus.com>,
	Bard Liao <yung-chuan.liao@linux.intel.com>
Subject: Re: [PATCH] ASoC: Intel: cirrus-common: fix incorrect channel mapping
Date: Tue, 31 May 2022 09:51:36 -0500	[thread overview]
Message-ID: <8a8a6bd9-aabf-6f27-0422-a47b01556276@linux.intel.com> (raw)
In-Reply-To: <20220530125421.885236-1-brent.lu@intel.com>



On 5/30/22 07:54, Brent Lu wrote:
> From: xliu <xiang.liu@cirrus.com>
> 
> The default mapping of ASPRX1 Slot is left channel. Map the slots of
> right amplifiers (WR and TR) to right channel.
> 
> Signed-off-by: xliu <xiang.liu@cirrus.com>
> Signed-off-by: Brent Lu <brent.lu@intel.com>
> ---
>  sound/soc/intel/boards/sof_cirrus_common.c | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 
> diff --git a/sound/soc/intel/boards/sof_cirrus_common.c b/sound/soc/intel/boards/sof_cirrus_common.c
> index e71d74ec1b0b..64ca0e3991dc 100644
> --- a/sound/soc/intel/boards/sof_cirrus_common.c
> +++ b/sound/soc/intel/boards/sof_cirrus_common.c
> @@ -107,6 +107,7 @@ static int cs35l41_hw_params(struct snd_pcm_substream *substream,
>  	struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
>  	struct snd_soc_dai *codec_dai;
>  	int clk_freq, i, ret;
> +	int rx_ch[2] = {1, 0};

Should this be 'const'?

I am also not clear on the mapping, how does this select the right
channel? This selects slot0 and the left channel, what am I missing?


>  
>  	clk_freq = sof_dai_get_bclk(rtd); /* BCLK freq */
>  
> @@ -134,6 +135,17 @@ static int cs35l41_hw_params(struct snd_pcm_substream *substream,
>  				ret);
>  			return ret;
>  		}
> +
> +		/* Setup for R channel Slot: WR and TR */
> +		if (i % 2) {
> +			ret = snd_soc_dai_set_channel_map(codec_dai, 0, NULL,
> +							  ARRAY_SIZE(rx_ch), rx_ch);
> +			if (ret < 0) {
> +				dev_err(codec_dai->dev, "fail to set channel map, ret %d\n",
> +					ret);
> +				return ret;
> +			}
> +		}

Should we do this loop for the left channels as well to have an explicit
setting?

>  	}
>  
>  	return 0;

  reply	other threads:[~2022-05-31 15:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-30 12:54 [PATCH] ASoC: Intel: cirrus-common: fix incorrect channel mapping Brent Lu
2022-05-31 14:51 ` Pierre-Louis Bossart [this message]
2022-06-01 13:00   ` Lu, Brent

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=8a8a6bd9-aabf-6f27-0422-a47b01556276@linux.intel.com \
    --to=pierre-louis.bossart@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=brent.lu@intel.com \
    --cc=broonie@kernel.org \
    --cc=cezary.rojewski@intel.com \
    --cc=liam.r.girdwood@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tiwai@suse.com \
    --cc=xiang.liu@cirrus.com \
    --cc=yang.jie@linux.intel.com \
    --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