Skip to content

Commit 3c16883

Browse files
RanderWangbroonie
authored andcommitted
ASoC: SOF: Intel: hda-dsp: use set_pm_gate according to ipc version
Use set_pm_gate to unify pm gate setting for different ipc version. Signed-off-by: Rander Wang <[email protected]> Reviewed-by: Pierre-Louis Bossart <[email protected]> Reviewed-by: Ranjani Sridharan <[email protected]> Reviewed-by: Péter Ujfalusi <[email protected]> Signed-off-by: Peter Ujfalusi <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 167ca6a commit 3c16883

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

sound/soc/sof/intel/hda-dsp.c

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -364,19 +364,12 @@ static int hda_dsp_wait_d0i3c_done(struct snd_sof_dev *sdev)
364364

365365
static int hda_dsp_send_pm_gate_ipc(struct snd_sof_dev *sdev, u32 flags)
366366
{
367-
struct sof_ipc_pm_gate pm_gate;
368-
struct sof_ipc_reply reply;
367+
const struct sof_ipc_pm_ops *pm_ops = sof_ipc_get_ops(sdev, pm);
369368

370-
memset(&pm_gate, 0, sizeof(pm_gate));
369+
if (pm_ops && pm_ops->set_pm_gate)
370+
return pm_ops->set_pm_gate(sdev, flags);
371371

372-
/* configure pm_gate ipc message */
373-
pm_gate.hdr.size = sizeof(pm_gate);
374-
pm_gate.hdr.cmd = SOF_IPC_GLB_PM_MSG | SOF_IPC_PM_GATE;
375-
pm_gate.flags = flags;
376-
377-
/* send pm_gate ipc to dsp */
378-
return sof_ipc_tx_message_no_pm(sdev->ipc, &pm_gate, sizeof(pm_gate),
379-
&reply, sizeof(reply));
372+
return 0;
380373
}
381374

382375
static int hda_dsp_update_d0i3c_register(struct snd_sof_dev *sdev, u8 value)

0 commit comments

Comments
 (0)