ASoC: tas2783: Update loaded firmware names to linux-firmware 20260519
Subsystems (3)
PATCH 1/1 ASoC: tas2783: Update loaded firmware names to linux-firmware 20260519
In linux-firmware commit from 2026-05-19 2f90f4fe5c67f51a8410907a... ASoC: tas2783: Add Firmware files for tas2783A projects by Baojun Xu 138 new firmware files for tas2783 were added, none of which are loaded by the kernel. Kernel expects files to be named with the following
convention: "%04X-%1X-%1X.bin". However the added firmware files follow "-0x%1X.bin" naming instead with 0x hex prefix, which fails to load resulting in following dmesg log:
slave-tas2783 sdw:0:1:0102:0000:01:8: Direct firmware load for 1714-1-8.bin failed with error -2 slave-tas2783 sdw:0:1:0102:0000:01:8: Failed to read fw binary 1714-1-8.bin slave-tas2783 sdw:0:1:0102:0000:01:b: Direct firmware load for 1714-1-B.bin failed with error -2 slave-tas2783 sdw:0:1:0102:0000:01:b: Failed to read fw binary 1714-1-B.bin slave-tas2783 sdw:0:1:0102:0000:01:8: error playback without fw download slave-tas2783 sdw:0:1:0102:0000:01:8: ASoC error (-22): at snd_soc_dai_hw_params() on tas2783-codec
This same commit removes all 22 symlinks from WHENCE, that used naming without the '0x' prefix to only 6 prevoiusly existing .bin files.
This patch adds 0x prefix explicitly to the generated firmware name allowing file to successfully load. This results in functioning audio on my device - ASUS ProArt PX13 HN7306EAC, which uses 1714-1-0x8.bin and 1714-1-0xB.bin firmware files.
Tested on top of 7.1.0-rc6, but no changes exist in newest linux-next.
--- sound/soc/codecs/tas2783-sdw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/codecs/tas2783-sdw.c +1 -1
@@ -1120,7 +1120,7 @@ static void tas_generate_fw_name(struct sdw_slave *slave, char *name, size_t sizfor (; dev; dev = dev->parent) {if (dev->bus == &pci_bus_type) { pci =to_pci_dev (dev); -scnprintf (name, size,"%04X-%1X-%1X.bin" , +scnprintf (name, size,"%04X-%1X-0x%1X.bin" , pci->subsystem_device, bus->link_id, unique_id); pci_found = true;break ;
Signature · 1 line
2.54.0
Mark Brown
maintainerQuoted 2 lines · Bartosz Juraszewski
This same commit removes all 22 symlinks from WHENCE, that used naming without the '0x' prefix to only 6 prevoiusly existing .bin files.
So there will be existing userspace using the old names.
sound/soc/codecs/tas2783-sdw.c static void tas_generate_fw_name(struct sdw_slave *slave, char *name, size_t siz · line 1124
Quoted 11 lines
This patch adds
0xprefix explicitly to the generated firmware name allowing file to successfully load. This results in functioning audio on my device - ASUS ProArt PX13 HN7306EAC, which uses 1714-1-0x8.bin and 1714-1-0xB.bin firmware files.sound/soc/codecs/tas2783-sdw.c +1
-1for (; dev; dev = dev->parent) {if (dev->bus == &pci_bus_type) { pci =to_pci_dev (dev); -scnprintf (name, size,"%04X-%1X-%1X.bin" , +scnprintf (name, size,"%04X-%1X-0x%1X.bin" , pci->subsystem_device, bus->link_id, unique_id);
This will only use the new name, meaning that an existing working install will be broken when upgrading the kernel unless linux-firmware is also updated. We should try both names, assuming the change in name stays, so that existing installs continue to work.
PATCH v2 1/1 ASoC: tas2783: Update loaded firmware names to linux-firmware 20260519
In linux-firmware commit from 2026-05-19 2f90f4fe5c67f51a8410907a... ASoC: tas2783: Add Firmware files for tas2783A projects by Baojun Xu 138 new firmware files for tas2783 were added, none of which are loaded by the kernel. Kernel expects files to be named with the following
convention: "%04X-%1X-%1X.bin". However the added firmware files follow "-0x%1X.bin" naming instead with 0x hex prefix, which fails to load resulting in following dmesg log:
slave-tas2783 sdw:0:1:0102:0000:01:8: Direct firmware load for 1714-1-8.bin failed with error -2 slave-tas2783 sdw:0:1:0102:0000:01:8: Failed to read fw binary 1714-1-8.bin slave-tas2783 sdw:0:1:0102:0000:01:b: Direct firmware load for 1714-1-B.bin failed with error -2 slave-tas2783 sdw:0:1:0102:0000:01:b: Failed to read fw binary 1714-1-B.bin slave-tas2783 sdw:0:1:0102:0000:01:8: error playback without fw download slave-tas2783 sdw:0:1:0102:0000:01:8: ASoC error (-22): at snd_soc_dai_hw_params() on tas2783-codec
This same commit removes all 22 symlinks from WHENCE, that used naming without the '0x' prefix to only 6 prevoiusly existing .bin files.
This patch adds 0x prefix explicitly to the generated firmware name allowing file to successfully load. In case prefixed firmware is missing due to out of date linux-firmware, we set the fallback flag and attempt to load firmware again based on the old file names.
This prefix change results in functioning firmware loading on ASUS ProArt PX13 HN7306EAC, which uses 1714-1-0x8.bin and 1714-1-0xB.bin firmware files.
Tested on top of 7.1.0-rc6, but no changes exist in newest linux-next.
---
Hi Mark,
Quoted 4 lines
This will only use the new name, meaning that an existing working install will be broken when upgrading the kernel unless linux-firmware is also updated. We should try both names, assuming the change in name stays, so that existing installs continue to work.
You're right, I've added a fallback to try old name if new one fails.
v2:
- new fw_using_fallback device flag; set when new format fw not present
- if !fw_using_fallback and load fails, set flag and try reloading
- when fw_using_fallback - generate fw name with old format string
sound/soc/codecs/tas2783-sdw.c | 36 ++++++++++++++++++++++++++++------ 1 file changed, 30 insertions(+), 6 deletions(-)
sound/soc/codecs/tas2783-sdw.c +30 -6
@@ -100,6 +100,8 @@ struct tas2783_prv {wait_queue_head_t fw_wait;bool fw_dl_task_done;bool fw_dl_success; +/* use fallback fw name */ +bool fw_using_fallback; };static const struct reg_default tas2783_reg_default[] = {
@@ -725,6 +727,8 @@ static s32 tas_fw_get_next_file(const u8 *data, struct tas_fw_file *file)return file->length +sizeof (u32) *5 ; } +static s32 tas_io_init (struct device *dev,struct sdw_slave *slave); +static void tas2783_fw_ready (const struct firmware *fmw,void *context) { struct tas2783_prv *tas_dev =
@@ -732,6 +736,7 @@ static void tas2783_fw_ready(const struct firmware *fmw, void *context)const u8 *buf =NULL ;s32 img_sz, ret =0 , cur_file =0 ;s32 offset =0 ; +bool try_load_fallback = false; struct tas_fw_hdr *hdr __free(kfree) = kzalloc_obj(*hdr); struct tas_fw_file *file __free(kfree) = kzalloc_obj(*file);
@@ -740,11 +745,21 @@ static void tas2783_fw_ready(const struct firmware *fmw, void *context) goto out; } +/* firmware binary not found*/ if (!fmw || !fmw->data) { -/* firmware binary not found*/ -dev_err (tas_dev->dev, -"Failed to read fw binary %s\n" , - tas_dev->rca_binaryname); +if (!tas_dev->fw_using_fallback) { + tas_dev->fw_using_fallback = true; + try_load_fallback = true; + +dev_info (tas_dev->dev, +"Failed to read preferred fw binary: %s\n" , + tas_dev->rca_binaryname); + }else { +dev_err (tas_dev->dev, +"Failed to read fallback fw binary %s\n" , + tas_dev->rca_binaryname); + } + ret = -EINVAL ; goto out; }
@@ -800,6 +815,11 @@ static void tas2783_fw_ready(const struct firmware *fmw, void *context)wake_up (&tas_dev->fw_wait);if (fmw)release_firmware (fmw); + +if (try_load_fallback) { +dev_info (tas_dev->dev,"Attempting fallback fw load\n" ); +tas_io_init (tas_dev->dev, tas_dev->sdw_peripheral); + } }static inline s32 tas_clear_latch (struct tas2783_prv *priv)
@@ -1115,13 +1135,16 @@ static void tas_generate_fw_name(struct sdw_slave *slave, char *name, size_t sizbool pci_found = false;#if IS_ENABLED (CONFIG_PCI )struct device *dev = &slave->dev; +struct tas2783_prv *tas_dev =dev_get_drvdata (&slave->dev);struct pci_dev *pci =NULL ; +const char *fw_uid_prefix = tas_dev->fw_using_fallback ?"" :"0x" ;for (; dev; dev = dev->parent) {if (dev->bus == &pci_bus_type) { pci =to_pci_dev (dev); -scnprintf (name, size,"%04X-%1X-%1X.bin" , - pci->subsystem_device, bus->link_id, unique_id); +scnprintf (name, size,"%04X-%1X-%s%1X.bin" , + pci->subsystem_device, bus->link_id, + fw_uid_prefix, unique_id); pci_found = true;break ; }
@@ -1326,6 +1349,7 @@ static s32 tas_sdw_probe(struct sdw_slave *peripheral,mutex_init (&tas_dev->calib_lock);mutex_init (&tas_dev->pde_lock); + tas_dev->fw_using_fallback = false;init_waitqueue_head (&tas_dev->fw_wait);dev_set_drvdata (dev, tas_dev); regmap = devm_regmap_init_sdw_mbq_cfg(&peripheral->dev,
Signature · 1 line
2.54.0
Mark Brown
maintainerQuoted 6 lines · Bartosz Juraszewski
This patch adds
0xprefix explicitly to the generated firmware name allowing file to successfully load. In case prefixed firmware is missing due to out of date linux-firmware, we set the fallback flag and attempt to load firmware again based on the old file names.
sound/soc/codecs/tas2783-sdw.c static void tas2783_fw_ready(const struct firmware *fmw, void *context) · line 824
Quoted 10 lines
sound/soc/codecs/tas2783-sdw.c +5
-0@@ -800,6 +815,11 @@ static void tas2783_fw_ready(const struct firmware *fmw, void *context)wake_up (&tas_dev->fw_wait);if (fmw)release_firmware (fmw); + +if (try_load_fallback) { +dev_info (tas_dev->dev,"Attempting fallback fw load\n" ); +tas_io_init (tas_dev->dev, tas_dev->sdw_peripheral); + } }
This will unconditionally wake fw_wait even if we've gone for the fallback, meaning that the rest of the driver will think the firmware is ready when it isn't.
Quoted 31 lines
sound/soc/codecs/tas2783-sdw.c +6
-2static inline s32 tas_clear_latch (struct tas2783_prv *priv)@@ -1115,13 +1135,16 @@ static void tas_generate_fw_name(struct sdw_slave *slave, char *name, size_t sizbool pci_found = false;#if IS_ENABLED (CONFIG_PCI )struct device *dev = &slave->dev; +struct tas2783_prv *tas_dev =dev_get_drvdata (&slave->dev);struct pci_dev *pci =NULL ; +const char *fw_uid_prefix = tas_dev->fw_using_fallback ?"" :"0x" ;for (; dev; dev = dev->parent) {if (dev->bus == &pci_bus_type) { pci =to_pci_dev (dev); -scnprintf (name, size,"%04X-%1X-%1X.bin" , - pci->subsystem_device, bus->link_id, unique_id); +scnprintf (name, size,"%04X-%1X-%s%1X.bin" , + pci->subsystem_device, bus->link_id, + fw_uid_prefix, unique_id); pci_found = true;break ; }@@ -1326,6 +1349,7 @@ static s32 tas_sdw_probe(struct sdw_slave *peripheral,mutex_init (&tas_dev->calib_lock);mutex_init (&tas_dev->pde_lock); + tas_dev->fw_using_fallback = false;init_waitqueue_head (&tas_dev->fw_wait);dev_set_drvdata (dev, tas_dev); regmap = devm_regmap_init_sdw_mbq_cfg(&peripheral->dev,Signature · 1 line
2.54.0
PATCH v3 1/1 ASoC: tas2783: Update loaded firmware names to linux-firmware 20260519
In linux-firmware commit from 2026-05-19 2f90f4fe5c67f51a8410907a... ASoC: tas2783: Add Firmware files for tas2783A projects by Baojun Xu 138 new firmware files for tas2783 were added, none of which are loaded by the kernel. Kernel expects files to be named with the following
convention: "%04X-%1X-%1X.bin". However the added firmware files follow "-0x%1X.bin" naming instead with 0x hex prefix, which fails to load resulting in following dmesg log:
slave-tas2783 sdw:0:1:0102:0000:01:8: Direct firmware load for 1714-1-8.bin failed with error -2 slave-tas2783 sdw:0:1:0102:0000:01:8: Failed to read fw binary 1714-1-8.bin slave-tas2783 sdw:0:1:0102:0000:01:b: Direct firmware load for 1714-1-B.bin failed with error -2 slave-tas2783 sdw:0:1:0102:0000:01:b: Failed to read fw binary 1714-1-B.bin slave-tas2783 sdw:0:1:0102:0000:01:8: error playback without fw download slave-tas2783 sdw:0:1:0102:0000:01:8: ASoC error (-22): at snd_soc_dai_hw_params() on tas2783-codec
This same commit removes all 22 symlinks from WHENCE, that used naming without the '0x' prefix to only 6 prevoiusly existing .bin files.
This patch adds 0x prefix explicitly to the generated firmware name allowing file to successfully load. In case prefixed firmware is missing due to out of date linux-firmware, we set the fallback flag and attempt to load firmware again based on the old file names.
This prefix change results in functioning firmware loading on ASUS ProArt PX13 HN7306EAC, which uses 1714-1-0x8.bin and 1714-1-0xB.bin firmware files.
Tested on top of 7.1 and next-20260619 with SND_SOC_AMD_ACP7X set to no.
---
Hi Mark,
Quoted 7 lines
Quoted 7 lines
(quoted diff) +3
-0@@ -800,6 +815,11 @@ static void tas2783_fw_ready(const struct firmware *fmw, void *context) wake_up(&tas_dev->fw_wait); if (fmw) release_firmware(fmw); + + if (try_load_fallback) { + dev_info(tas_dev->dev, "Attempting fallback fw load\n");
Quoted 8 lines
Review static void tas2783_fw_ready(const struct firmware *fmw, void *context) · line 824
Quoted 4 lines
(quoted diff) +2
-0+ tas_io_init(tas_dev->dev, tas_dev->sdw_peripheral); + } }This will unconditionally wake
fw_waiteven if we've gone for the fallback, meaning that the rest of the driver will think the firmware is ready when it isn't.
Changed the way we load fallback fw to prevent the race condition of driver init proceeding before all loads are finished.
v3:
- tas2783_fw_ready callback no longer calls tas_io_init, only sets flag
- tas_io_init orchestrates both loads using fw_wait and flag check
- tas_io_init proceeds with init only after all loads finish
- new tas_fw_load helper for repeating fw loading and waiting logic
- renamed fw_using_fallback to fw_use_fallback
- fw_use_fallback resets on every init now to try both bins again
v2:
- new fw_using_fallback device flag; set when new format fw not present
- if !fw_using_fallback and load fails, set flag and try reloading
- when fw_using_fallback - generate fw name with old format string
sound/soc/codecs/tas2783-sdw.c | 75 +++++++++++++++++++++++----------- 1 file changed, 51 insertions(+), 24 deletions(-)
sound/soc/codecs/tas2783-sdw.c +51 -24
@@ -100,6 +100,8 @@ struct tas2783_prv {wait_queue_head_t fw_wait;bool fw_dl_task_done;bool fw_dl_success; +/* use fallback fw name */ +bool fw_use_fallback; };static const struct reg_default tas2783_reg_default[] = {
@@ -740,11 +742,19 @@ static void tas2783_fw_ready(const struct firmware *fmw, void *context) goto out; } +/* firmware binary not found*/ if (!fmw || !fmw->data) { -/* firmware binary not found*/ -dev_err (tas_dev->dev, -"Failed to read fw binary %s\n" , - tas_dev->rca_binaryname); +if (!tas_dev->fw_use_fallback) { + tas_dev->fw_use_fallback = true; +dev_info (tas_dev->dev, +"Failed to read preferred fw binary: %s, attempting fallback binary load\n" , + tas_dev->rca_binaryname); + }else { +dev_err (tas_dev->dev, +"Failed to read fallback fw binary %s\n" , + tas_dev->rca_binaryname); + } + ret = -EINVAL ; goto out; }
@@ -1103,13 +1113,16 @@ static void tas_generate_fw_name(struct sdw_slave *slave, char *name, size_t sizbool pci_found = false;#if IS_ENABLED (CONFIG_PCI )struct device *dev = &slave->dev; +struct tas2783_prv *tas_dev =dev_get_drvdata (&slave->dev);struct pci_dev *pci =NULL ; +const char *fw_uid_prefix = tas_dev->fw_use_fallback ?"" :"0x" ;for (; dev; dev = dev->parent) {if (dev->bus == &pci_bus_type) { pci =to_pci_dev (dev); -scnprintf (name, size,"%04X-%1X-%1X.bin" , - pci->subsystem_device, bus->link_id, unique_id); +scnprintf (name, size,"%04X-%1X-%s%1X.bin" , + pci->subsystem_device, bus->link_id, + fw_uid_prefix, unique_id); pci_found = true;break ; }
@@ -1121,17 +1134,45 @@ static void tas_generate_fw_name(struct sdw_slave *slave, char *name, size_t siz bus->link_id, unique_id); } +static s32 tas_fw_load (struct tas2783_prv *tas_dev,struct sdw_slave *slave) +{ +s32 ret; +u8 unique_id = tas_dev->sdw_peripheral->id.unique_id; + +tas_generate_fw_name (slave, tas_dev->rca_binaryname, +sizeof (tas_dev->rca_binaryname)); + + ret =request_firmware_nowait (THIS_MODULE ,FW_ACTION_UEVENT , + tas_dev->rca_binaryname, tas_dev->dev, +GFP_KERNEL , tas_dev, tas2783_fw_ready); +if (ret) { +dev_err (tas_dev->dev, +"firmware request failed for uid=%d, ret=%d\n" , + unique_id, ret); +return ret; + } + + ret =wait_event_timeout (tas_dev->fw_wait, tas_dev->fw_dl_task_done, +msecs_to_jiffies (TIMEOUT_FW_DL_MS )); +if (!ret) { +dev_err (tas_dev->dev,"fw request, wait_event timeout\n" ); +return -EAGAIN ; + } + +return 0 ; +} +static s32 tas_io_init (struct device *dev,struct sdw_slave *slave) {struct tas2783_prv *tas_dev =dev_get_drvdata (dev);s32 ret; -u8 unique_id = tas_dev->sdw_peripheral->id.unique_id;if (tas_dev->hw_init)return 0 ; tas_dev->fw_dl_task_done = false; tas_dev->fw_dl_success = false; + tas_dev->fw_use_fallback = false; ret =regmap_write (tas_dev->regmap,TAS2783_SW_RESET ,0x1 );if (ret) {
@@ -1140,25 +1181,11 @@ static s32 tas_io_init(struct device *dev, struct sdw_slave *slave) }usleep_range (2000 ,2200 ); -tas_generate_fw_name (slave, tas_dev->rca_binaryname, -sizeof (tas_dev->rca_binaryname)); + ret =tas_fw_load (tas_dev, slave); +if (!ret && tas_dev->fw_use_fallback) + ret =tas_fw_load (tas_dev, slave); - ret =request_firmware_nowait (THIS_MODULE ,FW_ACTION_UEVENT , - tas_dev->rca_binaryname, tas_dev->dev, -GFP_KERNEL , tas_dev, tas2783_fw_ready); -if (ret) { -dev_err (tas_dev->dev, -"firmware request failed for uid=%d, ret=%d\n" , - unique_id, ret); -return ret; - } - - ret =wait_event_timeout (tas_dev->fw_wait, tas_dev->fw_dl_task_done, -msecs_to_jiffies (TIMEOUT_FW_DL_MS ));if (!ret) { -dev_err (tas_dev->dev,"fw request, wait_event timeout\n" ); - ret = -EAGAIN ; - }else {if (tas_dev->sa_func_data) ret =sdca_regmap_write_init (dev, tas_dev->regmap, tas_dev->sa_func_data);
Signature · 1 line
2.54.0
Mark Brown
maintainerQuoted 13 lines · Bartosz Juraszewski
In linux-firmware commit from 2026-05-19
2f90f4fe5c67f51a8410907a...ASoC: tas2783: Add Firmware files for tas2783A projectsby Baojun Xu 138 new firmware files for tas2783 were added, none of which are loadedsound/soc/codecs/tas2783-sdw.c +9
-0+{ +s32 ret; +u8 unique_id = tas_dev->sdw_peripheral->id.unique_id; + +tas_generate_fw_name (slave, tas_dev->rca_binaryname, +sizeof (tas_dev->rca_binaryname)); + + ret = request_firmware_nowait(THIS_MODULE, FW_ACTION_UEVENT, + tas_dev->rca_binaryname, tas_dev->dev,
sound/soc/codecs/tas2783-sdw.c static void tas_generate_fw_name(struct sdw_slave *slave, char *name, size_t siz · line 1156
Quoted 10 lines
sound/soc/codecs/tas2783-sdw.c +10
-0+ GFP_KERNEL, tas_dev, tas2783_fw_ready); +if (ret) { +dev_err (tas_dev->dev, +"firmware request failed for uid=%d, ret=%d\n" , + unique_id, ret); +return ret; + } + + ret =wait_event_timeout (tas_dev->fw_wait, tas_dev->fw_dl_task_done, +msecs_to_jiffies (TIMEOUT_FW_DL_MS ));
You need to reset fw_dl_task_done for each run through this, _fw_ready() will set it unconditionally so if the first attempt to load fails the second attempt will see the flag already set and not actually need to wait.
PATCH v4 1/1 ASoC: tas2783: Update loaded firmware names to linux-firmware 20260519
In linux-firmware commit from 2026-05-19 2f90f4fe5c67f51a8410907a... ASoC: tas2783: Add Firmware files for tas2783A projects by Baojun Xu 138 new firmware files for tas2783 were added, none of which are loaded by the kernel. Kernel expects files to be named with the following
convention: "%04X-%1X-%1X.bin". However the added firmware files follow "-0x%1X.bin" naming instead with 0x hex prefix, which fails to load resulting in following dmesg log:
slave-tas2783 sdw:0:1:0102:0000:01:8: Direct firmware load for 1714-1-8.bin failed with error -2 slave-tas2783 sdw:0:1:0102:0000:01:8: Failed to read fw binary 1714-1-8.bin slave-tas2783 sdw:0:1:0102:0000:01:b: Direct firmware load for 1714-1-B.bin failed with error -2 slave-tas2783 sdw:0:1:0102:0000:01:b: Failed to read fw binary 1714-1-B.bin slave-tas2783 sdw:0:1:0102:0000:01:8: error playback without fw download slave-tas2783 sdw:0:1:0102:0000:01:8: ASoC error (-22): at snd_soc_dai_hw_params() on tas2783-codec
This same commit removes all 22 symlinks from WHENCE, that used naming without the '0x' prefix to only 6 prevoiusly existing .bin files.
This patch adds 0x prefix explicitly to the generated firmware name allowing file to successfully load. In case prefixed firmware is missing due to out of date linux-firmware, we set the fallback flag and attempt to load firmware again based on the old file names.
This prefix change results in functioning firmware loading on ASUS ProArt PX13 HN7306EAC, which uses 1714-1-0x8.bin and 1714-1-0xB.bin firmware files.
Tested on top of 7.1 and next-20260619 with SND_SOC_AMD_ACP7X set to no.
---
Hi Mark,
Quoted 4 lines · Mark Brown
You need to reset
fw_dl_task_donefor each run through this,_fw_ready()will set it unconditionally so if the first attempt to load fails the second attempt will see the flag already set and not actually need to wait.
v4:
- tas_fw_load resets fw_dl_task_done before each _fw_ready() to fix wait
v3:
- tas2783_fw_ready callback no longer calls tas_io_init, only sets flag
- tas_io_init orchestrates both loads using fw_wait and flag check
- tas_io_init proceeds with init only after all loads finish
- new tas_fw_load helper for repeating fw loading and waiting logic
- renamed fw_using_fallback to fw_use_fallback
- fw_use_fallback resets on every init now to try both bins again
v2:
- new fw_using_fallback device flag; set when new format fw not present
- if !fw_using_fallback and load fails, set flag and try reloading
- when fw_using_fallback - generate fw name with old format string
sound/soc/codecs/tas2783-sdw.c | 73 +++++++++++++++++++++++----------- 1 file changed, 50 insertions(+), 23 deletions(-)
sound/soc/codecs/tas2783-sdw.c +50 -23
@@ -100,6 +100,8 @@ struct tas2783_prv {wait_queue_head_t fw_wait;bool fw_dl_task_done;bool fw_dl_success; +/* use fallback fw name */ +bool fw_use_fallback; };static const struct reg_default tas2783_reg_default[] = {
@@ -740,11 +742,19 @@ static void tas2783_fw_ready(const struct firmware *fmw, void *context) goto out; } +/* firmware binary not found*/ if (!fmw || !fmw->data) { -/* firmware binary not found*/ -dev_err (tas_dev->dev, -"Failed to read fw binary %s\n" , - tas_dev->rca_binaryname); +if (!tas_dev->fw_use_fallback) { + tas_dev->fw_use_fallback = true; +dev_info (tas_dev->dev, +"Failed to read preferred fw binary: %s, attempting fallback binary load\n" , + tas_dev->rca_binaryname); + }else { +dev_err (tas_dev->dev, +"Failed to read fallback fw binary %s\n" , + tas_dev->rca_binaryname); + } + ret = -EINVAL ; goto out; }
@@ -1103,13 +1113,16 @@ static void tas_generate_fw_name(struct sdw_slave *slave, char *name, size_t sizbool pci_found = false;#if IS_ENABLED (CONFIG_PCI )struct device *dev = &slave->dev; +struct tas2783_prv *tas_dev =dev_get_drvdata (&slave->dev);struct pci_dev *pci =NULL ; +const char *fw_uid_prefix = tas_dev->fw_use_fallback ?"" :"0x" ;for (; dev; dev = dev->parent) {if (dev->bus == &pci_bus_type) { pci =to_pci_dev (dev); -scnprintf (name, size,"%04X-%1X-%1X.bin" , - pci->subsystem_device, bus->link_id, unique_id); +scnprintf (name, size,"%04X-%1X-%s%1X.bin" , + pci->subsystem_device, bus->link_id, + fw_uid_prefix, unique_id); pci_found = true;break ; }
@@ -1121,28 +1134,15 @@ static void tas_generate_fw_name(struct sdw_slave *slave, char *name, size_t siz bus->link_id, unique_id); } -static s32 tas_io_init (struct device *dev,struct sdw_slave *slave) +static s32 tas_fw_load (struct tas2783_prv *tas_dev,struct sdw_slave *slave) { -struct tas2783_prv *tas_dev =dev_get_drvdata (dev);s32 ret;u8 unique_id = tas_dev->sdw_peripheral->id.unique_id; -if (tas_dev->hw_init) -return 0 ; - - tas_dev->fw_dl_task_done = false; - tas_dev->fw_dl_success = false; - - ret =regmap_write (tas_dev->regmap,TAS2783_SW_RESET ,0x1 ); -if (ret) { -dev_err (dev,"sw reset failed, err=%d" , ret); -return ret; - } -usleep_range (2000 ,2200 ); -tas_generate_fw_name (slave, tas_dev->rca_binaryname,sizeof (tas_dev->rca_binaryname)); + tas_dev->fw_dl_task_done = false; ret =request_firmware_nowait (THIS_MODULE ,FW_ACTION_UEVENT , tas_dev->rca_binaryname, tas_dev->dev,GFP_KERNEL , tas_dev, tas2783_fw_ready);
@@ -1157,8 +1157,35 @@ static s32 tas_io_init(struct device *dev, struct sdw_slave *slave) msecs_to_jiffies(TIMEOUT_FW_DL_MS));if (!ret) {dev_err (tas_dev->dev,"fw request, wait_event timeout\n" ); - ret = -EAGAIN ; - }else { +return -EAGAIN ; + } + +return 0 ; +} + +static s32 tas_io_init (struct device *dev,struct sdw_slave *slave) +{ +struct tas2783_prv *tas_dev =dev_get_drvdata (dev); +s32 ret; + +if (tas_dev->hw_init) +return 0 ; + + tas_dev->fw_dl_success = false; + + ret =regmap_write (tas_dev->regmap,TAS2783_SW_RESET ,0x1 ); +if (ret) { +dev_err (dev,"sw reset failed, err=%d" , ret); +return ret; + } +usleep_range (2000 ,2200 ); + + tas_dev->fw_use_fallback = false; + ret =tas_fw_load (tas_dev, slave); +if (!ret && tas_dev->fw_use_fallback) + ret =tas_fw_load (tas_dev, slave); + +if (!ret) {if (tas_dev->sa_func_data) ret =sdca_regmap_write_init (dev, tas_dev->regmap, tas_dev->sa_func_data);
Signature · 1 line
2.54.0
Mark Brown
maintainerQuoted 1 line · Bartosz Juraszewski
ASoC: tas2783: Update loaded firmware names to linux-firmware 20260519
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-7.2
Thanks!
[1/1] ASoC: tas2783: Update loaded firmware names to linux-firmware 20260519
https://git.kernel.org/broonie/sound/c/e26bb459d0f3
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark