mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Matthew Schwartz <matthew.schwartz@linux.dev>
To: Mark Brown <broonie@kernel.org>
Cc: Shenghao Ding <shenghao-ding@ti.com>, Kevin Lu <kevin-lu@ti.com>,
	Baojun Xu <baojun.xu@ti.com>, Sen Wang <sen@ti.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
	linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/5] ASoC: tas2783-sdw: use the BIOS speaker ID in the firmware name
Date: Mon, 2 Nov 2026 15:54:12 -0800	[thread overview]
Message-ID: <b501e25d-022d-4f37-88f6-f82af3d101ff@linux.dev> (raw)
In-Reply-To: <179366321499.2186205.14199496267448130552.b4-review@b4>

On 11/2/26 3:46 PM, Mark Brown wrote:
>> Some boards have TAS2783 firmware in linux-firmware named
>> SSID-SPKID-LINK-0xUID.bin, with a speaker ID ahead of the link ID (the
>> HP 8EA1 has its amps on link 0 and ships 8EA1-{0,1}-0-0x*.bin). The
>> driver only builds the three-field SSID-LINK-0xUID name, so these boards
>> never load firmware. On the ASUS ROG Xbox Ally X20 (SSID 1954) the BIOS
>> provides the speaker ID in a 4-byte SPEAKER_ID EFI variable, and only
>> the four-field 1954-*-*-0x*.bin files exist.
> 
>> Read SPEAKER_ID once and request the four-field name first when it is
>> present. Boards without the variable keep the current names, and the
>> unprefixed three-field name is still tried if the four-field file is
>> missing.
> 
>> +static int tas2783_get_spk_id(void)
>> +{
>> +	efi_guid_t guid = TAS2783_SPKID_GUID;
>> +	unsigned long size = sizeof(u32);
>> +	efi_status_t status;
>> +	u32 spk_id = 0;
>> +
>> +	if (!efi_rt_services_supported(EFI_RT_SUPPORTED_GET_VARIABLE))
>> +		return -ENOENT;
>> +
>> +	status = efi.get_variable(L"SPEAKER_ID", &guid, NULL, &size, &spk_id);
>> +	if (status != EFI_SUCCESS)
>> +		return -ENOENT;
>> +
>> +	return spk_id;
> 
> This returns a u32 as an int so if someone decides to pick a very large
> value it'll look like an error value.  That's likely unrealistic though.
> 
>>  	for (; dev; dev = dev->parent) {
>>  		if (dev->bus == &pci_bus_type) {
>>  			pci = to_pci_dev(dev);
>> -			scnprintf(name, size, "%04X-%1X-%s%1X.bin",
>> -				  pci->subsystem_device, bus->link_id,
>> -				  fw_uid_prefix, unique_id);
>> +			if (!tas_dev->spk_id_read) {
>> +				tas_dev->spk_id = tas2783_get_spk_id();
>> +				tas_dev->spk_id_read = true;
>> +			}
>> +			if (tas_dev->spk_id >= 0 && !tas_dev->fw_use_fallback)
>> +				scnprintf(name, size, "%04X-%X-%1X-0x%1X.bin",
>> +					  pci->subsystem_device, tas_dev->spk_id,
>> +					  bus->link_id, unique_id);
>> +			else
>> +				scnprintf(name, size, "%04X-%1X-%s%1X.bin",
>> +					  pci->subsystem_device, bus->link_id,
>> +					  fw_uid_prefix, unique_id);
> 
> Mixing this in with the fallback decision seems confusing.  There's some
> cases generated in the Sashiko review which look plausible though I
> didn't fully work through everything:
> 
>    https://sashiko.dev/#/patchset/20261016232416.2628603-1-matthew.schwartz%40linux.dev

Thanks, didn't know Sashiko feedback wasn't in-line anymore. I'll take a look and send out a v2.

> 


  reply	other threads:[~2026-11-02 23:54 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-16 23:24 [PATCH 0/5] ASoC: support the ASUS ROG Xbox Ally X20 audio Matthew Schwartz
2026-10-16 23:24 ` [PATCH 1/5] ASoC: amd: acp-config: force SoundWire probe on ASUS RC74XA Matthew Schwartz
2026-10-19  5:40   ` Mukunda,Vijendar
2026-10-16 23:24 ` [PATCH 2/5] ASoC: amd: acp: add ACP70 SoundWire machine entry for " Matthew Schwartz
2026-10-19  5:41   ` Mukunda,Vijendar
2026-10-16 23:24 ` [PATCH 3/5] ASoC: tas2783-sdw: use the BIOS speaker ID in the firmware name Matthew Schwartz
2026-11-02 23:46   ` Mark Brown
2026-11-02 23:54     ` Matthew Schwartz [this message]
2026-11-02 23:59       ` Mark Brown
2026-10-16 23:24 ` [PATCH 4/5] ASoC: sdw_utils: honor empty DisCo port lists when creating DAI links Matthew Schwartz
2026-10-29  3:35   ` Mukunda,Vijendar
2026-11-02 23:46   ` Mark Brown
2026-10-16 23:24 ` [PATCH 5/5] ASoC: rt721-sdca: wait for PDEs to reach PS0 after powering them up Matthew Schwartz

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=b501e25d-022d-4f37-88f6-f82af3d101ff@linux.dev \
    --to=matthew.schwartz@linux.dev \
    --cc=baojun.xu@ti.com \
    --cc=broonie@kernel.org \
    --cc=kevin-lu@ti.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=sen@ti.com \
    --cc=shenghao-ding@ti.com \
    --cc=tiwai@suse.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

all inboxes | Powered by JetHome®