]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
ASoC: Intel: Skylake: Update to use instance ids generated
authorDharageswari R <dharageswari.r@intel.com>
Thu, 22 Sep 2016 08:30:40 +0000 (14:00 +0530)
committerMark Brown <broonie@kernel.org>
Sat, 24 Sep 2016 18:26:25 +0000 (19:26 +0100)
Post bind parameters of KPB module contains the instance id's of
neighbouring modules in the sink path

Now that module instance ids are generated dynamically we need to update
these parameters as well, so use the table created and update the ids

Signed-off-by: Dharageswari R <dharageswari.r@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/intel/skylake/skl-messages.c
sound/soc/intel/skylake/skl-topology.c
sound/soc/intel/skylake/skl-topology.h
sound/soc/intel/skylake/skl-tplg-interface.h

index ac0c58e170c330bada15e9b0eee1bfe3288b5767..805b7f2173f3ec6163d9de9728d0b099d9a3a9a1 100644 (file)
@@ -680,6 +680,7 @@ static u16 skl_get_module_param_size(struct skl_sst *ctx,
                return param_size;
 
        case SKL_MODULE_TYPE_BASE_OUTFMT:
+       case SKL_MODULE_TYPE_KPB:
                return sizeof(struct skl_base_outfmt_cfg);
 
        default:
@@ -733,6 +734,7 @@ static int skl_set_module_format(struct skl_sst *ctx,
                break;
 
        case SKL_MODULE_TYPE_BASE_OUTFMT:
+       case SKL_MODULE_TYPE_KPB:
                skl_set_base_outfmt_format(ctx, module_config, *param_data);
                break;
 
index b6fc374f38b57e33c1d6e997889c284ca9063099..e48f872505b174b18bdb9432083ba5a1e5d24e4a 100644 (file)
@@ -607,6 +607,26 @@ static int skl_tplg_mixer_dapm_pre_pmu_event(struct snd_soc_dapm_widget *w,
        return 0;
 }
 
+static int skl_fill_sink_instance_id(struct skl_sst *ctx,
+                               struct skl_algo_data *alg_data)
+{
+       struct skl_kpb_params *params = (struct skl_kpb_params *)alg_data->params;
+       struct skl_mod_inst_map *inst;
+       int i, pvt_id;
+
+       inst = params->map;
+
+       for (i = 0; i < params->num_modules; i++) {
+               pvt_id = skl_get_pvt_instance_id_map(ctx,
+                                       inst->mod_id, inst->inst_id);
+               if (pvt_id < 0)
+                       return -EINVAL;
+               inst->inst_id = pvt_id;
+               inst++;
+       }
+       return 0;
+}
+
 /*
  * Some modules require params to be set after the module is bound to
  * all pins connected.
@@ -655,6 +675,8 @@ static int skl_tplg_set_module_bind_params(struct snd_soc_dapm_widget *w,
                        bc = (struct skl_algo_data *)sb->dobj.private;
 
                        if (bc->set_params == SKL_PARAM_BIND) {
+                               if (mconfig->m_type == SKL_MODULE_TYPE_KPB)
+                                       skl_fill_sink_instance_id(ctx, bc);
                                ret = skl_set_module_params(ctx,
                                                (u32 *)bc->params, bc->max,
                                                bc->param_id, mconfig);
index def03912b1bd5f64b4bed7a72a6f06a8e1d029b9..a519360f42a62d42b2c7a39b9ab8e0dac19bc28d 100644 (file)
@@ -215,6 +215,16 @@ struct skl_module_fmt {
 
 struct skl_module_cfg;
 
+struct skl_mod_inst_map {
+       u16 mod_id;
+       u16 inst_id;
+};
+
+struct skl_kpb_params {
+       u32 num_modules;
+       struct skl_mod_inst_map map[0];
+};
+
 struct skl_module_inst_id {
        int module_id;
        u32 instance_id;
index e208724f9db3ed2f8e2c4f5957be018d942b07a0..2f6281e056d6a660fab453c47ee31a5167e74cbb 100644 (file)
@@ -80,7 +80,8 @@ enum skl_module_type {
        SKL_MODULE_TYPE_UPDWMIX,
        SKL_MODULE_TYPE_SRCINT,
        SKL_MODULE_TYPE_ALGO,
-       SKL_MODULE_TYPE_BASE_OUTFMT
+       SKL_MODULE_TYPE_BASE_OUTFMT,
+       SKL_MODULE_TYPE_KPB,
 };
 
 enum skl_core_affinity {