return ret;
}
+static void skl_tplg_set_pipe_config_idx(struct skl_pipe *pipe, int idx)
+{
+ pipe->cur_config_idx = idx;
+ pipe->memory_pages = pipe->configs[idx].mem_pages;
+}
+
/*
* Here, we select pipe format based on the pipe type and pipe
* direction to determine the current config index for the pipeline.
int i;
if (pipe->nr_cfgs == 0) {
- pipe->cur_config_idx = 0;
+ skl_tplg_set_pipe_config_idx(pipe, 0);
return 0;
}
if (pipe->conn_type == SKL_PIPE_CONN_TYPE_NONE || pipe->nr_cfgs == 1) {
dev_dbg(skl->dev, "No conn_type or just 1 pathcfg, taking 0th for %d\n",
pipe->ppl_id);
- pipe->cur_config_idx = 0;
- pipe->memory_pages = pconfig->mem_pages;
-
+ skl_tplg_set_pipe_config_idx(pipe, 0);
return 0;
}
if (CHECK_HW_PARAMS(params->ch, params->s_freq, params->s_fmt,
fmt->channels, fmt->freq, fmt->bps)) {
- pipe->cur_config_idx = i;
- pipe->memory_pages = pconfig->mem_pages;
+ skl_tplg_set_pipe_config_idx(pipe, i);
dev_dbg(skl->dev, "Using pipe config: %d\n", i);
-
return 0;
}
}
return -EIO;
if (is_set)
- pipe->cur_config_idx = ucontrol->value.enumerated.item[0];
+ skl_tplg_set_pipe_config_idx(pipe, ucontrol->value.enumerated.item[0]);
else
ucontrol->value.enumerated.item[0] = pipe->cur_config_idx;