Linux Sound subsystem development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Lee Mann" <leepaulmann@gmail.com>, linux-sound@vger.kernel.org
Subject: Re: [PATCH v2] ASoC: tas2783-sdw: restore the stereo split when no SDCA function data
Date: Thu, 03 Dec 2026 14:15:40 +0000	[thread overview]
Message-ID: <sashiko-outbox-247937@kernel.org> (raw)
In-Reply-To: <20261203134857.11614-1-leepaulmann@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] ASoC: tas2783-sdw: inaccurate comment on ClusterIndex and
  ch_mask routing
--

commit faa58a455f0635ef0eb57c9ed35971c94e6b53eb
Author: Lee Mann <leepaulmann@gmail.com>

ASoC: tas2783-sdw: restore the stereo split when no SDCA function data

This commit restores a single-channel port_config.ch_mask and sets
stream_config.ch_count to 1 in tas_sdw_hw_params() for two-amp playback links
when SDCA SmartAmp function data is unavailable.

Link: https://github.com/thesofproject/linux/issues/6037

> diff --git a/sound/soc/codecs/tas2783-sdw.c b/sound/soc/codecs/tas2783-sdw.c
> index 08b37e7b3a9e4..899873a169b43 100644
> --- a/sound/soc/codecs/tas2783-sdw.c
> +++ b/sound/soc/codecs/tas2783-sdw.c
> @@ -994,6 +994,30 @@ static s32 tas_sdw_hw_params(struct snd_pcm_substream *substream,
>  	snd_sdw_params_to_config(substream, params,
>  				 &stream_config, &port_config);
>  
> +	/*
> +	 * Without the SDCA SmartAmp function data from ACPI DisCo, the per-amp
> +	 * init table that selects each amp's channel is never written and both
> +	 * amps keep the ClusterIndex from tas2783_init_seq, so with the full
> +	 * mask from snd_sdw_params_to_config() the pair renders one channel.
> +	 * With one amp per channel, give each amp its own channel, keyed off
> +	 * the machine-assigned prefix (tas2783-1 left, tas2783-2 right).
> +	 * Links with more amps than channels keep the full mask, as do
> +	 * platforms where the init table selects the channel.
> +	 */
> +	if (!tas_dev->sa_func_data &&
> +	    substream->stream == SNDRV_PCM_STREAM_PLAYBACK &&
> +	    params_channels(params) == 2 &&
> +	    snd_soc_substream_to_rtd(substream)->dai_link->num_codecs == 2 &&
> +	    component->name_prefix) {
> +		const char *idx_str = strrchr(component->name_prefix, '-');
> +		unsigned long idx;
> +
> +		if (idx_str && !kstrtoul(idx_str + 1, 10, &idx) && idx) {
> +			port_config.ch_mask = (idx & 1) ? BIT(0) : BIT(1);
> +			stream_config.ch_count = 1;
> +		}
> +	}

[Severity: Low]
Are the comment and commit message accurate in saying both amps keep
ClusterIndex from tas2783_init_seq?  tas2783_init_seq writes control 0x10 on
TAS2783_SDCA_ENT_PPU21, which is SDCA_CTL_PPU_POSTURENUMBER, not ClusterIndex
(control 0x10 on TAS2783_SDCA_ENT_UDMPU23).

The comment also implies that BIT(0) vs BIT(1) from component->name_prefix
selects left vs right.  sdw_compute_slave_ports() only uses
hweight32(p_rt->ch_mask) to advance port_bo across m_rt->slave_rt_list, so
channel assignment comes from codec ordering on the DAI link, not the bit.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261203134857.11614-1-leepaulmann@gmail.com?part=1

      reply	other threads:[~2026-12-03 14:15 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-03 13:48 [PATCH v2] ASoC: tas2783-sdw: restore the stereo split when no SDCA function data Lee Mann
2026-12-03 14:15 ` sashiko-bot [this message]

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=sashiko-outbox-247937@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=leepaulmann@gmail.com \
    --cc=linux-sound@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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