From fa0ecc0c505b03c1219c3ff1f66d5af53d5b7e19 Mon Sep 17 00:00:00 2001 From: Rander Wang Date: Fri, 27 Oct 2023 14:50:07 +0800 Subject: [PATCH] ASoC: SOF: Intel: reload library based on feature_mask If library reload is not defined by fw, driver can skip library reload on d3 exit, or reload library. Signed-off-by: Rander Wang --- sound/soc/sof/intel/hda-loader.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sound/soc/sof/intel/hda-loader.c b/sound/soc/sof/intel/hda-loader.c index 9d50652cc3f45e..62bd5bd047038f 100644 --- a/sound/soc/sof/intel/hda-loader.c +++ b/sound/soc/sof/intel/hda-loader.c @@ -519,14 +519,15 @@ int hda_dsp_ipc4_load_library(struct snd_sof_dev *sdev, struct sof_ipc4_fw_library *fw_lib, bool reload) { struct sof_intel_hda_dev *hda = sdev->pdata->hw_pdata; + struct sof_ipc4_fw_data *ipc4_data = sdev->private; struct hdac_ext_stream *hext_stream; struct firmware stripped_firmware; struct sof_ipc4_msg msg = {}; struct snd_dma_buffer dmab; int ret, ret1; - /* IMR booting will restore the libraries as well, skip the loading */ - if (reload && hda->booted_from_imr) + /* if IMR booting is enabled and library reload is not defined, skip the loading */ + if (reload && hda->booted_from_imr && !ipc4_data->feature_mask & SOF_IPC4_LIBRARY_RELOAD) return 0; /* the fw_lib has been verified during loading, we can trust the validity here */