Skip to content

Commit 057366b

Browse files
committed
ASoC: SOF: Intel: tgl: add ipc4 core_put on tgl platform
In ipc4 path, fw needs to save current context to imr before powering off master core but fw doesn't support this feature for ipc3 case. Signed-off-by: Rander Wang <rander.wang@intel.com>
1 parent 6ef0780 commit 057366b

File tree

1 file changed

+25
-2
lines changed

1 file changed

+25
-2
lines changed

sound/soc/sof/intel/tgl.c

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,24 @@ static int tgl_dsp_core_put(struct snd_sof_dev *sdev, int core)
5050
return 0;
5151
}
5252

53+
static int tgl_ipc4_dsp_core_put(struct snd_sof_dev *sdev, int core)
54+
{
55+
const struct sof_ipc_pm_ops *pm_ops = sdev->ipc->ops->pm;
56+
int ret;
57+
58+
if (pm_ops->set_core_state) {
59+
ret = pm_ops->set_core_state(sdev, core, false);
60+
if (ret < 0)
61+
return ret;
62+
}
63+
64+
/* power down primary core and return */
65+
if (core == SOF_DSP_PRIMARY_CORE)
66+
return hda_dsp_core_reset_power_down(sdev, BIT(core));
67+
68+
return 0;
69+
}
70+
5371
/* Tigerlake ops */
5472
struct snd_sof_dsp_ops sof_tgl_ops;
5573
EXPORT_SYMBOL_NS(sof_tgl_ops, SND_SOC_SOF_INTEL_HDA_COMMON);
@@ -71,6 +89,9 @@ int sof_tgl_ops_init(struct snd_sof_dev *sdev)
7189

7290
/* debug */
7391
sof_tgl_ops.ipc_dump = cnl_ipc_dump;
92+
93+
/* dsp core put */
94+
sof_tgl_ops.core_put = tgl_dsp_core_put;
7495
}
7596

7697
if (sdev->pdata->ipc_type == SOF_INTEL_IPC4) {
@@ -96,6 +117,9 @@ int sof_tgl_ops_init(struct snd_sof_dev *sdev)
96117

97118
/* debug */
98119
sof_tgl_ops.ipc_dump = cnl_ipc4_dump;
120+
121+
/* dsp core put */
122+
sof_tgl_ops.core_put = tgl_ipc4_dsp_core_put;
99123
}
100124

101125
/* set DAI driver ops */
@@ -111,9 +135,8 @@ int sof_tgl_ops_init(struct snd_sof_dev *sdev)
111135
/* firmware run */
112136
sof_tgl_ops.run = hda_dsp_cl_boot_firmware_iccmax;
113137

114-
/* dsp core get/put */
138+
/* dsp core get */
115139
sof_tgl_ops.core_get = tgl_dsp_core_get;
116-
sof_tgl_ops.core_put = tgl_dsp_core_put;
117140

118141
return 0;
119142
};

0 commit comments

Comments
 (0)