aboutsummaryrefslogtreecommitdiff
path: root/sound/soc/sof/pm.c
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2022-12-27 11:55:11 +0000
committerMark Brown <broonie@kernel.org>2022-12-27 11:55:11 +0000
commit560d97e5f98c4261583592c85608b13ca0075b9d (patch)
tree16fa1836eea57845b80f48f2f3b077c2c044f24d /sound/soc/sof/pm.c
parentec380a34a44fcf501dace3072cddc41374f2e289 (diff)
parent8a33863a0e287b17a5c637f231f31ff631348f8f (diff)
ASoC: SOF: Extend the IPC ops optionality
Merge series from Peter Ujfalusi <peter.ujfalusi@linux.intel.com>: This series will extend the IPC ops optionality to cover it up to the existence of the top level ipc pointer itself. There is no functionality change. The reason for the extended optionality is that we have "DSPless" debug/development support coming up (currently it is in SOF's topic/sof-dev stable branch) initially supporting Intel's HDA platforms. As the name suggests, in this mode the DSP is completely ignored by the linux driver stack (no firmware loaded, only using HDA directly). The DSPless mode is aimed to help us to verify our Linux stack on new platforms where the firmware is not yet in the state that we can reliably use it, but the hardware and programming flows can be tested already. There is no plan to make DSPless a production target for SOF Linux stack. While this is preparatory series aimed to unblock the DSPless support, it has been integrated into sof-dev separately and we have lots of new features depending on it (went in between this set and the DSPless support). I still have some minor tasks to complete for the DSPless to make it a bit more versatile, but I don't want to block other, stable features for upstreaming.
Diffstat (limited to 'sound/soc/sof/pm.c')
-rw-r--r--sound/soc/sof/pm.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/sound/soc/sof/pm.c b/sound/soc/sof/pm.c
index df740be645e8..e7fce9e4a0d2 100644
--- a/sound/soc/sof/pm.c
+++ b/sound/soc/sof/pm.c
@@ -73,8 +73,8 @@ static void sof_cache_debugfs(struct snd_sof_dev *sdev)
static int sof_resume(struct device *dev, bool runtime_resume)
{
struct snd_sof_dev *sdev = dev_get_drvdata(dev);
- const struct sof_ipc_pm_ops *pm_ops = sdev->ipc->ops->pm;
- const struct sof_ipc_tplg_ops *tplg_ops = sdev->ipc->ops->tplg;
+ const struct sof_ipc_pm_ops *pm_ops = sof_ipc_get_ops(sdev, pm);
+ const struct sof_ipc_tplg_ops *tplg_ops = sof_ipc_get_ops(sdev, tplg);
u32 old_state = sdev->dsp_power_state.state;
int ret;
@@ -155,7 +155,7 @@ static int sof_resume(struct device *dev, bool runtime_resume)
}
/* restore pipelines */
- if (tplg_ops->set_up_all_pipelines) {
+ if (tplg_ops && tplg_ops->set_up_all_pipelines) {
ret = tplg_ops->set_up_all_pipelines(sdev, false);
if (ret < 0) {
dev_err(sdev->dev, "Failed to restore pipeline after resume %d\n", ret);
@@ -179,8 +179,8 @@ static int sof_resume(struct device *dev, bool runtime_resume)
static int sof_suspend(struct device *dev, bool runtime_suspend)
{
struct snd_sof_dev *sdev = dev_get_drvdata(dev);
- const struct sof_ipc_pm_ops *pm_ops = sdev->ipc->ops->pm;
- const struct sof_ipc_tplg_ops *tplg_ops = sdev->ipc->ops->tplg;
+ const struct sof_ipc_pm_ops *pm_ops = sof_ipc_get_ops(sdev, pm);
+ const struct sof_ipc_tplg_ops *tplg_ops = sof_ipc_get_ops(sdev, tplg);
pm_message_t pm_state;
u32 target_state = 0;
int ret;
@@ -277,7 +277,7 @@ suspend:
int snd_sof_dsp_power_down_notify(struct snd_sof_dev *sdev)
{
- const struct sof_ipc_pm_ops *pm_ops = sdev->ipc->ops->pm;
+ const struct sof_ipc_pm_ops *pm_ops = sof_ipc_get_ops(sdev, pm);
/* Notify DSP of upcoming power down */
if (sof_ops(sdev)->remove && pm_ops && pm_ops->ctx_save)