···656656 int ret;657657658658 /* Use wm_adsp to load and apply the firmware patch and coefficient files */659659- ret = wm_adsp_power_up(&cs35l56->dsp);659659+ ret = wm_adsp_power_up(&cs35l56->dsp, true);660660 if (ret)661661 dev_dbg(cs35l56->base.dev, "%s: wm_adsp_power_up ret %d\n", __func__, ret);662662 else···665665666666static void cs35l56_patch(struct cs35l56_private *cs35l56)667667{668668+ unsigned int firmware_missing;668669 int ret;670670+671671+ ret = regmap_read(cs35l56->base.regmap, CS35L56_PROTECTION_STATUS, &firmware_missing);672672+ if (ret) {673673+ dev_err(cs35l56->base.dev, "Failed to read PROTECTION_STATUS: %d\n", ret);674674+ return;675675+ }676676+677677+ firmware_missing &= CS35L56_FIRMWARE_MISSING;669678670679 /*671680 * Disable SoundWire interrupts to prevent race with IRQ work.···694685 if (ret)695686 goto err;696687697697- /* Use wm_adsp to load and apply the firmware patch and coefficient files */698698- ret = wm_adsp_power_up(&cs35l56->dsp);688688+ /*689689+ * Use wm_adsp to load and apply the firmware patch and coefficient files,690690+ * but only if firmware is missing. If firmware is already patched just691691+ * power-up wm_adsp without downloading firmware.692692+ */693693+ ret = wm_adsp_power_up(&cs35l56->dsp, !!firmware_missing);699694 if (ret) {700695 dev_dbg(cs35l56->base.dev, "%s: wm_adsp_power_up ret %d\n", __func__, ret);701696 goto err;
+9-7
sound/soc/codecs/wm_adsp.c
···998998}999999EXPORT_SYMBOL_GPL(wm_adsp2_preloader_put);1000100010011001-int wm_adsp_power_up(struct wm_adsp *dsp)10011001+int wm_adsp_power_up(struct wm_adsp *dsp, bool load_firmware)10021002{10031003 int ret = 0;10041004 char *wmfw_filename = NULL;···10061006 char *coeff_filename = NULL;10071007 const struct firmware *coeff_firmware = NULL;1008100810091009- ret = wm_adsp_request_firmware_files(dsp,10101010- &wmfw_firmware, &wmfw_filename,10111011- &coeff_firmware, &coeff_filename);10121012- if (ret)10131013- return ret;10091009+ if (load_firmware) {10101010+ ret = wm_adsp_request_firmware_files(dsp,10111011+ &wmfw_firmware, &wmfw_filename,10121012+ &coeff_firmware, &coeff_filename);10131013+ if (ret)10141014+ return ret;10151015+ }1014101610151017 ret = cs_dsp_power_up(&dsp->cs_dsp,10161018 wmfw_firmware, wmfw_filename,···10391037 struct wm_adsp,10401038 boot_work);1041103910421042- wm_adsp_power_up(dsp);10401040+ wm_adsp_power_up(dsp, true);10431041}1044104210451043int wm_adsp_early_event(struct snd_soc_dapm_widget *w,