diff mbox series

[2/3] ASoC: SOF: IPC4: query fw_context_save feature from fw

Message ID 20231215083102.3064200-3-yung-chuan.liao@linux.intel.com (mailing list archive)
State Accepted
Commit 855a4772be9dc777cbcd580c8a07d9c54908219b
Headers show
Series ASoC: SOF: query FW config to reload library | expand

Commit Message

Bard Liao Dec. 15, 2023, 8:31 a.m. UTC
From: Rander Wang <rander.wang@intel.com>

Driver queries fw_context_save feature when fw is ready and can skip
library reload with this feature since library is saved in persistent
memory. The default value of fw_context_save is true unless fw reports
false.

Signed-off-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
---
 sound/soc/sof/intel/lnl.c   | 2 ++
 sound/soc/sof/intel/mtl.c   | 2 ++
 sound/soc/sof/intel/tgl.c   | 2 ++
 sound/soc/sof/ipc4-loader.c | 3 +++
 sound/soc/sof/ipc4-priv.h   | 1 +
 5 files changed, 10 insertions(+)
diff mbox series

Patch

diff --git a/sound/soc/sof/intel/lnl.c b/sound/soc/sof/intel/lnl.c
index dfbe4067a349..ec2a346100f3 100644
--- a/sound/soc/sof/intel/lnl.c
+++ b/sound/soc/sof/intel/lnl.c
@@ -156,6 +156,8 @@  int sof_lnl_ops_init(struct snd_sof_dev *sdev)
 
 	ipc4_data->mtrace_type = SOF_IPC4_MTRACE_INTEL_CAVS_2;
 
+	ipc4_data->fw_context_save = true;
+
 	/* External library loading support */
 	ipc4_data->load_library = hda_dsp_ipc4_load_library;
 
diff --git a/sound/soc/sof/intel/mtl.c b/sound/soc/sof/intel/mtl.c
index d4b666f125ea..df05dc77b8d5 100644
--- a/sound/soc/sof/intel/mtl.c
+++ b/sound/soc/sof/intel/mtl.c
@@ -718,6 +718,8 @@  int sof_mtl_ops_init(struct snd_sof_dev *sdev)
 
 	ipc4_data->mtrace_type = SOF_IPC4_MTRACE_INTEL_CAVS_2;
 
+	ipc4_data->fw_context_save = true;
+
 	/* External library loading support */
 	ipc4_data->load_library = hda_dsp_ipc4_load_library;
 
diff --git a/sound/soc/sof/intel/tgl.c b/sound/soc/sof/intel/tgl.c
index d890cac6cb01..c2bb04c89b9d 100644
--- a/sound/soc/sof/intel/tgl.c
+++ b/sound/soc/sof/intel/tgl.c
@@ -91,6 +91,8 @@  int sof_tgl_ops_init(struct snd_sof_dev *sdev)
 
 		ipc4_data->mtrace_type = SOF_IPC4_MTRACE_INTEL_CAVS_2;
 
+		ipc4_data->fw_context_save = true;
+
 		/* External library loading support */
 		ipc4_data->load_library = hda_dsp_ipc4_load_library;
 
diff --git a/sound/soc/sof/ipc4-loader.c b/sound/soc/sof/ipc4-loader.c
index eaa04762eb11..3539b0a66e1b 100644
--- a/sound/soc/sof/ipc4-loader.c
+++ b/sound/soc/sof/ipc4-loader.c
@@ -391,6 +391,9 @@  int sof_ipc4_query_fw_configuration(struct snd_sof_dev *sdev)
 				goto out;
 			}
 			break;
+		case SOF_IPC4_FW_CONTEXT_SAVE:
+			ipc4_data->fw_context_save = *tuple->value;
+			break;
 		default:
 			break;
 		}
diff --git a/sound/soc/sof/ipc4-priv.h b/sound/soc/sof/ipc4-priv.h
index fea93b693f4d..1d39836d5efa 100644
--- a/sound/soc/sof/ipc4-priv.h
+++ b/sound/soc/sof/ipc4-priv.h
@@ -81,6 +81,7 @@  struct sof_ipc4_fw_data {
 	u32 mtrace_log_bytes;
 	int max_num_pipelines;
 	u32 max_libs_count;
+	bool fw_context_save;
 
 	int (*load_library)(struct snd_sof_dev *sdev,
 			    struct sof_ipc4_fw_library *fw_lib, bool reload);