summaryrefslogtreecommitdiff
path: root/sound/soc/intel/skylake
diff options
context:
space:
mode:
authorKranthi G <gudishax.kranthikumar@intel.com>2016-07-26 12:36:43 (GMT)
committerMark Brown <broonie@kernel.org>2016-08-08 10:54:59 (GMT)
commit15ecaba9148da2d4088c7025d06312d1cbd9d5eb (patch)
tree6190b1cea5495098eb15d844b3241480b52ce4fb /sound/soc/intel/skylake
parent78cdbbdac059fad34740f0bdefe263f8de2a1faf (diff)
downloadlinux-15ecaba9148da2d4088c7025d06312d1cbd9d5eb.tar.xz
ASoC: Intel: Skylake: add support for tplg manifest load
Topology manifest gives information about the libraries to be loaded. Implement the topology manifest load callback to get this. Signed-off-by: Kranthi G <gudishax.kranthikumar@intel.com> Signed-off-by: Senthilnathan Veppur <senthilnathanx.veppur@intel.com> Signed-off-by: Ramesh Babu <ramesh.babu@intel.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/intel/skylake')
-rw-r--r--sound/soc/intel/skylake/skl-sst-ipc.h3
-rw-r--r--sound/soc/intel/skylake/skl-topology.c22
-rw-r--r--sound/soc/intel/skylake/skl-tplg-interface.h12
3 files changed, 37 insertions, 0 deletions
diff --git a/sound/soc/intel/skylake/skl-sst-ipc.h b/sound/soc/intel/skylake/skl-sst-ipc.h
index 0a0d09c..31e5bc3 100644
--- a/sound/soc/intel/skylake/skl-sst-ipc.h
+++ b/sound/soc/intel/skylake/skl-sst-ipc.h
@@ -80,6 +80,9 @@ struct skl_sst {
/* multi-core */
struct skl_dsp_cores cores;
+
+ /* tplg manifest */
+ struct skl_dfw_manifest manifest;
};
struct skl_ipc_init_instance_msg {
diff --git a/sound/soc/intel/skylake/skl-topology.c b/sound/soc/intel/skylake/skl-topology.c
index 9041030..a1d9f84 100644
--- a/sound/soc/intel/skylake/skl-topology.c
+++ b/sound/soc/intel/skylake/skl-topology.c
@@ -1789,11 +1789,33 @@ static int skl_tplg_control_load(struct snd_soc_component *cmpnt,
return 0;
}
+static int skl_manifest_load(struct snd_soc_component *cmpnt,
+ struct snd_soc_tplg_manifest *manifest)
+{
+ struct skl_dfw_manifest *minfo;
+ struct hdac_ext_bus *ebus = snd_soc_component_get_drvdata(cmpnt);
+ struct hdac_bus *bus = ebus_to_hbus(ebus);
+ struct skl *skl = ebus_to_skl(ebus);
+ int ret = 0;
+
+ minfo = &skl->skl_sst->manifest;
+ memcpy(minfo, manifest->priv.data, sizeof(struct skl_dfw_manifest));
+
+ if (minfo->lib_count > HDA_MAX_LIB) {
+ dev_err(bus->dev, "Exceeding max Library count. Got:%d\n",
+ minfo->lib_count);
+ ret = -EINVAL;
+ }
+
+ return ret;
+}
+
static struct snd_soc_tplg_ops skl_tplg_ops = {
.widget_load = skl_tplg_widget_load,
.control_load = skl_tplg_control_load,
.bytes_ext_ops = skl_tlv_ops,
.bytes_ext_ops_count = ARRAY_SIZE(skl_tlv_ops),
+ .manifest = skl_manifest_load,
};
/*
diff --git a/sound/soc/intel/skylake/skl-tplg-interface.h b/sound/soc/intel/skylake/skl-tplg-interface.h
index a32e5e9..1b531c1 100644
--- a/sound/soc/intel/skylake/skl-tplg-interface.h
+++ b/sound/soc/intel/skylake/skl-tplg-interface.h
@@ -228,4 +228,16 @@ struct skl_dfw_algo_data {
char params[0];
} __packed;
+#define LIB_NAME_LENGTH 128
+#define HDA_MAX_LIB 16
+
+struct lib_info {
+ char name[LIB_NAME_LENGTH];
+} __packed;
+
+struct skl_dfw_manifest {
+ u32 lib_count;
+ struct lib_info lib[HDA_MAX_LIB];
+} __packed;
+
#endif