History

ASoC: topology: ABI - Define types for vendor tuples

Tuples, a pair of token and value, can be used to define vendor specific data, for controls and widgets. This can avoid importing binary data blob from other files. Vendor specific tuple arrays will be embeded in the private data buffer of a control or widget object. To be backward compatible, union is used to define the tuple arrays in the existing private data ABI object 'struct snd_soc_tplg_private'. Vendors need to make sure the token values defined by the topology conf file match those defined by their driver. Now supported tuple types are uuid, string, bool, byte, short and word.

Mengdong Lin committed 10 years ago

Commit e42839b1 parent f55532a1 file · +41 −1Browse files

Showing the changes to include/uapi (1 of 1 file). Show all

Unified · Split

include/uapi/sound/asoc.h+41−1
@@ -116,6 +116,14 @@ · 115 unmodified lines
116#define SND_SOC_TPLG_STREAM_PLAYBACK 0116#define SND_SOC_TPLG_STREAM_PLAYBACK 0
117#define SND_SOC_TPLG_STREAM_CAPTURE 1117#define SND_SOC_TPLG_STREAM_CAPTURE 1
118 118
119/* vendor tuple types */
120#define SND_SOC_TPLG_TUPLE_TYPE_UUID 0
121#define SND_SOC_TPLG_TUPLE_TYPE_STRING 1
122#define SND_SOC_TPLG_TUPLE_TYPE_BOOL 2
123#define SND_SOC_TPLG_TUPLE_TYPE_BYTE 3
124#define SND_SOC_TPLG_TUPLE_TYPE_WORD 4
125#define SND_SOC_TPLG_TUPLE_TYPE_SHORT 5
126
119/*127/*
120 * Block Header.128 * Block Header.
121 * This header precedes all object and object arrays below.129 * This header precedes all object and object arrays below.
@@ -132,6 +140,35 @@ struct snd_soc_tplg_hdr { · 10 unmodified lines
132 __le32 count; /* number of elements in block */140 __le32 count; /* number of elements in block */
133} __attribute__((packed));141} __attribute__((packed));
134 142
143/* vendor tuple for uuid */
144struct snd_soc_tplg_vendor_uuid_elem {
145 __le32 token;
146 char uuid[16];
147} __attribute__((packed));
148
149/* vendor tuple for a bool/byte/short/word value */
150struct snd_soc_tplg_vendor_value_elem {
151 __le32 token;
152 __le32 value;
153} __attribute__((packed));
154
155/* vendor tuple for string */
156struct snd_soc_tplg_vendor_string_elem {
157 __le32 token;
158 char string[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
159} __attribute__((packed));
160
161struct snd_soc_tplg_vendor_array {
162 __le32 size; /* size in bytes of the array, including all elements */
163 __le32 type; /* SND_SOC_TPLG_TUPLE_TYPE_ */
164 __le32 num_elems; /* number of elements in array */
165 union {
166 struct snd_soc_tplg_vendor_uuid_elem uuid[0];
167 struct snd_soc_tplg_vendor_value_elem value[0];
168 struct snd_soc_tplg_vendor_string_elem string[0];
169 };
170} __attribute__((packed));
171
135/*172/*
136 * Private data.173 * Private data.
137 * All topology objects may have private data that can be used by the driver or174 * All topology objects may have private data that can be used by the driver or
@@ -139,7 +176,10 @@ struct snd_soc_tplg_hdr { · 1 unmodified line
139 */176 */
140struct snd_soc_tplg_private {177struct snd_soc_tplg_private {
141 __le32 size; /* in bytes of private data */178 __le32 size; /* in bytes of private data */
142 char data[0];179 union {
180 char data[0];
181 struct snd_soc_tplg_vendor_array array[0];
182 };
143} __attribute__((packed));183} __attribute__((packed));
144 184
145/*185/*

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t