aboutsummaryrefslogtreecommitdiff
path: root/sound/soc/sof
diff options
context:
space:
mode:
authorGravatar Mark Brown <broonie@kernel.org> 2023-05-23 20:49:22 +0100
committerGravatar Mark Brown <broonie@kernel.org> 2023-05-23 20:49:22 +0100
commita23b51b2c31c47036d0a9ae498094c428b1d8015 (patch)
treefc45cddb929e1dbac36146019a8819f005136e49 /sound/soc/sof
parentASoC: SOF: Intel: hda-dai: Fix locking in hda_ipc4_pre_trigger() (diff)
parentASoC: SOF: Intel: tgl: unify core_put on IPC3 & IPC4 path (diff)
downloadlinux-a23b51b2c31c47036d0a9ae498094c428b1d8015.tar.gz
linux-a23b51b2c31c47036d0a9ae498094c428b1d8015.tar.bz2
linux-a23b51b2c31c47036d0a9ae498094c428b1d8015.zip
ASoC: SOF: Intel: mtl: Enable multicore support
Merge series from Peter Ujfalusi <peter.ujfalusi@linux.intel.com>: The following series will enable multicore support on MTL platforms similarly to other Intel platforms. The TGL patch is included to simplify the core_put implementation. Multicore support can be enabled by updated topologies, with current set of tplg files this series is not introducing any runtime change.
Diffstat (limited to 'sound/soc/sof')
-rw-r--r--sound/soc/sof/intel/mtl.c33
-rw-r--r--sound/soc/sof/intel/tgl.c10
2 files changed, 39 insertions, 4 deletions
diff --git a/sound/soc/sof/intel/mtl.c b/sound/soc/sof/intel/mtl.c
index 46caf3ccde66..93dc2c9d8448 100644
--- a/sound/soc/sof/intel/mtl.c
+++ b/sound/soc/sof/intel/mtl.c
@@ -613,6 +613,36 @@ static u64 mtl_dsp_get_stream_hda_link_position(struct snd_sof_dev *sdev,
return ((u64)llp_u << 32) | llp_l;
}
+static int mtl_dsp_core_get(struct snd_sof_dev *sdev, int core)
+{
+ const struct sof_ipc_pm_ops *pm_ops = sdev->ipc->ops->pm;
+
+ if (core == SOF_DSP_PRIMARY_CORE)
+ return mtl_dsp_core_power_up(sdev, SOF_DSP_PRIMARY_CORE);
+
+ if (pm_ops->set_core_state)
+ return pm_ops->set_core_state(sdev, core, true);
+
+ return 0;
+}
+
+static int mtl_dsp_core_put(struct snd_sof_dev *sdev, int core)
+{
+ const struct sof_ipc_pm_ops *pm_ops = sdev->ipc->ops->pm;
+ int ret;
+
+ if (pm_ops->set_core_state) {
+ ret = pm_ops->set_core_state(sdev, core, false);
+ if (ret < 0)
+ return ret;
+ }
+
+ if (core == SOF_DSP_PRIMARY_CORE)
+ return mtl_dsp_core_power_down(sdev, SOF_DSP_PRIMARY_CORE);
+
+ return 0;
+}
+
/* Meteorlake ops */
struct snd_sof_dsp_ops sof_mtl_ops;
EXPORT_SYMBOL_NS(sof_mtl_ops, SND_SOC_SOF_INTEL_HDA_COMMON);
@@ -649,7 +679,8 @@ int sof_mtl_ops_init(struct snd_sof_dev *sdev)
sof_mtl_ops.parse_platform_ext_manifest = NULL;
/* dsp core get/put */
- /* TODO: add core_get and core_put */
+ sof_mtl_ops.core_get = mtl_dsp_core_get;
+ sof_mtl_ops.core_put = mtl_dsp_core_put;
sof_mtl_ops.get_stream_position = mtl_dsp_get_stream_hda_link_position;
diff --git a/sound/soc/sof/intel/tgl.c b/sound/soc/sof/intel/tgl.c
index 2713b7dc7931..8e2b07e1612b 100644
--- a/sound/soc/sof/intel/tgl.c
+++ b/sound/soc/sof/intel/tgl.c
@@ -39,14 +39,18 @@ static int tgl_dsp_core_get(struct snd_sof_dev *sdev, int core)
static int tgl_dsp_core_put(struct snd_sof_dev *sdev, int core)
{
const struct sof_ipc_pm_ops *pm_ops = sdev->ipc->ops->pm;
+ int ret;
+
+ if (pm_ops->set_core_state) {
+ ret = pm_ops->set_core_state(sdev, core, false);
+ if (ret < 0)
+ return ret;
+ }
/* power down primary core and return */
if (core == SOF_DSP_PRIMARY_CORE)
return hda_dsp_core_reset_power_down(sdev, BIT(core));
- if (pm_ops->set_core_state)
- return pm_ops->set_core_state(sdev, core, false);
-
return 0;
}