Lines Matching defs:sdev
21 static u32 snd_sof_dsp_power_target(struct snd_sof_dev *sdev)
25 switch (sdev->system_suspend_target) {
37 if (snd_sof_stream_suspend_ignored(sdev))
51 static int sof_send_pm_ctx_ipc(struct snd_sof_dev *sdev, int cmd)
63 return sof_ipc_tx_message(sdev->ipc, pm_ctx.hdr.cmd, &pm_ctx,
68 static void sof_cache_debugfs(struct snd_sof_dev *sdev)
72 list_for_each_entry(dfse, &sdev->dfsentry_list, list) {
88 struct snd_sof_dev *sdev = dev_get_drvdata(dev);
89 u32 old_state = sdev->dsp_power_state.state;
93 if (!runtime_resume && !sof_ops(sdev)->resume)
96 if (runtime_resume && !sof_ops(sdev)->runtime_resume)
100 if (sdev->first_boot)
108 ret = snd_sof_dsp_runtime_resume(sdev);
110 ret = snd_sof_dsp_resume(sdev);
112 dev_err(sdev->dev,
121 if (!runtime_resume && sof_ops(sdev)->set_power_state &&
125 sdev->fw_state = SOF_FW_BOOT_PREPARE;
128 ret = snd_sof_load_firmware(sdev);
130 dev_err(sdev->dev,
136 sdev->fw_state = SOF_FW_BOOT_IN_PROGRESS;
142 ret = snd_sof_run_firmware(sdev);
144 dev_err(sdev->dev,
151 ret = snd_sof_init_trace_ipc(sdev);
154 dev_warn(sdev->dev,
160 ret = sof_restore_pipelines(sdev->dev);
162 dev_err(sdev->dev,
169 ret = sof_send_pm_ctx_ipc(sdev, SOF_IPC_PM_CTX_RESTORE);
171 dev_err(sdev->dev,
180 struct snd_sof_dev *sdev = dev_get_drvdata(dev);
185 if (!runtime_suspend && !sof_ops(sdev)->suspend)
188 if (runtime_suspend && !sof_ops(sdev)->runtime_suspend)
191 if (sdev->fw_state != SOF_FW_BOOT_COMPLETE)
196 ret = sof_set_hw_params_upon_resume(sdev->dev);
198 dev_err(sdev->dev,
205 target_state = snd_sof_dsp_power_target(sdev);
212 snd_sof_release_trace(sdev);
217 sof_cache_debugfs(sdev);
220 ret = sof_send_pm_ctx_ipc(sdev, SOF_IPC_PM_CTX_SAVE);
226 dev_err(sdev->dev,
232 dev_warn(sdev->dev,
240 if (sdev->fw_state == SOF_FW_BOOT_NOT_STARTED)
245 ret = snd_sof_dsp_runtime_suspend(sdev);
247 ret = snd_sof_dsp_suspend(sdev, target_state);
249 dev_err(sdev->dev,
258 sdev->fw_state = SOF_FW_BOOT_NOT_STARTED;
259 sdev->enabled_cores_mask = 0;
264 int snd_sof_dsp_power_down_notify(struct snd_sof_dev *sdev)
267 if (sof_ops(sdev)->remove)
268 return sof_send_pm_ctx_ipc(sdev, SOF_IPC_PM_CTX_SAVE);
281 struct snd_sof_dev *sdev = dev_get_drvdata(dev);
283 return snd_sof_dsp_runtime_idle(sdev);
307 struct snd_sof_dev *sdev = dev_get_drvdata(dev);
308 const struct sof_dev_desc *desc = sdev->pdata->desc;
311 sdev->system_suspend_target = SOF_SUSPEND_S3;
318 sdev->system_suspend_target = SOF_SUSPEND_S0IX;
327 struct snd_sof_dev *sdev = dev_get_drvdata(dev);
329 sdev->system_suspend_target = SOF_SUSPEND_NONE;