ASoC: Intel: Skylake: Remove skl_tplg_is_multi_fmt()
authorCezary Rojewski <cezary.rojewski@intel.com>
Mon, 5 Dec 2022 08:53:26 +0000 (09:53 +0100)
committerMark Brown <broonie@kernel.org>
Wed, 7 Dec 2022 14:19:01 +0000 (14:19 +0000)
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>
sound/soc/intel/skylake/skl-topology.c

index fc3d719..f144aca 100644 (file)
@@ -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);