summaryrefslogtreecommitdiffstats
path: root/sound/soc/sof/ipc4.c
diff options
context:
space:
mode:
authorRander Wang <rander.wang@intel.com>2023-02-14 12:33:41 +0200
committerMark Brown <broonie@kernel.org>2023-02-14 13:25:11 +0000
commit167ca6a4fd87726e044df2db38fe86f6cb0fb907 (patch)
treee0817ebd712f6da49a55584493e2ba472ff282c6 /sound/soc/sof/ipc4.c
parentd227116c0e216da2eceba1d51a364ff025dffa58 (diff)
downloadlinux-stable-167ca6a4fd87726e044df2db38fe86f6cb0fb907.tar.gz
linux-stable-167ca6a4fd87726e044df2db38fe86f6cb0fb907.tar.bz2
linux-stable-167ca6a4fd87726e044df2db38fe86f6cb0fb907.zip
ASoC: SOF: Introduce a new set_pm_gate() IPC PM op
Set_pm_gate depends on ipc version. This patch defines the ops for both IPC3 and IPC4. Signed-off-by: Rander Wang <rander.wang@intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Link: https://lore.kernel.org/r/20230214103345.30669-2-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.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/sound/soc/sof/ipc4.c b/sound/soc/sof/ipc4.c
index f3c0c839d177..b27ec16ebdfa 100644
--- a/sound/soc/sof/ipc4.c
+++ b/sound/soc/sof/ipc4.c
@@ -656,9 +656,22 @@ static int sof_ipc4_ctx_save(struct snd_sof_dev *sdev)
return sof_ipc4_set_core_state(sdev, SOF_DSP_PRIMARY_CORE, false);
}
+static int sof_ipc4_set_pm_gate(struct snd_sof_dev *sdev, u32 flags)
+{
+ struct sof_ipc4_msg msg = {{0}};
+
+ msg.primary = SOF_IPC4_MSG_TYPE_SET(SOF_IPC4_MOD_SET_D0IX);
+ msg.primary |= SOF_IPC4_MSG_DIR(SOF_IPC4_MSG_REQUEST);
+ msg.primary |= SOF_IPC4_MSG_TARGET(SOF_IPC4_MODULE_MSG);
+ msg.extension = flags;
+
+ return sof_ipc4_tx_msg(sdev, &msg, 0, NULL, 0, true);
+}
+
static const struct sof_ipc_pm_ops ipc4_pm_ops = {
.ctx_save = sof_ipc4_ctx_save,
.set_core_state = sof_ipc4_set_core_state,
+ .set_pm_gate = sof_ipc4_set_pm_gate,
};
static int sof_ipc4_init(struct snd_sof_dev *sdev)