xref: /linux/include/uapi/sound/snd_ar_tokens.h (revision ef815d2cba782e96b9aad9483523d474ed41c62a)
1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2 
3 #ifndef __SND_AR_TOKENS_H__
4 #define __SND_AR_TOKENS_H__
5 
6 #define APM_SUB_GRAPH_PERF_MODE_LOW_POWER	0x1
7 #define APM_SUB_GRAPH_PERF_MODE_LOW_LATENCY	0x2
8 
9 #define APM_SUB_GRAPH_DIRECTION_TX		0x1
10 #define APM_SUB_GRAPH_DIRECTION_RX		0x2
11 
12 /** Scenario ID Audio Playback */
13 #define APM_SUB_GRAPH_SID_AUDIO_PLAYBACK          0x1
14 /* Scenario ID Audio Record */
15 #define APM_SUB_GRAPH_SID_AUDIO_RECORD            0x2
16 /* Scenario ID Voice call. */
17 #define APM_SUB_GRAPH_SID_VOICE_CALL              0x3
18 
19 /* container capability ID Pre/Post Processing (PP) */
20 #define APM_CONTAINER_CAP_ID_PP                   0x1
21 /* container capability ID Compression/Decompression (CD) */
22 #define APM_CONTAINER_CAP_ID_CD                   0x2
23 /* container capability ID End Point(EP) */
24 #define APM_CONTAINER_CAP_ID_EP                   0x3
25 /* container capability ID Offload (OLC) */
26 #define APM_CONTAINER_CAP_ID_OLC                  0x4
27 
28 /* container graph position Stream */
29 #define APM_CONT_GRAPH_POS_STREAM                 0x1
30 /* container graph position Per Stream Per Device*/
31 #define APM_CONT_GRAPH_POS_PER_STR_PER_DEV        0x2
32 /* container graph position Stream-Device */
33 #define APM_CONT_GRAPH_POS_STR_DEV                0x3
34 /* container graph position Global Device */
35 #define APM_CONT_GRAPH_POS_GLOBAL_DEV             0x4
36 
37 #define APM_PROC_DOMAIN_ID_MDSP			0x1
38 #define APM_PROC_DOMAIN_ID_ADSP			0x2
39 #define APM_PROC_DOMAIN_ID_SDSP			0x4
40 #define APM_PROC_DOMAIN_ID_CDSP			0x5
41 
42 #define PCM_INTERLEAVED			1
43 #define PCM_DEINTERLEAVED_PACKED	2
44 #define PCM_DEINTERLEAVED_UNPACKED	3
45 #define AR_I2S_WS_SRC_EXTERNAL	0
46 #define AR_I2S_WS_SRC_INTERNAL	1
47 
48 enum ar_event_types {
49 	AR_EVENT_NONE = 0,
50 	AR_PGA_DAPM_EVENT
51 };
52 
53 /*
54  * Kcontrol IDs
55  */
56 #define SND_SOC_AR_TPLG_FE_BE_GRAPH_CTL_MIX	256
57 #define SND_SOC_AR_TPLG_VOL_CTL			257
58 
59 /**
60  * %AR_TKN_U32_SUB_GRAPH_INSTANCE_ID:		Sub Graph Instance Id
61  *
62  * %AR_TKN_U32_SUB_GRAPH_PERF_MODE:		Performance mode of subgraph
63  *						APM_SUB_GRAPH_PERF_MODE_LOW_POWER = 1,
64  *						APM_SUB_GRAPH_PERF_MODE_LOW_LATENCY = 2
65  *
66  * %AR_TKN_U32_SUB_GRAPH_DIRECTION:		Direction of subgraph
67  *						APM_SUB_GRAPH_DIRECTION_TX = 1,
68  *						APM_SUB_GRAPH_DIRECTION_RX = 2
69  *
70  * %AR_TKN_U32_SUB_GRAPH_SCENARIO_ID:		Scenario ID for subgraph
71  *						APM_SUB_GRAPH_SID_AUDIO_PLAYBACK = 1,
72  *						APM_SUB_GRAPH_SID_AUDIO_RECORD = 2,
73  *						APM_SUB_GRAPH_SID_VOICE_CALL = 3
74  *
75  * %AR_TKN_U32_CONTAINER_INSTANCE_ID:		Container Instance ID
76  *
77  * %AR_TKN_U32_CONTAINER_CAPABILITY_ID:		Container capability ID
78  *						APM_CONTAINER_CAP_ID_PP = 1,
79  *						APM_CONTAINER_CAP_ID_CD = 2,
80  *						APM_CONTAINER_CAP_ID_EP = 3,
81  *						APM_CONTAINER_CAP_ID_OLC = 4
82  *
83  * %AR_TKN_U32_CONTAINER_STACK_SIZE:		Stack size in the container.
84  *
85  * %AR_TKN_U32_CONTAINER_GRAPH_POS:		Graph Position
86  *						APM_CONT_GRAPH_POS_STREAM = 1,
87  *						APM_CONT_GRAPH_POS_PER_STR_PER_DEV = 2,
88  *						APM_CONT_GRAPH_POS_STR_DEV = 3,
89  *						APM_CONT_GRAPH_POS_GLOBAL_DEV = 4
90  *
91  * %AR_TKN_U32_CONTAINER_PROC_DOMAIN:		Processor domain of container
92  *						APM_PROC_DOMAIN_ID_MDSP = 1,
93  *						APM_PROC_DOMAIN_ID_ADSP = 2,
94  *						APM_PROC_DOMAIN_ID_SDSP = 4,
95  *						APM_PROC_DOMAIN_ID_CDSP = 5
96  *
97  * %AR_TKN_U32_MODULE_ID:			Module ID
98  *
99  * %AR_TKN_U32_MODULE_INSTANCE_ID:		Module Instance ID.
100  *
101  * %AR_TKN_U32_MODULE_MAX_IP_PORTS:		Module maximum input ports
102  *
103  * %AR_TKN_U32_MODULE_MAX_OP_PORTS:		Module maximum output ports.
104  *
105  * %AR_TKN_U32_MODULE_IN_PORTS:			Number of in ports
106  *
107  * %AR_TKN_U32_MODULE_OUT_PORTS:		Number of out ports.
108  *
109  * %AR_TKN_U32_MODULE_SRC_OP_PORT_ID:		Source module output port ID
110  *
111  * %AR_TKN_U32_MODULE_DST_IN_PORT_ID:		Destination module input port ID
112  *
113  * %AR_TKN_U32_MODULE_HW_IF_IDX:		Interface index types for I2S/LPAIF
114  *
115  * %AR_TKN_U32_MODULE_HW_IF_TYPE:		Interface type
116  *						LPAIF = 0,
117  *						LPAIF_RXTX = 1,
118  *						LPAIF_WSA = 2,
119  *						LPAIF_VA = 3,
120  *						LPAIF_AXI = 4
121  *
122  * %AR_TKN_U32_MODULE_FMT_INTERLEAVE:		PCM Interleaving
123  *						PCM_INTERLEAVED = 1,
124  *						PCM_DEINTERLEAVED_PACKED = 2,
125  *						PCM_DEINTERLEAVED_UNPACKED = 3
126  *
127  * %AR_TKN_U32_MODULE_FMT_DATA:			data format
128  *						FIXED POINT = 1,
129  *						IEC60958 PACKETIZED = 3,
130  *						IEC60958 PACKETIZED NON LINEAR = 8,
131  *						COMPR OVER PCM PACKETIZED = 7,
132  *						IEC61937 PACKETIZED = 2,
133  *						GENERIC COMPRESSED = 5
134  *
135  * %AR_TKN_U32_MODULE_FMT_SAMPLE_RATE:		sample rate
136  *
137  * %AR_TKN_U32_MODULE_FMT_BIT_DEPTH:		bit depth
138  *
139  * %AR_TKN_U32_MODULE_SD_LINE_IDX:		I2S serial data line idx
140  *						I2S_SD0 = 1,
141  *						I2S_SD1 = 2,
142  *						I2S_SD2 = 3,
143  *						I2S_SD3 = 4,
144  *						I2S_QUAD01 = 5,
145  *						I2S_QUAD23 = 6,
146  *						I2S_6CHS = 7,
147  *						I2S_8CHS = 8
148  *
149  * %AR_TKN_U32_MODULE_WS_SRC:			Word Select Source
150  *						AR_I2S_WS_SRC_EXTERNAL = 0,
151  *						AR_I2S_WS_SRC_INTERNAL = 1,
152  *
153  * %AR_TKN_U32_MODULE_FRAME_SZ_FACTOR:		Frame size factor
154  *
155  * %AR_TKN_U32_MODULE_LOG_CODE:			Log Module Code
156  *
157  * %AR_TKN_U32_MODULE_LOG_TAP_POINT_ID:		logging tap point of this module
158  *
159  * %AR_TKN_U32_MODULE_LOG_MODE:			logging mode
160  *						LOG_WAIT = 0,
161  *						LOG_IMMEDIATELY = 1
162  *
163  * %AR_TKN_DAI_INDEX:				dai index
164  *
165  */
166 
167 /* DAI Tokens */
168 #define AR_TKN_DAI_INDEX			1
169 /* SUB GRAPH Tokens */
170 #define AR_TKN_U32_SUB_GRAPH_INSTANCE_ID	2
171 #define AR_TKN_U32_SUB_GRAPH_PERF_MODE		3
172 #define AR_TKN_U32_SUB_GRAPH_DIRECTION		4
173 #define AR_TKN_U32_SUB_GRAPH_SCENARIO_ID	5
174 
175 /* Container Tokens */
176 #define AR_TKN_U32_CONTAINER_INSTANCE_ID	100
177 #define AR_TKN_U32_CONTAINER_CAPABILITY_ID	101
178 #define AR_TKN_U32_CONTAINER_STACK_SIZE		102
179 #define AR_TKN_U32_CONTAINER_GRAPH_POS		103
180 #define AR_TKN_U32_CONTAINER_PROC_DOMAIN	104
181 
182 /* Module Tokens */
183 #define AR_TKN_U32_MODULE_ID			200
184 #define AR_TKN_U32_MODULE_INSTANCE_ID		201
185 #define AR_TKN_U32_MODULE_MAX_IP_PORTS		202
186 #define AR_TKN_U32_MODULE_MAX_OP_PORTS		203
187 #define AR_TKN_U32_MODULE_IN_PORTS		204
188 #define AR_TKN_U32_MODULE_OUT_PORTS		205
189 #define AR_TKN_U32_MODULE_SRC_OP_PORT_ID	206
190 #define AR_TKN_U32_MODULE_DST_IN_PORT_ID	207
191 #define AR_TKN_U32_MODULE_SRC_INSTANCE_ID	208
192 #define AR_TKN_U32_MODULE_DST_INSTANCE_ID	209
193 
194 #define AR_TKN_U32_MODULE_SRC_OP_PORT_ID1	210
195 #define AR_TKN_U32_MODULE_DST_IN_PORT_ID1	211
196 #define AR_TKN_U32_MODULE_DST_INSTANCE_ID1	212
197 
198 #define AR_TKN_U32_MODULE_SRC_OP_PORT_ID2	213
199 #define AR_TKN_U32_MODULE_DST_IN_PORT_ID2	214
200 #define AR_TKN_U32_MODULE_DST_INSTANCE_ID2	215
201 
202 #define AR_TKN_U32_MODULE_SRC_OP_PORT_ID3	216
203 #define AR_TKN_U32_MODULE_DST_IN_PORT_ID3	217
204 #define AR_TKN_U32_MODULE_DST_INSTANCE_ID3	218
205 
206 #define AR_TKN_U32_MODULE_SRC_OP_PORT_ID4	219
207 #define AR_TKN_U32_MODULE_DST_IN_PORT_ID4	220
208 #define AR_TKN_U32_MODULE_DST_INSTANCE_ID4	221
209 
210 #define AR_TKN_U32_MODULE_SRC_OP_PORT_ID5	222
211 #define AR_TKN_U32_MODULE_DST_IN_PORT_ID5	223
212 #define AR_TKN_U32_MODULE_DST_INSTANCE_ID5	224
213 
214 #define AR_TKN_U32_MODULE_SRC_OP_PORT_ID6	225
215 #define AR_TKN_U32_MODULE_DST_IN_PORT_ID6	226
216 #define AR_TKN_U32_MODULE_DST_INSTANCE_ID6	227
217 
218 #define AR_TKN_U32_MODULE_SRC_OP_PORT_ID7	228
219 #define AR_TKN_U32_MODULE_DST_IN_PORT_ID7	229
220 #define AR_TKN_U32_MODULE_DST_INSTANCE_ID7	230
221 
222 #define AR_TKN_U32_MODULE_HW_IF_IDX		250
223 #define AR_TKN_U32_MODULE_HW_IF_TYPE		251
224 #define AR_TKN_U32_MODULE_FMT_INTERLEAVE	252
225 #define AR_TKN_U32_MODULE_FMT_DATA		253
226 #define AR_TKN_U32_MODULE_FMT_SAMPLE_RATE	254
227 #define AR_TKN_U32_MODULE_FMT_BIT_DEPTH		255
228 #define AR_TKN_U32_MODULE_SD_LINE_IDX		256
229 #define AR_TKN_U32_MODULE_WS_SRC		257
230 #define AR_TKN_U32_MODULE_FRAME_SZ_FACTOR	258
231 #define AR_TKN_U32_MODULE_LOG_CODE		259
232 #define AR_TKN_U32_MODULE_LOG_TAP_POINT_ID	260
233 #define AR_TKN_U32_MODULE_LOG_MODE		261
234 
235 #endif /* __SND_AR_TOKENS_H__ */
236