Lines Matching defs:pipe
348 struct skl_pipe_params *params = m_cfg->pipe->p_params;
349 int p_conn_type = m_cfg->pipe->conn_type;
451 static int skl_tplg_module_prepare(struct skl_dev *skl, struct skl_pipe *pipe,
456 return skl_pcm_host_dma_prepare(skl->dev, pipe->p_params);
459 return skl_pcm_link_dma_prepare(skl->dev, pipe->p_params);
466 * Inside a pipe instance, we can have various modules. These modules need
471 skl_tplg_init_pipe_modules(struct skl_dev *skl, struct skl_pipe *pipe)
479 list_for_each_entry(w_module, &pipe->w_list, node) {
492 cfg_idx = mconfig->pipe->cur_config_idx;
506 ret = skl_tplg_module_prepare(skl, pipe, w, mconfig);
550 struct skl_pipe *pipe)
556 list_for_each_entry(w_module, &pipe->w_list, node) {
582 static bool skl_tplg_is_multi_fmt(struct skl_dev *skl, struct skl_pipe *pipe)
588 if (pipe->nr_cfgs <= 1)
591 if (pipe->conn_type != SKL_PIPE_CONN_TYPE_FE)
594 for (i = 0; i < pipe->nr_cfgs - 1; i++) {
595 if (pipe->direction == SNDRV_PCM_STREAM_PLAYBACK) {
596 cur_fmt = &pipe->configs[i].out_fmt;
597 next_fmt = &pipe->configs[i + 1].out_fmt;
599 cur_fmt = &pipe->configs[i].in_fmt;
600 next_fmt = &pipe->configs[i + 1].in_fmt;
615 * Here, we select pipe format based on the pipe type and pipe
624 struct skl_pipe *pipe = mconfig->pipe;
625 struct skl_pipe_params *params = pipe->p_params;
626 struct skl_path_config *pconfig = &pipe->configs[0];
631 if (pipe->nr_cfgs == 0) {
632 pipe->cur_config_idx = 0;
636 if (skl_tplg_is_multi_fmt(skl, pipe)) {
637 pipe->cur_config_idx = pipe->pipe_config_idx;
638 pipe->memory_pages = pconfig->mem_pages;
639 dev_dbg(skl->dev, "found pipe config idx:%d\n",
640 pipe->cur_config_idx);
644 if (pipe->conn_type == SKL_PIPE_CONN_TYPE_NONE) {
646 pipe->cur_config_idx = 0;
647 pipe->memory_pages = pconfig->mem_pages;
652 if ((pipe->conn_type == SKL_PIPE_CONN_TYPE_FE &&
653 pipe->direction == SNDRV_PCM_STREAM_PLAYBACK) ||
654 (pipe->conn_type == SKL_PIPE_CONN_TYPE_BE &&
655 pipe->direction == SNDRV_PCM_STREAM_CAPTURE))
658 for (i = 0; i < pipe->nr_cfgs; i++) {
659 pconfig = &pipe->configs[i];
667 pipe->cur_config_idx = i;
668 pipe->memory_pages = pconfig->mem_pages;
669 dev_dbg(skl->dev, "Using pipe config: %d\n", i);
675 dev_err(skl->dev, "Invalid pipe config: %d %d %d for pipe: %d\n",
676 params->ch, params->s_freq, params->s_fmt, pipe->ppl_id);
693 struct skl_pipe *s_pipe = mconfig->pipe;
702 * Create a list of modules for pipe.
705 ret = skl_create_pipeline(skl, mconfig->pipe);
709 /* Init all pipe modules from source to sink */
1030 /* Start sinks pipe first */
1031 if (sink_mconfig->pipe->state != SKL_PIPE_STARTED) {
1032 if (sink_mconfig->pipe->conn_type !=
1035 sink_mconfig->pipe);
1056 * - Then run current pipe
1068 * if sink is not started, start sink pipe first, then start
1069 * this pipe
1075 /* Start source pipe last after starting all sinks */
1076 if (src_mconfig->pipe->conn_type != SKL_PIPE_CONN_TYPE_FE)
1077 return skl_run_pipe(skl, src_mconfig->pipe);
1115 * - Check if this pipe is running
1118 * if source pipe is already running, this means it is a dynamic
1119 * connection and we need to bind only to that pipe
1134 * If source pipe is already started, that means source is driving
1136 * started, bind this sink to source and start this pipe.
1145 * check pipe state, then no need to bind or start the
1146 * pipe
1148 if (src_mconfig->pipe->state != SKL_PIPE_STARTED)
1161 if (sink_mconfig->pipe->conn_type != SKL_PIPE_CONN_TYPE_FE)
1162 ret = skl_run_pipe(skl, sink_mconfig->pipe);
1170 * - Stop the pipe
1182 /* Stop the pipe */
1183 ret = skl_stop_pipe(skl, sink_mconfig->pipe);
1213 struct skl_pipe *s_pipe = mconfig->pipe;
1260 skl_delete_pipe(skl, mconfig->pipe);
1273 * - In source pipe is connected, unbind with source pipelines
1283 /* Stop the pipe since this is a mixin module */
1284 ret = skl_stop_pipe(skl, src_mconfig->pipe);
1307 * second one is required that is created as another pipe entity.
1308 * The mixer is responsible for pipe management and represent a pipeline
1367 struct skl_pipe *pipe = NULL;
1380 if (ppl->pipe->ppl_id == *pipe_id) {
1381 pipe = ppl->pipe;
1385 if (!pipe)
1389 pipe->pipe_config_idx = ucontrol->value.enumerated.item[0];
1391 ucontrol->value.enumerated.item[0] = pipe->pipe_config_idx;
1595 struct skl_pipe *pipe = mcfg->pipe;
1597 if (pipe->passthru) {
1600 pipe->p_params->link_dma_id = params->link_dma_id;
1601 pipe->p_params->link_index = params->link_index;
1602 pipe->p_params->link_bps = params->link_bps;
1606 pipe->p_params->host_dma_id = params->host_dma_id;
1607 pipe->p_params->host_bps = params->host_bps;
1613 pipe->p_params->s_fmt = params->s_fmt;
1614 pipe->p_params->ch = params->ch;
1615 pipe->p_params->s_freq = params->s_freq;
1616 pipe->p_params->stream = params->stream;
1617 pipe->p_params->format = params->format;
1620 memcpy(pipe->p_params, params, sizeof(*params));
1637 u8 cfg_idx = mconfig->pipe->cur_config_idx;
1672 dev_err(dev, "Invalid bit depth %x for pipe\n",
1967 struct skl_pipe *pipe, u32 tkn,
1975 fmt = &pipe->configs[conf_idx].in_fmt;
1979 fmt = &pipe->configs[conf_idx].out_fmt;
1987 config = &pipe->configs[conf_idx];
2015 struct skl_pipe *pipe, u32 tkn,
2021 pipe->conn_type = tkn_val;
2025 pipe->pipe_priority = tkn_val;
2029 pipe->memory_pages = tkn_val;
2033 pipe->lp_mode = tkn_val;
2037 pipe->direction = tkn_val;
2041 pipe->nr_cfgs = tkn_val;
2054 * Return an existing pipe if the pipe already exists.
2061 struct skl_pipe *pipe;
2065 if (ppl->pipe->ppl_id == tkn_elem->value) {
2066 mconfig->pipe = ppl->pipe;
2075 pipe = devm_kzalloc(dev, sizeof(*pipe), GFP_KERNEL);
2076 if (!pipe)
2083 pipe->p_params = params;
2084 pipe->ppl_id = tkn_elem->value;
2085 INIT_LIST_HEAD(&pipe->w_list);
2087 ppl->pipe = pipe;
2090 mconfig->pipe = pipe;
2091 mconfig->pipe->state = SKL_PIPE_INVALID;
2500 ret = skl_tplg_fill_pipe_tkn(dev, mconfig->pipe,
2512 if (mconfig->pipe->nr_cfgs) {
2513 ret = skl_tplg_fill_pipe_cfg(dev, mconfig->pipe,
2715 struct skl_pipe *pipe;
2719 if (ppl->pipe->ppl_id == dfw_pipe->pipe_id) {
2720 mconfig->pipe = ppl->pipe;
2729 pipe = devm_kzalloc(dev, sizeof(*pipe), GFP_KERNEL);
2730 if (!pipe)
2737 pipe->ppl_id = dfw_pipe->pipe_id;
2738 pipe->memory_pages = dfw_pipe->memory_pages;
2739 pipe->pipe_priority = dfw_pipe->pipe_priority;
2740 pipe->conn_type = dfw_pipe->conn_type;
2741 pipe->state = SKL_PIPE_INVALID;
2742 pipe->p_params = params;
2743 INIT_LIST_HEAD(&pipe->w_list);
2745 ppl->pipe = pipe;
2748 mconfig->pipe = pipe;
2820 ret = skl_tplg_add_pipe_v4(dev, mconfig, skl, &dfw->pipe);
2946 struct skl_pipe *pipe;
2951 pipe = mconfig->pipe;
2960 pipe->state = SKL_PIPE_INVALID;
3653 * A pipe can have multiple modules, each of them will be a DAPM widget as
3663 struct skl_pipe *pipe;
3668 pipe = mcfg->pipe;
3676 list_add_tail(&p_module->node, &pipe->w_list);
3683 static void skl_tplg_set_pipe_type(struct skl_dev *skl, struct skl_pipe *pipe)
3690 list_for_each_entry(w_module, &pipe->w_list, node) {
3701 pipe->passthru = true;
3703 pipe->passthru = false;
3754 dev_err(bus->dev, "tplg create pipe widget list failed%d\n",
3760 skl_tplg_set_pipe_type(skl, ppl->pipe);