Lines Matching +full:fw +full:- +full:cfg +full:- +full:mmio
1 // SPDX-License-Identifier: GPL-2.0-only
3 * skl-message.c - HDA DSP interface for FW registration, Pipe and Module
16 #include <uapi/sound/skl-tplg-interface.h>
17 #include "skl-sst-dsp.h"
18 #include "cnl-sst-dsp.h"
19 #include "skl-sst-ipc.h"
21 #include "../common/sst-dsp.h"
22 #include "../common/sst-dsp-priv.h"
23 #include "skl-topology.h"
47 skl_ipc_set_large_config(&skl->ipc, &msg, data); in skl_dsp_set_astate_cfg()
59 return -EINVAL; in skl_dsp_setup_spib()
63 snd_hdac_ext_stream_spbcap_enable(bus, enable, stream->index); in skl_dsp_setup_spib()
81 return -ENODEV; in skl_dsp_prepare()
89 return -ENODEV; in skl_dsp_prepare()
98 skl_dsp_setup_spib(dev, size, stream->stream_tag, true); in skl_dsp_prepare()
100 return stream->stream_tag; in skl_dsp_prepare()
109 return -ENODEV; in skl_dsp_trigger()
114 return -EINVAL; in skl_dsp_trigger()
129 return -ENODEV; in skl_dsp_cleanup()
134 return -EINVAL; in skl_dsp_cleanup()
256 int irq = bus->irq; in skl_init_dsp()
265 /* read the BAR of the ADSP MMIO */ in skl_init_dsp()
266 mmio_base = pci_ioremap_bar(skl->pci, 4); in skl_init_dsp()
268 dev_err(bus->dev, "ioremap error\n"); in skl_init_dsp()
269 return -ENXIO; in skl_init_dsp()
272 ops = skl_get_dsp_ops(skl->pci->device); in skl_init_dsp()
274 ret = -EIO; in skl_init_dsp()
278 loader_ops = ops->loader_ops(); in skl_init_dsp()
279 ret = ops->init(bus->dev, mmio_base, irq, in skl_init_dsp()
280 skl->fw_name, loader_ops, in skl_init_dsp()
286 skl->dsp_ops = ops; in skl_init_dsp()
287 cores = &skl->cores; in skl_init_dsp()
288 cores->count = ops->num_cores; in skl_init_dsp()
290 cores->state = kcalloc(cores->count, sizeof(*cores->state), GFP_KERNEL); in skl_init_dsp()
291 if (!cores->state) { in skl_init_dsp()
292 ret = -ENOMEM; in skl_init_dsp()
296 cores->usage_count = kcalloc(cores->count, sizeof(*cores->usage_count), in skl_init_dsp()
298 if (!cores->usage_count) { in skl_init_dsp()
299 ret = -ENOMEM; in skl_init_dsp()
303 dev_dbg(bus->dev, "dsp registration status=%d\n", ret); in skl_init_dsp()
308 kfree(cores->state); in skl_init_dsp()
323 skl->dsp_ops->cleanup(bus->dev, skl); in skl_free_dsp()
325 kfree(skl->cores.state); in skl_free_dsp()
326 kfree(skl->cores.usage_count); in skl_free_dsp()
328 if (skl->dsp->addr.lpe) in skl_free_dsp()
329 iounmap(skl->dsp->addr.lpe); in skl_free_dsp()
348 dwork = &skl->d0i3.work; in skl_suspend_late_dsp()
350 if (dwork->work.func) { in skl_suspend_late_dsp()
351 if (skl->supend_active) in skl_suspend_late_dsp()
366 if (!bus->ppcap) in skl_suspend_dsp()
369 ret = skl_dsp_sleep(skl->dsp); in skl_suspend_dsp()
386 if (!bus->ppcap) in skl_resume_dsp()
394 if (skl->is_first_boot) in skl_resume_dsp()
401 skl->enable_miscbdcge(skl->dev, false); in skl_resume_dsp()
402 skl->clock_power_gating(skl->dev, false); in skl_resume_dsp()
404 ret = skl_dsp_wake(skl->dsp); in skl_resume_dsp()
405 skl->enable_miscbdcge(skl->dev, true); in skl_resume_dsp()
406 skl->clock_power_gating(skl->dev, true); in skl_resume_dsp()
410 if (skl->cfg.astate_cfg != NULL) { in skl_resume_dsp()
411 skl_dsp_set_astate_cfg(skl, skl->cfg.astate_cfg->count, in skl_resume_dsp()
412 skl->cfg.astate_cfg); in skl_resume_dsp()
448 struct skl_module *module = mconfig->module; in skl_set_base_module_format()
449 struct skl_module_res *res = &module->resources[mconfig->res_idx]; in skl_set_base_module_format()
450 struct skl_module_iface *fmt = &module->formats[mconfig->fmt_idx]; in skl_set_base_module_format()
451 struct skl_module_fmt *format = &fmt->inputs[0].fmt; in skl_set_base_module_format()
453 base_cfg->audio_fmt.number_of_channels = format->channels; in skl_set_base_module_format()
455 base_cfg->audio_fmt.s_freq = format->s_freq; in skl_set_base_module_format()
456 base_cfg->audio_fmt.bit_depth = format->bit_depth; in skl_set_base_module_format()
457 base_cfg->audio_fmt.valid_bit_depth = format->valid_bit_depth; in skl_set_base_module_format()
458 base_cfg->audio_fmt.ch_cfg = format->ch_cfg; in skl_set_base_module_format()
459 base_cfg->audio_fmt.sample_type = format->sample_type; in skl_set_base_module_format()
461 dev_dbg(skl->dev, "bit_depth=%x valid_bd=%x ch_config=%x\n", in skl_set_base_module_format()
462 format->bit_depth, format->valid_bit_depth, in skl_set_base_module_format()
463 format->ch_cfg); in skl_set_base_module_format()
465 base_cfg->audio_fmt.channel_map = format->ch_map; in skl_set_base_module_format()
467 base_cfg->audio_fmt.interleaving = format->interleaving_style; in skl_set_base_module_format()
469 base_cfg->cpc = res->cpc; in skl_set_base_module_format()
470 base_cfg->ibs = res->ibs; in skl_set_base_module_format()
471 base_cfg->obs = res->obs; in skl_set_base_module_format()
472 base_cfg->is_pages = res->is_pages; in skl_set_base_module_format()
478 pin_fmt->number_of_channels = format->channels; in fill_pin_params()
479 pin_fmt->s_freq = format->s_freq; in fill_pin_params()
480 pin_fmt->bit_depth = format->bit_depth; in fill_pin_params()
481 pin_fmt->valid_bit_depth = format->valid_bit_depth; in fill_pin_params()
482 pin_fmt->ch_cfg = format->ch_cfg; in fill_pin_params()
483 pin_fmt->sample_type = format->sample_type; in fill_pin_params()
484 pin_fmt->channel_map = format->ch_map; in fill_pin_params()
485 pin_fmt->interleaving = format->interleaving_style; in fill_pin_params()
497 struct skl_module *module = mconfig->module; in skl_set_base_ext_module_format()
499 struct skl_module_iface *fmt = &module->formats[mconfig->fmt_idx]; in skl_set_base_ext_module_format()
500 struct skl_module_res *res = &module->resources[mconfig->res_idx]; in skl_set_base_ext_module_format()
506 base_cfg_ext->nr_input_pins = res->nr_input_pins; in skl_set_base_ext_module_format()
507 base_cfg_ext->nr_output_pins = res->nr_output_pins; in skl_set_base_ext_module_format()
508 base_cfg_ext->priv_param_length = in skl_set_base_ext_module_format()
509 mconfig->formats_config[SKL_PARAM_INIT].caps_size; in skl_set_base_ext_module_format()
511 for (i = 0; i < res->nr_input_pins; i++) { in skl_set_base_ext_module_format()
512 pin_res = &res->input[i]; in skl_set_base_ext_module_format()
513 pin_fmt = &base_cfg_ext->pins_fmt[i]; in skl_set_base_ext_module_format()
515 pin_fmt->pin_idx = pin_res->pin_index; in skl_set_base_ext_module_format()
516 pin_fmt->buf_size = pin_res->buf_size; in skl_set_base_ext_module_format()
518 format = &fmt->inputs[pin_res->pin_index].fmt; in skl_set_base_ext_module_format()
519 fill_pin_params(&pin_fmt->audio_fmt, format); in skl_set_base_ext_module_format()
522 for (i = 0; i < res->nr_output_pins; i++) { in skl_set_base_ext_module_format()
523 pin_res = &res->output[i]; in skl_set_base_ext_module_format()
524 pin_fmt = &base_cfg_ext->pins_fmt[res->nr_input_pins + i]; in skl_set_base_ext_module_format()
526 pin_fmt->pin_idx = pin_res->pin_index; in skl_set_base_ext_module_format()
527 pin_fmt->buf_size = pin_res->buf_size; in skl_set_base_ext_module_format()
529 format = &fmt->outputs[pin_res->pin_index].fmt; in skl_set_base_ext_module_format()
530 fill_pin_params(&pin_fmt->audio_fmt, format); in skl_set_base_ext_module_format()
533 if (!base_cfg_ext->priv_param_length) in skl_set_base_ext_module_format()
537 params += (base_cfg_ext->nr_input_pins + base_cfg_ext->nr_output_pins) * in skl_set_base_ext_module_format()
540 memcpy(params, mconfig->formats_config[SKL_PARAM_INIT].caps, in skl_set_base_ext_module_format()
541 mconfig->formats_config[SKL_PARAM_INIT].caps_size); in skl_set_base_ext_module_format()
551 if (mconfig->formats_config[SKL_PARAM_INIT].caps_size == 0) in skl_copy_copier_caps()
554 memcpy(cpr_mconfig->gtw_cfg.config_data, in skl_copy_copier_caps()
555 mconfig->formats_config[SKL_PARAM_INIT].caps, in skl_copy_copier_caps()
556 mconfig->formats_config[SKL_PARAM_INIT].caps_size); in skl_copy_copier_caps()
558 cpr_mconfig->gtw_cfg.config_length = in skl_copy_copier_caps()
559 (mconfig->formats_config[SKL_PARAM_INIT].caps_size) / 4; in skl_copy_copier_caps()
572 struct skl_pipe_params *params = mconfig->pipe->p_params; in skl_get_node_id()
574 switch (mconfig->dev_type) { in skl_get_node_id()
577 (SKL_CONN_SOURCE == mconfig->hw_conn_type) ? in skl_get_node_id()
580 node_id.node.vindex = params->host_dma_id + in skl_get_node_id()
581 (mconfig->vbus_id << 3); in skl_get_node_id()
586 (SKL_CONN_SOURCE == mconfig->hw_conn_type) ? in skl_get_node_id()
589 ssp_node.dma_node.time_slot_index = mconfig->time_slot; in skl_get_node_id()
590 ssp_node.dma_node.i2s_instance = mconfig->vbus_id; in skl_get_node_id()
596 node_id.node.vindex = mconfig->vbus_id + in skl_get_node_id()
597 (mconfig->time_slot); in skl_get_node_id()
602 (SKL_CONN_SOURCE == mconfig->hw_conn_type) ? in skl_get_node_id()
605 node_id.node.vindex = params->link_dma_id; in skl_get_node_id()
610 (SKL_CONN_SOURCE == mconfig->hw_conn_type) ? in skl_get_node_id()
613 node_id.node.vindex = params->host_dma_id; in skl_get_node_id()
630 int res_idx = mconfig->res_idx; in skl_setup_cpr_gateway_cfg()
632 cpr_mconfig->gtw_cfg.node_id = skl_get_node_id(skl, mconfig); in skl_setup_cpr_gateway_cfg()
634 if (cpr_mconfig->gtw_cfg.node_id == SKL_NON_GATEWAY_CPR_NODE_ID) { in skl_setup_cpr_gateway_cfg()
635 cpr_mconfig->cpr_feature_mask = 0; in skl_setup_cpr_gateway_cfg()
639 if (skl->nr_modules) { in skl_setup_cpr_gateway_cfg()
640 res = &mconfig->module->resources[mconfig->res_idx]; in skl_setup_cpr_gateway_cfg()
641 cpr_mconfig->gtw_cfg.dma_buffer_size = res->dma_buffer_size; in skl_setup_cpr_gateway_cfg()
644 res = &mconfig->module->resources[res_idx]; in skl_setup_cpr_gateway_cfg()
647 switch (mconfig->hw_conn_type) { in skl_setup_cpr_gateway_cfg()
649 if (mconfig->dev_type == SKL_DEVICE_HDAHOST) in skl_setup_cpr_gateway_cfg()
650 dma_io_buf = res->ibs; in skl_setup_cpr_gateway_cfg()
652 dma_io_buf = res->obs; in skl_setup_cpr_gateway_cfg()
656 if (mconfig->dev_type == SKL_DEVICE_HDAHOST) in skl_setup_cpr_gateway_cfg()
657 dma_io_buf = res->obs; in skl_setup_cpr_gateway_cfg()
659 dma_io_buf = res->ibs; in skl_setup_cpr_gateway_cfg()
663 dev_warn(skl->dev, "wrong connection type: %d\n", in skl_setup_cpr_gateway_cfg()
664 mconfig->hw_conn_type); in skl_setup_cpr_gateway_cfg()
668 cpr_mconfig->gtw_cfg.dma_buffer_size = in skl_setup_cpr_gateway_cfg()
669 mconfig->dma_buffer_size * dma_io_buf; in skl_setup_cpr_gateway_cfg()
672 if (!cpr_mconfig->gtw_cfg.dma_buffer_size) { in skl_setup_cpr_gateway_cfg()
673 if (mconfig->hw_conn_type == SKL_CONN_SOURCE) in skl_setup_cpr_gateway_cfg()
674 cpr_mconfig->gtw_cfg.dma_buffer_size = 2 * res->obs; in skl_setup_cpr_gateway_cfg()
676 cpr_mconfig->gtw_cfg.dma_buffer_size = 2 * res->ibs; in skl_setup_cpr_gateway_cfg()
680 cpr_mconfig->cpr_feature_mask = 0; in skl_setup_cpr_gateway_cfg()
681 cpr_mconfig->gtw_cfg.config_length = 0; in skl_setup_cpr_gateway_cfg()
708 return -ENOMEM; in skl_dsp_set_dma_control()
710 dma_ctrl->node_id = node_id; in skl_dsp_set_dma_control()
718 dma_ctrl->config_length = DMA_I2S_BLOB_SIZE; in skl_dsp_set_dma_control()
720 memcpy(dma_ctrl->config_data, caps, caps_size); in skl_dsp_set_dma_control()
722 err = skl_ipc_set_large_config(&skl->ipc, &msg, (u32 *)dma_ctrl); in skl_dsp_set_dma_control()
733 struct skl_module *module = mconfig->module; in skl_setup_out_format()
734 struct skl_module_iface *fmt = &module->formats[mconfig->fmt_idx]; in skl_setup_out_format()
735 struct skl_module_fmt *format = &fmt->outputs[0].fmt; in skl_setup_out_format()
737 out_fmt->number_of_channels = (u8)format->channels; in skl_setup_out_format()
738 out_fmt->s_freq = format->s_freq; in skl_setup_out_format()
739 out_fmt->bit_depth = format->bit_depth; in skl_setup_out_format()
740 out_fmt->valid_bit_depth = format->valid_bit_depth; in skl_setup_out_format()
741 out_fmt->ch_cfg = format->ch_cfg; in skl_setup_out_format()
743 out_fmt->channel_map = format->ch_map; in skl_setup_out_format()
744 out_fmt->interleaving = format->interleaving_style; in skl_setup_out_format()
745 out_fmt->sample_type = format->sample_type; in skl_setup_out_format()
747 dev_dbg(skl->dev, "copier out format chan=%d fre=%d bitdepth=%d\n", in skl_setup_out_format()
748 out_fmt->number_of_channels, format->s_freq, format->bit_depth); in skl_setup_out_format()
760 struct skl_module *module = mconfig->module; in skl_set_src_format()
761 struct skl_module_iface *iface = &module->formats[mconfig->fmt_idx]; in skl_set_src_format()
762 struct skl_module_fmt *fmt = &iface->outputs[0].fmt; in skl_set_src_format()
767 src_mconfig->src_cfg = fmt->s_freq; in skl_set_src_format()
779 struct skl_module *module = mconfig->module; in skl_set_updown_mixer_format()
780 struct skl_module_iface *iface = &module->formats[mconfig->fmt_idx]; in skl_set_updown_mixer_format()
781 struct skl_module_fmt *fmt = &iface->outputs[0].fmt; in skl_set_updown_mixer_format()
785 mixer_mconfig->out_ch_cfg = fmt->ch_cfg; in skl_set_updown_mixer_format()
786 mixer_mconfig->ch_map = fmt->ch_map; in skl_set_updown_mixer_format()
800 struct skl_audio_data_format *out_fmt = &cpr_mconfig->out_fmt; in skl_set_copier_format()
813 * Mic select module take base module configuration and out-format
820 struct skl_audio_data_format *out_fmt = &base_outfmt_mcfg->out_fmt; in skl_set_base_outfmt_format()
832 struct skl_module *module = mconfig->module; in skl_get_module_param_size()
835 switch (mconfig->m_type) { in skl_get_module_param_size()
838 param_size += mconfig->formats_config[SKL_PARAM_INIT].caps_size; in skl_get_module_param_size()
857 res = &module->resources[mconfig->res_idx]; in skl_get_module_param_size()
860 param_size += (res->nr_input_pins + res->nr_output_pins) * in skl_get_module_param_size()
862 param_size += mconfig->formats_config[SKL_PARAM_INIT].caps_size; in skl_get_module_param_size()
888 return -ENOMEM; in skl_set_module_format()
892 switch (module_config->m_type) { in skl_set_module_format()
924 dev_dbg(skl->dev, "Module type=%d id=%d config size: %d bytes\n", in skl_set_module_format()
925 module_config->m_type, module_config->id.module_id, in skl_set_module_format()
943 return -EINVAL; in skl_get_queue_index()
955 struct skl_module_inst_id id = tgt_cfg->id; in skl_alloc_queue()
985 return -EINVAL; in skl_alloc_queue()
1016 mcfg->m_state = SKL_MODULE_INIT_DONE; in skl_clear_module_state()
1034 dev_dbg(skl->dev, "%s: module_id = %d instance=%d\n", __func__, in skl_init_module()
1035 mconfig->id.module_id, mconfig->id.pvt_id); in skl_init_module()
1037 if (mconfig->pipe->state != SKL_PIPE_CREATED) { in skl_init_module()
1038 dev_err(skl->dev, "Pipe not created state= %d pipe_id= %d\n", in skl_init_module()
1039 mconfig->pipe->state, mconfig->pipe->ppl_id); in skl_init_module()
1040 return -EIO; in skl_init_module()
1046 dev_err(skl->dev, "Failed to set module format ret=%d\n", ret); in skl_init_module()
1050 msg.module_id = mconfig->id.module_id; in skl_init_module()
1051 msg.instance_id = mconfig->id.pvt_id; in skl_init_module()
1052 msg.ppl_instance_id = mconfig->pipe->ppl_id; in skl_init_module()
1054 msg.core_id = mconfig->core_id; in skl_init_module()
1055 msg.domain = mconfig->domain; in skl_init_module()
1057 ret = skl_ipc_init_instance(&skl->ipc, &msg, param_data); in skl_init_module()
1059 dev_err(skl->dev, "Failed to init instance ret=%d\n", ret); in skl_init_module()
1063 mconfig->m_state = SKL_MODULE_INIT_DONE; in skl_init_module()
1071 dev_dbg(skl->dev, "%s: src module_id = %d src_instance=%d\n", in skl_dump_bind_info()
1072 __func__, src_module->id.module_id, src_module->id.pvt_id); in skl_dump_bind_info()
1073 dev_dbg(skl->dev, "%s: dst_module=%d dst_instance=%d\n", __func__, in skl_dump_bind_info()
1074 dst_module->id.module_id, dst_module->id.pvt_id); in skl_dump_bind_info()
1076 dev_dbg(skl->dev, "src_module state = %d dst module state = %d\n", in skl_dump_bind_info()
1077 src_module->m_state, dst_module->m_state); in skl_dump_bind_info()
1091 struct skl_module_inst_id src_id = src_mcfg->id; in skl_unbind_modules()
1092 struct skl_module_inst_id dst_id = dst_mcfg->id; in skl_unbind_modules()
1093 int in_max = dst_mcfg->module->max_input_pins; in skl_unbind_modules()
1094 int out_max = src_mcfg->module->max_output_pins; in skl_unbind_modules()
1100 src_index = skl_get_queue_index(src_mcfg->m_out_pin, dst_id, out_max); in skl_unbind_modules()
1107 dst_index = skl_get_queue_index(dst_mcfg->m_in_pin, src_id, in_max); in skl_unbind_modules()
1113 src_pin_state = src_mcfg->m_out_pin[src_index].pin_state; in skl_unbind_modules()
1114 dst_pin_state = dst_mcfg->m_in_pin[dst_index].pin_state; in skl_unbind_modules()
1120 msg.module_id = src_mcfg->id.module_id; in skl_unbind_modules()
1121 msg.instance_id = src_mcfg->id.pvt_id; in skl_unbind_modules()
1122 msg.dst_module_id = dst_mcfg->id.module_id; in skl_unbind_modules()
1123 msg.dst_instance_id = dst_mcfg->id.pvt_id; in skl_unbind_modules()
1126 ret = skl_ipc_bind_unbind(&skl->ipc, &msg); in skl_unbind_modules()
1129 skl_free_queue(src_mcfg->m_out_pin, src_index); in skl_unbind_modules()
1130 skl_free_queue(dst_mcfg->m_in_pin, dst_index); in skl_unbind_modules()
1134 * always from src -> sink in skl_unbind_modules()
1136 skl_clear_module_state(src_mcfg->m_out_pin, out_max, src_mcfg); in skl_unbind_modules()
1157 int in_max = dst_mcfg->module->max_input_pins; in skl_bind_modules()
1158 int out_max = src_mcfg->module->max_output_pins; in skl_bind_modules()
1167 if (src_mcfg->m_state < SKL_MODULE_INIT_DONE || in skl_bind_modules()
1168 dst_mcfg->m_state < SKL_MODULE_INIT_DONE) in skl_bind_modules()
1171 src_index = skl_alloc_queue(src_mcfg->m_out_pin, dst_mcfg, out_max); in skl_bind_modules()
1173 return -EINVAL; in skl_bind_modules()
1176 dst_index = skl_alloc_queue(dst_mcfg->m_in_pin, src_mcfg, in_max); in skl_bind_modules()
1178 skl_free_queue(src_mcfg->m_out_pin, src_index); in skl_bind_modules()
1179 return -EINVAL; in skl_bind_modules()
1186 if (src_mcfg->m_type == SKL_MODULE_TYPE_COPIER && src_index > 0) { in skl_bind_modules()
1188 module = src_mcfg->module; in skl_bind_modules()
1189 fmt = &module->formats[src_mcfg->fmt_idx]; in skl_bind_modules()
1191 /* Input fmt is same as that of src module input cfg */ in skl_bind_modules()
1192 format = &fmt->inputs[0].fmt; in skl_bind_modules()
1195 format = &fmt->outputs[src_index].fmt; in skl_bind_modules()
1207 dev_dbg(skl->dev, "src queue = %d dst queue =%d\n", in skl_bind_modules()
1210 msg.module_id = src_mcfg->id.module_id; in skl_bind_modules()
1211 msg.instance_id = src_mcfg->id.pvt_id; in skl_bind_modules()
1212 msg.dst_module_id = dst_mcfg->id.module_id; in skl_bind_modules()
1213 msg.dst_instance_id = dst_mcfg->id.pvt_id; in skl_bind_modules()
1216 ret = skl_ipc_bind_unbind(&skl->ipc, &msg); in skl_bind_modules()
1219 src_mcfg->m_state = SKL_MODULE_BIND_DONE; in skl_bind_modules()
1220 src_mcfg->m_out_pin[src_index].pin_state = SKL_PIN_BIND_DONE; in skl_bind_modules()
1221 dst_mcfg->m_in_pin[dst_index].pin_state = SKL_PIN_BIND_DONE; in skl_bind_modules()
1226 skl_free_queue(src_mcfg->m_out_pin, src_index); in skl_bind_modules()
1227 skl_free_queue(dst_mcfg->m_in_pin, dst_index); in skl_bind_modules()
1235 dev_dbg(skl->dev, "%s: pipe_state = %d\n", __func__, state); in skl_set_pipe_state()
1237 return skl_ipc_set_pipeline_state(&skl->ipc, pipe->ppl_id, state); in skl_set_pipe_state()
1244 * to FW
1250 dev_dbg(skl->dev, "%s: pipe_id = %d\n", __func__, pipe->ppl_id); in skl_create_pipeline()
1252 ret = skl_ipc_create_pipeline(&skl->ipc, pipe->memory_pages, in skl_create_pipeline()
1253 pipe->pipe_priority, pipe->ppl_id, in skl_create_pipeline()
1254 pipe->lp_mode); in skl_create_pipeline()
1256 dev_err(skl->dev, "Failed to create pipeline\n"); in skl_create_pipeline()
1260 pipe->state = SKL_PIPE_CREATED; in skl_create_pipeline()
1275 dev_dbg(skl->dev, "%s: pipe = %d\n", __func__, pipe->ppl_id); in skl_delete_pipe()
1277 /* If pipe was not created in FW, do not try to delete it */ in skl_delete_pipe()
1278 if (pipe->state < SKL_PIPE_CREATED) in skl_delete_pipe()
1281 /* If pipe is started, do stop the pipe in FW. */ in skl_delete_pipe()
1282 if (pipe->state >= SKL_PIPE_STARTED) { in skl_delete_pipe()
1285 dev_err(skl->dev, "Failed to stop pipeline\n"); in skl_delete_pipe()
1289 pipe->state = SKL_PIPE_PAUSED; in skl_delete_pipe()
1295 dev_err(skl->dev, "Failed to reset pipe ret=%d\n", ret); in skl_delete_pipe()
1299 pipe->state = SKL_PIPE_RESET; in skl_delete_pipe()
1301 ret = skl_ipc_delete_pipeline(&skl->ipc, pipe->ppl_id); in skl_delete_pipe()
1303 dev_err(skl->dev, "Failed to delete pipeline\n"); in skl_delete_pipe()
1307 pipe->state = SKL_PIPE_INVALID; in skl_delete_pipe()
1321 dev_dbg(skl->dev, "%s: pipe = %d\n", __func__, pipe->ppl_id); in skl_run_pipe()
1323 /* If pipe was not created in FW, do not try to pause or delete */ in skl_run_pipe()
1324 if (pipe->state < SKL_PIPE_CREATED) in skl_run_pipe()
1330 dev_err(skl->dev, "Failed to pause pipe\n"); in skl_run_pipe()
1334 pipe->state = SKL_PIPE_PAUSED; in skl_run_pipe()
1338 dev_err(skl->dev, "Failed to start pipe\n"); in skl_run_pipe()
1342 pipe->state = SKL_PIPE_STARTED; in skl_run_pipe()
1355 dev_dbg(skl->dev, "In %s pipe=%d\n", __func__, pipe->ppl_id); in skl_stop_pipe()
1357 /* If pipe was not created in FW, do not try to pause or delete */ in skl_stop_pipe()
1358 if (pipe->state < SKL_PIPE_PAUSED) in skl_stop_pipe()
1363 dev_dbg(skl->dev, "Failed to stop pipe\n"); in skl_stop_pipe()
1367 pipe->state = SKL_PIPE_PAUSED; in skl_stop_pipe()
1380 /* If pipe was not created in FW, do not try to pause or delete */ in skl_reset_pipe()
1381 if (pipe->state < SKL_PIPE_PAUSED) in skl_reset_pipe()
1386 dev_dbg(skl->dev, "Failed to reset pipe ret=%d\n", ret); in skl_reset_pipe()
1390 pipe->state = SKL_PIPE_RESET; in skl_reset_pipe()
1401 msg.module_id = mcfg->id.module_id; in skl_set_module_params()
1402 msg.instance_id = mcfg->id.pvt_id; in skl_set_module_params()
1406 return skl_ipc_set_large_config(&skl->ipc, &msg, params); in skl_set_module_params()
1415 msg.module_id = mcfg->id.module_id; in skl_get_module_params()
1416 msg.instance_id = mcfg->id.pvt_id; in skl_get_module_params()
1420 return skl_ipc_get_large_config(&skl->ipc, &msg, ¶ms, &bytes); in skl_get_module_params()