ASoC: SOF: Intel: lnl: add core get and set support for dsp core
authorRander Wang <rander.wang@intel.com>
Mon, 4 Dec 2023 21:44:07 +0000 (15:44 -0600)
committerMark Brown <broonie@kernel.org>
Tue, 5 Dec 2023 13:12:42 +0000 (13:12 +0000)
Driver uses get and set ops to change the power state of dsp core.

Closes: https://github.com/thesofproject/sof/issues/8478
Signed-off-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20231204214407.208528-1-pierre-louis.bossart@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/mtl.h

index 03308721ebd4fcb88997fcb2b2f0bc29ade1e95c..a095f5bcf50d038e784fe3f4b2d670e0f713667e 100644 (file)
@@ -120,6 +120,10 @@ int sof_lnl_ops_init(struct snd_sof_dev *sdev)
 
        sof_lnl_ops.get_stream_position = mtl_dsp_get_stream_hda_link_position;
 
+       /* dsp core get/put */
+       sof_lnl_ops.core_get = mtl_dsp_core_get;
+       sof_lnl_ops.core_put = mtl_dsp_core_put;
+
        sdev->private = kzalloc(sizeof(struct sof_ipc4_fw_data), GFP_KERNEL);
        if (!sdev->private)
                return -ENOMEM;
index f941e2c49d7813c17467b2600f5a30b52778c06a..3121a89219dd3150d0e484f359a224fff46c5439 100644 (file)
@@ -638,7 +638,7 @@ 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)
+int mtl_dsp_core_get(struct snd_sof_dev *sdev, int core)
 {
        const struct sof_ipc_pm_ops *pm_ops = sdev->ipc->ops->pm;
 
@@ -651,7 +651,7 @@ static int mtl_dsp_core_get(struct snd_sof_dev *sdev, int core)
        return 0;
 }
 
-static int mtl_dsp_core_put(struct snd_sof_dev *sdev, int core)
+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;
index 95696b3d7c4cfbadb5a3307954a0c9ace19e07cd..cc5a1f46fd09560e9fefc10d6b4775b82294bfd4 100644 (file)
@@ -106,3 +106,6 @@ void mtl_ipc_dump(struct snd_sof_dev *sdev);
 u64 mtl_dsp_get_stream_hda_link_position(struct snd_sof_dev *sdev,
                                         struct snd_soc_component *component,
                                         struct snd_pcm_substream *substream);
+
+int mtl_dsp_core_get(struct snd_sof_dev *sdev, int core);
+int mtl_dsp_core_put(struct snd_sof_dev *sdev, int core);