ASoC: codecs: aw88261: Add firmware-name support

Since the aw88261_acf.bin file appears to be device-specific, add
firmware-name support so that devicetree users can point to a
device-specific path to not conflict with other devices that might also
ship a aw88261_acf.bin.

Read the "firmware-name" property if available, and otherwise fall back
to the generic name.

Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
Link: https://patch.msgid.link/20260211-aw88261-fwname-v1-3-e24e833a019d@fairphone.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Luca Weiss 2026-02-11 11:27:34 +01:00 committed by Mark Brown
parent c5ad3f6231
commit 171b3663f3
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0

View File

@ -1094,17 +1094,22 @@ static int aw88261_dev_init(struct aw88261 *aw88261, struct aw_container *aw_cfg
static int aw88261_request_firmware_file(struct aw88261 *aw88261)
{
const struct firmware *cont = NULL;
const char *fw_name;
int ret;
aw88261->aw_pa->fw_status = AW88261_DEV_FW_FAILED;
ret = request_firmware(&cont, AW88261_ACF_FILE, aw88261->aw_pa->dev);
ret = device_property_read_string(aw88261->aw_pa->dev, "firmware-name", &fw_name);
if (ret)
fw_name = AW88261_ACF_FILE;
ret = request_firmware(&cont, fw_name, aw88261->aw_pa->dev);
if (ret)
return dev_err_probe(aw88261->aw_pa->dev, ret,
"load [%s] failed!", AW88261_ACF_FILE);
"load [%s] failed!", fw_name);
dev_info(aw88261->aw_pa->dev, "loaded %s - size: %zu\n",
AW88261_ACF_FILE, cont ? cont->size : 0);
fw_name, cont ? cont->size : 0);
aw88261->aw_cfg = devm_kzalloc(aw88261->aw_pa->dev, cont->size + sizeof(int), GFP_KERNEL);
if (!aw88261->aw_cfg) {
@ -1117,7 +1122,7 @@ static int aw88261_request_firmware_file(struct aw88261 *aw88261)
ret = aw88395_dev_load_acf_check(aw88261->aw_pa, aw88261->aw_cfg);
if (ret) {
dev_err(aw88261->aw_pa->dev, "load [%s] failed !", AW88261_ACF_FILE);
dev_err(aw88261->aw_pa->dev, "load [%s] failed !", fw_name);
return ret;
}