summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2026-02-23 17:49:32 +0300
committerMark Brown <broonie@kernel.org>2026-02-23 17:49:32 +0300
commit85b47b36303e9fc5fe8077ac495a2c79643bdec3 (patch)
tree159d6826faa5f544c8b368cfb820eff037b9fd33
parentd075cef4af6327a5de4bee7bf77591e3201e54f4 (diff)
parent171b3663f33e1efdc97f5112f49be10b47b20fa8 (diff)
downloadlinux-85b47b36303e9fc5fe8077ac495a2c79643bdec3.tar.xz
Bitmask logic fix and firmware-name support for
Merge series from Luca Weiss <luca.weiss@fairphone.com>: First a patch which fixes a logic error in the aw88261 driver. And then we add "firmware-name" support for that driver to support loading the device-specific firmware properly.
-rw-r--r--Documentation/devicetree/bindings/sound/awinic,aw88395.yaml4
-rw-r--r--sound/soc/codecs/aw88261.c13
2 files changed, 13 insertions, 4 deletions
diff --git a/Documentation/devicetree/bindings/sound/awinic,aw88395.yaml b/Documentation/devicetree/bindings/sound/awinic,aw88395.yaml
index 994d68c074a9..b9abb10942ba 100644
--- a/Documentation/devicetree/bindings/sound/awinic,aw88395.yaml
+++ b/Documentation/devicetree/bindings/sound/awinic,aw88395.yaml
@@ -35,6 +35,10 @@ properties:
dvdd-supply: true
+ firmware-name:
+ maxItems: 1
+ description: Name of the *_acf.bin file used for amplifier initialization
+
awinic,audio-channel:
description:
It is used to distinguish multiple PA devices, so that different
diff --git a/sound/soc/codecs/aw88261.c b/sound/soc/codecs/aw88261.c
index 43c03d3cb252..02f8c2bb2569 100644
--- a/sound/soc/codecs/aw88261.c
+++ b/sound/soc/codecs/aw88261.c
@@ -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;
}