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()
243 if (!sof_ops(sdev)->runtime_suspend || !sof_ops(sdev)->runtime_resume) in sof_probe_continue()
244 pm_runtime_get_noresume(sdev->dev); in sof_probe_continue()
247 plat_data->sof_probe_complete(sdev->dev); in sof_probe_continue()
252 snd_sof_free_trace(sdev); in sof_probe_continue()
254 snd_sof_fw_unload(sdev); in sof_probe_continue()
256 snd_sof_ipc_free(sdev); in sof_probe_continue()
258 snd_sof_free_debug(sdev); in sof_probe_continue()
260 snd_sof_remove(sdev); in sof_probe_continue()
263 sdev->fw_state = SOF_FW_BOOT_NOT_STARTED; in sof_probe_continue()
264 sdev->first_boot = true; in sof_probe_continue()
271 struct snd_sof_dev *sdev = in sof_probe_work() local
275 ret = sof_probe_continue(sdev); in sof_probe_work()
278 dev_err(sdev->dev, "error: %s failed err: %d\n", __func__, ret); in sof_probe_work()
284 struct snd_sof_dev *sdev; in snd_sof_device_probe() local
286 sdev = devm_kzalloc(dev, sizeof(*sdev), GFP_KERNEL); in snd_sof_device_probe()
287 if (!sdev) in snd_sof_device_probe()
291 sdev->dev = dev; in snd_sof_device_probe()
294 sdev->dsp_power_state.state = SOF_DSP_PM_D0; in snd_sof_device_probe()
296 sdev->pdata = plat_data; in snd_sof_device_probe()
297 sdev->first_boot = true; in snd_sof_device_probe()
298 sdev->fw_state = SOF_FW_BOOT_NOT_STARTED; in snd_sof_device_probe()
300 sdev->extractor_stream_tag = SOF_PROBE_INVALID_NODE_ID; in snd_sof_device_probe()
302 dev_set_drvdata(dev, sdev); in snd_sof_device_probe()
305 if (!sof_ops(sdev) || !sof_ops(sdev)->probe || !sof_ops(sdev)->run || in snd_sof_device_probe()
306 !sof_ops(sdev)->block_read || !sof_ops(sdev)->block_write || in snd_sof_device_probe()
307 !sof_ops(sdev)->send_msg || !sof_ops(sdev)->load_firmware || in snd_sof_device_probe()
308 !sof_ops(sdev)->ipc_msg_data || !sof_ops(sdev)->ipc_pcm_params || in snd_sof_device_probe()
309 !sof_ops(sdev)->fw_ready) in snd_sof_device_probe()
312 INIT_LIST_HEAD(&sdev->pcm_list); in snd_sof_device_probe()
313 INIT_LIST_HEAD(&sdev->kcontrol_list); in snd_sof_device_probe()
314 INIT_LIST_HEAD(&sdev->widget_list); in snd_sof_device_probe()
315 INIT_LIST_HEAD(&sdev->dai_list); in snd_sof_device_probe()
316 INIT_LIST_HEAD(&sdev->route_list); in snd_sof_device_probe()
317 spin_lock_init(&sdev->ipc_lock); in snd_sof_device_probe()
318 spin_lock_init(&sdev->hw_lock); in snd_sof_device_probe()
321 INIT_WORK(&sdev->probe_work, sof_probe_work); in snd_sof_device_probe()
325 sdev->ipc_timeout = TIMEOUT_DEFAULT_IPC_MS; in snd_sof_device_probe()
327 sdev->ipc_timeout = plat_data->desc->ipc_timeout; in snd_sof_device_probe()
329 sdev->boot_timeout = TIMEOUT_DEFAULT_BOOT_MS; in snd_sof_device_probe()
331 sdev->boot_timeout = plat_data->desc->boot_timeout; in snd_sof_device_probe()
334 schedule_work(&sdev->probe_work); in snd_sof_device_probe()
338 return sof_probe_continue(sdev); in snd_sof_device_probe()
344 struct snd_sof_dev *sdev = dev_get_drvdata(dev); in snd_sof_device_remove() local
345 struct snd_sof_pdata *pdata = sdev->pdata; in snd_sof_device_remove()
349 cancel_work_sync(&sdev->probe_work); in snd_sof_device_remove()
351 if (sdev->fw_state > SOF_FW_BOOT_NOT_STARTED) { in snd_sof_device_remove()
352 ret = snd_sof_dsp_power_down_notify(sdev); in snd_sof_device_remove()
357 snd_sof_fw_unload(sdev); in snd_sof_device_remove()
358 snd_sof_ipc_free(sdev); in snd_sof_device_remove()
359 snd_sof_free_debug(sdev); in snd_sof_device_remove()
360 snd_sof_free_trace(sdev); in snd_sof_device_remove()
368 snd_sof_machine_unregister(sdev, pdata); in snd_sof_device_remove()
376 if (sdev->fw_state > SOF_FW_BOOT_NOT_STARTED) in snd_sof_device_remove()
377 snd_sof_remove(sdev); in snd_sof_device_remove()