aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOmair M Abdullah <omair.m.abdullah@intel.com>2015-12-03 12:59:56 -0500
committerMark Brown <broonie@kernel.org>2015-12-08 12:57:51 -0500
commit7d9f29119d3e4db6ae817881d8e305650424032c (patch)
tree4c9d788d943f547935440f6b805661ce9295c61f
parentcce1c7f383e829651e0729d4b0b2cb78ea5cb2d6 (diff)
ASoC: Intel: Skylake: read params from DSP if module is on
If a module is ON then we should read the module parameters from DSP rather than driver cached values Signed-off-by: Omair M Abdullah <omair.m.abdullah@intel.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--sound/soc/intel/skylake/skl-messages.c13
-rw-r--r--sound/soc/intel/skylake/skl-topology.c7
-rw-r--r--sound/soc/intel/skylake/skl-topology.h2
3 files changed, 22 insertions, 0 deletions
diff --git a/sound/soc/intel/skylake/skl-messages.c b/sound/soc/intel/skylake/skl-messages.c
index a91161be7f5d..46310d9ac008 100644
--- a/sound/soc/intel/skylake/skl-messages.c
+++ b/sound/soc/intel/skylake/skl-messages.c
@@ -927,3 +927,16 @@ int skl_set_module_params(struct skl_sst *ctx, u32 *params, int size,
927 927
928 return skl_ipc_set_large_config(&ctx->ipc, &msg, params); 928 return skl_ipc_set_large_config(&ctx->ipc, &msg, params);
929} 929}
930
931int skl_get_module_params(struct skl_sst *ctx, u32 *params, int size,
932 u32 param_id, struct skl_module_cfg *mcfg)
933{
934 struct skl_ipc_large_config_msg msg;
935
936 msg.module_id = mcfg->id.module_id;
937 msg.instance_id = mcfg->id.instance_id;
938 msg.param_data_size = size;
939 msg.large_param_id = param_id;
940
941 return skl_ipc_get_large_config(&ctx->ipc, &msg, params);
942}
diff --git a/sound/soc/intel/skylake/skl-topology.c b/sound/soc/intel/skylake/skl-topology.c
index eb31235f7040..b824450edcb4 100644
--- a/sound/soc/intel/skylake/skl-topology.c
+++ b/sound/soc/intel/skylake/skl-topology.c
@@ -908,6 +908,13 @@ static int skl_tplg_tlv_control_get(struct snd_kcontrol *kcontrol,
908 struct soc_bytes_ext *sb = 908 struct soc_bytes_ext *sb =
909 (struct soc_bytes_ext *)kcontrol->private_value; 909 (struct soc_bytes_ext *)kcontrol->private_value;
910 struct skl_algo_data *bc = (struct skl_algo_data *)sb->dobj.private; 910 struct skl_algo_data *bc = (struct skl_algo_data *)sb->dobj.private;
911 struct snd_soc_dapm_widget *w = snd_soc_dapm_kcontrol_widget(kcontrol);
912 struct skl_module_cfg *mconfig = w->priv;
913 struct skl *skl = get_skl_ctx(w->dapm->dev);
914
915 if (w->power)
916 skl_get_module_params(skl->skl_sst, (u32 *)bc->params,
917 bc->max, bc->param_id, mconfig);
911 918
912 if (bc->params) { 919 if (bc->params) {
913 if (copy_to_user(data, &bc->param_id, sizeof(u32))) 920 if (copy_to_user(data, &bc->param_id, sizeof(u32)))
diff --git a/sound/soc/intel/skylake/skl-topology.h b/sound/soc/intel/skylake/skl-topology.h
index 6ba0bdc7753c..9aa2a2b6598a 100644
--- a/sound/soc/intel/skylake/skl-topology.h
+++ b/sound/soc/intel/skylake/skl-topology.h
@@ -342,6 +342,8 @@ int skl_unbind_modules(struct skl_sst *ctx, struct skl_module_cfg
342 342
343int skl_set_module_params(struct skl_sst *ctx, u32 *params, int size, 343int skl_set_module_params(struct skl_sst *ctx, u32 *params, int size,
344 u32 param_id, struct skl_module_cfg *mcfg); 344 u32 param_id, struct skl_module_cfg *mcfg);
345int skl_get_module_params(struct skl_sst *ctx, u32 *params, int size,
346 u32 param_id, struct skl_module_cfg *mcfg);
345 347
346enum skl_bitdepth skl_get_bit_depth(int params); 348enum skl_bitdepth skl_get_bit_depth(int params);
347#endif 349#endif