Lines Matching +full:dsp +full:- +full:ctrl

1 // SPDX-License-Identifier: GPL-2.0-only
3 * wm_adsp.c -- Wolfson ADSP support
35 dev_crit(_dsp->cs_dsp.dev, "%s: " fmt, _dsp->cs_dsp.name, ##__VA_ARGS__)
37 dev_err(_dsp->cs_dsp.dev, "%s: " fmt, _dsp->cs_dsp.name, ##__VA_ARGS__)
39 dev_warn(_dsp->cs_dsp.dev, "%s: " fmt, _dsp->cs_dsp.name, ##__VA_ARGS__)
41 dev_info(_dsp->cs_dsp.dev, "%s: " fmt, _dsp->cs_dsp.name, ##__VA_ARGS__)
43 dev_dbg(_dsp->cs_dsp.dev, "%s: " fmt, _dsp->cs_dsp.name, ##__VA_ARGS__)
46 adsp_err(_obj->dsp, "%s: " fmt, _obj->name ? _obj->name : "legacy", \
49 adsp_dbg(_obj->dsp, "%s: " fmt, _obj->name ? _obj->name : "legacy", \
80 [WM_ADSP_FW_CTRL] = "Voice Ctrl",
127 __be32 buf1_size; /* Size of buf1 area in DSP words */
129 __be32 buf1_buf2_size; /* Size of buf1+buf2 in DSP words */
131 __be32 buf_total_size; /* Size of buf1+buf2+buf3 in DSP words */
133 __be32 irq_count; /* bits 1-31 count IRQ assertions */
150 struct wm_adsp *dsp; member
167 struct wm_adsp *dsp; member
199 static int wm_adsp_buffer_init(struct wm_adsp *dsp);
200 static int wm_adsp_buffer_free(struct wm_adsp *dsp);
279 [WM_ADSP_FW_MBC_VSS] = { .file = "mbc-vss" },
282 [WM_ADSP_FW_TX_SPK] = { .file = "tx-spk" },
284 [WM_ADSP_FW_RX_ANC] = { .file = "rx-anc" },
286 .file = "ctrl",
300 .file = "spk-prot",
305 [WM_ADSP_FW_SPK_CALI] = { .file = "spk-cali" },
306 [WM_ADSP_FW_SPK_DIAG] = { .file = "spk-diag" },
321 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; in wm_adsp_fw_get()
322 struct wm_adsp *dsp = snd_soc_component_get_drvdata(component); in wm_adsp_fw_get() local
324 ucontrol->value.enumerated.item[0] = dsp[e->shift_l].fw; in wm_adsp_fw_get()
334 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; in wm_adsp_fw_put()
335 struct wm_adsp *dsp = snd_soc_component_get_drvdata(component); in wm_adsp_fw_put() local
338 if (ucontrol->value.enumerated.item[0] == dsp[e->shift_l].fw) in wm_adsp_fw_put()
341 if (ucontrol->value.enumerated.item[0] >= WM_ADSP_NUM_FW) in wm_adsp_fw_put()
342 return -EINVAL; in wm_adsp_fw_put()
344 mutex_lock(&dsp[e->shift_l].cs_dsp.pwr_lock); in wm_adsp_fw_put()
346 if (dsp[e->shift_l].cs_dsp.booted || !list_empty(&dsp[e->shift_l].compr_list)) in wm_adsp_fw_put()
347 ret = -EBUSY; in wm_adsp_fw_put()
349 dsp[e->shift_l].fw = ucontrol->value.enumerated.item[0]; in wm_adsp_fw_put()
351 mutex_unlock(&dsp[e->shift_l].cs_dsp.pwr_lock); in wm_adsp_fw_put()
377 (struct soc_bytes_ext *)kctl->private_value; in wm_coeff_info()
379 struct cs_dsp_coeff_ctl *cs_ctl = ctl->cs_ctl; in wm_coeff_info()
381 switch (cs_ctl->type) { in wm_coeff_info()
383 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; in wm_coeff_info()
384 uinfo->value.integer.min = CS_DSP_ACKED_CTL_MIN_VALUE; in wm_coeff_info()
385 uinfo->value.integer.max = CS_DSP_ACKED_CTL_MAX_VALUE; in wm_coeff_info()
386 uinfo->value.integer.step = 1; in wm_coeff_info()
387 uinfo->count = 1; in wm_coeff_info()
390 uinfo->type = SNDRV_CTL_ELEM_TYPE_BYTES; in wm_coeff_info()
391 uinfo->count = cs_ctl->len; in wm_coeff_info()
402 (struct soc_bytes_ext *)kctl->private_value; in wm_coeff_put()
404 struct cs_dsp_coeff_ctl *cs_ctl = ctl->cs_ctl; in wm_coeff_put()
405 char *p = ucontrol->value.bytes.data; in wm_coeff_put()
408 mutex_lock(&cs_ctl->dsp->pwr_lock); in wm_coeff_put()
409 ret = cs_dsp_coeff_write_ctrl(cs_ctl, 0, p, cs_ctl->len); in wm_coeff_put()
410 mutex_unlock(&cs_ctl->dsp->pwr_lock); in wm_coeff_put()
419 (struct soc_bytes_ext *)kctl->private_value; in wm_coeff_tlv_put()
421 struct cs_dsp_coeff_ctl *cs_ctl = ctl->cs_ctl; in wm_coeff_tlv_put()
424 mutex_lock(&cs_ctl->dsp->pwr_lock); in wm_coeff_tlv_put()
426 if (copy_from_user(cs_ctl->cache, bytes, size)) in wm_coeff_tlv_put()
427 ret = -EFAULT; in wm_coeff_tlv_put()
429 ret = cs_dsp_coeff_write_ctrl(cs_ctl, 0, cs_ctl->cache, size); in wm_coeff_tlv_put()
431 mutex_unlock(&cs_ctl->dsp->pwr_lock); in wm_coeff_tlv_put()
440 (struct soc_bytes_ext *)kctl->private_value; in wm_coeff_put_acked()
442 struct cs_dsp_coeff_ctl *cs_ctl = ctl->cs_ctl; in wm_coeff_put_acked()
443 unsigned int val = ucontrol->value.integer.value[0]; in wm_coeff_put_acked()
449 mutex_lock(&cs_ctl->dsp->pwr_lock); in wm_coeff_put_acked()
451 if (cs_ctl->enabled) in wm_coeff_put_acked()
454 ret = -EPERM; in wm_coeff_put_acked()
456 mutex_unlock(&cs_ctl->dsp->pwr_lock); in wm_coeff_put_acked()
465 (struct soc_bytes_ext *)kctl->private_value; in wm_coeff_get()
467 struct cs_dsp_coeff_ctl *cs_ctl = ctl->cs_ctl; in wm_coeff_get()
468 char *p = ucontrol->value.bytes.data; in wm_coeff_get()
471 mutex_lock(&cs_ctl->dsp->pwr_lock); in wm_coeff_get()
472 ret = cs_dsp_coeff_read_ctrl(cs_ctl, 0, p, cs_ctl->len); in wm_coeff_get()
473 mutex_unlock(&cs_ctl->dsp->pwr_lock); in wm_coeff_get()
482 (struct soc_bytes_ext *)kctl->private_value; in wm_coeff_tlv_get()
484 struct cs_dsp_coeff_ctl *cs_ctl = ctl->cs_ctl; in wm_coeff_tlv_get()
487 mutex_lock(&cs_ctl->dsp->pwr_lock); in wm_coeff_tlv_get()
489 ret = cs_dsp_coeff_read_ctrl(cs_ctl, 0, cs_ctl->cache, size); in wm_coeff_tlv_get()
491 if (!ret && copy_to_user(bytes, cs_ctl->cache, size)) in wm_coeff_tlv_get()
492 ret = -EFAULT; in wm_coeff_tlv_get()
494 mutex_unlock(&cs_ctl->dsp->pwr_lock); in wm_coeff_tlv_get()
504 * user-side assumptions that all controls are readable and that a in wm_coeff_get_acked()
509 ucontrol->value.integer.value[0] = 0; in wm_coeff_get_acked()
550 struct cs_dsp_coeff_ctl *cs_ctl = ctl->cs_ctl; in wm_adsp_ctl_work()
551 struct wm_adsp *dsp = container_of(cs_ctl->dsp, in wm_adsp_ctl_work() local
560 kcontrol->name = ctl->name; in wm_adsp_ctl_work()
561 kcontrol->info = wm_coeff_info; in wm_adsp_ctl_work()
562 kcontrol->iface = SNDRV_CTL_ELEM_IFACE_MIXER; in wm_adsp_ctl_work()
563 kcontrol->tlv.c = snd_soc_bytes_tlv_callback; in wm_adsp_ctl_work()
564 kcontrol->private_value = (unsigned long)&ctl->bytes_ext; in wm_adsp_ctl_work()
565 kcontrol->access = wmfw_convert_flags(cs_ctl->flags, cs_ctl->len); in wm_adsp_ctl_work()
567 switch (cs_ctl->type) { in wm_adsp_ctl_work()
569 kcontrol->get = wm_coeff_get_acked; in wm_adsp_ctl_work()
570 kcontrol->put = wm_coeff_put_acked; in wm_adsp_ctl_work()
573 if (kcontrol->access & SNDRV_CTL_ELEM_ACCESS_TLV_CALLBACK) { in wm_adsp_ctl_work()
574 ctl->bytes_ext.max = cs_ctl->len; in wm_adsp_ctl_work()
575 ctl->bytes_ext.get = wm_coeff_tlv_get; in wm_adsp_ctl_work()
576 ctl->bytes_ext.put = wm_coeff_tlv_put; in wm_adsp_ctl_work()
578 kcontrol->get = wm_coeff_get; in wm_adsp_ctl_work()
579 kcontrol->put = wm_coeff_put; in wm_adsp_ctl_work()
584 snd_soc_add_component_controls(dsp->component, kcontrol, 1); in wm_adsp_ctl_work()
591 struct wm_adsp *dsp = container_of(cs_ctl->dsp, struct wm_adsp, cs_dsp); in wm_adsp_control_add() local
592 struct cs_dsp *cs_dsp = &dsp->cs_dsp; in wm_adsp_control_add()
598 if (cs_ctl->flags & WMFW_CTL_FLAG_SYS) in wm_adsp_control_add()
601 region_name = cs_dsp_mem_region_name(cs_ctl->alg_region.type); in wm_adsp_control_add()
603 adsp_err(dsp, "Unknown region type: %d\n", cs_ctl->alg_region.type); in wm_adsp_control_add()
604 return -EINVAL; in wm_adsp_control_add()
607 switch (cs_dsp->fw_ver) { in wm_adsp_control_add()
611 "%s %s %x", cs_dsp->name, region_name, in wm_adsp_control_add()
612 cs_ctl->alg_region.alg); in wm_adsp_control_add()
616 "%s%c %.12s %x", cs_dsp->name, *region_name, in wm_adsp_control_add()
617 wm_adsp_fw_text[dsp->fw], cs_ctl->alg_region.alg); in wm_adsp_control_add()
621 "%s %.12s %x", cs_dsp->name, in wm_adsp_control_add()
622 wm_adsp_fw_text[dsp->fw], cs_ctl->alg_region.alg); in wm_adsp_control_add()
626 if (cs_ctl->subname) { in wm_adsp_control_add()
627 int avail = SNDRV_CTL_ELEM_ID_NAME_MAXLEN - ret - 2; in wm_adsp_control_add()
630 if (dsp->component->name_prefix) in wm_adsp_control_add()
631 avail -= strlen(dsp->component->name_prefix) + 1; in wm_adsp_control_add()
634 if (cs_ctl->subname_len > avail) in wm_adsp_control_add()
635 skip = cs_ctl->subname_len - avail; in wm_adsp_control_add()
637 snprintf(name + ret, SNDRV_CTL_ELEM_ID_NAME_MAXLEN - ret, in wm_adsp_control_add()
638 " %.*s", cs_ctl->subname_len - skip, cs_ctl->subname + skip); in wm_adsp_control_add()
643 return -ENOMEM; in wm_adsp_control_add()
644 ctl->cs_ctl = cs_ctl; in wm_adsp_control_add()
646 ctl->name = kmemdup(name, strlen(name) + 1, GFP_KERNEL); in wm_adsp_control_add()
647 if (!ctl->name) { in wm_adsp_control_add()
648 ret = -ENOMEM; in wm_adsp_control_add()
652 cs_ctl->priv = ctl; in wm_adsp_control_add()
654 INIT_WORK(&ctl->work, wm_adsp_ctl_work); in wm_adsp_control_add()
655 schedule_work(&ctl->work); in wm_adsp_control_add()
667 struct wm_coeff_ctl *ctl = cs_ctl->priv; in wm_adsp_control_remove()
669 cancel_work_sync(&ctl->work); in wm_adsp_control_remove()
671 kfree(ctl->name); in wm_adsp_control_remove()
675 int wm_adsp_write_ctl(struct wm_adsp *dsp, const char *name, int type, in wm_adsp_write_ctl() argument
678 struct cs_dsp_coeff_ctl *cs_ctl = cs_dsp_get_ctl(&dsp->cs_dsp, name, type, alg); in wm_adsp_write_ctl()
688 if (cs_ctl->flags & WMFW_CTL_FLAG_SYS) in wm_adsp_write_ctl()
691 ctl = cs_ctl->priv; in wm_adsp_write_ctl()
693 if (dsp->component->name_prefix) in wm_adsp_write_ctl()
695 dsp->component->name_prefix, ctl->name); in wm_adsp_write_ctl()
698 ctl->name); in wm_adsp_write_ctl()
700 kcontrol = snd_soc_card_get_kcontrol(dsp->component->card, ctl_name); in wm_adsp_write_ctl()
702 adsp_err(dsp, "Can't find kcontrol %s\n", ctl_name); in wm_adsp_write_ctl()
703 return -EINVAL; in wm_adsp_write_ctl()
706 snd_ctl_notify(dsp->component->card->snd_card, in wm_adsp_write_ctl()
707 SNDRV_CTL_EVENT_MASK_VALUE, &kcontrol->id); in wm_adsp_write_ctl()
713 int wm_adsp_read_ctl(struct wm_adsp *dsp, const char *name, int type, in wm_adsp_read_ctl() argument
716 return cs_dsp_coeff_read_ctrl(cs_dsp_get_ctl(&dsp->cs_dsp, name, type, alg), in wm_adsp_read_ctl()
721 static void wm_adsp_release_firmware_files(struct wm_adsp *dsp, in wm_adsp_release_firmware_files() argument
736 static int wm_adsp_request_firmware_file(struct wm_adsp *dsp, in wm_adsp_request_firmware_file() argument
742 struct cs_dsp *cs_dsp = &dsp->cs_dsp; in wm_adsp_request_firmware_file()
747 *filename = kasprintf(GFP_KERNEL, "%s%s-%s-%s-%s-%s.%s", dir, dsp->part, in wm_adsp_request_firmware_file()
748 dsp->fwf_name, wm_adsp_fw[dsp->fw].file, system_name, in wm_adsp_request_firmware_file()
751 *filename = kasprintf(GFP_KERNEL, "%s%s-%s-%s-%s.%s", dir, dsp->part, in wm_adsp_request_firmware_file()
752 dsp->fwf_name, wm_adsp_fw[dsp->fw].file, system_name, in wm_adsp_request_firmware_file()
755 *filename = kasprintf(GFP_KERNEL, "%s%s-%s-%s.%s", dir, dsp->part, dsp->fwf_name, in wm_adsp_request_firmware_file()
756 wm_adsp_fw[dsp->fw].file, filetype); in wm_adsp_request_firmware_file()
759 return -ENOMEM; in wm_adsp_request_firmware_file()
762 * Make sure that filename is lower-case and any non alpha-numeric in wm_adsp_request_firmware_file()
772 *s = '-'; in wm_adsp_request_firmware_file()
776 ret = firmware_request_nowarn(firmware, *filename, cs_dsp->dev); in wm_adsp_request_firmware_file()
778 adsp_dbg(dsp, "Failed to request '%s'\n", *filename); in wm_adsp_request_firmware_file()
787 static int wm_adsp_request_firmware_files(struct wm_adsp *dsp, in wm_adsp_request_firmware_files() argument
793 const char *system_name = dsp->system_name; in wm_adsp_request_firmware_files()
794 const char *asoc_component_prefix = dsp->component->name_prefix; in wm_adsp_request_firmware_files()
798 if (!wm_adsp_request_firmware_file(dsp, wmfw_firmware, wmfw_filename, in wm_adsp_request_firmware_files()
801 adsp_dbg(dsp, "Found '%s'\n", *wmfw_filename); in wm_adsp_request_firmware_files()
802 wm_adsp_request_firmware_file(dsp, coeff_firmware, coeff_filename, in wm_adsp_request_firmware_files()
810 if (!wm_adsp_request_firmware_file(dsp, wmfw_firmware, wmfw_filename, in wm_adsp_request_firmware_files()
813 adsp_dbg(dsp, "Found '%s'\n", *wmfw_filename); in wm_adsp_request_firmware_files()
815 wm_adsp_request_firmware_file(dsp, coeff_firmware, coeff_filename, in wm_adsp_request_firmware_files()
820 wm_adsp_request_firmware_file(dsp, coeff_firmware, coeff_filename, in wm_adsp_request_firmware_files()
827 if (!wm_adsp_request_firmware_file(dsp, wmfw_firmware, wmfw_filename, in wm_adsp_request_firmware_files()
829 adsp_dbg(dsp, "Found '%s'\n", *wmfw_filename); in wm_adsp_request_firmware_files()
830 wm_adsp_request_firmware_file(dsp, coeff_firmware, coeff_filename, in wm_adsp_request_firmware_files()
835 ret = wm_adsp_request_firmware_file(dsp, wmfw_firmware, wmfw_filename, in wm_adsp_request_firmware_files()
838 adsp_dbg(dsp, "Found '%s'\n", *wmfw_filename); in wm_adsp_request_firmware_files()
839 wm_adsp_request_firmware_file(dsp, coeff_firmware, coeff_filename, in wm_adsp_request_firmware_files()
844 adsp_err(dsp, "Failed to request firmware <%s>%s-%s-%s<-%s<%s>>.wmfw\n", in wm_adsp_request_firmware_files()
845 cirrus_dir, dsp->part, dsp->fwf_name, wm_adsp_fw[dsp->fw].file, in wm_adsp_request_firmware_files()
848 return -ENOENT; in wm_adsp_request_firmware_files()
851 static int wm_adsp_common_init(struct wm_adsp *dsp) in wm_adsp_common_init() argument
855 INIT_LIST_HEAD(&dsp->compr_list); in wm_adsp_common_init()
856 INIT_LIST_HEAD(&dsp->buffer_list); in wm_adsp_common_init()
858 if (!dsp->fwf_name) { in wm_adsp_common_init()
859 p = devm_kstrdup(dsp->cs_dsp.dev, dsp->cs_dsp.name, GFP_KERNEL); in wm_adsp_common_init()
861 return -ENOMEM; in wm_adsp_common_init()
863 dsp->fwf_name = p; in wm_adsp_common_init()
871 int wm_adsp1_init(struct wm_adsp *dsp) in wm_adsp1_init() argument
875 dsp->cs_dsp.client_ops = &wm_adsp1_client_ops; in wm_adsp1_init()
877 ret = cs_dsp_adsp1_init(&dsp->cs_dsp); in wm_adsp1_init()
881 return wm_adsp_common_init(dsp); in wm_adsp1_init()
889 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in wm_adsp1_event()
891 struct wm_adsp *dsp = &dsps[w->shift]; in wm_adsp1_event() local
898 dsp->component = component; in wm_adsp1_event()
902 ret = wm_adsp_request_firmware_files(dsp, in wm_adsp1_event()
908 ret = cs_dsp_adsp1_power_up(&dsp->cs_dsp, in wm_adsp1_event()
911 wm_adsp_fw_text[dsp->fw]); in wm_adsp1_event()
913 wm_adsp_release_firmware_files(dsp, in wm_adsp1_event()
918 cs_dsp_adsp1_power_down(&dsp->cs_dsp); in wm_adsp1_event()
930 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in wm_adsp2_set_dspclk()
932 struct wm_adsp *dsp = &dsps[w->shift]; in wm_adsp2_set_dspclk() local
934 return cs_dsp_set_dspclk(&dsp->cs_dsp, freq); in wm_adsp2_set_dspclk()
944 (struct soc_mixer_control *)kcontrol->private_value; in wm_adsp2_preloader_get()
945 struct wm_adsp *dsp = &dsps[mc->shift - 1]; in wm_adsp2_preloader_get() local
947 ucontrol->value.integer.value[0] = dsp->preloaded; in wm_adsp2_preloader_get()
960 (struct soc_mixer_control *)kcontrol->private_value; in wm_adsp2_preloader_put()
961 struct wm_adsp *dsp = &dsps[mc->shift - 1]; in wm_adsp2_preloader_put() local
964 if (dsp->preloaded == ucontrol->value.integer.value[0]) in wm_adsp2_preloader_put()
967 snprintf(preload, ARRAY_SIZE(preload), "%s Preload", dsp->cs_dsp.name); in wm_adsp2_preloader_put()
969 if (ucontrol->value.integer.value[0] || dsp->toggle_preload) in wm_adsp2_preloader_put()
976 flush_work(&dsp->boot_work); in wm_adsp2_preloader_put()
978 dsp->preloaded = ucontrol->value.integer.value[0]; in wm_adsp2_preloader_put()
980 if (dsp->toggle_preload) { in wm_adsp2_preloader_put()
991 struct wm_adsp *dsp = container_of(work, in wm_adsp_boot_work() local
1000 ret = wm_adsp_request_firmware_files(dsp, in wm_adsp_boot_work()
1006 cs_dsp_power_up(&dsp->cs_dsp, in wm_adsp_boot_work()
1009 wm_adsp_fw_text[dsp->fw]); in wm_adsp_boot_work()
1011 wm_adsp_release_firmware_files(dsp, in wm_adsp_boot_work()
1019 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in wm_adsp_early_event()
1021 struct wm_adsp *dsp = &dsps[w->shift]; in wm_adsp_early_event() local
1025 queue_work(system_unbound_wq, &dsp->boot_work); in wm_adsp_early_event()
1028 cs_dsp_power_down(&dsp->cs_dsp); in wm_adsp_early_event()
1040 struct wm_adsp *dsp = container_of(cs_dsp, struct wm_adsp, cs_dsp); in wm_adsp_event_post_run() local
1042 if (wm_adsp_fw[dsp->fw].num_caps != 0) in wm_adsp_event_post_run()
1043 return wm_adsp_buffer_init(dsp); in wm_adsp_event_post_run()
1050 struct wm_adsp *dsp = container_of(cs_dsp, struct wm_adsp, cs_dsp); in wm_adsp_event_post_stop() local
1052 if (wm_adsp_fw[dsp->fw].num_caps != 0) in wm_adsp_event_post_stop()
1053 wm_adsp_buffer_free(dsp); in wm_adsp_event_post_stop()
1055 dsp->fatal_error = false; in wm_adsp_event_post_stop()
1061 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in wm_adsp_event()
1063 struct wm_adsp *dsp = &dsps[w->shift]; in wm_adsp_event() local
1068 flush_work(&dsp->boot_work); in wm_adsp_event()
1069 ret = cs_dsp_run(&dsp->cs_dsp); in wm_adsp_event()
1072 cs_dsp_stop(&dsp->cs_dsp); in wm_adsp_event()
1082 int wm_adsp2_component_probe(struct wm_adsp *dsp, struct snd_soc_component *component) in wm_adsp2_component_probe() argument
1086 snprintf(preload, ARRAY_SIZE(preload), "%s Preload", dsp->cs_dsp.name); in wm_adsp2_component_probe()
1089 cs_dsp_init_debugfs(&dsp->cs_dsp, component->debugfs_root); in wm_adsp2_component_probe()
1091 dsp->component = component; in wm_adsp2_component_probe()
1097 int wm_adsp2_component_remove(struct wm_adsp *dsp, struct snd_soc_component *component) in wm_adsp2_component_remove() argument
1099 cs_dsp_cleanup_debugfs(&dsp->cs_dsp); in wm_adsp2_component_remove()
1105 int wm_adsp2_init(struct wm_adsp *dsp) in wm_adsp2_init() argument
1109 INIT_WORK(&dsp->boot_work, wm_adsp_boot_work); in wm_adsp2_init()
1111 dsp->sys_config_size = sizeof(struct wm_adsp_system_config_xm_hdr); in wm_adsp2_init()
1112 dsp->cs_dsp.client_ops = &wm_adsp2_client_ops; in wm_adsp2_init()
1114 ret = cs_dsp_adsp2_init(&dsp->cs_dsp); in wm_adsp2_init()
1118 return wm_adsp_common_init(dsp); in wm_adsp2_init()
1122 int wm_halo_init(struct wm_adsp *dsp) in wm_halo_init() argument
1126 INIT_WORK(&dsp->boot_work, wm_adsp_boot_work); in wm_halo_init()
1128 dsp->sys_config_size = sizeof(struct wm_halo_system_config_xm_hdr); in wm_halo_init()
1129 dsp->cs_dsp.client_ops = &wm_adsp2_client_ops; in wm_halo_init()
1131 ret = cs_dsp_halo_init(&dsp->cs_dsp); in wm_halo_init()
1135 return wm_adsp_common_init(dsp); in wm_halo_init()
1139 void wm_adsp2_remove(struct wm_adsp *dsp) in wm_adsp2_remove() argument
1141 cs_dsp_remove(&dsp->cs_dsp); in wm_adsp2_remove()
1147 return compr->buf != NULL; in wm_adsp_compr_attached()
1154 if (compr->dsp->fatal_error) in wm_adsp_compr_attach()
1155 return -EINVAL; in wm_adsp_compr_attach()
1157 list_for_each_entry(tmp, &compr->dsp->buffer_list, list) { in wm_adsp_compr_attach()
1158 if (!tmp->name || !strcmp(compr->name, tmp->name)) { in wm_adsp_compr_attach()
1165 return -EINVAL; in wm_adsp_compr_attach()
1167 compr->buf = buf; in wm_adsp_compr_attach()
1168 buf->compr = compr; in wm_adsp_compr_attach()
1179 if (compr->stream) in wm_adsp_compr_detach()
1180 snd_compr_fragment_elapsed(compr->stream); in wm_adsp_compr_detach()
1183 compr->buf->compr = NULL; in wm_adsp_compr_detach()
1184 compr->buf = NULL; in wm_adsp_compr_detach()
1188 int wm_adsp_compr_open(struct wm_adsp *dsp, struct snd_compr_stream *stream) in wm_adsp_compr_open() argument
1191 struct snd_soc_pcm_runtime *rtd = stream->private_data; in wm_adsp_compr_open()
1194 mutex_lock(&dsp->cs_dsp.pwr_lock); in wm_adsp_compr_open()
1196 if (wm_adsp_fw[dsp->fw].num_caps == 0) { in wm_adsp_compr_open()
1197 adsp_err(dsp, "%s: Firmware does not support compressed API\n", in wm_adsp_compr_open()
1198 asoc_rtd_to_codec(rtd, 0)->name); in wm_adsp_compr_open()
1199 ret = -ENXIO; in wm_adsp_compr_open()
1203 if (wm_adsp_fw[dsp->fw].compr_direction != stream->direction) { in wm_adsp_compr_open()
1204 adsp_err(dsp, "%s: Firmware does not support stream direction\n", in wm_adsp_compr_open()
1205 asoc_rtd_to_codec(rtd, 0)->name); in wm_adsp_compr_open()
1206 ret = -EINVAL; in wm_adsp_compr_open()
1210 list_for_each_entry(tmp, &dsp->compr_list, list) { in wm_adsp_compr_open()
1211 if (!strcmp(tmp->name, asoc_rtd_to_codec(rtd, 0)->name)) { in wm_adsp_compr_open()
1212 adsp_err(dsp, "%s: Only a single stream supported per dai\n", in wm_adsp_compr_open()
1213 asoc_rtd_to_codec(rtd, 0)->name); in wm_adsp_compr_open()
1214 ret = -EBUSY; in wm_adsp_compr_open()
1221 ret = -ENOMEM; in wm_adsp_compr_open()
1225 compr->dsp = dsp; in wm_adsp_compr_open()
1226 compr->stream = stream; in wm_adsp_compr_open()
1227 compr->name = asoc_rtd_to_codec(rtd, 0)->name; in wm_adsp_compr_open()
1229 list_add_tail(&compr->list, &dsp->compr_list); in wm_adsp_compr_open()
1231 stream->runtime->private_data = compr; in wm_adsp_compr_open()
1234 mutex_unlock(&dsp->cs_dsp.pwr_lock); in wm_adsp_compr_open()
1243 struct wm_adsp_compr *compr = stream->runtime->private_data; in wm_adsp_compr_free()
1244 struct wm_adsp *dsp = compr->dsp; in wm_adsp_compr_free() local
1246 mutex_lock(&dsp->cs_dsp.pwr_lock); in wm_adsp_compr_free()
1249 list_del(&compr->list); in wm_adsp_compr_free()
1251 kfree(compr->raw_buf); in wm_adsp_compr_free()
1254 mutex_unlock(&dsp->cs_dsp.pwr_lock); in wm_adsp_compr_free()
1263 struct wm_adsp_compr *compr = stream->runtime->private_data; in wm_adsp_compr_check_params()
1264 struct wm_adsp *dsp = compr->dsp; in wm_adsp_compr_check_params() local
1269 if (params->buffer.fragment_size < WM_ADSP_MIN_FRAGMENT_SIZE || in wm_adsp_compr_check_params()
1270 params->buffer.fragment_size > WM_ADSP_MAX_FRAGMENT_SIZE || in wm_adsp_compr_check_params()
1271 params->buffer.fragments < WM_ADSP_MIN_FRAGMENTS || in wm_adsp_compr_check_params()
1272 params->buffer.fragments > WM_ADSP_MAX_FRAGMENTS || in wm_adsp_compr_check_params()
1273 params->buffer.fragment_size % CS_DSP_DATA_WORD_SIZE) { in wm_adsp_compr_check_params()
1275 params->buffer.fragment_size, in wm_adsp_compr_check_params()
1276 params->buffer.fragments); in wm_adsp_compr_check_params()
1278 return -EINVAL; in wm_adsp_compr_check_params()
1281 for (i = 0; i < wm_adsp_fw[dsp->fw].num_caps; i++) { in wm_adsp_compr_check_params()
1282 caps = &wm_adsp_fw[dsp->fw].caps[i]; in wm_adsp_compr_check_params()
1283 desc = &caps->desc; in wm_adsp_compr_check_params()
1285 if (caps->id != params->codec.id) in wm_adsp_compr_check_params()
1288 if (stream->direction == SND_COMPRESS_PLAYBACK) { in wm_adsp_compr_check_params()
1289 if (desc->max_ch < params->codec.ch_out) in wm_adsp_compr_check_params()
1292 if (desc->max_ch < params->codec.ch_in) in wm_adsp_compr_check_params()
1296 if (!(desc->formats & (1 << params->codec.format))) in wm_adsp_compr_check_params()
1299 for (j = 0; j < desc->num_sample_rates; ++j) in wm_adsp_compr_check_params()
1300 if (desc->sample_rates[j] == params->codec.sample_rate) in wm_adsp_compr_check_params()
1305 params->codec.id, params->codec.ch_in, params->codec.ch_out, in wm_adsp_compr_check_params()
1306 params->codec.sample_rate, params->codec.format); in wm_adsp_compr_check_params()
1307 return -EINVAL; in wm_adsp_compr_check_params()
1312 return compr->size.fragment_size / CS_DSP_DATA_WORD_SIZE; in wm_adsp_compr_frag_words()
1319 struct wm_adsp_compr *compr = stream->runtime->private_data; in wm_adsp_compr_set_params()
1327 compr->size = params->buffer; in wm_adsp_compr_set_params()
1330 compr->size.fragment_size, compr->size.fragments); in wm_adsp_compr_set_params()
1332 size = wm_adsp_compr_frag_words(compr) * sizeof(*compr->raw_buf); in wm_adsp_compr_set_params()
1333 compr->raw_buf = kmalloc(size, GFP_DMA | GFP_KERNEL); in wm_adsp_compr_set_params()
1334 if (!compr->raw_buf) in wm_adsp_compr_set_params()
1335 return -ENOMEM; in wm_adsp_compr_set_params()
1337 compr->sample_rate = params->codec.sample_rate; in wm_adsp_compr_set_params()
1347 struct wm_adsp_compr *compr = stream->runtime->private_data; in wm_adsp_compr_get_caps()
1348 int fw = compr->dsp->fw; in wm_adsp_compr_get_caps()
1353 caps->codecs[i] = wm_adsp_fw[fw].caps[i].id; in wm_adsp_compr_get_caps()
1355 caps->num_codecs = i; in wm_adsp_compr_get_caps()
1356 caps->direction = wm_adsp_fw[fw].compr_direction; in wm_adsp_compr_get_caps()
1358 caps->min_fragment_size = WM_ADSP_MIN_FRAGMENT_SIZE; in wm_adsp_compr_get_caps()
1359 caps->max_fragment_size = WM_ADSP_MAX_FRAGMENT_SIZE; in wm_adsp_compr_get_caps()
1360 caps->min_fragments = WM_ADSP_MIN_FRAGMENTS; in wm_adsp_compr_get_caps()
1361 caps->max_fragments = WM_ADSP_MAX_FRAGMENTS; in wm_adsp_compr_get_caps()
1371 return cs_dsp_read_data_word(&buf->dsp->cs_dsp, buf->host_buf_mem_type, in wm_adsp_buffer_read()
1372 buf->host_buf_ptr + field_offset, data); in wm_adsp_buffer_read()
1378 return cs_dsp_write_data_word(&buf->dsp->cs_dsp, buf->host_buf_mem_type, in wm_adsp_buffer_write()
1379 buf->host_buf_ptr + field_offset, in wm_adsp_buffer_write()
1385 const struct wm_adsp_fw_caps *caps = wm_adsp_fw[buf->dsp->fw].caps; in wm_adsp_buffer_populate()
1390 buf->regions = kcalloc(caps->num_regions, sizeof(*buf->regions), in wm_adsp_buffer_populate()
1392 if (!buf->regions) in wm_adsp_buffer_populate()
1393 return -ENOMEM; in wm_adsp_buffer_populate()
1395 for (i = 0; i < caps->num_regions; ++i) { in wm_adsp_buffer_populate()
1396 region = &buf->regions[i]; in wm_adsp_buffer_populate()
1398 region->offset = offset; in wm_adsp_buffer_populate()
1399 region->mem_type = caps->region_defs[i].mem_type; in wm_adsp_buffer_populate()
1401 ret = wm_adsp_buffer_read(buf, caps->region_defs[i].base_offset, in wm_adsp_buffer_populate()
1402 &region->base_addr); in wm_adsp_buffer_populate()
1406 ret = wm_adsp_buffer_read(buf, caps->region_defs[i].size_offset, in wm_adsp_buffer_populate()
1411 region->cumulative_size = offset; in wm_adsp_buffer_populate()
1415 i, region->mem_type, region->base_addr, in wm_adsp_buffer_populate()
1416 region->offset, region->cumulative_size); in wm_adsp_buffer_populate()
1424 buf->irq_count = 0xFFFFFFFF; in wm_adsp_buffer_clear()
1425 buf->read_index = -1; in wm_adsp_buffer_clear()
1426 buf->avail = 0; in wm_adsp_buffer_clear()
1429 static struct wm_adsp_compr_buf *wm_adsp_buffer_alloc(struct wm_adsp *dsp) in wm_adsp_buffer_alloc() argument
1437 buf->dsp = dsp; in wm_adsp_buffer_alloc()
1444 static int wm_adsp_buffer_parse_legacy(struct wm_adsp *dsp) in wm_adsp_buffer_parse_legacy() argument
1451 alg_region = cs_dsp_find_alg_region(&dsp->cs_dsp, WMFW_ADSP2_XM, dsp->cs_dsp.fw_id); in wm_adsp_buffer_parse_legacy()
1453 adsp_err(dsp, "No algorithm region found\n"); in wm_adsp_buffer_parse_legacy()
1454 return -EINVAL; in wm_adsp_buffer_parse_legacy()
1457 xmalg = dsp->sys_config_size / sizeof(__be32); in wm_adsp_buffer_parse_legacy()
1459 addr = alg_region->base + xmalg + ALG_XM_FIELD(magic); in wm_adsp_buffer_parse_legacy()
1460 ret = cs_dsp_read_data_word(&dsp->cs_dsp, WMFW_ADSP2_XM, addr, &magic); in wm_adsp_buffer_parse_legacy()
1465 return -ENODEV; in wm_adsp_buffer_parse_legacy()
1467 buf = wm_adsp_buffer_alloc(dsp); in wm_adsp_buffer_parse_legacy()
1469 return -ENOMEM; in wm_adsp_buffer_parse_legacy()
1471 addr = alg_region->base + xmalg + ALG_XM_FIELD(host_buf_ptr); in wm_adsp_buffer_parse_legacy()
1473 ret = cs_dsp_read_data_word(&dsp->cs_dsp, WMFW_ADSP2_XM, addr, in wm_adsp_buffer_parse_legacy()
1474 &buf->host_buf_ptr); in wm_adsp_buffer_parse_legacy()
1478 if (buf->host_buf_ptr) in wm_adsp_buffer_parse_legacy()
1484 if (!buf->host_buf_ptr) { in wm_adsp_buffer_parse_legacy()
1485 ret = -EIO; in wm_adsp_buffer_parse_legacy()
1489 buf->host_buf_mem_type = WMFW_ADSP2_XM; in wm_adsp_buffer_parse_legacy()
1495 list_add_tail(&buf->list, &dsp->buffer_list); in wm_adsp_buffer_parse_legacy()
1497 compr_dbg(buf, "legacy host_buf_ptr=%x\n", buf->host_buf_ptr); in wm_adsp_buffer_parse_legacy()
1511 struct wm_adsp *dsp = container_of(cs_ctl->dsp, struct wm_adsp, cs_dsp); in wm_adsp_buffer_parse_coeff() local
1517 min(cs_ctl->len, sizeof(coeff_v1))); in wm_adsp_buffer_parse_coeff()
1528 adsp_err(dsp, "Failed to acquire host buffer\n"); in wm_adsp_buffer_parse_coeff()
1529 return -EIO; in wm_adsp_buffer_parse_coeff()
1532 buf = wm_adsp_buffer_alloc(dsp); in wm_adsp_buffer_parse_coeff()
1534 return -ENOMEM; in wm_adsp_buffer_parse_coeff()
1536 buf->host_buf_mem_type = cs_ctl->alg_region.type; in wm_adsp_buffer_parse_coeff()
1537 buf->host_buf_ptr = be32_to_cpu(coeff_v1.host_buf_ptr); in wm_adsp_buffer_parse_coeff()
1547 if (cs_ctl->len == 4) in wm_adsp_buffer_parse_coeff()
1554 adsp_err(dsp, in wm_adsp_buffer_parse_coeff()
1557 ret = -EINVAL; in wm_adsp_buffer_parse_coeff()
1563 buf->name = kasprintf(GFP_KERNEL, "%s-dsp-%s", dsp->part, in wm_adsp_buffer_parse_coeff()
1567 list_add_tail(&buf->list, &dsp->buffer_list); in wm_adsp_buffer_parse_coeff()
1570 buf->host_buf_ptr, version); in wm_adsp_buffer_parse_coeff()
1580 static int wm_adsp_buffer_init(struct wm_adsp *dsp) in wm_adsp_buffer_init() argument
1585 list_for_each_entry(cs_ctl, &dsp->cs_dsp.ctl_list, list) { in wm_adsp_buffer_init()
1586 if (cs_ctl->type != WMFW_CTL_TYPE_HOST_BUFFER) in wm_adsp_buffer_init()
1589 if (!cs_ctl->enabled) in wm_adsp_buffer_init()
1594 adsp_err(dsp, "Failed to parse coeff: %d\n", ret); in wm_adsp_buffer_init()
1602 if (list_empty(&dsp->buffer_list)) { in wm_adsp_buffer_init()
1604 ret = wm_adsp_buffer_parse_legacy(dsp); in wm_adsp_buffer_init()
1605 if (ret == -ENODEV) in wm_adsp_buffer_init()
1606 adsp_info(dsp, "Legacy support not available\n"); in wm_adsp_buffer_init()
1608 adsp_warn(dsp, "Failed to parse legacy: %d\n", ret); in wm_adsp_buffer_init()
1614 wm_adsp_buffer_free(dsp); in wm_adsp_buffer_init()
1618 static int wm_adsp_buffer_free(struct wm_adsp *dsp) in wm_adsp_buffer_free() argument
1622 list_for_each_entry_safe(buf, tmp, &dsp->buffer_list, list) { in wm_adsp_buffer_free()
1623 wm_adsp_compr_detach(buf->compr); in wm_adsp_buffer_free()
1625 kfree(buf->name); in wm_adsp_buffer_free()
1626 kfree(buf->regions); in wm_adsp_buffer_free()
1627 list_del(&buf->list); in wm_adsp_buffer_free()
1638 ret = wm_adsp_buffer_read(buf, HOST_BUFFER_FIELD(error), &buf->error); in wm_adsp_buffer_get_error()
1643 if (buf->error != 0) { in wm_adsp_buffer_get_error()
1644 compr_err(buf, "Buffer error occurred: %d\n", buf->error); in wm_adsp_buffer_get_error()
1645 return -EIO; in wm_adsp_buffer_get_error()
1654 struct wm_adsp_compr *compr = stream->runtime->private_data; in wm_adsp_compr_trigger()
1655 struct wm_adsp *dsp = compr->dsp; in wm_adsp_compr_trigger() local
1660 mutex_lock(&dsp->cs_dsp.pwr_lock); in wm_adsp_compr_trigger()
1673 ret = wm_adsp_buffer_get_error(compr->buf); in wm_adsp_compr_trigger()
1678 ret = wm_adsp_buffer_write(compr->buf, in wm_adsp_compr_trigger()
1689 wm_adsp_buffer_clear(compr->buf); in wm_adsp_compr_trigger()
1692 ret = -EINVAL; in wm_adsp_compr_trigger()
1696 mutex_unlock(&dsp->cs_dsp.pwr_lock); in wm_adsp_compr_trigger()
1704 int last_region = wm_adsp_fw[buf->dsp->fw].caps->num_regions - 1; in wm_adsp_buffer_size()
1706 return buf->regions[last_region].cumulative_size; in wm_adsp_buffer_size()
1716 if (buf->read_index < 0) { in wm_adsp_buffer_update_avail()
1730 buf->read_index = read_index; in wm_adsp_buffer_update_avail()
1740 avail = write_index - buf->read_index; in wm_adsp_buffer_update_avail()
1745 buf->read_index, write_index, avail * CS_DSP_DATA_WORD_SIZE); in wm_adsp_buffer_update_avail()
1747 buf->avail = avail; in wm_adsp_buffer_update_avail()
1752 int wm_adsp_compr_handle_irq(struct wm_adsp *dsp) in wm_adsp_compr_handle_irq() argument
1758 mutex_lock(&dsp->cs_dsp.pwr_lock); in wm_adsp_compr_handle_irq()
1760 if (list_empty(&dsp->buffer_list)) { in wm_adsp_compr_handle_irq()
1761 ret = -ENODEV; in wm_adsp_compr_handle_irq()
1765 adsp_dbg(dsp, "Handling buffer IRQ\n"); in wm_adsp_compr_handle_irq()
1767 list_for_each_entry(buf, &dsp->buffer_list, list) { in wm_adsp_compr_handle_irq()
1768 compr = buf->compr; in wm_adsp_compr_handle_irq()
1775 &buf->irq_count); in wm_adsp_compr_handle_irq()
1787 if (wm_adsp_fw[dsp->fw].voice_trigger && buf->irq_count == 2) in wm_adsp_compr_handle_irq()
1791 if (compr && compr->stream) in wm_adsp_compr_handle_irq()
1792 snd_compr_fragment_elapsed(compr->stream); in wm_adsp_compr_handle_irq()
1796 mutex_unlock(&dsp->cs_dsp.pwr_lock); in wm_adsp_compr_handle_irq()
1804 if (buf->irq_count & 0x01) in wm_adsp_buffer_reenable_irq()
1807 compr_dbg(buf, "Enable IRQ(0x%x) for next fragment\n", buf->irq_count); in wm_adsp_buffer_reenable_irq()
1809 buf->irq_count |= 0x01; in wm_adsp_buffer_reenable_irq()
1812 buf->irq_count); in wm_adsp_buffer_reenable_irq()
1819 struct wm_adsp_compr *compr = stream->runtime->private_data; in wm_adsp_compr_pointer()
1820 struct wm_adsp *dsp = compr->dsp; in wm_adsp_compr_pointer() local
1826 mutex_lock(&dsp->cs_dsp.pwr_lock); in wm_adsp_compr_pointer()
1828 buf = compr->buf; in wm_adsp_compr_pointer()
1830 if (dsp->fatal_error || !buf || buf->error) { in wm_adsp_compr_pointer()
1832 ret = -EIO; in wm_adsp_compr_pointer()
1836 if (buf->avail < wm_adsp_compr_frag_words(compr)) { in wm_adsp_compr_pointer()
1845 * DSP to inform us once a whole fragment is available. in wm_adsp_compr_pointer()
1847 if (buf->avail < wm_adsp_compr_frag_words(compr)) { in wm_adsp_compr_pointer()
1850 if (buf->error) in wm_adsp_compr_pointer()
1858 compr_err(compr, "Failed to re-enable buffer IRQ: %d\n", in wm_adsp_compr_pointer()
1865 tstamp->copied_total = compr->copied_total; in wm_adsp_compr_pointer()
1866 tstamp->copied_total += buf->avail * CS_DSP_DATA_WORD_SIZE; in wm_adsp_compr_pointer()
1867 tstamp->sampling_rate = compr->sample_rate; in wm_adsp_compr_pointer()
1870 mutex_unlock(&dsp->cs_dsp.pwr_lock); in wm_adsp_compr_pointer()
1878 struct wm_adsp_compr_buf *buf = compr->buf; in wm_adsp_buffer_capture_block()
1884 for (i = 0; i < wm_adsp_fw[buf->dsp->fw].caps->num_regions; ++i) in wm_adsp_buffer_capture_block()
1885 if (buf->read_index < buf->regions[i].cumulative_size) in wm_adsp_buffer_capture_block()
1888 if (i == wm_adsp_fw[buf->dsp->fw].caps->num_regions) in wm_adsp_buffer_capture_block()
1889 return -EINVAL; in wm_adsp_buffer_capture_block()
1891 mem_type = buf->regions[i].mem_type; in wm_adsp_buffer_capture_block()
1892 adsp_addr = buf->regions[i].base_addr + in wm_adsp_buffer_capture_block()
1893 (buf->read_index - buf->regions[i].offset); in wm_adsp_buffer_capture_block()
1896 nwords = buf->regions[i].cumulative_size - buf->read_index; in wm_adsp_buffer_capture_block()
1900 if (nwords > buf->avail) in wm_adsp_buffer_capture_block()
1901 nwords = buf->avail; in wm_adsp_buffer_capture_block()
1907 /* Read data from DSP */ in wm_adsp_buffer_capture_block()
1908 ret = cs_dsp_read_raw_data_block(&buf->dsp->cs_dsp, mem_type, adsp_addr, in wm_adsp_buffer_capture_block()
1909 nwords, (__be32 *)compr->raw_buf); in wm_adsp_buffer_capture_block()
1913 cs_dsp_remove_padding(compr->raw_buf, nwords); in wm_adsp_buffer_capture_block()
1916 buf->read_index += nwords; in wm_adsp_buffer_capture_block()
1917 if (buf->read_index == wm_adsp_buffer_size(buf)) in wm_adsp_buffer_capture_block()
1918 buf->read_index = 0; in wm_adsp_buffer_capture_block()
1921 buf->read_index); in wm_adsp_buffer_capture_block()
1926 buf->avail -= nwords; in wm_adsp_buffer_capture_block()
1934 struct wm_adsp *dsp = compr->dsp; in wm_adsp_compr_read() local
1940 if (dsp->fatal_error || !compr->buf || compr->buf->error) { in wm_adsp_compr_read()
1941 snd_compr_stop_error(compr->stream, SNDRV_PCM_STATE_XRUN); in wm_adsp_compr_read()
1942 return -EIO; in wm_adsp_compr_read()
1959 if (copy_to_user(buf + ntotal, compr->raw_buf, nbytes)) { in wm_adsp_compr_read()
1962 return -EFAULT; in wm_adsp_compr_read()
1965 count -= nwords; in wm_adsp_compr_read()
1969 compr->copied_total += ntotal; in wm_adsp_compr_read()
1978 struct wm_adsp_compr *compr = stream->runtime->private_data; in wm_adsp_compr_copy()
1979 struct wm_adsp *dsp = compr->dsp; in wm_adsp_compr_copy() local
1982 mutex_lock(&dsp->cs_dsp.pwr_lock); in wm_adsp_compr_copy()
1984 if (stream->direction == SND_COMPRESS_CAPTURE) in wm_adsp_compr_copy()
1987 ret = -ENOTSUPP; in wm_adsp_compr_copy()
1989 mutex_unlock(&dsp->cs_dsp.pwr_lock); in wm_adsp_compr_copy()
1997 struct wm_adsp *dsp = container_of(cs_dsp, struct wm_adsp, cs_dsp); in wm_adsp_fatal_error() local
2000 dsp->fatal_error = true; in wm_adsp_fatal_error()
2002 list_for_each_entry(compr, &dsp->compr_list, list) { in wm_adsp_fatal_error()
2003 if (compr->stream) in wm_adsp_fatal_error()
2004 snd_compr_fragment_elapsed(compr->stream); in wm_adsp_fatal_error()
2010 struct wm_adsp *dsp = (struct wm_adsp *)data; in wm_adsp2_bus_error() local
2012 cs_dsp_adsp2_bus_error(&dsp->cs_dsp); in wm_adsp2_bus_error()
2020 struct wm_adsp *dsp = (struct wm_adsp *)data; in wm_halo_bus_error() local
2022 cs_dsp_halo_bus_error(&dsp->cs_dsp); in wm_halo_bus_error()
2030 struct wm_adsp *dsp = data; in wm_halo_wdt_expire() local
2032 cs_dsp_halo_wdt_expire(&dsp->cs_dsp); in wm_halo_wdt_expire()