diff options
author | Peter Ujfalusi <peter.ujfalusi@linux.intel.com> | 2022-06-10 11:35:49 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2022-06-10 13:31:43 +0100 |
commit | 63b9069653a710b08d5fd174ac05d43711356541 (patch) | |
tree | dcdc21bd873555ce304aad36b7736116403089fe /sound/soc/sof/ipc4.c | |
parent | 7a5677407300e8ba6af95e66f4e8cfe23059f4a7 (diff) | |
download | linux-stable-63b9069653a710b08d5fd174ac05d43711356541.tar.gz linux-stable-63b9069653a710b08d5fd174ac05d43711356541.tar.bz2 linux-stable-63b9069653a710b08d5fd174ac05d43711356541.zip |
ASoC: SOF: ipc4: implement pm ctx_save callback
Use the context save callback to power down the primary core which is used
by the firmware as an indication that the DSP is going to be turned off.
The IMR boot setup is done in response to the primary core power down.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20220610083549.16773-7-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/sof/ipc4.c')
-rw-r--r-- | sound/soc/sof/ipc4.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/sound/soc/sof/ipc4.c b/sound/soc/sof/ipc4.c index b2cb92745ec6..5dd22f6a0605 100644 --- a/sound/soc/sof/ipc4.c +++ b/sound/soc/sof/ipc4.c @@ -618,7 +618,22 @@ static int sof_ipc4_set_core_state(struct snd_sof_dev *sdev, int core_idx, bool return sof_ipc4_tx_msg(sdev, &msg, msg.data_size, NULL, 0, false); } +/* + * The context save callback is used to send a message to the firmware notifying + * it that the primary core is going to be turned off, which is used as an + * indication to prepare for a full power down, thus preparing for IMR boot + * (when supported) + * + * Note: in IPC4 there is no message used to restore context, thus no context + * restore callback is implemented + */ +static int sof_ipc4_ctx_save(struct snd_sof_dev *sdev) +{ + return sof_ipc4_set_core_state(sdev, SOF_DSP_PRIMARY_CORE, false); +} + static const struct sof_ipc_pm_ops ipc4_pm_ops = { + .ctx_save = sof_ipc4_ctx_save, .set_core_state = sof_ipc4_set_core_state, }; |