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, "error: unexpected fault 0x%8.8x trace 0x%8.8x\n", in snd_sof_get_status()
79 dev_err(sdev->dev, "error: %s\n", panic_msg[i].msg); in snd_sof_get_status()
80 dev_err(sdev->dev, "error: trace point %8.8x\n", in snd_sof_get_status()
87 dev_err(sdev->dev, "error: unknown reason %8.8x\n", panic_code); in snd_sof_get_status()
88 dev_err(sdev->dev, "error: trace point %8.8x\n", tracep_code); in snd_sof_get_status()
91 dev_err(sdev->dev, "error: panic at %s:%d\n", 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 sdev->fw_state = 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 sdev->fw_state = 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()
207 sdev->dtrace_is_supported = true; in sof_probe_continue()
210 ret = snd_sof_init_trace(sdev); in sof_probe_continue()
213 dev_warn(sdev->dev, in sof_probe_continue()
218 dev_dbg(sdev->dev, "SOF firmware trace disabled\n"); in sof_probe_continue()
222 sdev->first_boot = false; in sof_probe_continue()
225 ret = devm_snd_soc_register_component(sdev->dev, &sdev->plat_drv, in sof_probe_continue()
226 sof_ops(sdev)->drv, in sof_probe_continue()
227 sof_ops(sdev)->num_drv); in sof_probe_continue()
229 dev_err(sdev->dev, in sof_probe_continue()
234 ret = snd_sof_machine_register(sdev, plat_data); in sof_probe_continue()
236 dev_err(sdev->dev, in sof_probe_continue()
246 if (!sof_ops(sdev)->runtime_suspend || !sof_ops(sdev)->runtime_resume) in sof_probe_continue()
247 pm_runtime_get_noresume(sdev->dev); in sof_probe_continue()
250 plat_data->sof_probe_complete(sdev->dev); in sof_probe_continue()
252 sdev->probe_completed = true; in sof_probe_continue()
257 snd_sof_free_trace(sdev); in sof_probe_continue()
259 snd_sof_fw_unload(sdev); in sof_probe_continue()
261 snd_sof_ipc_free(sdev); in sof_probe_continue()
264 snd_sof_free_debug(sdev); in sof_probe_continue()
266 snd_sof_remove(sdev); in sof_probe_continue()
269 sdev->fw_state = SOF_FW_BOOT_NOT_STARTED; in sof_probe_continue()
270 sdev->first_boot = true; in sof_probe_continue()
277 struct snd_sof_dev *sdev = in sof_probe_work() local
281 ret = sof_probe_continue(sdev); in sof_probe_work()
284 dev_err(sdev->dev, "error: %s failed err: %d\n", __func__, ret); in sof_probe_work()
290 struct snd_sof_dev *sdev; in snd_sof_device_probe() local
292 sdev = devm_kzalloc(dev, sizeof(*sdev), GFP_KERNEL); in snd_sof_device_probe()
293 if (!sdev) in snd_sof_device_probe()
297 sdev->dev = dev; in snd_sof_device_probe()
300 sdev->dsp_power_state.state = SOF_DSP_PM_D0; in snd_sof_device_probe()
302 sdev->pdata = plat_data; in snd_sof_device_probe()
303 sdev->first_boot = true; in snd_sof_device_probe()
304 sdev->fw_state = SOF_FW_BOOT_NOT_STARTED; in snd_sof_device_probe()
306 sdev->extractor_stream_tag = SOF_PROBE_INVALID_NODE_ID; in snd_sof_device_probe()
308 dev_set_drvdata(dev, sdev); in snd_sof_device_probe()
311 if (!sof_ops(sdev) || !sof_ops(sdev)->probe || !sof_ops(sdev)->run || in snd_sof_device_probe()
312 !sof_ops(sdev)->block_read || !sof_ops(sdev)->block_write || in snd_sof_device_probe()
313 !sof_ops(sdev)->send_msg || !sof_ops(sdev)->load_firmware || in snd_sof_device_probe()
314 !sof_ops(sdev)->ipc_msg_data || !sof_ops(sdev)->ipc_pcm_params || in snd_sof_device_probe()
315 !sof_ops(sdev)->fw_ready) { in snd_sof_device_probe()
320 INIT_LIST_HEAD(&sdev->pcm_list); in snd_sof_device_probe()
321 INIT_LIST_HEAD(&sdev->kcontrol_list); in snd_sof_device_probe()
322 INIT_LIST_HEAD(&sdev->widget_list); in snd_sof_device_probe()
323 INIT_LIST_HEAD(&sdev->dai_list); in snd_sof_device_probe()
324 INIT_LIST_HEAD(&sdev->route_list); in snd_sof_device_probe()
325 spin_lock_init(&sdev->ipc_lock); in snd_sof_device_probe()
326 spin_lock_init(&sdev->hw_lock); in snd_sof_device_probe()
327 mutex_init(&sdev->power_state_access); in snd_sof_device_probe()
330 INIT_WORK(&sdev->probe_work, sof_probe_work); in snd_sof_device_probe()
334 sdev->ipc_timeout = TIMEOUT_DEFAULT_IPC_MS; in snd_sof_device_probe()
336 sdev->ipc_timeout = plat_data->desc->ipc_timeout; in snd_sof_device_probe()
338 sdev->boot_timeout = TIMEOUT_DEFAULT_BOOT_MS; in snd_sof_device_probe()
340 sdev->boot_timeout = plat_data->desc->boot_timeout; in snd_sof_device_probe()
343 schedule_work(&sdev->probe_work); in snd_sof_device_probe()
347 return sof_probe_continue(sdev); in snd_sof_device_probe()
353 struct snd_sof_dev *sdev = dev_get_drvdata(dev); in snd_sof_device_probe_completed() local
355 return sdev->probe_completed; in snd_sof_device_probe_completed()
361 struct snd_sof_dev *sdev = dev_get_drvdata(dev); in snd_sof_device_remove() local
362 struct snd_sof_pdata *pdata = sdev->pdata; in snd_sof_device_remove()
366 cancel_work_sync(&sdev->probe_work); in snd_sof_device_remove()
368 if (sdev->fw_state > SOF_FW_BOOT_NOT_STARTED) { in snd_sof_device_remove()
369 ret = snd_sof_dsp_power_down_notify(sdev); in snd_sof_device_remove()
374 snd_sof_ipc_free(sdev); in snd_sof_device_remove()
375 snd_sof_free_debug(sdev); in snd_sof_device_remove()
376 snd_sof_free_trace(sdev); in snd_sof_device_remove()
384 snd_sof_machine_unregister(sdev, pdata); in snd_sof_device_remove()
392 if (sdev->fw_state > SOF_FW_BOOT_NOT_STARTED) in snd_sof_device_remove()
393 snd_sof_remove(sdev); in snd_sof_device_remove()
396 snd_sof_fw_unload(sdev); in snd_sof_device_remove()
404 struct snd_sof_dev *sdev = dev_get_drvdata(dev); in snd_sof_device_shutdown() local
407 cancel_work_sync(&sdev->probe_work); in snd_sof_device_shutdown()
409 if (sdev->fw_state == SOF_FW_BOOT_COMPLETE) in snd_sof_device_shutdown()
410 return snd_sof_shutdown(sdev); in snd_sof_device_shutdown()