Lines Matching refs:sdev

27 struct snd_sof_pcm *snd_sof_find_spcm_name(struct snd_sof_dev *sdev,  in snd_sof_find_spcm_name()  argument
32 list_for_each_entry(spcm, &sdev->pcm_list, list) { in snd_sof_find_spcm_name()
51 struct snd_sof_pcm *snd_sof_find_spcm_comp(struct snd_sof_dev *sdev, in snd_sof_find_spcm_comp() argument
57 list_for_each_entry(spcm, &sdev->pcm_list, list) { in snd_sof_find_spcm_comp()
71 struct snd_sof_pcm *snd_sof_find_spcm_pcm_id(struct snd_sof_dev *sdev, in snd_sof_find_spcm_pcm_id() argument
76 list_for_each_entry(spcm, &sdev->pcm_list, list) { in snd_sof_find_spcm_pcm_id()
84 struct snd_sof_widget *snd_sof_find_swidget(struct snd_sof_dev *sdev, in snd_sof_find_swidget() argument
89 list_for_each_entry(swidget, &sdev->widget_list, list) { in snd_sof_find_swidget()
98 struct snd_sof_widget *snd_sof_find_swidget_sname(struct snd_sof_dev *sdev, in snd_sof_find_swidget_sname() argument
109 list_for_each_entry(swidget, &sdev->widget_list, list) { in snd_sof_find_swidget_sname()
117 struct snd_sof_dai *snd_sof_find_dai(struct snd_sof_dev *sdev, in snd_sof_find_dai() argument
122 list_for_each_entry(dai, &sdev->dai_list, list) { in snd_sof_find_dai()
160 void snd_sof_get_status(struct snd_sof_dev *sdev, u32 panic_code, in snd_sof_get_status() argument
170 dev_err(sdev->dev, "error: unexpected fault 0x%8.8x trace 0x%8.8x\n", in snd_sof_get_status()
179 dev_err(sdev->dev, "error: %s\n", panic_msg[i].msg); in snd_sof_get_status()
180 dev_err(sdev->dev, "error: trace point %8.8x\n", in snd_sof_get_status()
187 dev_err(sdev->dev, "error: unknown reason %8.8x\n", panic_code); in snd_sof_get_status()
188 dev_err(sdev->dev, "error: trace point %8.8x\n", tracep_code); in snd_sof_get_status()
191 dev_err(sdev->dev, "error: panic at %s:%d\n", in snd_sof_get_status()
193 sof_oops(sdev, oops); in snd_sof_get_status()
194 sof_stack(sdev, oops, stack, stack_words); in snd_sof_get_status()
205 int snd_sof_create_page_table(struct snd_sof_dev *sdev, in snd_sof_create_page_table() argument
213 dev_dbg(sdev->dev, "generating page table for %p size 0x%zx pages %d\n", in snd_sof_create_page_table()
228 dev_vdbg(sdev->dev, "pfn i %i idx %d pfn %x\n", i, idx, pfn); in snd_sof_create_page_table()
259 static int sof_machine_check(struct snd_sof_dev *sdev) in sof_machine_check() argument
261 struct snd_sof_pdata *plat_data = sdev->pdata; in sof_machine_check()
271 dev_err(sdev->dev, "error: no matching ASoC machine driver found - aborting probe\n"); in sof_machine_check()
275 dev_warn(sdev->dev, "No ASoC machine driver found - using nocodec\n"); in sof_machine_check()
276 machine = devm_kzalloc(sdev->dev, sizeof(*machine), GFP_KERNEL); in sof_machine_check()
280 ret = sof_nocodec_setup(sdev->dev, plat_data, machine, in sof_machine_check()
291 static int sof_probe_continue(struct snd_sof_dev *sdev) in sof_probe_continue() argument
293 struct snd_sof_pdata *plat_data = sdev->pdata; in sof_probe_continue()
300 ret = snd_sof_probe(sdev); in sof_probe_continue()
302 dev_err(sdev->dev, "error: failed to probe DSP %d\n", ret); in sof_probe_continue()
307 ret = sof_machine_check(sdev); in sof_probe_continue()
309 dev_err(sdev->dev, "error: failed to get machine info %d\n", in sof_probe_continue()
315 snd_sof_new_platform_drv(sdev); in sof_probe_continue()
318 ret = snd_sof_dbg_init(sdev); in sof_probe_continue()
325 dev_err(sdev->dev, "error: failed to init DSP trace/debug %d\n", in sof_probe_continue()
331 sdev->ipc = snd_sof_ipc_init(sdev); in sof_probe_continue()
332 if (!sdev->ipc) { in sof_probe_continue()
333 dev_err(sdev->dev, "error: failed to init DSP IPC %d\n", ret); in sof_probe_continue()
338 ret = snd_sof_load_firmware(sdev); in sof_probe_continue()
340 dev_err(sdev->dev, "error: failed to load DSP firmware %d\n", in sof_probe_continue()
346 ret = snd_sof_run_firmware(sdev); in sof_probe_continue()
348 dev_err(sdev->dev, "error: failed to boot DSP firmware %d\n", in sof_probe_continue()
354 ret = snd_sof_init_trace(sdev); in sof_probe_continue()
357 dev_warn(sdev->dev, in sof_probe_continue()
362 sdev->first_boot = false; in sof_probe_continue()
365 ret = devm_snd_soc_register_component(sdev->dev, &sdev->plat_drv, in sof_probe_continue()
366 sof_ops(sdev)->drv, in sof_probe_continue()
367 sof_ops(sdev)->num_drv); in sof_probe_continue()
369 dev_err(sdev->dev, in sof_probe_continue()
380 platform_device_register_data(sdev->dev, drv_name, in sof_probe_continue()
388 dev_dbg(sdev->dev, "created machine %s\n", in sof_probe_continue()
392 plat_data->sof_probe_complete(sdev->dev); in sof_probe_continue()
398 snd_sof_fw_unload(sdev); in sof_probe_continue()
400 snd_sof_ipc_free(sdev); in sof_probe_continue()
402 snd_sof_free_debug(sdev); in sof_probe_continue()
404 snd_sof_remove(sdev); in sof_probe_continue()
426 struct snd_sof_dev *sdev = in sof_probe_work() local
430 ret = sof_probe_continue(sdev); in sof_probe_work()
433 dev_err(sdev->dev, "error: %s failed err: %d\n", __func__, ret); in sof_probe_work()
439 struct snd_sof_dev *sdev; in snd_sof_device_probe() local
441 sdev = devm_kzalloc(dev, sizeof(*sdev), GFP_KERNEL); in snd_sof_device_probe()
442 if (!sdev) in snd_sof_device_probe()
446 sdev->dev = dev; in snd_sof_device_probe()
448 sdev->pdata = plat_data; in snd_sof_device_probe()
449 sdev->first_boot = true; in snd_sof_device_probe()
450 dev_set_drvdata(dev, sdev); in snd_sof_device_probe()
453 if (!sof_ops(sdev) || !sof_ops(sdev)->probe || !sof_ops(sdev)->run || in snd_sof_device_probe()
454 !sof_ops(sdev)->block_read || !sof_ops(sdev)->block_write || in snd_sof_device_probe()
455 !sof_ops(sdev)->send_msg || !sof_ops(sdev)->load_firmware || in snd_sof_device_probe()
456 !sof_ops(sdev)->ipc_msg_data || !sof_ops(sdev)->ipc_pcm_params) in snd_sof_device_probe()
459 INIT_LIST_HEAD(&sdev->pcm_list); in snd_sof_device_probe()
460 INIT_LIST_HEAD(&sdev->kcontrol_list); in snd_sof_device_probe()
461 INIT_LIST_HEAD(&sdev->widget_list); in snd_sof_device_probe()
462 INIT_LIST_HEAD(&sdev->dai_list); in snd_sof_device_probe()
463 INIT_LIST_HEAD(&sdev->route_list); in snd_sof_device_probe()
464 spin_lock_init(&sdev->ipc_lock); in snd_sof_device_probe()
465 spin_lock_init(&sdev->hw_lock); in snd_sof_device_probe()
468 INIT_WORK(&sdev->probe_work, sof_probe_work); in snd_sof_device_probe()
472 sdev->ipc_timeout = TIMEOUT_DEFAULT_IPC_MS; in snd_sof_device_probe()
474 sdev->ipc_timeout = plat_data->desc->ipc_timeout; in snd_sof_device_probe()
476 sdev->boot_timeout = TIMEOUT_DEFAULT_BOOT_MS; in snd_sof_device_probe()
478 sdev->boot_timeout = plat_data->desc->boot_timeout; in snd_sof_device_probe()
481 schedule_work(&sdev->probe_work); in snd_sof_device_probe()
485 return sof_probe_continue(sdev); in snd_sof_device_probe()
491 struct snd_sof_dev *sdev = dev_get_drvdata(dev); in snd_sof_device_remove() local
492 struct snd_sof_pdata *pdata = sdev->pdata; in snd_sof_device_remove()
495 cancel_work_sync(&sdev->probe_work); in snd_sof_device_remove()
497 snd_sof_fw_unload(sdev); in snd_sof_device_remove()
498 snd_sof_ipc_free(sdev); in snd_sof_device_remove()
499 snd_sof_free_debug(sdev); in snd_sof_device_remove()
500 snd_sof_free_trace(sdev); in snd_sof_device_remove()
516 snd_sof_remove(sdev); in snd_sof_device_remove()