diff options
author | Daniel Baluta <daniel.baluta@nxp.com> | 2020-05-11 13:16:47 +0300 |
---|---|---|
committer | Daniel Baluta <daniel.baluta@nxp.com> | 2020-06-11 16:50:22 +0300 |
commit | 103eddadf85ffc711d93f604da071f2537915173 (patch) | |
tree | 657595bb55014bf5069de3ab690e58e6f79c9f88 /sound/soc/sof | |
parent | 798bd66a9c7ed0518453910a8d6a2354e78e85fd (diff) |
MLK-24263-4 ASoC: SOF: Do nothing when DSP PM callbacks are not set
This provides a better separation between runtime and PM sleep
callbacks.
Only do nothing if given runtime flag is set and calback is not set.
With the current implementation, if PM sleep callback is set but runtime
callback is not set then at runtime resume we reload the firmware even
if we do not support runtime resume callback.
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Diffstat (limited to 'sound/soc/sof')
-rw-r--r-- | sound/soc/sof/pm.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/sound/soc/sof/pm.c b/sound/soc/sof/pm.c index 195af259e78e..128680b09c20 100644 --- a/sound/soc/sof/pm.c +++ b/sound/soc/sof/pm.c @@ -266,7 +266,10 @@ static int sof_resume(struct device *dev, bool runtime_resume) int ret; /* do nothing if dsp resume callbacks are not set */ - if (!sof_ops(sdev)->resume || !sof_ops(sdev)->runtime_resume) + if (!runtime_resume && !sof_ops(sdev)->resume) + return 0; + + if (runtime_resume && !sof_ops(sdev)->runtime_resume) return 0; /* DSP was never successfully started, nothing to resume */ @@ -346,7 +349,10 @@ static int sof_suspend(struct device *dev, bool runtime_suspend) int ret; /* do nothing if dsp suspend callback is not set */ - if (!sof_ops(sdev)->suspend) + if (!runtime_suspend && !sof_ops(sdev)->suspend) + return 0; + + if (runtime_suspend && !sof_ops(sdev)->runtime_suspend) return 0; if (sdev->fw_state != SOF_FW_BOOT_COMPLETE) |