Skip to content

Commit 77c6072

Browse files
rfvirgilbroonie
authored andcommitted
ALSA: hda: cs35l56: Fix order of searching for firmware files
Check for the cases of system-specific bin file without a wmfw before falling back to looking for a generic wmfw. All system-specific options should be tried before falling back to loading a generic wmfw/bin. With the original code, the presence of a fallback generic wmfw on the filesystem would prevent using a system-specific tuning with a ROM firmware. Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Fixes: 73cfbfa ("ALSA: hda/cs35l56: Add driver for Cirrus Logic CS35L56 amplifier") Link: https://msgid.link/r/20240129162737.497-16-rf@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 9e92b77 commit 77c6072

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

sound/pci/hda/cs35l56_hda.c

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -483,6 +483,20 @@ static void cs35l56_hda_request_firmware_files(struct cs35l56_hda *cs35l56,
483483
NULL, "bin");
484484
return;
485485
}
486+
487+
/*
488+
* Check for system-specific bin files without wmfw before
489+
* falling back to generic firmware
490+
*/
491+
if (amp_name)
492+
cs35l56_hda_request_firmware_file(cs35l56, coeff_firmware, coeff_filename,
493+
cirrus_dir, system_name, amp_name, "bin");
494+
if (!*coeff_firmware)
495+
cs35l56_hda_request_firmware_file(cs35l56, coeff_firmware, coeff_filename,
496+
cirrus_dir, system_name, NULL, "bin");
497+
498+
if (*coeff_firmware)
499+
return;
486500
}
487501

488502
ret = cs35l56_hda_request_firmware_file(cs35l56, wmfw_firmware, wmfw_filename,
@@ -493,16 +507,6 @@ static void cs35l56_hda_request_firmware_files(struct cs35l56_hda *cs35l56,
493507
return;
494508
}
495509

496-
/* When a firmware file is not found must still search for the coeff files */
497-
if (system_name) {
498-
if (amp_name)
499-
cs35l56_hda_request_firmware_file(cs35l56, coeff_firmware, coeff_filename,
500-
cirrus_dir, system_name, amp_name, "bin");
501-
if (!*coeff_firmware)
502-
cs35l56_hda_request_firmware_file(cs35l56, coeff_firmware, coeff_filename,
503-
cirrus_dir, system_name, NULL, "bin");
504-
}
505-
506510
if (!*coeff_firmware)
507511
cs35l56_hda_request_firmware_file(cs35l56, coeff_firmware, coeff_filename,
508512
cirrus_dir, NULL, NULL, "bin");

0 commit comments

Comments
 (0)