Lines Matching refs:sdev

60 void snd_sof_get_status(struct snd_sof_dev *sdev, u32 panic_code,  in snd_sof_get_status()  argument
70 dev_err(sdev->dev, "unexpected fault %#010x trace %#010x\n", in snd_sof_get_status()
79 dev_err(sdev->dev, "reason: %s (%#x)\n", panic_msg[i].msg, in snd_sof_get_status()
81 dev_err(sdev->dev, "trace point: %#010x\n", tracep_code); in snd_sof_get_status()
87 dev_err(sdev->dev, "unknown panic code: %#x\n", code & SOF_IPC_PANIC_CODE_MASK); in snd_sof_get_status()
88 dev_err(sdev->dev, "trace point: %#010x\n", tracep_code); in snd_sof_get_status()
91 dev_err(sdev->dev, "panic at %s:%d\n", panic_info->filename, in snd_sof_get_status()
93 sof_oops(sdev, oops); in snd_sof_get_status()
94 sof_stack(sdev, oops, stack, stack_words); in snd_sof_get_status()
138 static int sof_probe_continue(struct snd_sof_dev *sdev) in sof_probe_continue() argument
140 struct snd_sof_pdata *plat_data = sdev->pdata; in sof_probe_continue()
144 ret = snd_sof_probe(sdev); in sof_probe_continue()
146 dev_err(sdev->dev, "error: failed to probe DSP %d\n", ret); in sof_probe_continue()
150 sof_set_fw_state(sdev, SOF_FW_BOOT_PREPARE); in sof_probe_continue()
153 ret = sof_machine_check(sdev); in sof_probe_continue()
155 dev_err(sdev->dev, "error: failed to get machine info %d\n", in sof_probe_continue()
161 snd_sof_new_platform_drv(sdev); in sof_probe_continue()
164 ret = snd_sof_dbg_init(sdev); in sof_probe_continue()
171 dev_err(sdev->dev, "error: failed to init DSP trace/debug %d\n", in sof_probe_continue()
177 sdev->ipc = snd_sof_ipc_init(sdev); in sof_probe_continue()
178 if (!sdev->ipc) { in sof_probe_continue()
180 dev_err(sdev->dev, "error: failed to init DSP IPC %d\n", ret); in sof_probe_continue()
185 ret = snd_sof_load_firmware(sdev); in sof_probe_continue()
187 dev_err(sdev->dev, "error: failed to load DSP firmware %d\n", in sof_probe_continue()
192 sof_set_fw_state(sdev, SOF_FW_BOOT_IN_PROGRESS); in sof_probe_continue()
198 ret = snd_sof_run_firmware(sdev); in sof_probe_continue()
200 dev_err(sdev->dev, "error: failed to boot DSP firmware %d\n", in sof_probe_continue()
206 sdev->dtrace_is_supported = true; in sof_probe_continue()
209 ret = snd_sof_init_trace(sdev); in sof_probe_continue()
212 dev_warn(sdev->dev, in sof_probe_continue()
217 dev_dbg(sdev->dev, "SOF firmware trace disabled\n"); in sof_probe_continue()
221 sdev->first_boot = false; in sof_probe_continue()
224 ret = devm_snd_soc_register_component(sdev->dev, &sdev->plat_drv, in sof_probe_continue()
225 sof_ops(sdev)->drv, in sof_probe_continue()
226 sof_ops(sdev)->num_drv); in sof_probe_continue()
228 dev_err(sdev->dev, in sof_probe_continue()
233 ret = snd_sof_machine_register(sdev, plat_data); in sof_probe_continue()
235 dev_err(sdev->dev, in sof_probe_continue()
245 if (!sof_ops(sdev)->runtime_suspend || !sof_ops(sdev)->runtime_resume) in sof_probe_continue()
246 pm_runtime_get_noresume(sdev->dev); in sof_probe_continue()
249 plat_data->sof_probe_complete(sdev->dev); in sof_probe_continue()
251 sdev->probe_completed = true; in sof_probe_continue()
256 snd_sof_free_trace(sdev); in sof_probe_continue()
258 snd_sof_fw_unload(sdev); in sof_probe_continue()
260 snd_sof_ipc_free(sdev); in sof_probe_continue()
263 snd_sof_free_debug(sdev); in sof_probe_continue()
265 snd_sof_remove(sdev); in sof_probe_continue()
268 sof_set_fw_state(sdev, SOF_FW_BOOT_NOT_STARTED); in sof_probe_continue()
269 sdev->first_boot = true; in sof_probe_continue()
276 struct snd_sof_dev *sdev = in sof_probe_work() local
280 ret = sof_probe_continue(sdev); in sof_probe_work()
283 dev_err(sdev->dev, "error: %s failed err: %d\n", __func__, ret); in sof_probe_work()
289 struct snd_sof_dev *sdev; in snd_sof_device_probe() local
291 sdev = devm_kzalloc(dev, sizeof(*sdev), GFP_KERNEL); in snd_sof_device_probe()
292 if (!sdev) in snd_sof_device_probe()
296 sdev->dev = dev; in snd_sof_device_probe()
299 sdev->dsp_power_state.state = SOF_DSP_PM_D0; in snd_sof_device_probe()
301 sdev->pdata = plat_data; in snd_sof_device_probe()
302 sdev->first_boot = true; in snd_sof_device_probe()
303 sof_set_fw_state(sdev, SOF_FW_BOOT_NOT_STARTED); in snd_sof_device_probe()
305 sdev->extractor_stream_tag = SOF_PROBE_INVALID_NODE_ID; in snd_sof_device_probe()
307 dev_set_drvdata(dev, sdev); in snd_sof_device_probe()
310 if (!sof_ops(sdev) || !sof_ops(sdev)->probe || !sof_ops(sdev)->run || in snd_sof_device_probe()
311 !sof_ops(sdev)->block_read || !sof_ops(sdev)->block_write || in snd_sof_device_probe()
312 !sof_ops(sdev)->send_msg || !sof_ops(sdev)->load_firmware || in snd_sof_device_probe()
313 !sof_ops(sdev)->ipc_msg_data || !sof_ops(sdev)->ipc_pcm_params || in snd_sof_device_probe()
314 !sof_ops(sdev)->fw_ready) { in snd_sof_device_probe()
319 INIT_LIST_HEAD(&sdev->pcm_list); in snd_sof_device_probe()
320 INIT_LIST_HEAD(&sdev->kcontrol_list); in snd_sof_device_probe()
321 INIT_LIST_HEAD(&sdev->widget_list); in snd_sof_device_probe()
322 INIT_LIST_HEAD(&sdev->dai_list); in snd_sof_device_probe()
323 INIT_LIST_HEAD(&sdev->route_list); in snd_sof_device_probe()
324 spin_lock_init(&sdev->ipc_lock); in snd_sof_device_probe()
325 spin_lock_init(&sdev->hw_lock); in snd_sof_device_probe()
326 mutex_init(&sdev->power_state_access); in snd_sof_device_probe()
330 sdev->ipc_timeout = TIMEOUT_DEFAULT_IPC_MS; in snd_sof_device_probe()
332 sdev->ipc_timeout = plat_data->desc->ipc_timeout; in snd_sof_device_probe()
334 sdev->boot_timeout = TIMEOUT_DEFAULT_BOOT_MS; in snd_sof_device_probe()
336 sdev->boot_timeout = plat_data->desc->boot_timeout; in snd_sof_device_probe()
339 INIT_WORK(&sdev->probe_work, sof_probe_work); in snd_sof_device_probe()
340 schedule_work(&sdev->probe_work); in snd_sof_device_probe()
344 return sof_probe_continue(sdev); in snd_sof_device_probe()
350 struct snd_sof_dev *sdev = dev_get_drvdata(dev); in snd_sof_device_probe_completed() local
352 return sdev->probe_completed; in snd_sof_device_probe_completed()
358 struct snd_sof_dev *sdev = dev_get_drvdata(dev); in snd_sof_device_remove() local
359 struct snd_sof_pdata *pdata = sdev->pdata; in snd_sof_device_remove()
363 cancel_work_sync(&sdev->probe_work); in snd_sof_device_remove()
365 if (sdev->fw_state > SOF_FW_BOOT_NOT_STARTED) { in snd_sof_device_remove()
366 ret = snd_sof_dsp_power_down_notify(sdev); in snd_sof_device_remove()
371 snd_sof_ipc_free(sdev); in snd_sof_device_remove()
372 snd_sof_free_debug(sdev); in snd_sof_device_remove()
373 snd_sof_free_trace(sdev); in snd_sof_device_remove()
381 snd_sof_machine_unregister(sdev, pdata); in snd_sof_device_remove()
389 if (sdev->fw_state > SOF_FW_BOOT_NOT_STARTED) in snd_sof_device_remove()
390 snd_sof_remove(sdev); in snd_sof_device_remove()
393 snd_sof_fw_unload(sdev); in snd_sof_device_remove()
401 struct snd_sof_dev *sdev = dev_get_drvdata(dev); in snd_sof_device_shutdown() local
404 cancel_work_sync(&sdev->probe_work); in snd_sof_device_shutdown()
406 if (sdev->fw_state == SOF_FW_BOOT_COMPLETE) in snd_sof_device_shutdown()
407 return snd_sof_shutdown(sdev); in snd_sof_device_shutdown()