mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH RESEND] ASoC: tas2783-sdw: restore the stereo split when no SDCA function data
@ 2026-12-02 14:55 Lee Mann
  0 siblings, 0 replies; only message in thread
From: Lee Mann @ 2026-12-02 14:55 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood, linux-sound
  Cc: Baojun Xu, Shenghao Ding, Niranjan H Y, Thorsten Leemhuis,
	regressions, Antoine Monnet, Andrey Golovko,
	Pierre-Louis Bossart, Matthew Schwartz, linux-kernel

Commit f42fbd560cd8 ("ASoC: tas2783-sdw: add firmware download status
check") removed the per-amp channel mask from tas_sdw_hw_params(), on
the basis that the channel is selected by the SDCA init table from
ACPI DisCo.

That only holds when the SmartAmp function is parsed. On the ASUS
ProArt PX13 (HN7306EA, two TAS2783 on SoundWire link 1) the ACPI
declares the function type without a DisCo constant, so
sdca_parse_function() fails, sa_func_data stays NULL and the init
table is never written. Both amps keep ClusterIndex 0x01 from
tas2783_init_seq and, with the full playback mask, the right speaker
is silent.

Restore the split for that case only: when sa_func_data is NULL, give
each amp a single channel from its machine-assigned prefix, as before
f42fbd560cd8. When the function data is present, keep the full mask
and let the init table select the channel, so platforms that parse
the table are unchanged.

Tested on the PX13 on v7.3.5 with the v7.4-rc5 driver plus this patch,
speaker-test -c2 -t wav:
  stock ACPI (function not parsed, split path): left and right correct
  SDCA function parsed (via the out-of-tree fallback from SOF PR #5904,
  init table applied, full mask): left and right correct

Fixes: f42fbd560cd8 ("ASoC: tas2783-sdw: add firmware download status check")
Closes: https://lore.kernel.org/all/20261107212552.10990-1-leepaulmann@gmail.com/
Link: https://github.com/thesofproject/linux/issues/6037
Assisted-by: LLM
Signed-off-by: Lee Mann <leepaulmann@gmail.com>
---
Resent as a new thread; the first copy went in reply to the v7 thread
(https://lore.kernel.org/all/3a7685b52ad14928828ff36f717b9440@ti.com/).
No changes.

Baojun, your boards parse the SmartAmp function, so the init table
selects the channel and the split broke them. The PX13 ACPI does not
("function type only supported as DisCo constant"), so without the
split nothing selects the right channel. A plain revert would break
your boards again; this keeps the split only for the unparsed case.
I can send the PX13 ACPI tables if still useful.

AI note: written with Claude Code; I reviewed, built and tested it.

 sound/soc/codecs/tas2783-sdw.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/sound/soc/codecs/tas2783-sdw.c b/sound/soc/codecs/tas2783-sdw.c
index 3f21700..45b45cb 100644
--- a/sound/soc/codecs/tas2783-sdw.c
+++ b/sound/soc/codecs/tas2783-sdw.c
@@ -995,6 +995,26 @@ 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.  snd_sdw_params_to_config()
+	 * hands every codec the full mask for playback, so the pair would render
+	 * the same channel.  In that case claim a single channel per amp, keyed
+	 * off the machine-assigned prefix (soc_sdw_ti_amp.c names the amps
+	 * tas2783-1..4).  When the function data is present, the init table
+	 * selects the channel and the full mask must be kept.
+	 */
+	if (!tas_dev->sa_func_data &&
+	    substream->stream == SNDRV_PCM_STREAM_PLAYBACK &&
+	    params_channels(params) == 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);
+	}
+
 	/* port 1 for playback */
 	if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
 		port_config.num = 1;
-- 
2.56.0


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-12-02 14:55 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-12-02 14:55 [PATCH RESEND] ASoC: tas2783-sdw: restore the stereo split when no SDCA function data Lee Mann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®