Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 91fe0e70 authored by Jeeja KP's avatar Jeeja KP Committed by Mark Brown
Browse files

ASoC: Intel: Skylake: Update module id in pin connections



Each module's id comes from the topology and gets updated in the
driver. This patch updates the input and output pin connections of
each module by matching the uuid for each module.

Signed-off-by: default avatarJeeja KP <jeeja.kp@intel.com>
Signed-off-by: default avatarGuneshwor Singh <guneshwor.o.singh@intel.com>
Acked-By: default avatarVinod Koul <vinod.koul@intel.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent f6fa56e2
Loading
Loading
Loading
Loading
+38 −3
Original line number Diff line number Diff line
@@ -1220,8 +1220,11 @@ static int skl_pcm_new(struct snd_soc_pcm_runtime *rtd)
static int skl_get_module_info(struct skl *skl, struct skl_module_cfg *mconfig)
{
	struct skl_sst *ctx = skl->skl_sst;
	struct skl_module_inst_id *pin_id;
	uuid_le *uuid_mod, *uuid_tplg;
	struct skl_module *skl_module;
	struct uuid_module *module;
	uuid_le *uuid_mod;
	int i, ret = -EIO;

	uuid_mod = (uuid_le *)mconfig->guid;

@@ -1235,11 +1238,43 @@ static int skl_get_module_info(struct skl *skl, struct skl_module_cfg *mconfig)
			mconfig->id.module_id = module->id;
			if (mconfig->module)
				mconfig->module->loadable = module->is_loadable;
			return 0;
			ret = 0;
			break;
		}
	}

	return -EIO;
	if (ret)
		return ret;

	uuid_mod = &module->uuid;
	ret = -EIO;
	for (i = 0; i < skl->nr_modules; i++) {
		skl_module = skl->modules[i];
		uuid_tplg = &skl_module->uuid;
		if (!uuid_le_cmp(*uuid_mod, *uuid_tplg)) {
			mconfig->module = skl_module;
			ret = 0;
			break;
		}
	}
	if (skl->nr_modules && ret)
		return ret;

	list_for_each_entry(module, &ctx->uuid_list, list) {
		for (i = 0; i < MAX_IN_QUEUE; i++) {
			pin_id = &mconfig->m_in_pin[i].id;
			if (!uuid_le_cmp(pin_id->mod_uuid, module->uuid))
				pin_id->module_id = module->id;
		}

		for (i = 0; i < MAX_OUT_QUEUE; i++) {
			pin_id = &mconfig->m_out_pin[i].id;
			if (!uuid_le_cmp(pin_id->mod_uuid, module->uuid))
				pin_id->module_id = module->id;
		}
	}

	return 0;
}

static int skl_populate_modules(struct skl *skl)
+1 −0
Original line number Diff line number Diff line
@@ -221,6 +221,7 @@ struct skl_kpb_params {
};

struct skl_module_inst_id {
	uuid_le mod_uuid;
	int module_id;
	u32 instance_id;
	int pvt_id;