mirror of
https://github.com/torvalds/linux.git
synced 2026-06-01 11:03:43 +02:00
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.
This commit is contained in:
commit
85b47b3630
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user