Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ASoC: codecs: aw88166: Support device specific firmware

This driver currently loads firmware from a hardcoded path. Support
loading device specific firmware when provided by the boot firmware.

Signed-off-by: Teguh Sobirin <teguh@sobir.in>
Co-developed-by: Aaron Kling <webgeek1234@gmail.com>
Signed-off-by: Aaron Kling <webgeek1234@gmail.com>
Link: https://patch.msgid.link/20260311-aw88166-fw-v2-1-8ef30dae3657@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Teguh Sobirin and committed by
Mark Brown
fc1fbafc 706d2dc0

+8 -4
+8 -4
sound/soc/codecs/aw88166.c
··· 1574 1574 static int aw88166_request_firmware_file(struct aw88166 *aw88166) 1575 1575 { 1576 1576 const struct firmware *cont = NULL; 1577 + const char *fw_name; 1577 1578 int ret; 1578 1579 1579 1580 aw88166->aw_pa->fw_status = AW88166_DEV_FW_FAILED; 1580 1581 1581 - ret = request_firmware(&cont, AW88166_ACF_FILE, aw88166->aw_pa->dev); 1582 + if (device_property_read_string(aw88166->aw_pa->dev, "firmware-name", &fw_name) < 0) 1583 + fw_name = AW88166_ACF_FILE; 1584 + 1585 + ret = request_firmware(&cont, fw_name, aw88166->aw_pa->dev); 1582 1586 if (ret) { 1583 - dev_err(aw88166->aw_pa->dev, "request [%s] failed!\n", AW88166_ACF_FILE); 1587 + dev_err(aw88166->aw_pa->dev, "request [%s] failed!\n", fw_name); 1584 1588 return ret; 1585 1589 } 1586 1590 1587 1591 dev_dbg(aw88166->aw_pa->dev, "loaded %s - size: %zu\n", 1588 - AW88166_ACF_FILE, cont ? cont->size : 0); 1592 + fw_name, cont ? cont->size : 0); 1589 1593 1590 1594 aw88166->aw_cfg = devm_kzalloc(aw88166->aw_pa->dev, 1591 1595 struct_size(aw88166->aw_cfg, data, cont->size), GFP_KERNEL); ··· 1603 1599 1604 1600 ret = aw88395_dev_load_acf_check(aw88166->aw_pa, aw88166->aw_cfg); 1605 1601 if (ret) { 1606 - dev_err(aw88166->aw_pa->dev, "load [%s] failed!\n", AW88166_ACF_FILE); 1602 + dev_err(aw88166->aw_pa->dev, "load [%s] failed!\n", fw_name); 1607 1603 return ret; 1608 1604 } 1609 1605