ASoC: SOF: IPC4: query fw_context_save feature from fw
authorRander Wang <rander.wang@intel.com>
Fri, 15 Dec 2023 08:31:01 +0000 (16:31 +0800)
committerMark Brown <broonie@kernel.org>
Fri, 15 Dec 2023 12:57:56 +0000 (12:57 +0000)
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>
Link: https://msgid.link/r/20231215083102.3064200-3-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sof/intel/lnl.c
sound/soc/sof/intel/mtl.c
sound/soc/sof/intel/tgl.c
sound/soc/sof/ipc4-loader.c
sound/soc/sof/ipc4-priv.h

index a095f5bcf50d038e784fe3f4b2d670e0f713667e..30712ea05a7a54086c798aa9e737cf0f7283ebbb 100644 (file)
@@ -133,6 +133,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;
 
index 3121a89219dd3150d0e484f359a224fff46c5439..c14a80dd90fd2b52cf58abc9a3f717caf3a8e10d 100644 (file)
@@ -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;
 
index d890cac6cb01bc1710488a19dfe58470c25e436d..c2bb04c89b9d6b371d04f8b34c66a84472c72552 100644 (file)
@@ -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;
 
index eaa04762eb1122df3d23cbb619ac3a55c8c5f8d4..3539b0a66e1beedb6a5e2841a999b97f39cf75c0 100644 (file)
@@ -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;
                }
index fea93b693f4d99d2442d3742673a42f941026288..1d39836d5efacc880163f3c8449d24bde87c3434 100644 (file)
@@ -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);