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