[PATCH 2/2] ALSA: hda: aw88399: use SSID-specific firmware name
From: Marco Giunta
Date: Sun Oct 18 2026 - 13:45:34 EST
Use the ACPI subsystem ID to construct per-model firmware filenames
(e.g. "awinic/aw88399_acf_17aa3938.bin") when loading firmware on HDA
systems. This makes the driver compatible with the linux-firmware
repository's per-device naming convention.
Also, since the ACPI SSID is now required for firmware loading, change
the error handling for a missing SSID from silently succeeding
to an early -ENODEV return in aw88399_hda_acpi_probe().
Tested-by: Xia Yun'an <imitoy@xxxxxxxxxx>
Signed-off-by: Marco Giunta <marco_giunta@xxxxxxxxxx>
---
sound/hda/codecs/side-codecs/aw88399_hda.c | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
diff --git a/sound/hda/codecs/side-codecs/aw88399_hda.c b/sound/hda/codecs/side-codecs/aw88399_hda.c
index 78bafe3c1b64..1cfda25dce57 100644
--- a/sound/hda/codecs/side-codecs/aw88399_hda.c
+++ b/sound/hda/codecs/side-codecs/aw88399_hda.c
@@ -12,6 +12,7 @@
#include <linux/mutex.h>
#include <linux/pm_runtime.h>
#include <linux/string.h>
+#include <linux/string_helpers.h>
#include <sound/hda_codec.h>
#include "../generic.h"
#include "hda_component.h"
@@ -129,10 +130,17 @@ static int aw88399_hda_init(struct aw88399_hda *aw88399)
if (core->aw_pa)
aw88399_dev_set_channel(core, aw88399->channel);
- ret = aw88399_request_firmware_file(core, AW88399_ACF_FILE);
+ char *fw_name __free(kfree) =
+ kasprintf(GFP_KERNEL, "awinic/aw88399_acf_%s.bin", aw88399->acpi_subsystem_id);
+ if (!fw_name)
+ return -ENOMEM;
+ string_lower(fw_name, fw_name);
+ ret = aw88399_request_firmware_file(core, fw_name);
if (ret)
return ret;
+ dev_info(dev, "Loaded firmware %s\n", fw_name);
+
aw88399->core = core;
aw88399->aw_dev = core->aw_pa;
@@ -193,8 +201,10 @@ static int aw88399_hda_acpi_probe(struct aw88399_hda *aw88399)
return -ENODEV;
sub = acpi_get_subsystem_id(ACPI_HANDLE(physdev));
- if (IS_ERR_OR_NULL(sub))
- return 0;
+ if (IS_ERR_OR_NULL(sub)) {
+ dev_err(aw88399->dev, "ACPI subsystem ID not available\n");
+ return -ENODEV;
+ }
aw88399->acpi_subsystem_id = devm_kstrdup(aw88399->dev, sub, GFP_KERNEL);
kfree(sub);
@@ -347,4 +357,4 @@ MODULE_DESCRIPTION("AW88399 HDA driver");
MODULE_AUTHOR("Yakov Till <yakov.till@xxxxxxxxx>");
MODULE_AUTHOR("Marco Giunta <marco_giunta@xxxxxxxxxx>");
MODULE_LICENSE("GPL");
-MODULE_FIRMWARE("aw88399_acf.bin");
+MODULE_FIRMWARE("awinic/aw88399_acf_*.bin");
--
2.56.0