path: root/include/uapi/sound
diff options
authorMengdong Lin <mengdong.lin@intel.com>2015-08-05 14:41:13 +0100
committerMark Brown <broonie@kernel.org>2015-08-06 12:34:46 +0100
commit28a87eebcad40101b1b273cbd4f2a02c104f9367 (patch)
tree09e5be519de6b8f9f19d3ce3122678dfa5560f89 /include/uapi/sound
parent113adf21cf1ed49b57098c1d0d6b38ffbe9ea1e6 (diff)
ASoC: topology: Update TLV support so we can support more TLV types
Currently the TLV topology structure is targeted at only supporting the DB scale data. This patch extends support for the other TLV types so they can be easily added at a later stage. TLV structure is moved to common topology control header since it's a common field for controls and can be processed in a general way. Users must set a proper access flag for a control since it's used to decide if the TLV field is valid and if a TLV callback is needed. Removed the following fields from topology TLV struct: - size/count: type can decide the size. - numid: not needed to initialize TLV for kcontrol. - data: replaced by the type specific struct. Added TLV structure to generic control header and removed TLV structure from mixer control. Signed-off-by: Mengdong Lin <mengdong.lin@intel.com> Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'include/uapi/sound')
1 files changed, 13 insertions, 6 deletions
diff --git a/include/uapi/sound/asoc.h b/include/uapi/sound/asoc.h
index 2819fc1f8458..aa3a79b42438 100644
--- a/include/uapi/sound/asoc.h
+++ b/include/uapi/sound/asoc.h
@@ -137,11 +137,19 @@ struct snd_soc_tplg_private {
* Kcontrol TLV data.
+struct snd_soc_tplg_tlv_dbscale {
+ __le32 min;
+ __le32 step;
+ __le32 mute;
+} __attribute__((packed));
struct snd_soc_tplg_ctl_tlv {
- __le32 size; /* in bytes aligned to 4 */
- __le32 numid; /* control element numeric identification */
- __le32 count; /* number of elem in data array */
- __le32 data[SND_SOC_TPLG_TLV_SIZE];
+ __le32 size; /* in bytes of this structure */
+ __le32 type; /* SNDRV_CTL_TLVT_*, type of TLV */
+ union {
+ __le32 data[SND_SOC_TPLG_TLV_SIZE];
+ struct snd_soc_tplg_tlv_dbscale scale;
+ };
} __attribute__((packed));
@@ -172,7 +180,7 @@ struct snd_soc_tplg_ctl_hdr {
__le32 access;
struct snd_soc_tplg_kcontrol_ops_id ops;
- __le32 tlv_size; /* non zero means control has TLV data */
+ struct snd_soc_tplg_ctl_tlv tlv;
} __attribute__((packed));
@@ -260,7 +268,6 @@ struct snd_soc_tplg_mixer_control {
__le32 invert;
__le32 num_channels;
struct snd_soc_tplg_channel channel[SND_SOC_TPLG_MAX_CHAN];
- struct snd_soc_tplg_ctl_tlv tlv;
struct snd_soc_tplg_private priv;
} __attribute__((packed));