mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-09 11:23:09 -04:00
ASoC: Intel: Skylake: Remove skl_tplg_is_multi_fmt()
Rather than forcing userspace to select proper format with enumerable kcontrols, select it ourselves based on provided hw_params. Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Tested-by: Lukasz Majczak <lma@semihlaf.com> Link: https://lore.kernel.org/r/20221205085330.857665-3-cezary.rojewski@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
committed by
Mark Brown
parent
72d9a541d7
commit
b0d16e54e7
@@ -582,38 +582,6 @@ static int skl_tplg_unload_pipe_modules(struct skl_dev *skl,
|
||||
return ret;
|
||||
}
|
||||
|
||||
static bool skl_tplg_is_multi_fmt(struct skl_dev *skl, struct skl_pipe *pipe)
|
||||
{
|
||||
struct skl_pipe_fmt *cur_fmt;
|
||||
struct skl_pipe_fmt *next_fmt;
|
||||
int i;
|
||||
|
||||
if (pipe->nr_cfgs <= 1)
|
||||
return false;
|
||||
|
||||
if (pipe->conn_type != SKL_PIPE_CONN_TYPE_FE)
|
||||
return true;
|
||||
|
||||
for (i = 0; i < pipe->nr_cfgs - 1; i++) {
|
||||
if (pipe->direction == SNDRV_PCM_STREAM_PLAYBACK) {
|
||||
cur_fmt = &pipe->configs[i].out_fmt;
|
||||
next_fmt = &pipe->configs[i + 1].out_fmt;
|
||||
} else {
|
||||
cur_fmt = &pipe->configs[i].in_fmt;
|
||||
next_fmt = &pipe->configs[i + 1].in_fmt;
|
||||
}
|
||||
|
||||
if (!CHECK_HW_PARAMS(cur_fmt->channels, cur_fmt->freq,
|
||||
cur_fmt->bps,
|
||||
next_fmt->channels,
|
||||
next_fmt->freq,
|
||||
next_fmt->bps))
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
* Here, we select pipe format based on the pipe type and pipe
|
||||
* direction to determine the current config index for the pipeline.
|
||||
@@ -636,14 +604,6 @@ skl_tplg_get_pipe_config(struct skl_dev *skl, struct skl_module_cfg *mconfig)
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (skl_tplg_is_multi_fmt(skl, pipe)) {
|
||||
pipe->cur_config_idx = pipe->pipe_config_idx;
|
||||
pipe->memory_pages = pconfig->mem_pages;
|
||||
dev_dbg(skl->dev, "found pipe config idx:%d\n",
|
||||
pipe->cur_config_idx);
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user