Lines Matching refs:sdev
21 static u32 snd_sof_dsp_power_target(struct snd_sof_dev *sdev)
25 switch (sdev->system_suspend_target) {
40 if (snd_sof_stream_suspend_ignored(sdev))
55 static void sof_cache_debugfs(struct snd_sof_dev *sdev)
59 list_for_each_entry(dfse, &sdev->dfsentry_list, list) {
75 struct snd_sof_dev *sdev = dev_get_drvdata(dev);
76 const struct sof_ipc_pm_ops *pm_ops = sof_ipc_get_ops(sdev, pm);
77 const struct sof_ipc_tplg_ops *tplg_ops = sof_ipc_get_ops(sdev, tplg);
78 u32 old_state = sdev->dsp_power_state.state;
82 if (!runtime_resume && !sof_ops(sdev)->resume)
85 if (runtime_resume && !sof_ops(sdev)->runtime_resume)
89 if (sdev->first_boot)
97 ret = snd_sof_dsp_runtime_resume(sdev);
99 ret = snd_sof_dsp_resume(sdev);
101 dev_err(sdev->dev,
106 if (sdev->dspless_mode_selected) {
107 sof_set_fw_state(sdev, SOF_DSPLESS_MODE);
116 if (!runtime_resume && sof_ops(sdev)->set_power_state &&
118 ret = sof_fw_trace_resume(sdev);
121 dev_warn(sdev->dev,
126 sof_set_fw_state(sdev, SOF_FW_BOOT_PREPARE);
129 ret = snd_sof_load_firmware(sdev);
131 dev_err(sdev->dev,
134 sof_set_fw_state(sdev, SOF_FW_BOOT_FAILED);
138 sof_set_fw_state(sdev, SOF_FW_BOOT_IN_PROGRESS);
144 ret = snd_sof_run_firmware(sdev);
146 dev_err(sdev->dev,
149 sof_set_fw_state(sdev, SOF_FW_BOOT_FAILED);
154 ret = sof_fw_trace_resume(sdev);
157 dev_warn(sdev->dev,
164 ret = tplg_ops->set_up_all_pipelines(sdev, false);
166 dev_err(sdev->dev, "Failed to restore pipeline after resume %d\n", ret);
172 sof_resume_clients(sdev);
176 ret = pm_ops->ctx_restore(sdev);
178 dev_err(sdev->dev, "ctx_restore IPC error during resume: %d\n", ret);
189 sof_cache_debugfs(sdev);
198 struct snd_sof_dev *sdev = dev_get_drvdata(dev);
199 const struct sof_ipc_pm_ops *pm_ops = sof_ipc_get_ops(sdev, pm);
200 const struct sof_ipc_tplg_ops *tplg_ops = sof_ipc_get_ops(sdev, tplg);
202 u32 target_state = snd_sof_dsp_power_target(sdev);
203 u32 old_state = sdev->dsp_power_state.state;
207 if (!runtime_suspend && !sof_ops(sdev)->suspend)
210 if (runtime_suspend && !sof_ops(sdev)->runtime_suspend)
219 tplg_ops->tear_down_all_pipelines(sdev, false);
221 if (sdev->fw_state != SOF_FW_BOOT_COMPLETE)
226 ret = snd_sof_dsp_hw_params_upon_resume(sdev);
228 dev_err(sdev->dev,
238 sof_fw_trace_suspend(sdev, pm_state);
241 sof_suspend_clients(sdev, pm_state);
250 sof_cache_debugfs(sdev);
254 ret = pm_ops->ctx_save(sdev);
260 dev_err(sdev->dev, "ctx_save IPC error during suspend: %d\n", ret);
264 dev_warn(sdev->dev, "ctx_save IPC error: %d, proceeding with suspend\n",
272 if (sdev->fw_state == SOF_FW_BOOT_NOT_STARTED)
277 ret = snd_sof_dsp_runtime_suspend(sdev);
279 ret = snd_sof_dsp_suspend(sdev, target_state);
281 dev_err(sdev->dev,
290 sof_set_fw_state(sdev, SOF_FW_BOOT_NOT_STARTED);
291 sdev->enabled_cores_mask = 0;
296 int snd_sof_dsp_power_down_notify(struct snd_sof_dev *sdev)
298 const struct sof_ipc_pm_ops *pm_ops = sof_ipc_get_ops(sdev, pm);
301 if (sof_ops(sdev)->remove && pm_ops && pm_ops->ctx_save)
302 return pm_ops->ctx_save(sdev);
315 struct snd_sof_dev *sdev = dev_get_drvdata(dev);
317 return snd_sof_dsp_runtime_idle(sdev);
341 struct snd_sof_dev *sdev = dev_get_drvdata(dev);
342 const struct sof_dev_desc *desc = sdev->pdata->desc;
345 sdev->system_suspend_target = SOF_SUSPEND_S3;
351 if (sdev->fw_state == SOF_FW_CRASHED ||
352 sdev->fw_state == SOF_FW_BOOT_FAILED)
361 sdev->system_suspend_target = SOF_SUSPEND_S0IX;
366 sdev->system_suspend_target = SOF_SUSPEND_S3;
369 sdev->system_suspend_target = SOF_SUSPEND_S4;
372 sdev->system_suspend_target = SOF_SUSPEND_S5;
385 struct snd_sof_dev *sdev = dev_get_drvdata(dev);
387 sdev->system_suspend_target = SOF_SUSPEND_NONE;