From: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
To: lgirdwood@gmail.com, broonie@kernel.org
Cc: alsa-devel@alsa-project.org,
pierre-louis.bossart@linux.intel.com,
ranjani.sridharan@linux.intel.com, kai.vehmanen@linux.intel.com,
rander.wang@intel.com
Subject: [PATCH 2/5] ASoC: SOF: Intel: hda-dsp: use set_pm_gate according to ipc version
Date: Tue, 14 Feb 2023 12:33:42 +0200 [thread overview]
Message-ID: <20230214103345.30669-3-peter.ujfalusi@linux.intel.com> (raw)
In-Reply-To: <20230214103345.30669-1-peter.ujfalusi@linux.intel.com>
From: Rander Wang <rander.wang@intel.com>
Use set_pm_gate to unify pm gate setting for different
ipc version.
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>
---
sound/soc/sof/intel/hda-dsp.c | 15 ++++-----------
1 file changed, 4 insertions(+), 11 deletions(-)
diff --git a/sound/soc/sof/intel/hda-dsp.c b/sound/soc/sof/intel/hda-dsp.c
index b4eacae8564c..e34fe0c9bcde 100644
--- a/sound/soc/sof/intel/hda-dsp.c
+++ b/sound/soc/sof/intel/hda-dsp.c
@@ -364,19 +364,12 @@ static int hda_dsp_wait_d0i3c_done(struct snd_sof_dev *sdev)
static int hda_dsp_send_pm_gate_ipc(struct snd_sof_dev *sdev, u32 flags)
{
- struct sof_ipc_pm_gate pm_gate;
- struct sof_ipc_reply reply;
+ const struct sof_ipc_pm_ops *pm_ops = sof_ipc_get_ops(sdev, pm);
- memset(&pm_gate, 0, sizeof(pm_gate));
+ if (pm_ops && pm_ops->set_pm_gate)
+ return pm_ops->set_pm_gate(sdev, flags);
- /* configure pm_gate ipc message */
- pm_gate.hdr.size = sizeof(pm_gate);
- pm_gate.hdr.cmd = SOF_IPC_GLB_PM_MSG | SOF_IPC_PM_GATE;
- pm_gate.flags = flags;
-
- /* send pm_gate ipc to dsp */
- return sof_ipc_tx_message_no_pm(sdev->ipc, &pm_gate, sizeof(pm_gate),
- &reply, sizeof(reply));
+ return 0;
}
static int hda_dsp_update_d0i3c_register(struct snd_sof_dev *sdev, u8 value)
--
2.39.1
next prev parent reply other threads:[~2023-02-14 10:35 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-14 10:33 [PATCH 0/5] ASoC: SOF: Intel/ipc4: Support for low power playback (d0i3) Peter Ujfalusi
2023-02-14 10:33 ` [PATCH 1/5] ASoC: SOF: Introduce a new set_pm_gate() IPC PM op Peter Ujfalusi
2023-02-14 10:33 ` Peter Ujfalusi [this message]
2023-02-14 10:33 ` [PATCH 3/5] ASoC: SOF: ipc4: Wake up dsp core before sending ipc msg Peter Ujfalusi
2023-02-14 10:33 ` [PATCH 4/5] ASoC: SOF: Intel: Enable d0i3 work for ipc4 Peter Ujfalusi
2023-02-14 10:33 ` [PATCH 5/5] ASoC: SOF: Intel: hda-dsp: Set streaming flag for d0i3 Peter Ujfalusi
2023-02-14 18:01 ` [PATCH 0/5] ASoC: SOF: Intel/ipc4: Support for low power playback (d0i3) Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230214103345.30669-3-peter.ujfalusi@linux.intel.com \
--to=peter.ujfalusi@linux.intel.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=kai.vehmanen@linux.intel.com \
--cc=lgirdwood@gmail.com \
--cc=pierre-louis.bossart@linux.intel.com \
--cc=rander.wang@intel.com \
--cc=ranjani.sridharan@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.