blob: ef24f63cd4ecfbf2b68b55e7ebbd0a3311cf2173 [file] [log] [blame]
Rohit kumar4ea92b12019-02-01 18:05:33 +05301/* Copyright (c) 2012-2019, The Linux Foundation. All rights reserved.
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05302 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License version 2 and
5 * only version 2 as published by the Free Software Foundation.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 */
12
13
14#ifndef _APR_AUDIO_V2_H_
15#define _APR_AUDIO_V2_H_
16
Laxminath Kasam605b42f2017-08-01 22:02:15 +053017#include <ipc/apr.h>
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +053018#include <linux/msm_audio.h>
19
20/* size of header needed for passing data out of band */
21#define APR_CMD_OB_HDR_SZ 12
22
23/* size of header needed for getting data */
24#define APR_CMD_GET_HDR_SZ 16
25
26struct param_outband {
27 size_t size;
28 void *kvaddr;
29 phys_addr_t paddr;
30};
31
32#define ADSP_ADM_VERSION 0x00070000
33
34#define ADM_CMD_SHARED_MEM_MAP_REGIONS 0x00010322
35#define ADM_CMDRSP_SHARED_MEM_MAP_REGIONS 0x00010323
36#define ADM_CMD_SHARED_MEM_UNMAP_REGIONS 0x00010324
37
38#define ADM_CMD_MATRIX_MAP_ROUTINGS_V5 0x00010325
39#define ADM_CMD_STREAM_DEVICE_MAP_ROUTINGS_V5 0x0001033D
40/* Enumeration for an audio Rx matrix ID.*/
41#define ADM_MATRIX_ID_AUDIO_RX 0
42
43#define ADM_MATRIX_ID_AUDIO_TX 1
44
45#define ADM_MATRIX_ID_COMPRESSED_AUDIO_RX 2
46
47#define ADM_MATRIX_ID_COMPRESSED_AUDIO_TX 3
48
49#define ADM_MATRIX_ID_LISTEN_TX 4
50/* Enumeration for an audio Tx matrix ID.*/
51#define ADM_MATRIX_ID_AUDIOX 1
52
53#define ADM_MAX_COPPS 5
54
55/* make sure this matches with msm_audio_calibration */
56#define SP_V2_NUM_MAX_SPKR 2
57
58/* Session map node structure.
59 * Immediately following this structure are num_copps
60 * entries of COPP IDs. The COPP IDs are 16 bits, so
61 * there might be a padding 16-bit field if num_copps
62 * is odd.
63 */
64struct adm_session_map_node_v5 {
65 u16 session_id;
66 /* Handle of the ASM session to be routed. Supported values: 1
67 * to 8.
68 */
69
70
71 u16 num_copps;
72 /* Number of COPPs to which this session is to be routed.
73 * Supported values: 0 < num_copps <= ADM_MAX_COPPS.
74 */
75} __packed;
76
77/* Payload of the #ADM_CMD_MATRIX_MAP_ROUTINGS_V5 command.
78 * Immediately following this structure are num_sessions of the session map
79 * node payload (adm_session_map_node_v5).
80 */
81
82struct adm_cmd_matrix_map_routings_v5 {
83 struct apr_hdr hdr;
84
85 u32 matrix_id;
86 /* Specifies whether the matrix ID is Audio Rx (0) or Audio Tx
87 * (1). Use the ADM_MATRIX_ID_AUDIO_RX or ADM_MATRIX_ID_AUDIOX
88 * macros to set this field.
89 */
90 u32 num_sessions;
91 /* Number of sessions being updated by this command (optional). */
92} __packed;
93
94/* This command allows a client to open a COPP/Voice Proc. TX module
95 * and sets up the device session: Matrix -> COPP -> AFE on the RX
96 * and AFE -> COPP -> Matrix on the TX. This enables PCM data to
97 * be transferred to/from the endpoint (AFEPortID).
98 *
99 * @return
100 * #ADM_CMDRSP_DEVICE_OPEN_V5 with the resulting status and COPP ID.
101 */
102#define ADM_CMD_DEVICE_OPEN_V5 0x00010326
103
104/* This command allows a client to open a COPP/Voice Proc the
105 * way as ADM_CMD_DEVICE_OPEN_V5 but supports multiple endpoint2
106 * channels.
107 *
108 * @return
109 * #ADM_CMDRSP_DEVICE_OPEN_V6 with the resulting status and
110 * COPP ID.
111 */
112#define ADM_CMD_DEVICE_OPEN_V6 0x00010356
113
Dieter Lueckinga8b8e3b2018-09-28 14:29:17 +0200114/* This command allows a client to open a COPP/Voice Proc the
115* way as ADM_CMD_DEVICE_OPEN_V8 but supports any number channel
116* of configuration.
117*
118* @return
119* #ADM_CMDRSP_DEVICE_OPEN_V8 with the resulting status and
120* COPP ID.
121*/
122#define ADM_CMD_DEVICE_OPEN_V8 0x0001036A
123
124
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +0530125/* Definition for a low latency stream session. */
126#define ADM_LOW_LATENCY_DEVICE_SESSION 0x2000
127
128/* Definition for a ultra low latency stream session. */
129#define ADM_ULTRA_LOW_LATENCY_DEVICE_SESSION 0x4000
130
131/* Definition for a ultra low latency with Post Processing stream session. */
132#define ADM_ULL_POST_PROCESSING_DEVICE_SESSION 0x8000
133
134/* Definition for a legacy device session. */
135#define ADM_LEGACY_DEVICE_SESSION 0
136
137/* Indicates that endpoint_id_2 is to be ignored.*/
138#define ADM_CMD_COPP_OPEN_END_POINT_ID_2_IGNORE 0xFFFF
139
140#define ADM_CMD_COPP_OPEN_MODE_OF_OPERATION_RX_PATH_COPP 1
141
142#define ADM_CMD_COPP_OPEN_MODE_OF_OPERATIONX_PATH_LIVE_COPP 2
143
144#define ADM_CMD_COPP_OPEN_MODE_OF_OPERATIONX_PATH_NON_LIVE_COPP 3
145
146/* Indicates that an audio COPP is to send/receive a mono PCM
147 * stream to/from
148 * END_POINT_ID_1.
149 */
150#define ADM_CMD_COPP_OPEN_CHANNEL_CONFIG_MONO 1
151
152/* Indicates that an audio COPP is to send/receive a
153 * stereo PCM stream to/from END_POINT_ID_1.
154 */
155#define ADM_CMD_COPP_OPEN_CHANNEL_CONFIG_STEREO 2
156
157/* Sample rate is 8000 Hz.*/
158#define ADM_CMD_COPP_OPEN_SAMPLE_RATE_8K 8000
159
160/* Sample rate is 16000 Hz.*/
161#define ADM_CMD_COPP_OPEN_SAMPLE_RATE_16K 16000
162
163/* Sample rate is 48000 Hz.*/
164#define ADM_CMD_COPP_OPEN_SAMPLE_RATE_48K 48000
165
166/* Definition for a COPP live input flag bitmask.*/
167#define ADM_BIT_MASK_COPP_LIVE_INPUT_FLAG (0x0001U)
168
169/* Definition for a COPP live shift value bitmask.*/
170#define ADM_SHIFT_COPP_LIVE_INPUT_FLAG 0
171
172/* Definition for the COPP ID bitmask.*/
173#define ADM_BIT_MASK_COPP_ID (0x0000FFFFUL)
174
175/* Definition for the COPP ID shift value.*/
176#define ADM_SHIFT_COPP_ID 0
177
178/* Definition for the service ID bitmask.*/
179#define ADM_BIT_MASK_SERVICE_ID (0x00FF0000UL)
180
181/* Definition for the service ID shift value.*/
182#define ADM_SHIFT_SERVICE_ID 16
183
184/* Definition for the domain ID bitmask.*/
185#define ADM_BIT_MASK_DOMAIN_ID (0xFF000000UL)
186
187/* Definition for the domain ID shift value.*/
188#define ADM_SHIFT_DOMAIN_ID 24
189
190/* ADM device open command payload of the
191 * #ADM_CMD_DEVICE_OPEN_V5 command.
192 */
193struct adm_cmd_device_open_v5 {
194 struct apr_hdr hdr;
195 u16 flags;
196/* Reserved for future use. Clients must set this field
197 * to zero.
198 */
199
200 u16 mode_of_operation;
201/* Specifies whether the COPP must be opened on the Tx or Rx
202 * path. Use the ADM_CMD_COPP_OPEN_MODE_OF_OPERATION_* macros for
203 * supported values and interpretation.
204 * Supported values:
205 * - 0x1 -- Rx path COPP
206 * - 0x2 -- Tx path live COPP
207 * - 0x3 -- Tx path nonlive COPP
208 * Live connections cause sample discarding in the Tx device
209 * matrix if the destination output ports do not pull them
210 * fast enough. Nonlive connections queue the samples
211 * indefinitely.
212 */
213
214 u16 endpoint_id_1;
215/* Logical and physical endpoint ID of the audio path.
216 * If the ID is a voice processor Tx block, it receives near
217 * samples. Supported values: Any pseudoport, AFE Rx port,
218 * or AFE Tx port For a list of valid IDs, refer to
219 * @xhyperref{Q4,[Q4]}.
220 * Q4 = Hexagon Multimedia: AFE Interface Specification
221 */
222
223 u16 endpoint_id_2;
224/* Logical and physical endpoint ID 2 for a voice processor
225 * Tx block.
226 * This is not applicable to audio COPP.
227 * Supported values:
228 * - AFE Rx port
229 * - 0xFFFF -- Endpoint 2 is unavailable and the voice
230 * processor Tx
231 * block ignores this endpoint
232 * When the voice processor Tx block is created on the audio
233 * record path,
234 * it can receive far-end samples from an AFE Rx port if the
235 * voice call
236 * is active. The ID of the AFE port is provided in this
237 * field.
238 * For a list of valid IDs, refer @xhyperref{Q4,[Q4]}.
239 */
240
241 u32 topology_id;
242/* Audio COPP topology ID; 32-bit GUID. */
243
244 u16 dev_num_channel;
245/* Number of channels the audio COPP sends to/receives from
246 * the endpoint.
247 * Supported values: 1 to 8.
248 * The value is ignored for the voice processor Tx block,
249 * where channel
250 * configuration is derived from the topology ID.
251 */
252
253 u16 bit_width;
254/* Bit width (in bits) that the audio COPP sends to/receives
255 * from the
256 * endpoint. The value is ignored for the voice processing
257 * Tx block,
258 * where the PCM width is 16 bits.
259 */
260
261 u32 sample_rate;
262/* Sampling rate at which the audio COPP/voice processor
263 * Tx block
264 * interfaces with the endpoint.
265 * Supported values for voice processor Tx: 8000, 16000,
266 * 48000 Hz
267 * Supported values for audio COPP: >0 and <=192 kHz
268 */
269
270 u8 dev_channel_mapping[8];
271/* Array of channel mapping of buffers that the audio COPP
272 * sends to the endpoint. Channel[i] mapping describes channel
273 * I inside the buffer, where 0 < i < dev_num_channel.
274 * This value is relevant only for an audio Rx COPP.
275 * For the voice processor block and Tx audio block, this field
276 * is set to zero and is ignored.
277 */
278} __packed;
279
280/* ADM device open command payload of the
281 * #ADM_CMD_DEVICE_OPEN_V6 command.
282 */
283struct adm_cmd_device_open_v6 {
284 struct apr_hdr hdr;
285 u16 flags;
286/* Reserved for future use. Clients must set this field
287 * to zero.
288 */
289
290 u16 mode_of_operation;
291/* Specifies whether the COPP must be opened on the Tx or Rx
292 * path. Use the ADM_CMD_COPP_OPEN_MODE_OF_OPERATION_* macros for
293 * supported values and interpretation.
294 * Supported values:
295 * - 0x1 -- Rx path COPP
296 * - 0x2 -- Tx path live COPP
297 * - 0x3 -- Tx path nonlive COPP
298 * Live connections cause sample discarding in the Tx device
299 * matrix if the destination output ports do not pull them
300 * fast enough. Nonlive connections queue the samples
301 * indefinitely.
302 */
303
304 u16 endpoint_id_1;
305/* Logical and physical endpoint ID of the audio path.
306 * If the ID is a voice processor Tx block, it receives near
307 * samples. Supported values: Any pseudoport, AFE Rx port,
308 * or AFE Tx port For a list of valid IDs, refer to
309 * @xhyperref{Q4,[Q4]}.
310 * Q4 = Hexagon Multimedia: AFE Interface Specification
311 */
312
313 u16 endpoint_id_2;
314/* Logical and physical endpoint ID 2 for a voice processor
315 * Tx block.
316 * This is not applicable to audio COPP.
317 * Supported values:
318 * - AFE Rx port
319 * - 0xFFFF -- Endpoint 2 is unavailable and the voice
320 * processor Tx
321 * block ignores this endpoint
322 * When the voice processor Tx block is created on the audio
323 * record path,
324 * it can receive far-end samples from an AFE Rx port if the
325 * voice call
326 * is active. The ID of the AFE port is provided in this
327 * field.
328 * For a list of valid IDs, refer @xhyperref{Q4,[Q4]}.
329 */
330
331 u32 topology_id;
332/* Audio COPP topology ID; 32-bit GUID. */
333
334 u16 dev_num_channel;
335/* Number of channels the audio COPP sends to/receives from
336 * the endpoint.
337 * Supported values: 1 to 8.
338 * The value is ignored for the voice processor Tx block,
339 * where channel
340 * configuration is derived from the topology ID.
341 */
342
343 u16 bit_width;
344/* Bit width (in bits) that the audio COPP sends to/receives
345 * from the
346 * endpoint. The value is ignored for the voice processing
347 * Tx block,
348 * where the PCM width is 16 bits.
349 */
350
351 u32 sample_rate;
352/* Sampling rate at which the audio COPP/voice processor
353 * Tx block
354 * interfaces with the endpoint.
355 * Supported values for voice processor Tx: 8000, 16000,
356 * 48000 Hz
357 * Supported values for audio COPP: >0 and <=192 kHz
358 */
359
360 u8 dev_channel_mapping[8];
361/* Array of channel mapping of buffers that the audio COPP
362 * sends to the endpoint. Channel[i] mapping describes channel
363 * I inside the buffer, where 0 < i < dev_num_channel.
364 * This value is relevant only for an audio Rx COPP.
365 * For the voice processor block and Tx audio block, this field
366 * is set to zero and is ignored.
367 */
368
369 u16 dev_num_channel_eid2;
370/* Number of channels the voice processor block sends
371 * to/receives from the endpoint2.
372 * Supported values: 1 to 8.
373 * The value is ignored for audio COPP or if endpoint_id_2 is
374 * set to 0xFFFF.
375 */
376
377 u16 bit_width_eid2;
378/* Bit width (in bits) that the voice processor sends
379 * to/receives from the endpoint2.
380 * Supported values: 16 and 24.
381 * The value is ignored for audio COPP or if endpoint_id_2 is
382 * set to 0xFFFF.
383 */
384
385 u32 sample_rate_eid2;
386/* Sampling rate at which the voice processor Tx block
387 * interfaces with the endpoint2.
388 * Supported values for Tx voice processor: >0 and <=384 kHz
389 * The value is ignored for audio COPP or if endpoint_id_2 is
390 * set to 0xFFFF.
391 */
392
393 u8 dev_channel_mapping_eid2[8];
394/* Array of channel mapping of buffers that the voice processor
395 * sends to the endpoint. Channel[i] mapping describes channel
396 * I inside the buffer, where 0 < i < dev_num_channel.
397 * This value is relevant only for the Tx voice processor.
398 * The values are ignored for audio COPP or if endpoint_id_2 is
399 * set to 0xFFFF.
400 */
401} __packed;
402
Dieter Lueckinga8b8e3b2018-09-28 14:29:17 +0200403
404/* ADM device open endpoint payload the
405 * #ADM_CMD_DEVICE_OPEN_V8 command.
406 */
407struct adm_device_endpoint_payload {
408 u16 dev_num_channel;
409/* Number of channels the audio COPP sends to/receives from
410 * the endpoint.
411 * Supported values: 1 to 32.
412 * The value is ignored for the voice processor Tx block,
413 * where channel
414 * configuration is derived from the topology ID.
415 */
416
417 u16 bit_width;
418/* Bit width (in bits) that the audio COPP sends to/receives
419 * from the
420 * endpoint. The value is ignored for the voice processing
421 * Tx block,
422 * where the PCM width is 16 bits.
423 */
424
425 u32 sample_rate;
426/* Sampling rate at which the audio COPP/voice processor
427 * Tx block
428 * interfaces with the endpoint.
429 * Supported values for voice processor Tx: 8000, 16000,
430 * 48000 Hz
431 * Supported values for audio COPP: >0 and <=192 kHz
432 */
433
434 u8 dev_channel_mapping[32];
435} __packed;
436
437/* ADM device open command payload of the
438 * #ADM_CMD_DEVICE_OPEN_V8 command.
439 */
440struct adm_cmd_device_open_v8 {
441 struct apr_hdr hdr;
442 u16 flags;
443/* Bit width Native mode enabled : 11th bit of flag parameter
444* If 11th bit of flag is set then that means matrix mixer will be
445* running in native mode for bit width for this device session.
446*
447* Channel Native mode enabled : 12th bit of flag parameter
448* If 12th bit of flag is set then that means matrix mixer will be
449* running in native mode for channel configuration for this device session.
450* All other bits are reserved; clients must set them to 0.
451*/
452 u16 mode_of_operation;
453/* Specifies whether the COPP must be opened on the Tx or Rx
454 * path. Use the ADM_CMD_COPP_OPEN_MODE_OF_OPERATION_* macros for
455 * supported values and interpretation.
456 * Supported values:
457 * - 0x1 -- Rx path COPP
458 * - 0x2 -- Tx path live COPP
459 * - 0x3 -- Tx path nonlive COPP
460 * Live connections cause sample discarding in the Tx device
461 * matrix if the destination output ports do not pull them
462 * fast enough. Nonlive connections queue the samples
463 * indefinitely.
464 */
465 u32 topology_id;
466/* Audio COPP topology ID; 32-bit GUID. */
467
468
469 u16 endpoint_id_1;
470/* Logical and physical endpoint ID of the audio path.
471 * If the ID is a voice processor Tx block, it receives near
472 * samples.
473 * Supported values: Any pseudoport, AFE Rx port,
474 * or AFE Tx port For a list of valid IDs, refer to
475 * @xhyperref{Q4,[Q4]}.
476 * Q4 = Hexagon Multimedia: AFE Interface Specification
477 */
478
479 u16 endpoint_id_2;
480/* Logical and physical endpoint ID 2 for a voice processor
481 * Tx block.
482 * This is not applicable to audio COPP.
483 * Supported values:
484 * - AFE Rx port
485 * - 0xFFFF -- Endpoint 2 is unavailable and the voice
486 * processor Tx
487 * block ignores this endpoint
488 * When the voice processor Tx block is created on the audio
489 * record path,
490 * it can receive far-end samples from an AFE Rx port if the
491 * voice call
492 * is active. The ID of the AFE port is provided in this
493 * field.
494 * For a list of valid IDs, refer @xhyperref{Q4,[Q4]}.
495 */
496
497 u16 endpoint_id_3;
498/*
499 * Logical and physical endpoint ID of the audio path.
500 * This indicated afe rx port in ADM loopback use cases.
501 * In all other use cases this should be set to 0xffff
502 */
503
504 u16 reserved;
505} __packed;
506
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +0530507/*
508 * This command allows the client to close a COPP and disconnect
509 * the device session.
510 */
511#define ADM_CMD_DEVICE_CLOSE_V5 0x00010327
512
513/* Sets one or more parameters to a COPP. */
514#define ADM_CMD_SET_PP_PARAMS_V5 0x00010328
515
516/* Payload of the #ADM_CMD_SET_PP_PARAMS_V5 command.
517 * If the data_payload_addr_lsw and data_payload_addr_msw element
518 * are NULL, a series of adm_param_datastructures immediately
519 * follows, whose total size is data_payload_size bytes.
520 */
521struct adm_cmd_set_pp_params_v5 {
522 struct apr_hdr hdr;
523 u32 payload_addr_lsw;
524/* LSW of parameter data payload address. */
525 u32 payload_addr_msw;
526/* MSW of parameter data payload address. */
527
528 u32 mem_map_handle;
529/* Memory map handle returned by ADM_CMD_SHARED_MEM_MAP_REGIONS
530 * command
531 *
532 * If mem_map_handle is zero implies the message is in
533 * the payload
534 */
535
536 u32 payload_size;
537/* Size in bytes of the variable payload accompanying this
538 * message or
539 * in shared memory. This is used for parsing the parameter
540 * payload.
541 */
542} __packed;
543
544/* Payload format for COPP parameter data.
545 * Immediately following this structure are param_size bytes
546 * of parameter
547 * data.
548 */
549struct adm_param_data_v5 {
550 u32 module_id;
551 /* Unique ID of the module. */
552 u32 param_id;
553 /* Unique ID of the parameter. */
554 u16 param_size;
555 /* Data size of the param_id/module_id combination.
556 * This value is a
557 * multiple of 4 bytes.
558 */
559 u16 reserved;
560 /* Reserved for future enhancements.
561 * This field must be set to zero.
562 */
563} __packed;
564
565#define ASM_STREAM_CMD_REGISTER_PP_EVENTS 0x00013213
566#define ASM_STREAM_PP_EVENT 0x00013214
567#define ASM_STREAM_CMD_REGISTER_IEC_61937_FMT_UPDATE 0x13333
568#define ASM_IEC_61937_MEDIA_FMT_EVENT 0x13334
569
570#define DSP_STREAM_CMD "ADSP Stream Cmd"
571#define DSP_STREAM_CALLBACK "ADSP Stream Callback Event"
572#define DSP_STREAM_CALLBACK_QUEUE_SIZE 1024
573
574struct dsp_stream_callback_list {
575 struct list_head list;
576 struct msm_adsp_event_data event;
577};
578
579struct dsp_stream_callback_prtd {
580 uint16_t event_count;
581 struct list_head event_queue;
582 spinlock_t prtd_spin_lock;
583};
584
585/* set customized mixing on matrix mixer */
586#define ADM_CMD_SET_PSPD_MTMX_STRTR_PARAMS_V5 0x00010344
587struct adm_cmd_set_pspd_mtmx_strtr_params_v5 {
588 struct apr_hdr hdr;
589 /* LSW of parameter data payload address.*/
590 u32 payload_addr_lsw;
591 /* MSW of parameter data payload address.*/
592 u32 payload_addr_msw;
593 /* Memory map handle returned by ADM_CMD_SHARED_MEM_MAP_REGIONS */
594 /* command. If mem_map_handle is zero implies the message is in */
595 /* the payload */
596 u32 mem_map_handle;
597 /* Size in bytes of the variable payload accompanying this */
598 /* message or in shared memory. This is used for parsing the */
599 /* parameter payload. */
600 u32 payload_size;
601 u16 direction;
602 u16 sessionid;
603 u16 deviceid;
604 u16 reserved;
605} __packed;
606
607/* Defined specifically for in-band use, includes params */
608struct adm_cmd_set_pp_params_inband_v5 {
609 struct apr_hdr hdr;
610 /* LSW of parameter data payload address.*/
611 u32 payload_addr_lsw;
612 /* MSW of parameter data payload address.*/
613 u32 payload_addr_msw;
614 /* Memory map handle returned by ADM_CMD_SHARED_MEM_MAP_REGIONS */
615 /* command. If mem_map_handle is zero implies the message is in */
616 /* the payload */
617 u32 mem_map_handle;
618 /* Size in bytes of the variable payload accompanying this */
619 /* message or in shared memory. This is used for parsing the */
620 /* parameter payload. */
621 u32 payload_size;
622 /* Parameters passed for in band payload */
623 struct adm_param_data_v5 params;
624} __packed;
625
626/* Returns the status and COPP ID to an #ADM_CMD_DEVICE_OPEN_V5 command.
627 */
628#define ADM_CMDRSP_DEVICE_OPEN_V5 0x00010329
629
630/* Payload of the #ADM_CMDRSP_DEVICE_OPEN_V5 message,
631 * which returns the
632 * status and COPP ID to an #ADM_CMD_DEVICE_OPEN_V5 command.
633 */
634struct adm_cmd_rsp_device_open_v5 {
635 u32 status;
636 /* Status message (error code).*/
637
638 u16 copp_id;
639 /* COPP ID: Supported values: 0 <= copp_id < ADM_MAX_COPPS*/
640
641 u16 reserved;
642 /* Reserved. This field must be set to zero.*/
643} __packed;
644
645/* Returns the status and COPP ID to an #ADM_CMD_DEVICE_OPEN_V6 command. */
646#define ADM_CMDRSP_DEVICE_OPEN_V6 0x00010357
647
Dieter Lueckinga8b8e3b2018-09-28 14:29:17 +0200648/* Returns the status and COPP ID to an #ADM_CMD_DEVICE_OPEN_V8 command. */
649#define ADM_CMDRSP_DEVICE_OPEN_V8 0x0001036B
650
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +0530651/* Payload of the #ADM_CMDRSP_DEVICE_OPEN_V6 message,
652 * which returns the
653 * status and COPP ID to an #ADM_CMD_DEVICE_OPEN_V6 command
654 * is the exact same as ADM_CMDRSP_DEVICE_OPEN_V5.
655 */
656
657/* This command allows a query of one COPP parameter. */
658#define ADM_CMD_GET_PP_PARAMS_V5 0x0001032A
659
660/* Payload an #ADM_CMD_GET_PP_PARAMS_V5 command. */
661struct adm_cmd_get_pp_params_v5 {
662 struct apr_hdr hdr;
663 u32 data_payload_addr_lsw;
664 /* LSW of parameter data payload address.*/
665
666 u32 data_payload_addr_msw;
667 /* MSW of parameter data payload address.*/
668
669 /* If the mem_map_handle is non zero,
670 * on ACK, the ParamData payloads begin at
671 * the address specified (out-of-band).
672 */
673
674 u32 mem_map_handle;
675 /* Memory map handle returned
676 * by ADM_CMD_SHARED_MEM_MAP_REGIONS command.
677 * If the mem_map_handle is 0, it implies that
678 * the ACK's payload will contain the ParamData (in-band).
679 */
680
681 u32 module_id;
682 /* Unique ID of the module. */
683
684 u32 param_id;
685 /* Unique ID of the parameter. */
686
687 u16 param_max_size;
688 /* Maximum data size of the parameter
689 *ID/module ID combination. This
690 * field is a multiple of 4 bytes.
691 */
692 u16 reserved;
693 /* Reserved for future enhancements.
694 * This field must be set to zero.
695 */
696} __packed;
697
698/* Returns parameter values
699 * in response to an #ADM_CMD_GET_PP_PARAMS_V5 command.
700 */
701#define ADM_CMDRSP_GET_PP_PARAMS_V5 0x0001032B
702
703/* Payload of the #ADM_CMDRSP_GET_PP_PARAMS_V5 message,
704 * which returns parameter values in response
705 * to an #ADM_CMD_GET_PP_PARAMS_V5 command.
706 * Immediately following this
707 * structure is the adm_param_data_v5
708 * structure containing the pre/postprocessing
709 * parameter data. For an in-band
710 * scenario, the variable payload depends
711 * on the size of the parameter.
712 */
713struct adm_cmd_rsp_get_pp_params_v5 {
714 u32 status;
715 /* Status message (error code).*/
716} __packed;
717
718/* Structure for holding soft stepping volume parameters. */
719
720/*
721 * Payload of the #ASM_PARAM_ID_SOFT_VOL_STEPPING_PARAMETERS
722 * parameters used by the Volume Control module.
723 */
724
725struct audproc_softvolume_params {
726 u32 period;
727 u32 step;
728 u32 rampingcurve;
729} __packed;
730
731/*
732 * ID of the Media Format Converter (MFC) module.
733 * This module supports the following parameter IDs:
734 * #AUDPROC_PARAM_ID_MFC_OUTPUT_MEDIA_FORMAT
735 * #AUDPROC_CHMIXER_PARAM_ID_COEFF
736 */
737#define AUDPROC_MODULE_ID_MFC 0x00010912
738
739/* ID of the Output Media Format parameters used by AUDPROC_MODULE_ID_MFC.
740 *
741 */
742#define AUDPROC_PARAM_ID_MFC_OUTPUT_MEDIA_FORMAT 0x00010913
743
Aditya Bavanari245361d2017-09-07 12:11:30 +0530744/* Param ID of Channel Mixer used by AUDPROC_MODULE_ID_MFC */
745#define AUDPROC_CHMIXER_PARAM_ID_COEFF 0x00010342
746
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +0530747
748struct audproc_mfc_output_media_fmt {
749 struct adm_cmd_set_pp_params_v5 params;
750 struct adm_param_data_v5 data;
751 uint32_t sampling_rate;
752 uint16_t bits_per_sample;
753 uint16_t num_channels;
754 uint16_t channel_type[8];
755} __packed;
756
757struct audproc_volume_ctrl_master_gain {
758 struct adm_cmd_set_pp_params_v5 params;
759 struct adm_param_data_v5 data;
760 /* Linear gain in Q13 format. */
761 uint16_t master_gain;
762 /* Clients must set this field to zero. */
763 uint16_t reserved;
764} __packed;
765
766struct audproc_soft_step_volume_params {
767 struct adm_cmd_set_pp_params_v5 params;
768 struct adm_param_data_v5 data;
769/*
770 * Period in milliseconds.
771 * Supported values: 0 to 15000
772 */
773 uint32_t period;
774/*
775 * Step in microseconds.
776 * Supported values: 0 to 15000000
777 */
778 uint32_t step;
779/*
780 * Ramping curve type.
781 * Supported values:
782 * - #AUDPROC_PARAM_SVC_RAMPINGCURVE_LINEAR
783 * - #AUDPROC_PARAM_SVC_RAMPINGCURVE_EXP
784 * - #AUDPROC_PARAM_SVC_RAMPINGCURVE_LOG
785 */
786 uint32_t ramping_curve;
787} __packed;
788
789struct audproc_enable_param_t {
790 struct adm_cmd_set_pp_params_inband_v5 pp_params;
791 /*
792 * Specifies whether the Audio processing module is enabled.
793 * This parameter is generic/common parameter to configure or
794 * determine the state of any audio processing module.
795
796 * @values 0 : Disable 1: Enable
797 */
798 uint32_t enable;
799};
800
801/*
802 * Allows a client to control the gains on various session-to-COPP paths.
803 */
804#define ADM_CMD_MATRIX_RAMP_GAINS_V5 0x0001032C
805
806/* Indicates that the target gain in the
807 * current adm_session_copp_gain_v5
808 * structure is to be applied to all
809 * the session-to-COPP paths that exist for
810 * the specified session.
811 */
812#define ADM_CMD_MATRIX_RAMP_GAINS_COPP_ID_ALL_CONNECTED_COPPS 0xFFFF
813
814/* Indicates that the target gain is
815 * to be immediately applied to the
816 * specified session-to-COPP path,
817 * without a ramping fashion.
818 */
819#define ADM_CMD_MATRIX_RAMP_GAINS_RAMP_DURATION_IMMEDIATE 0x0000
820
821/* Enumeration for a linear ramping curve.*/
822#define ADM_CMD_MATRIX_RAMP_GAINS_RAMP_CURVE_LINEAR 0x0000
823
824/* Payload of the #ADM_CMD_MATRIX_RAMP_GAINS_V5 command.
825 * Immediately following this structure are num_gains of the
826 * adm_session_copp_gain_v5structure.
827 */
828struct adm_cmd_matrix_ramp_gains_v5 {
829 u32 matrix_id;
830/* Specifies whether the matrix ID is Audio Rx (0) or Audio Tx (1).
831 * Use the ADM_MATRIX_ID_AUDIO_RX or ADM_MATRIX_ID_AUDIOX
832 * macros to set this field.
833 */
834
835 u16 num_gains;
836 /* Number of gains being applied. */
837
838 u16 reserved_for_align;
839 /* Reserved. This field must be set to zero.*/
840} __packed;
841
842/* Session-to-COPP path gain structure, used by the
843 * #ADM_CMD_MATRIX_RAMP_GAINS_V5 command.
844 * This structure specifies the target
845 * gain (per channel) that must be applied
846 * to a particular session-to-COPP path in
847 * the audio matrix. The structure can
848 * also be used to apply the gain globally
849 * to all session-to-COPP paths that
850 * exist for the given session.
851 * The aDSP uses device channel mapping to
852 * determine which channel gains to
853 * use from this command. For example,
854 * if the device is configured as stereo,
855 * the aDSP uses only target_gain_ch_1 and
856 * target_gain_ch_2, and it ignores
857 * the others.
858 */
859struct adm_session_copp_gain_v5 {
860 u16 session_id;
861/* Handle of the ASM session.
862 * Supported values: 1 to 8.
863 */
864
865 u16 copp_id;
866/* Handle of the COPP. Gain will be applied on the Session ID
867 * COPP ID path.
868 */
869
870 u16 ramp_duration;
871/* Duration (in milliseconds) of the ramp over
872 * which target gains are
873 * to be applied. Use
874 * #ADM_CMD_MATRIX_RAMP_GAINS_RAMP_DURATION_IMMEDIATE
875 * to indicate that gain must be applied immediately.
876 */
877
878 u16 step_duration;
879/* Duration (in milliseconds) of each step in the ramp.
880 * This parameter is ignored if ramp_duration is equal to
881 * #ADM_CMD_MATRIX_RAMP_GAINS_RAMP_DURATION_IMMEDIATE.
882 * Supported value: 1
883 */
884
885 u16 ramp_curve;
886/* Type of ramping curve.
887 * Supported value: #ADM_CMD_MATRIX_RAMP_GAINS_RAMP_CURVE_LINEAR
888 */
889
890 u16 reserved_for_align;
891 /* Reserved. This field must be set to zero. */
892
893 u16 target_gain_ch_1;
894 /* Target linear gain for channel 1 in Q13 format; */
895
896 u16 target_gain_ch_2;
897 /* Target linear gain for channel 2 in Q13 format; */
898
899 u16 target_gain_ch_3;
900 /* Target linear gain for channel 3 in Q13 format; */
901
902 u16 target_gain_ch_4;
903 /* Target linear gain for channel 4 in Q13 format; */
904
905 u16 target_gain_ch_5;
906 /* Target linear gain for channel 5 in Q13 format; */
907
908 u16 target_gain_ch_6;
909 /* Target linear gain for channel 6 in Q13 format; */
910
911 u16 target_gain_ch_7;
912 /* Target linear gain for channel 7 in Q13 format; */
913
914 u16 target_gain_ch_8;
915 /* Target linear gain for channel 8 in Q13 format; */
916} __packed;
917
918/* Allows to set mute/unmute on various session-to-COPP paths.
919 * For every session-to-COPP path (stream-device interconnection),
920 * mute/unmute can be set individually on the output channels.
921 */
922#define ADM_CMD_MATRIX_MUTE_V5 0x0001032D
923
924/* Indicates that mute/unmute in the
925 * current adm_session_copp_mute_v5structure
926 * is to be applied to all the session-to-COPP
927 * paths that exist for the specified session.
928 */
929#define ADM_CMD_MATRIX_MUTE_COPP_ID_ALL_CONNECTED_COPPS 0xFFFF
930
931/* Payload of the #ADM_CMD_MATRIX_MUTE_V5 command*/
932struct adm_cmd_matrix_mute_v5 {
933 u32 matrix_id;
934/* Specifies whether the matrix ID is Audio Rx (0) or Audio Tx (1).
935 * Use the ADM_MATRIX_ID_AUDIO_RX or ADM_MATRIX_ID_AUDIOX
936 * macros to set this field.
937 */
938
939 u16 session_id;
940/* Handle of the ASM session.
941 * Supported values: 1 to 8.
942 */
943
944 u16 copp_id;
945/* Handle of the COPP.
946 * Use ADM_CMD_MATRIX_MUTE_COPP_ID_ALL_CONNECTED_COPPS
947 * to indicate that mute/unmute must be applied to
948 * all the COPPs connected to session_id.
949 * Supported values:
950 * - 0xFFFF -- Apply mute/unmute to all connected COPPs
951 * - Other values -- Valid COPP ID
952 */
953
954 u8 mute_flag_ch_1;
955 /* Mute flag for channel 1 is set to unmute (0) or mute (1). */
956
957 u8 mute_flag_ch_2;
958 /* Mute flag for channel 2 is set to unmute (0) or mute (1). */
959
960 u8 mute_flag_ch_3;
961 /* Mute flag for channel 3 is set to unmute (0) or mute (1). */
962
963 u8 mute_flag_ch_4;
964 /* Mute flag for channel 4 is set to unmute (0) or mute (1). */
965
966 u8 mute_flag_ch_5;
967 /* Mute flag for channel 5 is set to unmute (0) or mute (1). */
968
969 u8 mute_flag_ch_6;
970 /* Mute flag for channel 6 is set to unmute (0) or mute (1). */
971
972 u8 mute_flag_ch_7;
973 /* Mute flag for channel 7 is set to unmute (0) or mute (1). */
974
975 u8 mute_flag_ch_8;
976 /* Mute flag for channel 8 is set to unmute (0) or mute (1). */
977
978 u16 ramp_duration;
979/* Period (in milliseconds) over which the soft mute/unmute will be
980 * applied.
981 * Supported values: 0 (Default) to 0xFFFF
982 * The default of 0 means mute/unmute will be applied immediately.
983 */
984
985 u16 reserved_for_align;
986 /* Clients must set this field to zero.*/
987} __packed;
988
989#define ASM_PARAM_ID_AAC_STEREO_MIX_COEFF_SELECTION_FLAG_V2 (0x00010DD8)
990
991struct asm_aac_stereo_mix_coeff_selection_param_v2 {
992 struct apr_hdr hdr;
993 u32 param_id;
994 u32 param_size;
995 u32 aac_stereo_mix_coeff_flag;
996} __packed;
997
998/* Allows a client to connect the desired stream to
999 * the desired AFE port through the stream router
1000 *
1001 * This command allows the client to connect specified session to
1002 * specified AFE port. This is used for compressed streams only
1003 * opened using the #ASM_STREAM_CMD_OPEN_WRITE_COMPRESSED or
1004 * #ASM_STREAM_CMD_OPEN_READ_COMPRESSED command.
1005 *
1006 * @prerequisites
1007 * Session ID and AFE Port ID must be valid.
1008 * #ASM_STREAM_CMD_OPEN_WRITE_COMPRESSED or
1009 * #ASM_STREAM_CMD_OPEN_READ_COMPRESSED
1010 * must have been called on this session.
1011 */
1012
1013#define ADM_CMD_CONNECT_AFE_PORT_V5 0x0001032E
1014#define ADM_CMD_DISCONNECT_AFE_PORT_V5 0x0001032F
1015/* Enumeration for the Rx stream router ID.*/
1016#define ADM_STRTR_ID_RX 0
1017/* Enumeration for the Tx stream router ID.*/
1018#define ADM_STRTR_IDX 1
1019
1020/* Payload of the #ADM_CMD_CONNECT_AFE_PORT_V5 command.*/
1021struct adm_cmd_connect_afe_port_v5 {
1022 struct apr_hdr hdr;
1023 u8 mode;
1024/* ID of the stream router (RX/TX). Use the
1025 * ADM_STRTR_ID_RX or ADM_STRTR_IDX macros
1026 * to set this field.
1027 */
1028
1029 u8 session_id;
1030 /* Session ID of the stream to connect */
1031
1032 u16 afe_port_id;
1033 /* Port ID of the AFE port to connect to.*/
1034 u32 num_channels;
1035/* Number of device channels
1036 * Supported values: 2(Audio Sample Packet),
1037 * 8 (HBR Audio Stream Sample Packet)
1038 */
1039
1040 u32 sampling_rate;
1041/* Device sampling rate
1042 * Supported values: Any
1043 */
1044} __packed;
1045
1046
1047/* adsp_adm_api.h */
1048
1049
1050/* Port ID. Update afe_get_port_index
1051 * when a new port is added here.
1052 */
1053#define PRIMARY_I2S_RX 0
1054#define PRIMARY_I2S_TX 1
1055#define SECONDARY_I2S_RX 4
1056#define SECONDARY_I2S_TX 5
1057#define MI2S_RX 6
1058#define MI2S_TX 7
1059#define HDMI_RX 8
1060#define RSVD_2 9
1061#define RSVD_3 10
1062#define DIGI_MIC_TX 11
1063#define VOICE2_PLAYBACK_TX 0x8002
1064#define VOICE_RECORD_RX 0x8003
1065#define VOICE_RECORD_TX 0x8004
1066#define VOICE_PLAYBACK_TX 0x8005
1067
1068/* Slimbus Multi channel port id pool */
1069#define SLIMBUS_0_RX 0x4000
1070#define SLIMBUS_0_TX 0x4001
1071#define SLIMBUS_1_RX 0x4002
1072#define SLIMBUS_1_TX 0x4003
1073#define SLIMBUS_2_RX 0x4004
1074#define SLIMBUS_2_TX 0x4005
1075#define SLIMBUS_3_RX 0x4006
1076#define SLIMBUS_3_TX 0x4007
1077#define SLIMBUS_4_RX 0x4008
1078#define SLIMBUS_4_TX 0x4009
1079#define SLIMBUS_5_RX 0x400a
1080#define SLIMBUS_5_TX 0x400b
1081#define SLIMBUS_6_RX 0x400c
1082#define SLIMBUS_6_TX 0x400d
1083#define SLIMBUS_7_RX 0x400e
1084#define SLIMBUS_7_TX 0x400f
1085#define SLIMBUS_8_RX 0x4010
1086#define SLIMBUS_8_TX 0x4011
1087#define SLIMBUS_PORT_LAST SLIMBUS_8_TX
1088#define INT_BT_SCO_RX 0x3000
1089#define INT_BT_SCO_TX 0x3001
1090#define INT_BT_A2DP_RX 0x3002
1091#define INT_FM_RX 0x3004
1092#define INT_FM_TX 0x3005
1093#define RT_PROXY_PORT_001_RX 0x2000
1094#define RT_PROXY_PORT_001_TX 0x2001
Raja Mallik425e1d32018-05-20 19:21:10 +05301095#define AFE_LOOPBACK_TX 0x6001
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301096#define DISPLAY_PORT_RX 0x6020
1097
1098#define AFE_PORT_INVALID 0xFFFF
1099#define SLIMBUS_INVALID AFE_PORT_INVALID
1100
1101#define AFE_PORT_CMD_START 0x000100ca
1102
1103#define AFE_EVENT_RTPORT_START 0
1104#define AFE_EVENT_RTPORT_STOP 1
1105#define AFE_EVENT_RTPORT_LOW_WM 2
1106#define AFE_EVENT_RTPORT_HI_WM 3
1107
1108#define ADSP_AFE_VERSION 0x00200000
1109
1110/* Size of the range of port IDs for the audio interface. */
1111#define AFE_PORT_ID_AUDIO_IF_PORT_RANGE_SIZE 0xF
1112
1113/* Size of the range of port IDs for internal BT-FM ports. */
1114#define AFE_PORT_ID_INTERNAL_BT_FM_RANGE_SIZE 0x6
1115
1116/* Size of the range of port IDs for SLIMbus<sup>&reg;
1117 * </sup> multichannel
1118 * ports.
1119 */
1120#define AFE_PORT_ID_SLIMBUS_RANGE_SIZE 0xA
1121
1122/* Size of the range of port IDs for real-time proxy ports. */
1123#define AFE_PORT_ID_RT_PROXY_PORT_RANGE_SIZE 0x2
1124
1125/* Size of the range of port IDs for pseudoports. */
1126#define AFE_PORT_ID_PSEUDOPORT_RANGE_SIZE 0x5
1127
1128/* Start of the range of port IDs for the audio interface. */
1129#define AFE_PORT_ID_AUDIO_IF_PORT_RANGE_START 0x1000
1130
1131/* End of the range of port IDs for the audio interface. */
1132#define AFE_PORT_ID_AUDIO_IF_PORT_RANGE_END \
1133 (AFE_PORT_ID_AUDIO_IF_PORT_RANGE_START +\
1134 AFE_PORT_ID_AUDIO_IF_PORT_RANGE_SIZE - 1)
1135
1136/* Start of the range of port IDs for real-time proxy ports. */
1137#define AFE_PORT_ID_RT_PROXY_PORT_RANGE_START 0x2000
1138
1139/* End of the range of port IDs for real-time proxy ports. */
1140#define AFE_PORT_ID_RT_PROXY_PORT_RANGE_END \
1141 (AFE_PORT_ID_RT_PROXY_PORT_RANGE_START +\
1142 AFE_PORT_ID_RT_PROXY_PORT_RANGE_SIZE-1)
1143
1144/* Start of the range of port IDs for internal BT-FM devices. */
1145#define AFE_PORT_ID_INTERNAL_BT_FM_RANGE_START 0x3000
1146
1147/* End of the range of port IDs for internal BT-FM devices. */
1148#define AFE_PORT_ID_INTERNAL_BT_FM_RANGE_END \
1149 (AFE_PORT_ID_INTERNAL_BT_FM_RANGE_START +\
1150 AFE_PORT_ID_INTERNAL_BT_FM_RANGE_SIZE-1)
1151
1152/* Start of the range of port IDs for SLIMbus devices. */
1153#define AFE_PORT_ID_SLIMBUS_RANGE_START 0x4000
1154
1155/* End of the range of port IDs for SLIMbus devices. */
1156#define AFE_PORT_ID_SLIMBUS_RANGE_END \
1157 (AFE_PORT_ID_SLIMBUS_RANGE_START +\
1158 AFE_PORT_ID_SLIMBUS_RANGE_SIZE-1)
1159
1160/* Start of the range of port IDs for pseudoports. */
1161#define AFE_PORT_ID_PSEUDOPORT_RANGE_START 0x8001
1162
1163/* End of the range of port IDs for pseudoports. */
1164#define AFE_PORT_ID_PSEUDOPORT_RANGE_END \
1165 (AFE_PORT_ID_PSEUDOPORT_RANGE_START +\
1166 AFE_PORT_ID_PSEUDOPORT_RANGE_SIZE-1)
1167
1168/* Start of the range of port IDs for TDM devices. */
1169#define AFE_PORT_ID_TDM_PORT_RANGE_START 0x9000
1170
1171/* End of the range of port IDs for TDM devices. */
1172#define AFE_PORT_ID_TDM_PORT_RANGE_END \
Rohit Kumara5077932017-09-10 22:05:05 +05301173 (AFE_PORT_ID_TDM_PORT_RANGE_START+0x50-1)
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301174
1175/* Size of the range of port IDs for TDM ports. */
1176#define AFE_PORT_ID_TDM_PORT_RANGE_SIZE \
1177 (AFE_PORT_ID_TDM_PORT_RANGE_END - \
1178 AFE_PORT_ID_TDM_PORT_RANGE_START+1)
1179
1180#define AFE_PORT_ID_PRIMARY_MI2S_RX 0x1000
1181#define AFE_PORT_ID_PRIMARY_MI2S_TX 0x1001
1182#define AFE_PORT_ID_SECONDARY_MI2S_RX 0x1002
1183#define AFE_PORT_ID_SECONDARY_MI2S_TX 0x1003
1184#define AFE_PORT_ID_TERTIARY_MI2S_RX 0x1004
1185#define AFE_PORT_ID_TERTIARY_MI2S_TX 0x1005
1186#define AFE_PORT_ID_QUATERNARY_MI2S_RX 0x1006
1187#define AFE_PORT_ID_QUATERNARY_MI2S_TX 0x1007
1188#define AUDIO_PORT_ID_I2S_RX 0x1008
1189#define AFE_PORT_ID_DIGITAL_MIC_TX 0x1009
1190#define AFE_PORT_ID_PRIMARY_PCM_RX 0x100A
1191#define AFE_PORT_ID_PRIMARY_PCM_TX 0x100B
1192#define AFE_PORT_ID_SECONDARY_PCM_RX 0x100C
1193#define AFE_PORT_ID_SECONDARY_PCM_TX 0x100D
1194#define AFE_PORT_ID_MULTICHAN_HDMI_RX 0x100E
1195#define AFE_PORT_ID_SECONDARY_MI2S_RX_SD1 0x1010
1196#define AFE_PORT_ID_TERTIARY_PCM_RX 0x1012
1197#define AFE_PORT_ID_TERTIARY_PCM_TX 0x1013
1198#define AFE_PORT_ID_QUATERNARY_PCM_RX 0x1014
1199#define AFE_PORT_ID_QUATERNARY_PCM_TX 0x1015
1200#define AFE_PORT_ID_QUINARY_MI2S_RX 0x1016
1201#define AFE_PORT_ID_QUINARY_MI2S_TX 0x1017
1202/* ID of the senary MI2S Rx port. */
1203#define AFE_PORT_ID_SENARY_MI2S_RX 0x1018
1204/* ID of the senary MI2S Tx port. */
1205#define AFE_PORT_ID_SENARY_MI2S_TX 0x1019
Rohit Kumara5077932017-09-10 22:05:05 +05301206
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301207/* ID of the Internal 0 MI2S Rx port */
1208#define AFE_PORT_ID_INT0_MI2S_RX 0x102E
1209/* ID of the Internal 0 MI2S Tx port */
1210#define AFE_PORT_ID_INT0_MI2S_TX 0x102F
1211/* ID of the Internal 1 MI2S Rx port */
1212#define AFE_PORT_ID_INT1_MI2S_RX 0x1030
1213/* ID of the Internal 1 MI2S Tx port */
1214#define AFE_PORT_ID_INT1_MI2S_TX 0x1031
1215/* ID of the Internal 2 MI2S Rx port */
1216#define AFE_PORT_ID_INT2_MI2S_RX 0x1032
1217/* ID of the Internal 2 MI2S Tx port */
1218#define AFE_PORT_ID_INT2_MI2S_TX 0x1033
1219/* ID of the Internal 3 MI2S Rx port */
1220#define AFE_PORT_ID_INT3_MI2S_RX 0x1034
1221/* ID of the Internal 3 MI2S Tx port */
1222#define AFE_PORT_ID_INT3_MI2S_TX 0x1035
1223/* ID of the Internal 4 MI2S Rx port */
1224#define AFE_PORT_ID_INT4_MI2S_RX 0x1036
1225/* ID of the Internal 4 MI2S Tx port */
1226#define AFE_PORT_ID_INT4_MI2S_TX 0x1037
1227/* ID of the Internal 5 MI2S Rx port */
1228#define AFE_PORT_ID_INT5_MI2S_RX 0x1038
1229/* ID of the Internal 5 MI2S Tx port */
1230#define AFE_PORT_ID_INT5_MI2S_TX 0x1039
1231/* ID of the Internal 6 MI2S Rx port */
1232#define AFE_PORT_ID_INT6_MI2S_RX 0x103A
1233/* ID of the Internal 6 MI2S Tx port */
1234#define AFE_PORT_ID_INT6_MI2S_TX 0x103B
Rohit Kumara5077932017-09-10 22:05:05 +05301235
1236#define AFE_PORT_ID_QUINARY_PCM_RX 0x103C
1237#define AFE_PORT_ID_QUINARY_PCM_TX 0x103D
1238
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301239#define AFE_PORT_ID_SPDIF_RX 0x5000
1240#define AFE_PORT_ID_RT_PROXY_PORT_001_RX 0x2000
1241#define AFE_PORT_ID_RT_PROXY_PORT_001_TX 0x2001
1242#define AFE_PORT_ID_INTERNAL_BT_SCO_RX 0x3000
1243#define AFE_PORT_ID_INTERNAL_BT_SCO_TX 0x3001
1244#define AFE_PORT_ID_INTERNAL_BT_A2DP_RX 0x3002
1245#define AFE_PORT_ID_INTERNAL_FM_RX 0x3004
1246#define AFE_PORT_ID_INTERNAL_FM_TX 0x3005
1247/* SLIMbus Rx port on channel 0. */
1248#define AFE_PORT_ID_SLIMBUS_MULTI_CHAN_0_RX 0x4000
1249/* SLIMbus Tx port on channel 0. */
1250#define AFE_PORT_ID_SLIMBUS_MULTI_CHAN_0_TX 0x4001
1251/* SLIMbus Rx port on channel 1. */
1252#define AFE_PORT_ID_SLIMBUS_MULTI_CHAN_1_RX 0x4002
1253/* SLIMbus Tx port on channel 1. */
1254#define AFE_PORT_ID_SLIMBUS_MULTI_CHAN_1_TX 0x4003
1255/* SLIMbus Rx port on channel 2. */
1256#define AFE_PORT_ID_SLIMBUS_MULTI_CHAN_2_RX 0x4004
1257/* SLIMbus Tx port on channel 2. */
1258#define AFE_PORT_ID_SLIMBUS_MULTI_CHAN_2_TX 0x4005
1259/* SLIMbus Rx port on channel 3. */
1260#define AFE_PORT_ID_SLIMBUS_MULTI_CHAN_3_RX 0x4006
1261/* SLIMbus Tx port on channel 3. */
1262#define AFE_PORT_ID_SLIMBUS_MULTI_CHAN_3_TX 0x4007
1263/* SLIMbus Rx port on channel 4. */
1264#define AFE_PORT_ID_SLIMBUS_MULTI_CHAN_4_RX 0x4008
1265/* SLIMbus Tx port on channel 4. */
1266#define AFE_PORT_ID_SLIMBUS_MULTI_CHAN_4_TX 0x4009
1267/* SLIMbus Rx port on channel 5. */
1268#define AFE_PORT_ID_SLIMBUS_MULTI_CHAN_5_RX 0x400a
1269/* SLIMbus Tx port on channel 5. */
1270#define AFE_PORT_ID_SLIMBUS_MULTI_CHAN_5_TX 0x400b
1271/* SLIMbus Rx port on channel 6. */
1272#define AFE_PORT_ID_SLIMBUS_MULTI_CHAN_6_RX 0x400c
1273/* SLIMbus Tx port on channel 6. */
1274#define AFE_PORT_ID_SLIMBUS_MULTI_CHAN_6_TX 0x400d
1275/* SLIMbus Rx port on channel 7. */
1276#define AFE_PORT_ID_SLIMBUS_MULTI_CHAN_7_RX 0x400e
1277/* SLIMbus Tx port on channel 7. */
1278#define AFE_PORT_ID_SLIMBUS_MULTI_CHAN_7_TX 0x400f
1279/* SLIMbus Rx port on channel 8. */
1280#define AFE_PORT_ID_SLIMBUS_MULTI_CHAN_8_RX 0x4010
1281/* SLIMbus Tx port on channel 8. */
1282#define AFE_PORT_ID_SLIMBUS_MULTI_CHAN_8_TX 0x4011
1283/* AFE Rx port for audio over Display port */
1284#define AFE_PORT_ID_HDMI_OVER_DP_RX 0x6020
1285/*USB AFE port */
1286#define AFE_PORT_ID_USB_RX 0x7000
1287#define AFE_PORT_ID_USB_TX 0x7001
1288
1289/* Generic pseudoport 1. */
1290#define AFE_PORT_ID_PSEUDOPORT_01 0x8001
1291/* Generic pseudoport 2. */
1292#define AFE_PORT_ID_PSEUDOPORT_02 0x8002
1293
1294/* @xreflabel{hdr:AfePortIdPrimaryAuxPcmTx}
1295 * Primary Aux PCM Tx port ID.
1296 */
1297#define AFE_PORT_ID_PRIMARY_PCM_TX 0x100B
1298/* Pseudoport that corresponds to the voice Rx path.
1299 * For recording, the voice Rx path samples are written to this
1300 * port and consumed by the audio path.
1301 */
1302
1303#define AFE_PORT_ID_VOICE_RECORD_RX 0x8003
1304
1305/* Pseudoport that corresponds to the voice Tx path.
1306 * For recording, the voice Tx path samples are written to this
1307 * port and consumed by the audio path.
1308 */
1309
1310#define AFE_PORT_ID_VOICE_RECORD_TX 0x8004
1311/* Pseudoport that corresponds to in-call voice delivery samples.
1312 * During in-call audio delivery, the audio path delivers samples
1313 * to this port from where the voice path delivers them on the
1314 * Rx path.
1315 */
1316#define AFE_PORT_ID_VOICE2_PLAYBACK_TX 0x8002
1317#define AFE_PORT_ID_VOICE_PLAYBACK_TX 0x8005
1318
1319#define AFE_PORT_ID_PRIMARY_TDM_RX \
1320 (AFE_PORT_ID_TDM_PORT_RANGE_START + 0x00)
1321#define AFE_PORT_ID_PRIMARY_TDM_RX_1 \
1322 (AFE_PORT_ID_PRIMARY_TDM_RX + 0x02)
1323#define AFE_PORT_ID_PRIMARY_TDM_RX_2 \
1324 (AFE_PORT_ID_PRIMARY_TDM_RX + 0x04)
1325#define AFE_PORT_ID_PRIMARY_TDM_RX_3 \
1326 (AFE_PORT_ID_PRIMARY_TDM_RX + 0x06)
1327#define AFE_PORT_ID_PRIMARY_TDM_RX_4 \
1328 (AFE_PORT_ID_PRIMARY_TDM_RX + 0x08)
1329#define AFE_PORT_ID_PRIMARY_TDM_RX_5 \
1330 (AFE_PORT_ID_PRIMARY_TDM_RX + 0x0A)
1331#define AFE_PORT_ID_PRIMARY_TDM_RX_6 \
1332 (AFE_PORT_ID_PRIMARY_TDM_RX + 0x0C)
1333#define AFE_PORT_ID_PRIMARY_TDM_RX_7 \
1334 (AFE_PORT_ID_PRIMARY_TDM_RX + 0x0E)
1335
1336#define AFE_PORT_ID_PRIMARY_TDM_TX \
1337 (AFE_PORT_ID_TDM_PORT_RANGE_START + 0x01)
1338#define AFE_PORT_ID_PRIMARY_TDM_TX_1 \
1339 (AFE_PORT_ID_PRIMARY_TDM_TX + 0x02)
1340#define AFE_PORT_ID_PRIMARY_TDM_TX_2 \
1341 (AFE_PORT_ID_PRIMARY_TDM_TX + 0x04)
1342#define AFE_PORT_ID_PRIMARY_TDM_TX_3 \
1343 (AFE_PORT_ID_PRIMARY_TDM_TX + 0x06)
1344#define AFE_PORT_ID_PRIMARY_TDM_TX_4 \
1345 (AFE_PORT_ID_PRIMARY_TDM_TX + 0x08)
1346#define AFE_PORT_ID_PRIMARY_TDM_TX_5 \
1347 (AFE_PORT_ID_PRIMARY_TDM_TX + 0x0A)
1348#define AFE_PORT_ID_PRIMARY_TDM_TX_6 \
1349 (AFE_PORT_ID_PRIMARY_TDM_TX + 0x0C)
1350#define AFE_PORT_ID_PRIMARY_TDM_TX_7 \
1351 (AFE_PORT_ID_PRIMARY_TDM_TX + 0x0E)
1352
1353#define AFE_PORT_ID_SECONDARY_TDM_RX \
1354 (AFE_PORT_ID_TDM_PORT_RANGE_START + 0x10)
1355#define AFE_PORT_ID_SECONDARY_TDM_RX_1 \
1356 (AFE_PORT_ID_SECONDARY_TDM_RX + 0x02)
1357#define AFE_PORT_ID_SECONDARY_TDM_RX_2 \
1358 (AFE_PORT_ID_SECONDARY_TDM_RX + 0x04)
1359#define AFE_PORT_ID_SECONDARY_TDM_RX_3 \
1360 (AFE_PORT_ID_SECONDARY_TDM_RX + 0x06)
1361#define AFE_PORT_ID_SECONDARY_TDM_RX_4 \
1362 (AFE_PORT_ID_SECONDARY_TDM_RX + 0x08)
1363#define AFE_PORT_ID_SECONDARY_TDM_RX_5 \
1364 (AFE_PORT_ID_SECONDARY_TDM_RX + 0x0A)
1365#define AFE_PORT_ID_SECONDARY_TDM_RX_6 \
1366 (AFE_PORT_ID_SECONDARY_TDM_RX + 0x0C)
1367#define AFE_PORT_ID_SECONDARY_TDM_RX_7 \
1368 (AFE_PORT_ID_SECONDARY_TDM_RX + 0x0E)
1369
1370#define AFE_PORT_ID_SECONDARY_TDM_TX \
1371 (AFE_PORT_ID_TDM_PORT_RANGE_START + 0x11)
1372#define AFE_PORT_ID_SECONDARY_TDM_TX_1 \
1373 (AFE_PORT_ID_SECONDARY_TDM_TX + 0x02)
1374#define AFE_PORT_ID_SECONDARY_TDM_TX_2 \
1375 (AFE_PORT_ID_SECONDARY_TDM_TX + 0x04)
1376#define AFE_PORT_ID_SECONDARY_TDM_TX_3 \
1377 (AFE_PORT_ID_SECONDARY_TDM_TX + 0x06)
1378#define AFE_PORT_ID_SECONDARY_TDM_TX_4 \
1379 (AFE_PORT_ID_SECONDARY_TDM_TX + 0x08)
1380#define AFE_PORT_ID_SECONDARY_TDM_TX_5 \
1381 (AFE_PORT_ID_SECONDARY_TDM_TX + 0x0A)
1382#define AFE_PORT_ID_SECONDARY_TDM_TX_6 \
1383 (AFE_PORT_ID_SECONDARY_TDM_TX + 0x0C)
1384#define AFE_PORT_ID_SECONDARY_TDM_TX_7 \
1385 (AFE_PORT_ID_SECONDARY_TDM_TX + 0x0E)
1386
1387#define AFE_PORT_ID_TERTIARY_TDM_RX \
1388 (AFE_PORT_ID_TDM_PORT_RANGE_START + 0x20)
1389#define AFE_PORT_ID_TERTIARY_TDM_RX_1 \
1390 (AFE_PORT_ID_TERTIARY_TDM_RX + 0x02)
1391#define AFE_PORT_ID_TERTIARY_TDM_RX_2 \
1392 (AFE_PORT_ID_TERTIARY_TDM_RX + 0x04)
1393#define AFE_PORT_ID_TERTIARY_TDM_RX_3 \
1394 (AFE_PORT_ID_TERTIARY_TDM_RX + 0x06)
1395#define AFE_PORT_ID_TERTIARY_TDM_RX_4 \
1396 (AFE_PORT_ID_TERTIARY_TDM_RX + 0x08)
1397#define AFE_PORT_ID_TERTIARY_TDM_RX_5 \
1398 (AFE_PORT_ID_TERTIARY_TDM_RX + 0x0A)
1399#define AFE_PORT_ID_TERTIARY_TDM_RX_6 \
1400 (AFE_PORT_ID_TERTIARY_TDM_RX + 0x0C)
1401#define AFE_PORT_ID_TERTIARY_TDM_RX_7 \
1402 (AFE_PORT_ID_TERTIARY_TDM_RX + 0x0E)
1403
1404#define AFE_PORT_ID_TERTIARY_TDM_TX \
1405 (AFE_PORT_ID_TDM_PORT_RANGE_START + 0x21)
1406#define AFE_PORT_ID_TERTIARY_TDM_TX_1 \
1407 (AFE_PORT_ID_TERTIARY_TDM_TX + 0x02)
1408#define AFE_PORT_ID_TERTIARY_TDM_TX_2 \
1409 (AFE_PORT_ID_TERTIARY_TDM_TX + 0x04)
1410#define AFE_PORT_ID_TERTIARY_TDM_TX_3 \
1411 (AFE_PORT_ID_TERTIARY_TDM_TX + 0x06)
1412#define AFE_PORT_ID_TERTIARY_TDM_TX_4 \
1413 (AFE_PORT_ID_TERTIARY_TDM_TX + 0x08)
1414#define AFE_PORT_ID_TERTIARY_TDM_TX_5 \
1415 (AFE_PORT_ID_TERTIARY_TDM_TX + 0x0A)
1416#define AFE_PORT_ID_TERTIARY_TDM_TX_6 \
1417 (AFE_PORT_ID_TERTIARY_TDM_TX + 0x0C)
1418#define AFE_PORT_ID_TERTIARY_TDM_TX_7 \
1419 (AFE_PORT_ID_TERTIARY_TDM_TX + 0x0E)
1420
1421#define AFE_PORT_ID_QUATERNARY_TDM_RX \
1422 (AFE_PORT_ID_TDM_PORT_RANGE_START + 0x30)
1423#define AFE_PORT_ID_QUATERNARY_TDM_RX_1 \
1424 (AFE_PORT_ID_QUATERNARY_TDM_RX + 0x02)
1425#define AFE_PORT_ID_QUATERNARY_TDM_RX_2 \
1426 (AFE_PORT_ID_QUATERNARY_TDM_RX + 0x04)
1427#define AFE_PORT_ID_QUATERNARY_TDM_RX_3 \
1428 (AFE_PORT_ID_QUATERNARY_TDM_RX + 0x06)
1429#define AFE_PORT_ID_QUATERNARY_TDM_RX_4 \
1430 (AFE_PORT_ID_QUATERNARY_TDM_RX + 0x08)
1431#define AFE_PORT_ID_QUATERNARY_TDM_RX_5 \
1432 (AFE_PORT_ID_QUATERNARY_TDM_RX + 0x0A)
1433#define AFE_PORT_ID_QUATERNARY_TDM_RX_6 \
1434 (AFE_PORT_ID_QUATERNARY_TDM_RX + 0x0C)
1435#define AFE_PORT_ID_QUATERNARY_TDM_RX_7 \
1436 (AFE_PORT_ID_QUATERNARY_TDM_RX + 0x0E)
1437
1438#define AFE_PORT_ID_QUATERNARY_TDM_TX \
1439 (AFE_PORT_ID_TDM_PORT_RANGE_START + 0x31)
1440#define AFE_PORT_ID_QUATERNARY_TDM_TX_1 \
1441 (AFE_PORT_ID_QUATERNARY_TDM_TX + 0x02)
1442#define AFE_PORT_ID_QUATERNARY_TDM_TX_2 \
1443 (AFE_PORT_ID_QUATERNARY_TDM_TX + 0x04)
1444#define AFE_PORT_ID_QUATERNARY_TDM_TX_3 \
1445 (AFE_PORT_ID_QUATERNARY_TDM_TX + 0x06)
1446#define AFE_PORT_ID_QUATERNARY_TDM_TX_4 \
1447 (AFE_PORT_ID_QUATERNARY_TDM_TX + 0x08)
1448#define AFE_PORT_ID_QUATERNARY_TDM_TX_5 \
1449 (AFE_PORT_ID_QUATERNARY_TDM_TX + 0x0A)
1450#define AFE_PORT_ID_QUATERNARY_TDM_TX_6 \
1451 (AFE_PORT_ID_QUATERNARY_TDM_TX + 0x0C)
1452#define AFE_PORT_ID_QUATERNARY_TDM_TX_7 \
1453 (AFE_PORT_ID_QUATERNARY_TDM_TX + 0x0E)
1454
Rohit Kumara5077932017-09-10 22:05:05 +05301455#define AFE_PORT_ID_QUINARY_TDM_RX \
1456 (AFE_PORT_ID_TDM_PORT_RANGE_START + 0x40)
1457#define AFE_PORT_ID_QUINARY_TDM_RX_1 \
1458 (AFE_PORT_ID_QUINARY_TDM_RX + 0x02)
1459#define AFE_PORT_ID_QUINARY_TDM_RX_2 \
1460 (AFE_PORT_ID_QUINARY_TDM_RX + 0x04)
1461#define AFE_PORT_ID_QUINARY_TDM_RX_3 \
1462 (AFE_PORT_ID_QUINARY_TDM_RX + 0x06)
1463#define AFE_PORT_ID_QUINARY_TDM_RX_4 \
1464 (AFE_PORT_ID_QUINARY_TDM_RX + 0x08)
1465#define AFE_PORT_ID_QUINARY_TDM_RX_5 \
1466 (AFE_PORT_ID_QUINARY_TDM_RX + 0x0A)
1467#define AFE_PORT_ID_QUINARY_TDM_RX_6 \
1468 (AFE_PORT_ID_QUINARY_TDM_RX + 0x0C)
1469#define AFE_PORT_ID_QUINARY_TDM_RX_7 \
1470 (AFE_PORT_ID_QUINARY_TDM_RX + 0x0E)
1471
1472#define AFE_PORT_ID_QUINARY_TDM_TX \
1473 (AFE_PORT_ID_TDM_PORT_RANGE_START + 0x41)
1474#define AFE_PORT_ID_QUINARY_TDM_TX_1 \
1475 (AFE_PORT_ID_QUINARY_TDM_TX + 0x02)
1476#define AFE_PORT_ID_QUINARY_TDM_TX_2 \
1477 (AFE_PORT_ID_QUINARY_TDM_TX + 0x04)
1478#define AFE_PORT_ID_QUINARY_TDM_TX_3 \
1479 (AFE_PORT_ID_QUINARY_TDM_TX + 0x06)
1480#define AFE_PORT_ID_QUINARY_TDM_TX_4 \
1481 (AFE_PORT_ID_QUINARY_TDM_TX + 0x08)
1482#define AFE_PORT_ID_QUINARY_TDM_TX_5 \
1483 (AFE_PORT_ID_QUINARY_TDM_TX + 0x0A)
1484#define AFE_PORT_ID_QUINARY_TDM_TX_6 \
1485 (AFE_PORT_ID_QUINARY_TDM_TX + 0x0C)
1486#define AFE_PORT_ID_QUINARY_TDM_TX_7 \
1487 (AFE_PORT_ID_QUINARY_TDM_TX + 0x0E)
1488
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301489#define AFE_PORT_ID_INVALID 0xFFFF
1490
1491#define AAC_ENC_MODE_AAC_LC 0x02
1492#define AAC_ENC_MODE_AAC_P 0x05
1493#define AAC_ENC_MODE_EAAC_P 0x1D
1494
1495#define AFE_PSEUDOPORT_CMD_START 0x000100cf
1496struct afe_pseudoport_start_command {
1497 struct apr_hdr hdr;
1498 u16 port_id; /* Pseudo Port 1 = 0x8000 */
1499 /* Pseudo Port 2 = 0x8001 */
1500 /* Pseudo Port 3 = 0x8002 */
1501 u16 timing; /* FTRT = 0 , AVTimer = 1, */
1502} __packed;
1503
1504#define AFE_PSEUDOPORT_CMD_STOP 0x000100d0
1505struct afe_pseudoport_stop_command {
1506 struct apr_hdr hdr;
1507 u16 port_id; /* Pseudo Port 1 = 0x8000 */
1508 /* Pseudo Port 2 = 0x8001 */
1509 /* Pseudo Port 3 = 0x8002 */
1510 u16 reserved;
1511} __packed;
1512
1513
1514#define AFE_MODULE_SIDETONE_IIR_FILTER 0x00010202
1515#define AFE_PARAM_ID_ENABLE 0x00010203
1516
1517/* Payload of the #AFE_PARAM_ID_ENABLE
1518 * parameter, which enables or
1519 * disables any module.
1520 * The fixed size of this structure is four bytes.
1521 */
1522
1523struct afe_mod_enable_param {
1524 u16 enable;
1525 /* Enables (1) or disables (0) the module. */
1526
1527 u16 reserved;
1528 /* This field must be set to zero. */
1529} __packed;
1530
1531/* ID of the configuration parameter used by the
1532 * #AFE_MODULE_SIDETONE_IIR_FILTER module.
1533 */
1534#define AFE_PARAM_ID_SIDETONE_IIR_FILTER_CONFIG 0x00010204
1535#define MAX_SIDETONE_IIR_DATA_SIZE 224
1536#define MAX_NO_IIR_FILTER_STAGE 10
1537
1538struct afe_sidetone_iir_filter_config_params {
1539 u16 num_biquad_stages;
1540/* Number of stages.
1541 * Supported values: Minimum of 5 and maximum of 10
1542 */
1543
1544 u16 pregain;
1545/* Pregain for the compensating filter response.
1546 * Supported values: Any number in Q13 format
1547 */
1548 uint8_t iir_config[MAX_SIDETONE_IIR_DATA_SIZE];
1549} __packed;
1550
1551#define AFE_MODULE_LOOPBACK 0x00010205
1552#define AFE_PARAM_ID_LOOPBACK_GAIN_PER_PATH 0x00010206
1553
1554/* Payload of the #AFE_PARAM_ID_LOOPBACK_GAIN_PER_PATH parameter,
1555 * which gets/sets loopback gain of a port to an Rx port.
1556 * The Tx port ID of the loopback is part of the set_param command.
1557 */
1558
1559/* Payload of the #AFE_PORT_CMD_SET_PARAM_V2 command's
1560 * configuration/calibration settings for the AFE port.
1561 */
1562struct afe_port_cmd_set_param_v2 {
1563 u16 port_id;
1564/* Port interface and direction (Rx or Tx) to start. */
1565
1566 u16 payload_size;
1567/* Actual size of the payload in bytes.
1568 * This is used for parsing the parameter payload.
1569 * Supported values: > 0
1570 */
1571
1572u32 payload_address_lsw;
1573/* LSW of 64 bit Payload address.
1574 * Address should be 32-byte,
1575 * 4kbyte aligned and must be contiguous memory.
1576 */
1577
1578u32 payload_address_msw;
1579/* MSW of 64 bit Payload address.
1580 * In case of 32-bit shared memory address,
1581 * this field must be set to zero.
1582 * In case of 36-bit shared memory address,
1583 * bit-4 to bit-31 must be set to zero.
1584 * Address should be 32-byte, 4kbyte aligned
1585 * and must be contiguous memory.
1586 */
1587
1588u32 mem_map_handle;
1589/* Memory map handle returned by
1590 * AFE_SERVICE_CMD_SHARED_MEM_MAP_REGIONS commands.
1591 * Supported Values:
1592 * - NULL -- Message. The parameter data is in-band.
1593 * - Non-NULL -- The parameter data is Out-band.Pointer to
1594 * the physical address
1595 * in shared memory of the payload data.
1596 * An optional field is available if parameter
1597 * data is in-band:
1598 * afe_param_data_v2 param_data[...].
1599 * For detailed payload content, see the
1600 * afe_port_param_data_v2 structure.
1601 */
1602} __packed;
1603
1604#define AFE_PORT_CMD_SET_PARAM_V2 0x000100EF
1605
1606struct afe_port_param_data_v2 {
1607 u32 module_id;
1608/* ID of the module to be configured.
1609 * Supported values: Valid module ID
1610 */
1611
1612u32 param_id;
1613/* ID of the parameter corresponding to the supported parameters
1614 * for the module ID.
1615 * Supported values: Valid parameter ID
1616 */
1617
1618u16 param_size;
1619/* Actual size of the data for the
1620 * module_id/param_id pair. The size is a
1621 * multiple of four bytes.
1622 * Supported values: > 0
1623 */
1624
1625u16 reserved;
1626/* This field must be set to zero.
1627 */
1628} __packed;
1629
1630struct afe_loopback_gain_per_path_param {
1631 struct apr_hdr hdr;
1632 struct afe_port_cmd_set_param_v2 param;
1633 struct afe_port_param_data_v2 pdata;
1634 u16 rx_port_id;
1635/* Rx port of the loopback. */
1636
1637u16 gain;
1638/* Loopback gain per path of the port.
1639 * Supported values: Any number in Q13 format
1640 */
1641} __packed;
1642
1643/* Parameter ID used to configure and enable/disable the
1644 * loopback path. The difference with respect to the existing
1645 * API, AFE_PORT_CMD_LOOPBACK, is that it allows Rx port to be
1646 * configured as source port in loopback path. Port-id in
1647 * AFE_PORT_CMD_SET_PARAM cmd is the source port which can be
1648 * Tx or Rx port. In addition, we can configure the type of
1649 * routing mode to handle different use cases.
1650 */
1651#define AFE_PARAM_ID_LOOPBACK_CONFIG 0x0001020B
1652#define AFE_API_VERSION_LOOPBACK_CONFIG 0x1
1653
1654enum afe_loopback_routing_mode {
1655 LB_MODE_DEFAULT = 1,
1656 /* Regular loopback from source to destination port */
1657 LB_MODE_SIDETONE,
1658 /* Sidetone feed from Tx source to Rx destination port */
1659 LB_MODE_EC_REF_VOICE_AUDIO,
1660 /* Echo canceller reference, voice + audio + DTMF */
1661 LB_MODE_EC_REF_VOICE
1662 /* Echo canceller reference, voice alone */
1663} __packed;
1664
1665/* Payload of the #AFE_PARAM_ID_LOOPBACK_CONFIG ,
1666 * which enables/disables one AFE loopback.
1667 */
1668struct afe_loopback_cfg_v1 {
1669 struct apr_hdr hdr;
1670 struct afe_port_cmd_set_param_v2 param;
1671 struct afe_port_param_data_v2 pdata;
1672 u32 loopback_cfg_minor_version;
1673/* Minor version used for tracking the version of the RMC module
1674 * configuration interface.
1675 * Supported values: #AFE_API_VERSION_LOOPBACK_CONFIG
1676 */
1677 u16 dst_port_id;
1678 /* Destination Port Id. */
1679 u16 routing_mode;
1680/* Specifies data path type from src to dest port.
1681 * Supported values:
1682 * #LB_MODE_DEFAULT
1683 * #LB_MODE_SIDETONE
1684 * #LB_MODE_EC_REF_VOICE_AUDIO
1685 * #LB_MODE_EC_REF_VOICE_A
1686 * #LB_MODE_EC_REF_VOICE
1687 */
1688
1689 u16 enable;
1690/* Specifies whether to enable (1) or
1691 * disable (0) an AFE loopback.
1692 */
1693 u16 reserved;
1694/* Reserved for 32-bit alignment. This field must be set to 0.
1695 */
1696
1697} __packed;
1698
1699struct afe_loopback_sidetone_gain {
1700 u16 rx_port_id;
1701 u16 gain;
1702} __packed;
1703
1704struct loopback_cfg_data {
1705 u32 loopback_cfg_minor_version;
1706/* Minor version used for tracking the version of the RMC module
1707 * configuration interface.
1708 * Supported values: #AFE_API_VERSION_LOOPBACK_CONFIG
1709 */
1710 u16 dst_port_id;
1711 /* Destination Port Id. */
1712 u16 routing_mode;
1713/* Specifies data path type from src to dest port.
1714 * Supported values:
1715 * #LB_MODE_DEFAULT
1716 * #LB_MODE_SIDETONE
1717 * #LB_MODE_EC_REF_VOICE_AUDIO
1718 * #LB_MODE_EC_REF_VOICE_A
1719 * #LB_MODE_EC_REF_VOICE
1720 */
1721
1722 u16 enable;
1723/* Specifies whether to enable (1) or
1724 * disable (0) an AFE loopback.
1725 */
1726 u16 reserved;
1727/* Reserved for 32-bit alignment. This field must be set to 0.
1728 */
1729} __packed;
1730
1731struct afe_st_loopback_cfg_v1 {
1732 struct apr_hdr hdr;
1733 struct afe_port_cmd_set_param_v2 param;
1734 struct afe_port_param_data_v2 gain_pdata;
1735 struct afe_loopback_sidetone_gain gain_data;
1736 struct afe_port_param_data_v2 cfg_pdata;
1737 struct loopback_cfg_data cfg_data;
1738} __packed;
1739
1740struct afe_loopback_iir_cfg_v2 {
1741 struct apr_hdr hdr;
1742 struct afe_port_cmd_set_param_v2 param;
1743 struct afe_port_param_data_v2 st_iir_enable_pdata;
1744 struct afe_mod_enable_param st_iir_mode_enable_data;
1745 struct afe_port_param_data_v2 st_iir_filter_config_pdata;
1746 struct afe_sidetone_iir_filter_config_params st_iir_filter_config_data;
1747} __packed;
1748#define AFE_MODULE_SPEAKER_PROTECTION 0x00010209
1749#define AFE_PARAM_ID_SPKR_PROT_CONFIG 0x0001020a
1750#define AFE_API_VERSION_SPKR_PROT_CONFIG 0x1
1751#define AFE_SPKR_PROT_EXCURSIONF_LEN 512
1752struct afe_spkr_prot_cfg_param_v1 {
1753 u32 spkr_prot_minor_version;
1754/*
1755 * Minor version used for tracking the version of the
1756 * speaker protection module configuration interface.
1757 * Supported values: #AFE_API_VERSION_SPKR_PROT_CONFIG
1758 */
1759
1760int16_t win_size;
1761/* Analysis and synthesis window size (nWinSize).
1762 * Supported values: 1024, 512, 256 samples
1763 */
1764
1765int16_t margin;
1766/* Allowable margin for excursion prediction,
1767 * in L16Q15 format. This is a
1768 * control parameter to allow
1769 * for overestimation of peak excursion.
1770 */
1771
1772int16_t spkr_exc_limit;
1773/* Speaker excursion limit, in L16Q15 format.*/
1774
1775int16_t spkr_resonance_freq;
1776/* Resonance frequency of the speaker; used
1777 * to define a frequency range
1778 * for signal modification.
1779 *
1780 * Supported values: 0 to 2000 Hz
1781 */
1782
1783int16_t limhresh;
1784/* Threshold of the hard limiter; used to
1785 * prevent overshooting beyond a
1786 * signal level that was set by the limiter
1787 * prior to speaker protection.
1788 * Supported values: 0 to 32767
1789 */
1790
1791int16_t hpf_cut_off_freq;
1792/* High pass filter cutoff frequency.
1793 * Supported values: 100, 200, 300 Hz
1794 */
1795
1796int16_t hpf_enable;
1797/* Specifies whether the high pass filter
1798 * is enabled (0) or disabled (1).
1799 */
1800
1801int16_t reserved;
1802/* This field must be set to zero. */
1803
1804int32_t amp_gain;
1805/* Amplifier gain in L32Q15 format.
1806 * This is the RMS voltage at the
1807 * loudspeaker when a 0dBFS tone
1808 * is played in the digital domain.
1809 */
1810
1811int16_t excursionf[AFE_SPKR_PROT_EXCURSIONF_LEN];
1812/* Array of the excursion transfer function.
1813 * The peak excursion of the
1814 * loudspeaker diaphragm is
1815 * measured in millimeters for 1 Vrms Sine
1816 * tone at all FFT bin frequencies.
1817 * Supported values: Q15 format
1818 */
1819} __packed;
1820
1821
1822#define AFE_SERVICE_CMD_REGISTER_RT_PORT_DRIVER 0x000100E0
1823
1824/* Payload of the #AFE_SERVICE_CMD_REGISTER_RT_PORT_DRIVER
1825 * command, which registers a real-time port driver
1826 * with the AFE service.
1827 */
1828struct afe_service_cmd_register_rt_port_driver {
1829 struct apr_hdr hdr;
1830 u16 port_id;
1831/* Port ID with which the real-time driver exchanges data
1832 * (registers for events).
1833 * Supported values: #AFE_PORT_ID_RT_PROXY_PORT_RANGE_START to
1834 * #AFE_PORT_ID_RT_PROXY_PORT_RANGE_END
1835 */
1836
1837 u16 reserved;
1838 /* This field must be set to zero. */
1839} __packed;
1840
1841#define AFE_SERVICE_CMD_UNREGISTER_RT_PORT_DRIVER 0x000100E1
1842
1843/* Payload of the #AFE_SERVICE_CMD_UNREGISTER_RT_PORT_DRIVER
1844 * command, which unregisters a real-time port driver from
1845 * the AFE service.
1846 */
1847struct afe_service_cmd_unregister_rt_port_driver {
1848 struct apr_hdr hdr;
1849 u16 port_id;
1850/* Port ID from which the real-time
1851 * driver unregisters for events.
1852 * Supported values: #AFE_PORT_ID_RT_PROXY_PORT_RANGE_START to
1853 * #AFE_PORT_ID_RT_PROXY_PORT_RANGE_END
1854 */
1855
1856 u16 reserved;
1857 /* This field must be set to zero. */
1858} __packed;
1859
1860#define AFE_EVENT_RT_PROXY_PORT_STATUS 0x00010105
1861#define AFE_EVENTYPE_RT_PROXY_PORT_START 0
1862#define AFE_EVENTYPE_RT_PROXY_PORT_STOP 1
1863#define AFE_EVENTYPE_RT_PROXY_PORT_LOW_WATER_MARK 2
1864#define AFE_EVENTYPE_RT_PROXY_PORT_HIGH_WATER_MARK 3
1865#define AFE_EVENTYPE_RT_PROXY_PORT_INVALID 0xFFFF
1866
1867/* Payload of the #AFE_EVENT_RT_PROXY_PORT_STATUS
1868 * message, which sends an event from the AFE service
1869 * to a registered client.
1870 */
1871struct afe_event_rt_proxy_port_status {
1872 u16 port_id;
1873/* Port ID to which the event is sent.
1874 * Supported values: #AFE_PORT_ID_RT_PROXY_PORT_RANGE_START to
1875 * #AFE_PORT_ID_RT_PROXY_PORT_RANGE_END
1876 */
1877
1878 u16 eventype;
1879/* Type of event.
1880 * Supported values:
1881 * - #AFE_EVENTYPE_RT_PROXY_PORT_START
1882 * - #AFE_EVENTYPE_RT_PROXY_PORT_STOP
1883 * - #AFE_EVENTYPE_RT_PROXY_PORT_LOW_WATER_MARK
1884 * - #AFE_EVENTYPE_RT_PROXY_PORT_HIGH_WATER_MARK
1885 */
1886} __packed;
1887
1888#define AFE_PORT_DATA_CMD_RT_PROXY_PORT_WRITE_V2 0x000100ED
1889
1890struct afe_port_data_cmd_rt_proxy_port_write_v2 {
1891 struct apr_hdr hdr;
1892 u16 port_id;
1893/* Tx (mic) proxy port ID with which the real-time
1894 * driver exchanges data.
1895 * Supported values: #AFE_PORT_ID_RT_PROXY_PORT_RANGE_START to
1896 * #AFE_PORT_ID_RT_PROXY_PORT_RANGE_END
1897 */
1898
1899 u16 reserved;
1900 /* This field must be set to zero. */
1901
1902 u32 buffer_address_lsw;
1903/* LSW Address of the buffer containing the
1904 * data from the real-time source
1905 * device on a client.
1906 */
1907
1908 u32 buffer_address_msw;
1909/* MSW Address of the buffer containing the
1910 * data from the real-time source
1911 * device on a client.
1912 */
1913
1914 u32 mem_map_handle;
1915/* A memory map handle encapsulating shared memory
1916 * attributes is returned if
1917 * AFE_SERVICE_CMD_SHARED_MEM_MAP_REGIONS
1918 * command is successful.
1919 * Supported Values:
1920 * - Any 32 bit value
1921 */
1922
1923 u32 available_bytes;
1924/* Number of valid bytes available
1925 * in the buffer (including all
1926 * channels: number of bytes per
1927 * channel = availableBytesumChannels).
1928 * Supported values: > 0
1929 *
1930 * This field must be equal to the frame
1931 * size specified in the #AFE_PORT_AUDIO_IF_CONFIG
1932 * command that was sent to configure this
1933 * port.
1934 */
1935} __packed;
1936
1937#define AFE_PORT_DATA_CMD_RT_PROXY_PORT_READ_V2 0x000100EE
1938
1939/* Payload of the
1940 * #AFE_PORT_DATA_CMD_RT_PROXY_PORT_READ_V2 command, which
1941 * delivers an empty buffer to the AFE service. On
1942 * acknowledgment, data is filled in the buffer.
1943 */
1944struct afe_port_data_cmd_rt_proxy_port_read_v2 {
1945 struct apr_hdr hdr;
1946 u16 port_id;
1947/* Rx proxy port ID with which the real-time
1948 * driver exchanges data.
1949 * Supported values: #AFE_PORT_ID_RT_PROXY_PORT_RANGE_START to
1950 * #AFE_PORT_ID_RT_PROXY_PORT_RANGE_END
1951 * (This must be an Rx (speaker) port.)
1952 */
1953
1954 u16 reserved;
1955 /* This field must be set to zero. */
1956
1957 u32 buffer_address_lsw;
1958/* LSW Address of the buffer containing the data sent from the AFE
1959 * service to a real-time sink device on the client.
1960 */
1961
1962
1963 u32 buffer_address_msw;
1964/* MSW Address of the buffer containing the data sent from the AFE
1965 * service to a real-time sink device on the client.
1966 */
1967
1968 u32 mem_map_handle;
1969/* A memory map handle encapsulating shared memory attributes is
1970 * returned if AFE_SERVICE_CMD_SHARED_MEM_MAP_REGIONS command is
1971 * successful.
1972 * Supported Values:
1973 * - Any 32 bit value
1974 */
1975
1976 u32 available_bytes;
1977/* Number of valid bytes available in the buffer (including all
1978 * channels).
1979 * Supported values: > 0
1980 * This field must be equal to the frame size specified in the
1981 * #AFE_PORT_AUDIO_IF_CONFIG command that was sent to configure
1982 * this port.
1983 */
1984} __packed;
1985
1986/* This module ID is related to device configuring like I2S,PCM,
1987 * HDMI, SLIMBus etc. This module supports following parameter ids.
1988 * - #AFE_PARAM_ID_I2S_CONFIG
1989 * - #AFE_PARAM_ID_PCM_CONFIG
1990 * - #AFE_PARAM_ID_DIGI_MIC_CONFIG
1991 * - #AFE_PARAM_ID_HDMI_CONFIG
1992 * - #AFE_PARAM_ID_INTERNAL_BT_FM_CONFIG
1993 * - #AFE_PARAM_ID_SLIMBUS_CONFIG
1994 * - #AFE_PARAM_ID_RT_PROXY_CONFIG
1995 */
1996
1997#define AFE_MODULE_AUDIO_DEV_INTERFACE 0x0001020C
1998#define AFE_PORT_SAMPLE_RATE_8K 8000
1999#define AFE_PORT_SAMPLE_RATE_16K 16000
2000#define AFE_PORT_SAMPLE_RATE_48K 48000
2001#define AFE_PORT_SAMPLE_RATE_96K 96000
2002#define AFE_PORT_SAMPLE_RATE_176P4K 176400
2003#define AFE_PORT_SAMPLE_RATE_192K 192000
2004#define AFE_PORT_SAMPLE_RATE_352P8K 352800
2005#define AFE_LINEAR_PCM_DATA 0x0
2006#define AFE_NON_LINEAR_DATA 0x1
2007#define AFE_LINEAR_PCM_DATA_PACKED_60958 0x2
2008#define AFE_NON_LINEAR_DATA_PACKED_60958 0x3
2009#define AFE_GENERIC_COMPRESSED 0x8
2010
2011/* This param id is used to configure I2S interface */
2012#define AFE_PARAM_ID_I2S_CONFIG 0x0001020D
2013#define AFE_API_VERSION_I2S_CONFIG 0x1
2014/* Enumeration for setting the I2S configuration
2015 * channel_mode parameter to
2016 * serial data wire number 1-3 (SD3).
2017 */
2018#define AFE_PORT_I2S_SD0 0x1
2019#define AFE_PORT_I2S_SD1 0x2
2020#define AFE_PORT_I2S_SD2 0x3
2021#define AFE_PORT_I2S_SD3 0x4
2022#define AFE_PORT_I2S_QUAD01 0x5
2023#define AFE_PORT_I2S_QUAD23 0x6
2024#define AFE_PORT_I2S_6CHS 0x7
2025#define AFE_PORT_I2S_8CHS 0x8
2026#define AFE_PORT_I2S_MONO 0x0
2027#define AFE_PORT_I2S_STEREO 0x1
2028#define AFE_PORT_CONFIG_I2S_WS_SRC_EXTERNAL 0x0
2029#define AFE_PORT_CONFIG_I2S_WS_SRC_INTERNAL 0x1
2030
2031/* Payload of the #AFE_PARAM_ID_I2S_CONFIG
2032 * command's (I2S configuration
2033 * parameter).
2034 */
2035struct afe_param_id_i2s_cfg {
2036 u32 i2s_cfg_minor_version;
2037/* Minor version used for tracking the version of the I2S
2038 * configuration interface.
2039 * Supported values: #AFE_API_VERSION_I2S_CONFIG
2040 */
2041
2042 u16 bit_width;
2043/* Bit width of the sample.
2044 * Supported values: 16, 24
2045 */
2046
2047 u16 channel_mode;
2048/* I2S lines and multichannel operation.
2049 * Supported values:
2050 * - #AFE_PORT_I2S_SD0
2051 * - #AFE_PORT_I2S_SD1
2052 * - #AFE_PORT_I2S_SD2
2053 * - #AFE_PORT_I2S_SD3
2054 * - #AFE_PORT_I2S_QUAD01
2055 * - #AFE_PORT_I2S_QUAD23
2056 * - #AFE_PORT_I2S_6CHS
2057 * - #AFE_PORT_I2S_8CHS
2058 */
2059
2060 u16 mono_stereo;
2061/* Specifies mono or stereo. This applies only when
2062 * a single I2S line is used.
2063 * Supported values:
2064 * - #AFE_PORT_I2S_MONO
2065 * - #AFE_PORT_I2S_STEREO
2066 */
2067
2068 u16 ws_src;
2069/* Word select source: internal or external.
2070 * Supported values:
2071 * - #AFE_PORT_CONFIG_I2S_WS_SRC_EXTERNAL
2072 * - #AFE_PORT_CONFIG_I2S_WS_SRC_INTERNAL
2073 */
2074
2075 u32 sample_rate;
2076/* Sampling rate of the port.
2077 * Supported values:
2078 * - #AFE_PORT_SAMPLE_RATE_8K
2079 * - #AFE_PORT_SAMPLE_RATE_16K
2080 * - #AFE_PORT_SAMPLE_RATE_48K
2081 * - #AFE_PORT_SAMPLE_RATE_96K
2082 * - #AFE_PORT_SAMPLE_RATE_192K
2083 */
2084
2085 u16 data_format;
2086/* data format
2087 * Supported values:
2088 * - #LINEAR_PCM_DATA
2089 * - #NON_LINEAR_DATA
2090 * - #LINEAR_PCM_DATA_PACKED_IN_60958
2091 * - #NON_LINEAR_DATA_PACKED_IN_60958
2092 */
2093 u16 reserved;
2094 /* This field must be set to zero. */
2095} __packed;
2096
2097/*
2098 * This param id is used to configure PCM interface
2099 */
2100
2101#define AFE_API_VERSION_SPDIF_CONFIG 0x1
2102#define AFE_API_VERSION_SPDIF_CH_STATUS_CONFIG 0x1
2103#define AFE_API_VERSION_SPDIF_CLK_CONFIG 0x1
2104#define AFE_CH_STATUS_A 1
2105#define AFE_CH_STATUS_B 2
2106
2107#define AFE_PARAM_ID_SPDIF_CONFIG 0x00010244
2108#define AFE_PARAM_ID_CH_STATUS_CONFIG 0x00010245
2109#define AFE_PARAM_ID_SPDIF_CLK_CONFIG 0x00010246
2110
2111#define AFE_PORT_CLK_ROOT_LPAPLL 0x3
2112#define AFE_PORT_CLK_ROOT_LPAQ6PLL 0x4
2113
2114struct afe_param_id_spdif_cfg {
2115/* Minor version used for tracking the version of the SPDIF
2116 * configuration interface.
2117 * Supported values: #AFE_API_VERSION_SPDIF_CONFIG
2118 */
2119 u32 spdif_cfg_minor_version;
2120
2121/* Sampling rate of the port.
2122 * Supported values:
2123 * - #AFE_PORT_SAMPLE_RATE_22_05K
2124 * - #AFE_PORT_SAMPLE_RATE_32K
2125 * - #AFE_PORT_SAMPLE_RATE_44_1K
2126 * - #AFE_PORT_SAMPLE_RATE_48K
2127 * - #AFE_PORT_SAMPLE_RATE_96K
2128 * - #AFE_PORT_SAMPLE_RATE_176_4K
2129 * - #AFE_PORT_SAMPLE_RATE_192K
2130 */
2131 u32 sample_rate;
2132
2133/* data format
2134 * Supported values:
2135 * - #AFE_LINEAR_PCM_DATA
2136 * - #AFE_NON_LINEAR_DATA
2137 */
2138 u16 data_format;
2139/* Number of channels supported by the port
2140 * - PCM - 1, Compressed Case - 2
2141 */
2142 u16 num_channels;
2143/* Bit width of the sample.
2144 * Supported values: 16, 24
2145 */
2146 u16 bit_width;
2147/* This field must be set to zero. */
2148 u16 reserved;
2149} __packed;
2150
2151struct afe_param_id_spdif_ch_status_cfg {
2152 u32 ch_status_cfg_minor_version;
2153/* Minor version used for tracking the version of channel
2154 * status configuration. Current supported version is 1
2155 */
2156
2157 u32 status_type;
2158/* Indicate if the channel status is for channel A or B
2159 * Supported values:
2160 * - #AFE_CH_STATUS_A
2161 * - #AFE_CH_STATUS_B
2162 */
2163
2164 u8 status_bits[24];
2165/* Channel status - 192 bits for channel
2166 * Byte ordering as defined by IEC60958-3
2167 */
2168
2169 u8 status_mask[24];
2170/* Channel status with mask bits 1 will be applied.
2171 * Byte ordering as defined by IEC60958-3
2172 */
2173} __packed;
2174
2175struct afe_param_id_spdif_clk_cfg {
2176 u32 clk_cfg_minor_version;
2177/* Minor version used for tracking the version of SPDIF
2178 * interface clock configuration. Current supported version
2179 * is 1
2180 */
2181
2182 u32 clk_value;
2183/* Specifies the clock frequency in Hz to set
2184 * Supported values:
2185 * 0 - Disable the clock
2186 * 2 (byphase) * 32 (60958 subframe size) * sampling rate * 2
2187 * (channels A and B)
2188 */
2189
2190 u32 clk_root;
2191/* Specifies SPDIF root clk source
2192 * Supported Values:
2193 * - #AFE_PORT_CLK_ROOT_LPAPLL
2194 * - #AFE_PORT_CLK_ROOT_LPAQ6PLL
2195 */
2196} __packed;
2197
2198struct afe_spdif_clk_config_command {
2199 struct apr_hdr hdr;
2200 struct afe_port_cmd_set_param_v2 param;
2201 struct afe_port_param_data_v2 pdata;
2202 struct afe_param_id_spdif_clk_cfg clk_cfg;
2203} __packed;
2204
2205struct afe_spdif_chstatus_config_command {
2206 struct apr_hdr hdr;
2207 struct afe_port_cmd_set_param_v2 param;
2208 struct afe_port_param_data_v2 pdata;
2209 struct afe_param_id_spdif_ch_status_cfg ch_status;
2210} __packed;
2211
2212struct afe_spdif_port_config {
2213 struct afe_param_id_spdif_cfg cfg;
2214 struct afe_param_id_spdif_ch_status_cfg ch_status;
2215} __packed;
2216
2217#define AFE_PARAM_ID_PCM_CONFIG 0x0001020E
2218#define AFE_API_VERSION_PCM_CONFIG 0x1
2219/* Enumeration for the auxiliary PCM synchronization signal
2220 * provided by an external source.
2221 */
2222
2223#define AFE_PORT_PCM_SYNC_SRC_EXTERNAL 0x0
2224/* Enumeration for the auxiliary PCM synchronization signal
2225 * provided by an internal source.
2226 */
2227#define AFE_PORT_PCM_SYNC_SRC_INTERNAL 0x1
2228/* Enumeration for the PCM configuration aux_mode parameter,
2229 * which configures the auxiliary PCM interface to use
2230 * short synchronization.
2231 */
2232#define AFE_PORT_PCM_AUX_MODE_PCM 0x0
2233/*
2234 * Enumeration for the PCM configuration aux_mode parameter,
2235 * which configures the auxiliary PCM interface to use long
2236 * synchronization.
2237 */
2238#define AFE_PORT_PCM_AUX_MODE_AUX 0x1
2239/*
2240 * Enumeration for setting the PCM configuration frame to 8.
2241 */
2242#define AFE_PORT_PCM_BITS_PER_FRAME_8 0x0
2243/*
2244 * Enumeration for setting the PCM configuration frame to 16.
2245 */
2246#define AFE_PORT_PCM_BITS_PER_FRAME_16 0x1
2247
2248/* Enumeration for setting the PCM configuration frame to 32.*/
2249#define AFE_PORT_PCM_BITS_PER_FRAME_32 0x2
2250
2251/* Enumeration for setting the PCM configuration frame to 64.*/
2252#define AFE_PORT_PCM_BITS_PER_FRAME_64 0x3
2253
2254/* Enumeration for setting the PCM configuration frame to 128.*/
2255#define AFE_PORT_PCM_BITS_PER_FRAME_128 0x4
2256
2257/* Enumeration for setting the PCM configuration frame to 256.*/
2258#define AFE_PORT_PCM_BITS_PER_FRAME_256 0x5
2259
2260/* Enumeration for setting the PCM configuration
2261 * quantype parameter to A-law with no padding.
2262 */
2263#define AFE_PORT_PCM_ALAW_NOPADDING 0x0
2264
2265/* Enumeration for setting the PCM configuration quantype
2266 * parameter to mu-law with no padding.
2267 */
2268#define AFE_PORT_PCM_MULAW_NOPADDING 0x1
2269/* Enumeration for setting the PCM configuration quantype
2270 * parameter to linear with no padding.
2271 */
2272#define AFE_PORT_PCM_LINEAR_NOPADDING 0x2
2273/* Enumeration for setting the PCM configuration quantype
2274 * parameter to A-law with padding.
2275 */
2276#define AFE_PORT_PCM_ALAW_PADDING 0x3
2277/* Enumeration for setting the PCM configuration quantype
2278 * parameter to mu-law with padding.
2279 */
2280#define AFE_PORT_PCM_MULAW_PADDING 0x4
2281/* Enumeration for setting the PCM configuration quantype
2282 * parameter to linear with padding.
2283 */
2284#define AFE_PORT_PCM_LINEAR_PADDING 0x5
2285/* Enumeration for disabling the PCM configuration
2286 * ctrl_data_out_enable parameter.
2287 * The PCM block is the only master.
2288 */
2289#define AFE_PORT_PCM_CTRL_DATA_OE_DISABLE 0x0
2290/*
2291 * Enumeration for enabling the PCM configuration
2292 * ctrl_data_out_enable parameter. The PCM block shares
2293 * the signal with other masters.
2294 */
2295#define AFE_PORT_PCM_CTRL_DATA_OE_ENABLE 0x1
2296
2297/* Payload of the #AFE_PARAM_ID_PCM_CONFIG command's
2298 * (PCM configuration parameter).
2299 */
2300
2301struct afe_param_id_pcm_cfg {
2302 u32 pcm_cfg_minor_version;
2303/* Minor version used for tracking the version of the AUX PCM
2304 * configuration interface.
2305 * Supported values: #AFE_API_VERSION_PCM_CONFIG
2306 */
2307
2308 u16 aux_mode;
2309/* PCM synchronization setting.
2310 * Supported values:
2311 * - #AFE_PORT_PCM_AUX_MODE_PCM
2312 * - #AFE_PORT_PCM_AUX_MODE_AUX
2313 */
2314
2315 u16 sync_src;
2316/* Synchronization source.
2317 * Supported values:
2318 * - #AFE_PORT_PCM_SYNC_SRC_EXTERNAL
2319 * - #AFE_PORT_PCM_SYNC_SRC_INTERNAL
2320 */
2321
2322 u16 frame_setting;
2323/* Number of bits per frame.
2324 * Supported values:
2325 * - #AFE_PORT_PCM_BITS_PER_FRAME_8
2326 * - #AFE_PORT_PCM_BITS_PER_FRAME_16
2327 * - #AFE_PORT_PCM_BITS_PER_FRAME_32
2328 * - #AFE_PORT_PCM_BITS_PER_FRAME_64
2329 * - #AFE_PORT_PCM_BITS_PER_FRAME_128
2330 * - #AFE_PORT_PCM_BITS_PER_FRAME_256
2331 */
2332
2333 u16 quantype;
2334/* PCM quantization type.
2335 * Supported values:
2336 * - #AFE_PORT_PCM_ALAW_NOPADDING
2337 * - #AFE_PORT_PCM_MULAW_NOPADDING
2338 * - #AFE_PORT_PCM_LINEAR_NOPADDING
2339 * - #AFE_PORT_PCM_ALAW_PADDING
2340 * - #AFE_PORT_PCM_MULAW_PADDING
2341 * - #AFE_PORT_PCM_LINEAR_PADDING
2342 */
2343
2344 u16 ctrl_data_out_enable;
2345/* Specifies whether the PCM block shares the data-out
2346 * signal to the drive with other masters.
2347 * Supported values:
2348 * - #AFE_PORT_PCM_CTRL_DATA_OE_DISABLE
2349 * - #AFE_PORT_PCM_CTRL_DATA_OE_ENABLE
2350 */
2351 u16 reserved;
2352 /* This field must be set to zero. */
2353
2354 u32 sample_rate;
2355/* Sampling rate of the port.
2356 * Supported values:
2357 * - #AFE_PORT_SAMPLE_RATE_8K
2358 * - #AFE_PORT_SAMPLE_RATE_16K
2359 */
2360
2361 u16 bit_width;
2362/* Bit width of the sample.
2363 * Supported values: 16
2364 */
2365
2366 u16 num_channels;
2367/* Number of channels.
2368 * Supported values: 1 to 4
2369 */
2370
2371 u16 slot_number_mapping[4];
2372/* Specifies the slot number for the each channel in
2373 * multi channel scenario.
2374 * Supported values: 1 to 32
2375 */
2376} __packed;
2377
2378/*
2379 * This param id is used to configure DIGI MIC interface
2380 */
2381#define AFE_PARAM_ID_DIGI_MIC_CONFIG 0x0001020F
2382/* This version information is used to handle the new
2383 * additions to the config interface in future in backward
2384 * compatible manner.
2385 */
2386#define AFE_API_VERSION_DIGI_MIC_CONFIG 0x1
2387
2388/* Enumeration for setting the digital mic configuration
2389 * channel_mode parameter to left 0.
2390 */
2391
2392#define AFE_PORT_DIGI_MIC_MODE_LEFT0 0x1
2393
2394/*Enumeration for setting the digital mic configuration
2395 * channel_mode parameter to right 0.
2396 */
2397
2398
2399#define AFE_PORT_DIGI_MIC_MODE_RIGHT0 0x2
2400
2401/* Enumeration for setting the digital mic configuration
2402 * channel_mode parameter to left 1.
2403 */
2404
2405#define AFE_PORT_DIGI_MIC_MODE_LEFT1 0x3
2406
2407/* Enumeration for setting the digital mic configuration
2408 * channel_mode parameter to right 1.
2409 */
2410
2411#define AFE_PORT_DIGI_MIC_MODE_RIGHT1 0x4
2412
2413/* Enumeration for setting the digital mic configuration
2414 * channel_mode parameter to stereo 0.
2415 */
2416#define AFE_PORT_DIGI_MIC_MODE_STEREO0 0x5
2417
2418/* Enumeration for setting the digital mic configuration
2419 * channel_mode parameter to stereo 1.
2420 */
2421
2422
2423#define AFE_PORT_DIGI_MIC_MODE_STEREO1 0x6
2424
2425/* Enumeration for setting the digital mic configuration
2426 * channel_mode parameter to quad.
2427 */
2428
2429#define AFE_PORT_DIGI_MIC_MODE_QUAD 0x7
2430
2431/* Payload of the #AFE_PARAM_ID_DIGI_MIC_CONFIG command's
2432 * (DIGI MIC configuration
2433 * parameter).
2434 */
2435struct afe_param_id_digi_mic_cfg {
2436 u32 digi_mic_cfg_minor_version;
2437/* Minor version used for tracking the version of the DIGI Mic
2438 * configuration interface.
2439 * Supported values: #AFE_API_VERSION_DIGI_MIC_CONFIG
2440 */
2441
2442 u16 bit_width;
2443/* Bit width of the sample.
2444 * Supported values: 16
2445 */
2446
2447 u16 channel_mode;
2448/* Digital mic and multichannel operation.
2449 * Supported values:
2450 * - #AFE_PORT_DIGI_MIC_MODE_LEFT0
2451 * - #AFE_PORT_DIGI_MIC_MODE_RIGHT0
2452 * - #AFE_PORT_DIGI_MIC_MODE_LEFT1
2453 * - #AFE_PORT_DIGI_MIC_MODE_RIGHT1
2454 * - #AFE_PORT_DIGI_MIC_MODE_STEREO0
2455 * - #AFE_PORT_DIGI_MIC_MODE_STEREO1
2456 * - #AFE_PORT_DIGI_MIC_MODE_QUAD
2457 */
2458
2459 u32 sample_rate;
2460/* Sampling rate of the port.
2461 * Supported values:
2462 * - #AFE_PORT_SAMPLE_RATE_8K
2463 * - #AFE_PORT_SAMPLE_RATE_16K
2464 * - #AFE_PORT_SAMPLE_RATE_48K
2465 */
2466} __packed;
2467
2468/* This param id is used to configure HDMI interface */
2469#define AFE_PARAM_ID_HDMI_CONFIG 0x00010210
2470
2471/* This version information is used to handle the new
2472 * additions to the config interface in future in backward
2473 * compatible manner.
2474 */
2475#define AFE_API_VERSION_HDMI_CONFIG 0x1
2476
2477/* Payload of the #AFE_PARAM_ID_HDMI_CONFIG command,
2478 * which configures a multichannel HDMI audio interface.
2479 */
2480struct afe_param_id_hdmi_multi_chan_audio_cfg {
2481 u32 hdmi_cfg_minor_version;
2482/* Minor version used for tracking the version of the HDMI
2483 * configuration interface.
2484 * Supported values: #AFE_API_VERSION_HDMI_CONFIG
2485 */
2486
2487u16 datatype;
2488/* data type
2489 * Supported values:
2490 * - #LINEAR_PCM_DATA
2491 * - #NON_LINEAR_DATA
2492 * - #LINEAR_PCM_DATA_PACKED_IN_60958
2493 * - #NON_LINEAR_DATA_PACKED_IN_60958
2494 */
2495
2496u16 channel_allocation;
2497/* HDMI channel allocation information for programming an HDMI
2498 * frame. The default is 0 (Stereo).
2499 *
2500 * This information is defined in the HDMI standard, CEA 861-D
2501 * (refer to @xhyperref{S1,[S1]}). The number of channels is also
2502 * inferred from this parameter.
2503 */
2504
2505
2506u32 sample_rate;
2507/* Sampling rate of the port.
2508 * Supported values:
2509 * - #AFE_PORT_SAMPLE_RATE_8K
2510 * - #AFE_PORT_SAMPLE_RATE_16K
2511 * - #AFE_PORT_SAMPLE_RATE_48K
2512 * - #AFE_PORT_SAMPLE_RATE_96K
2513 * - 22050, 44100, 176400 for compressed streams
2514 */
2515
2516 u16 bit_width;
2517/* Bit width of the sample.
2518 * Supported values: 16, 24
2519 */
2520 u16 reserved;
2521 /* This field must be set to zero. */
2522} __packed;
2523
2524/* This param id is used to configure BT or FM(RIVA) interface */
2525#define AFE_PARAM_ID_INTERNAL_BT_FM_CONFIG 0x00010211
2526
2527/* This version information is used to handle the new
2528 * additions to the config interface in future in backward
2529 * compatible manner.
2530 */
2531#define AFE_API_VERSION_INTERNAL_BT_FM_CONFIG 0x1
2532
2533/* Payload of the #AFE_PARAM_ID_INTERNAL_BT_FM_CONFIG
2534 * command's BT voice/BT audio/FM configuration parameter.
2535 */
2536struct afe_param_id_internal_bt_fm_cfg {
2537 u32 bt_fm_cfg_minor_version;
2538/* Minor version used for tracking the version of the BT and FM
2539 * configuration interface.
2540 * Supported values: #AFE_API_VERSION_INTERNAL_BT_FM_CONFIG
2541 */
2542
2543 u16 num_channels;
2544/* Number of channels.
2545 * Supported values: 1 to 2
2546 */
2547
2548 u16 bit_width;
2549/* Bit width of the sample.
2550 * Supported values: 16
2551 */
2552
2553 u32 sample_rate;
2554/* Sampling rate of the port.
2555 * Supported values:
2556 * - #AFE_PORT_SAMPLE_RATE_8K (only for BTSCO)
2557 * - #AFE_PORT_SAMPLE_RATE_16K (only for BTSCO)
2558 * - #AFE_PORT_SAMPLE_RATE_48K (FM and A2DP)
2559 */
2560} __packed;
2561
2562/* This param id is used to configure SLIMBUS interface using
2563 * shared channel approach.
2564 */
2565
2566
2567#define AFE_PARAM_ID_SLIMBUS_CONFIG 0x00010212
2568
2569/* This version information is used to handle the new
2570 * additions to the config interface in future in backward
2571 * compatible manner.
2572 */
2573#define AFE_API_VERSION_SLIMBUS_CONFIG 0x1
2574
2575/* Enumeration for setting SLIMbus device ID 1. */
2576#define AFE_SLIMBUS_DEVICE_1 0x0
2577
2578/* Enumeration for setting SLIMbus device ID 2. */
2579#define AFE_SLIMBUS_DEVICE_2 0x1
2580
2581/* Enumeration for setting the SLIMbus data formats. */
2582#define AFE_SB_DATA_FORMAT_NOT_INDICATED 0x0
2583
2584/* Enumeration for setting the maximum number of streams per
2585 * device.
2586 */
2587
2588#define AFE_PORT_MAX_AUDIO_CHAN_CNT 0x8
2589
2590/* Payload of the #AFE_PORT_CMD_SLIMBUS_CONFIG command's SLIMbus
2591 * port configuration parameter.
2592 */
2593
2594struct afe_param_id_slimbus_cfg {
2595 u32 sb_cfg_minor_version;
2596/* Minor version used for tracking the version of the SLIMBUS
2597 * configuration interface.
2598 * Supported values: #AFE_API_VERSION_SLIMBUS_CONFIG
2599 */
2600
2601 u16 slimbus_dev_id;
2602/* SLIMbus hardware device ID, which is required to handle
2603 * multiple SLIMbus hardware blocks.
2604 * Supported values: - #AFE_SLIMBUS_DEVICE_1 - #AFE_SLIMBUS_DEVICE_2
2605 */
2606
2607
2608 u16 bit_width;
2609/* Bit width of the sample.
2610 * Supported values: 16, 24
2611 */
2612
2613 u16 data_format;
2614/* Data format supported by the SLIMbus hardware. The default is
2615 * 0 (#AFE_SB_DATA_FORMAT_NOT_INDICATED), which indicates the
2616 * hardware does not perform any format conversions before the data
2617 * transfer.
2618 */
2619
2620
2621 u16 num_channels;
2622/* Number of channels.
2623 * Supported values: 1 to #AFE_PORT_MAX_AUDIO_CHAN_CNT
2624 */
2625
2626 u8 shared_ch_mapping[AFE_PORT_MAX_AUDIO_CHAN_CNT];
2627/* Mapping of shared channel IDs (128 to 255) to which the
2628 * master port is to be connected.
2629 * Shared_channel_mapping[i] represents the shared channel assigned
2630 * for audio channel i in multichannel audio data.
2631 */
2632
2633 u32 sample_rate;
2634/* Sampling rate of the port.
2635 * Supported values:
2636 * - #AFE_PORT_SAMPLE_RATE_8K
2637 * - #AFE_PORT_SAMPLE_RATE_16K
2638 * - #AFE_PORT_SAMPLE_RATE_48K
2639 * - #AFE_PORT_SAMPLE_RATE_96K
2640 * - #AFE_PORT_SAMPLE_RATE_192K
2641 */
2642} __packed;
2643
2644
2645/* ID of the parameter used by AFE_PARAM_ID_USB_AUDIO_DEV_PARAMS to configure
2646 * USB audio device parameter. It should be used with
2647 * AFE_MODULE_AUDIO_DEV_INTERFACE
2648 */
2649#define AFE_PARAM_ID_USB_AUDIO_DEV_PARAMS 0x000102A5
2650
2651
2652/* ID of the parameter used to set the endianness value for the
2653 * USB audio device. It should be used with
2654 * AFE_MODULE_AUDIO_DEV_INTERFACE
2655 */
2656#define AFE_PARAM_ID_USB_AUDIO_DEV_LPCM_FMT 0x000102AA
2657
2658/* Minor version used for tracking USB audio configuration */
2659#define AFE_API_MINIOR_VERSION_USB_AUDIO_CONFIG 0x1
2660
Haynes Mathew George7ed9b512018-02-28 18:18:09 -08002661/* ID of the parameter used to set the latency mode of the
2662 * USB audio device.
2663 */
2664#define AFE_PARAM_ID_PORT_LATENCY_MODE_CONFIG 0x000102B3
2665
2666/* Minor version used for tracking USB audio latency mode */
2667#define AFE_API_MINOR_VERSION_USB_AUDIO_LATENCY_MODE 0x1
2668
2669/* Supported AFE port latency modes */
2670#define AFE_PORT_DEFAULT_LATENCY_MODE 0x0
2671#define AFE_PORT_LOW_LATENCY_MODE 0x1
2672
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05302673/* Payload of the AFE_PARAM_ID_USB_AUDIO_DEV_PARAMS parameter used by
2674 * AFE_MODULE_AUDIO_DEV_INTERFACE.
2675 */
2676struct afe_param_id_usb_audio_dev_params {
2677/* Minor version used for tracking USB audio device parameter.
2678 * Supported values: AFE_API_MINIOR_VERSION_USB_AUDIO_CONFIG
2679 */
2680 u32 cfg_minor_version;
2681/* Token of actual end USB aduio device */
2682 u32 dev_token;
2683} __packed;
2684
2685struct afe_param_id_usb_audio_dev_lpcm_fmt {
2686/* Minor version used for tracking USB audio device parameter.
2687 * Supported values: AFE_API_MINIOR_VERSION_USB_AUDIO_CONFIG
2688 */
2689 u32 cfg_minor_version;
2690/* Endianness of actual end USB audio device */
2691 u32 endian;
2692} __packed;
2693
Haynes Mathew George7ed9b512018-02-28 18:18:09 -08002694struct afe_param_id_usb_audio_dev_latency_mode {
2695/* Minor version used for tracking USB audio device parameter.
2696 * Supported values: AFE_API_MINOR_VERSION_USB_AUDIO_LATENCY_MODE
2697 */
2698 u32 minor_version;
2699/* latency mode for the USB audio device */
2700 u32 mode;
2701} __packed;
2702
2703
2704
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05302705/* ID of the parameter used by AFE_PARAM_ID_USB_AUDIO_CONFIG to configure
2706 * USB audio interface. It should be used with AFE_MODULE_AUDIO_DEV_INTERFACE
2707 */
2708#define AFE_PARAM_ID_USB_AUDIO_CONFIG 0x000102A4
2709
2710/* Payload of the AFE_PARAM_ID_USB_AUDIO_CONFIG parameter used by
2711 * AFE_MODULE_AUDIO_DEV_INTERFACE.
2712 */
2713struct afe_param_id_usb_audio_cfg {
2714/* Minor version used for tracking USB audio device configuration.
2715 * Supported values: AFE_API_MINIOR_VERSION_USB_AUDIO_CONFIG
2716 */
2717 u32 cfg_minor_version;
2718/* Sampling rate of the port.
2719 * Supported values:
2720 * - AFE_PORT_SAMPLE_RATE_8K
2721 * - AFE_PORT_SAMPLE_RATE_11025
2722 * - AFE_PORT_SAMPLE_RATE_12K
2723 * - AFE_PORT_SAMPLE_RATE_16K
2724 * - AFE_PORT_SAMPLE_RATE_22050
2725 * - AFE_PORT_SAMPLE_RATE_24K
2726 * - AFE_PORT_SAMPLE_RATE_32K
2727 * - AFE_PORT_SAMPLE_RATE_44P1K
2728 * - AFE_PORT_SAMPLE_RATE_48K
2729 * - AFE_PORT_SAMPLE_RATE_96K
2730 * - AFE_PORT_SAMPLE_RATE_192K
2731 */
2732 u32 sample_rate;
2733/* Bit width of the sample.
2734 * Supported values: 16, 24
2735 */
2736 u16 bit_width;
2737/* Number of channels.
2738 * Supported values: 1 and 2
2739 */
2740 u16 num_channels;
2741/* Data format supported by the USB. The supported value is
2742 * 0 (#AFE_USB_AUDIO_DATA_FORMAT_LINEAR_PCM).
2743 */
2744 u16 data_format;
2745/* this field must be 0 */
2746 u16 reserved;
2747/* device token of actual end USB aduio device */
2748 u32 dev_token;
2749/* endianness of this interface */
Haynes Mathew George7ed9b512018-02-28 18:18:09 -08002750 u32 endian;
2751/* service interval */
2752 u32 service_interval;
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05302753} __packed;
2754
2755struct afe_usb_audio_dev_param_command {
2756 struct apr_hdr hdr;
2757 struct afe_port_cmd_set_param_v2 param;
2758 struct afe_port_param_data_v2 pdata;
2759 union {
2760 struct afe_param_id_usb_audio_dev_params usb_dev;
2761 struct afe_param_id_usb_audio_dev_lpcm_fmt lpcm_fmt;
Haynes Mathew George7ed9b512018-02-28 18:18:09 -08002762 struct afe_param_id_usb_audio_dev_latency_mode latency_config;
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05302763 };
2764} __packed;
2765
2766/* This param id is used to configure Real Time Proxy interface. */
2767#define AFE_PARAM_ID_RT_PROXY_CONFIG 0x00010213
2768
2769/* This version information is used to handle the new
2770 * additions to the config interface in future in backward
2771 * compatible manner.
2772 */
2773#define AFE_API_VERSION_RT_PROXY_CONFIG 0x1
2774
2775/* Payload of the #AFE_PARAM_ID_RT_PROXY_CONFIG
2776 * command (real-time proxy port configuration parameter).
2777 */
2778struct afe_param_id_rt_proxy_port_cfg {
2779 u32 rt_proxy_cfg_minor_version;
2780/* Minor version used for tracking the version of rt-proxy
2781 * config interface.
2782 */
2783
2784 u16 bit_width;
2785/* Bit width of the sample.
2786 * Supported values: 16
2787 */
2788
2789 u16 interleaved;
2790/* Specifies whether the data exchanged between the AFE
2791 * interface and real-time port is interleaved.
2792 * Supported values: - 0 -- Non-interleaved (samples from each
2793 * channel are contiguous in the buffer) - 1 -- Interleaved
2794 * (corresponding samples from each input channel are interleaved
2795 * within the buffer)
2796 */
2797
2798
2799 u16 frame_size;
2800/* Size of the frames that are used for PCM exchanges with this
2801 * port.
2802 * Supported values: > 0, in bytes
2803 * For example, 5 ms buffers of 16 bits and 16 kHz stereo samples
2804 * is 5 ms * 16 samples/ms * 2 bytes/sample * 2 channels = 320
2805 * bytes.
2806 */
2807 u16 jitter_allowance;
2808/* Configures the amount of jitter that the port will allow.
2809 * Supported values: > 0
2810 * For example, if +/-10 ms of jitter is anticipated in the timing
2811 * of sending frames to the port, and the configuration is 16 kHz
2812 * mono with 16-bit samples, this field is 10 ms * 16 samples/ms * 2
2813 * bytes/sample = 320.
2814 */
2815
2816 u16 low_water_mark;
2817/* Low watermark in bytes (including all channels).
2818 * Supported values:
2819 * - 0 -- Do not send any low watermark events
2820 * - > 0 -- Low watermark for triggering an event
2821 * If the number of bytes in an internal circular buffer is lower
2822 * than this low_water_mark parameter, a LOW_WATER_MARK event is
2823 * sent to applications (via the #AFE_EVENT_RT_PROXY_PORT_STATUS
2824 * event).
2825 * Use of watermark events is optional for debugging purposes.
2826 */
2827
2828 u16 high_water_mark;
2829/* High watermark in bytes (including all channels).
2830 * Supported values:
2831 * - 0 -- Do not send any high watermark events
2832 * - > 0 -- High watermark for triggering an event
2833 * If the number of bytes in an internal circular buffer exceeds
2834 * TOTAL_CIRC_BUF_SIZE minus high_water_mark, a high watermark event
2835 * is sent to applications (via the #AFE_EVENT_RT_PROXY_PORT_STATUS
2836 * event).
2837 * The use of watermark events is optional and for debugging
2838 * purposes.
2839 */
2840
2841
2842 u32 sample_rate;
2843/* Sampling rate of the port.
2844 * Supported values:
2845 * - #AFE_PORT_SAMPLE_RATE_8K
2846 * - #AFE_PORT_SAMPLE_RATE_16K
2847 * - #AFE_PORT_SAMPLE_RATE_48K
2848 */
2849
2850 u16 num_channels;
2851/* Number of channels.
2852 * Supported values: 1 to #AFE_PORT_MAX_AUDIO_CHAN_CNT
2853 */
2854
2855 u16 reserved;
2856 /* For 32 bit alignment. */
2857} __packed;
2858
2859
2860/* This param id is used to configure the Pseudoport interface */
2861
2862#define AFE_PARAM_ID_PSEUDO_PORT_CONFIG 0x00010219
2863
2864/* Version information used to handle future additions to the configuration
2865 * interface (for backward compatibility).
2866 */
2867#define AFE_API_VERSION_PSEUDO_PORT_CONFIG 0x1
2868
2869/* Enumeration for setting the timing_mode parameter to faster than real
2870 * time.
2871 */
2872#define AFE_PSEUDOPORT_TIMING_MODE_FTRT 0x0
2873
2874/* Enumeration for setting the timing_mode parameter to real time using
2875 * timers.
2876 */
2877#define AFE_PSEUDOPORT_TIMING_MODE_TIMER 0x1
2878
2879/* Payload of the AFE_PARAM_ID_PSEUDO_PORT_CONFIG parameter used by
2880 * AFE_MODULE_AUDIO_DEV_INTERFACE.
2881 */
2882struct afe_param_id_pseudo_port_cfg {
2883 u32 pseud_port_cfg_minor_version;
2884 /*
2885 * Minor version used for tracking the version of the pseudoport
2886 * configuration interface.
2887 */
2888
2889 u16 bit_width;
2890 /* Bit width of the sample at values 16, 24 */
2891
2892 u16 num_channels;
2893 /* Number of channels at values 1 to 8 */
2894
2895 u16 data_format;
2896 /* Non-linear data format supported by the pseudoport (for future use).
2897 * At values #AFE_LINEAR_PCM_DATA
2898 */
2899
2900 u16 timing_mode;
2901 /* Indicates whether the pseudoport synchronizes to the clock or
2902 * operates faster than real time.
2903 * at values
2904 * - #AFE_PSEUDOPORT_TIMING_MODE_FTRT
2905 * - #AFE_PSEUDOPORT_TIMING_MODE_TIMER @tablebulletend
2906 */
2907
2908 u32 sample_rate;
2909 /* Sample rate at which the pseudoport will run.
2910 * at values
2911 * - #AFE_PORT_SAMPLE_RATE_8K
2912 * - #AFE_PORT_SAMPLE_RATE_32K
2913 * - #AFE_PORT_SAMPLE_RATE_48K
2914 * - #AFE_PORT_SAMPLE_RATE_96K
2915 * - #AFE_PORT_SAMPLE_RATE_192K @tablebulletend
2916 */
2917} __packed;
2918
2919#define AFE_PARAM_ID_TDM_CONFIG 0x0001029D
2920
2921#define AFE_API_VERSION_TDM_CONFIG 1
2922
2923#define AFE_PORT_TDM_SHORT_SYNC_BIT_MODE 0
2924#define AFE_PORT_TDM_LONG_SYNC_MODE 1
2925#define AFE_PORT_TDM_SHORT_SYNC_SLOT_MODE 2
2926
2927#define AFE_PORT_TDM_SYNC_SRC_EXTERNAL 0
2928#define AFE_PORT_TDM_SYNC_SRC_INTERNAL 1
2929
2930#define AFE_PORT_TDM_CTRL_DATA_OE_DISABLE 0
2931#define AFE_PORT_TDM_CTRL_DATA_OE_ENABLE 1
2932
2933#define AFE_PORT_TDM_SYNC_NORMAL 0
2934#define AFE_PORT_TDM_SYNC_INVERT 1
2935
2936#define AFE_PORT_TDM_DATA_DELAY_0_BCLK_CYCLE 0
2937#define AFE_PORT_TDM_DATA_DELAY_1_BCLK_CYCLE 1
2938#define AFE_PORT_TDM_DATA_DELAY_2_BCLK_CYCLE 2
2939
2940/* Payload of the AFE_PARAM_ID_TDM_CONFIG parameter used by
2941 * AFE_MODULE_AUDIO_DEV_INTERFACE.
2942 */
2943struct afe_param_id_tdm_cfg {
2944 u32 tdm_cfg_minor_version;
2945 /* < Minor version used to track TDM configuration.
2946 * @values #AFE_API_VERSION_TDM_CONFIG
2947 */
2948
2949 u32 num_channels;
2950 /* < Number of enabled slots for TDM frame.
2951 * @values 1 to 8
2952 */
2953
2954 u32 sample_rate;
2955 /* < Sampling rate of the port.
2956 * @values
2957 * - #AFE_PORT_SAMPLE_RATE_8K
2958 * - #AFE_PORT_SAMPLE_RATE_16K
2959 * - #AFE_PORT_SAMPLE_RATE_24K
2960 * - #AFE_PORT_SAMPLE_RATE_32K
2961 * - #AFE_PORT_SAMPLE_RATE_48K
2962 * - #AFE_PORT_SAMPLE_RATE_176P4K
2963 * - #AFE_PORT_SAMPLE_RATE_352P8K @tablebulletend
2964 */
2965
2966 u32 bit_width;
2967 /* < Bit width of the sample.
2968 * @values 16, 24
2969 */
2970
2971 u16 data_format;
2972 /* < Data format: linear ,compressed, generic compresssed
2973 * @values
2974 * - #AFE_LINEAR_PCM_DATA
2975 * - #AFE_NON_LINEAR_DATA
2976 * - #AFE_GENERIC_COMPRESSED
2977 */
2978
2979 u16 sync_mode;
2980 /* < TDM synchronization setting.
2981 * @values (short, long, slot) sync mode
2982 * - #AFE_PORT_TDM_SHORT_SYNC_BIT_MODE
2983 * - #AFE_PORT_TDM_LONG_SYNC_MODE
2984 * - #AFE_PORT_TDM_SHORT_SYNC_SLOT_MODE @tablebulletend
2985 */
2986
2987 u16 sync_src;
2988 /* < Synchronization source.
2989 * @values
2990 * - #AFE_PORT_TDM_SYNC_SRC_EXTERNAL
2991 * - #AFE_PORT_TDM_SYNC_SRC_INTERNAL @tablebulletend
2992 */
2993
2994 u16 nslots_per_frame;
2995 /* < Number of slots per frame. Typical : 1, 2, 4, 8, 16, 32.
2996 * @values 1 - 32
2997 */
2998
2999 u16 ctrl_data_out_enable;
3000 /* < Specifies whether the TDM block shares the data-out signal to the
3001 * drive with other masters.
3002 * @values
3003 * - #AFE_PORT_TDM_CTRL_DATA_OE_DISABLE
3004 * - #AFE_PORT_TDM_CTRL_DATA_OE_ENABLE @tablebulletend
3005 */
3006
3007 u16 ctrl_invert_sync_pulse;
3008 /* < Specifies whether to invert the sync or not.
3009 * @values
3010 * - #AFE_PORT_TDM_SYNC_NORMAL
3011 * - #AFE_PORT_TDM_SYNC_INVERT @tablebulletend
3012 */
3013
3014 u16 ctrl_sync_data_delay;
3015 /* < Specifies the number of bit clock to delay data with respect to
3016 * sync edge.
3017 * @values
3018 * - #AFE_PORT_TDM_DATA_DELAY_0_BCLK_CYCLE
3019 * - #AFE_PORT_TDM_DATA_DELAY_1_BCLK_CYCLE
3020 * - #AFE_PORT_TDM_DATA_DELAY_2_BCLK_CYCLE @tablebulletend
3021 */
3022
3023 u16 slot_width;
3024 /* < Slot width of the slot in a TDM frame. (slot_width >= bit_width)
3025 * have to be satisfied.
3026 * @values 16, 24, 32
3027 */
3028
3029 u32 slot_mask;
3030 /* < Position of active slots. When that bit is set,
3031 * that paricular slot is active.
3032 * Number of active slots can be inferred by number of
3033 * bits set in the mask. Only 8 individual bits can be enabled.
3034 * Bits 0..31 corresponding to slot 0..31
3035 * @values 1 to 2^32 - 1
3036 */
3037} __packed;
3038
3039/* ID of Time Divsion Multiplexing (TDM) module,
3040 * which is used for configuring the AFE TDM.
3041 *
3042 * This module supports following parameter IDs:
3043 * - #AFE_PORT_TDM_SLOT_CONFIG
3044 *
3045 * To configure the TDM interface, the client must use the
3046 * #AFE_PORT_CMD_SET_PARAM command, and fill the module ID with the
3047 * respective parameter IDs as listed above.
3048 */
3049
3050#define AFE_MODULE_TDM 0x0001028A
3051
3052/* ID of the parameter used by #AFE_MODULE_TDM to configure
3053 * the TDM slot mapping. #AFE_PORT_CMD_SET_PARAM can use this parameter ID.
3054 */
3055#define AFE_PARAM_ID_PORT_SLOT_MAPPING_CONFIG 0x00010297
3056
3057/* Version information used to handle future additions to slot mapping
3058 * configuration (for backward compatibility).
3059 */
3060#define AFE_API_VERSION_SLOT_MAPPING_CONFIG 0x1
3061
3062/* Data align type */
3063#define AFE_SLOT_MAPPING_DATA_ALIGN_MSB 0
3064#define AFE_SLOT_MAPPING_DATA_ALIGN_LSB 1
3065
3066#define AFE_SLOT_MAPPING_OFFSET_INVALID 0xFFFF
3067
3068/* Payload of the AFE_PARAM_ID_PORT_SLOT_MAPPING_CONFIG
3069 * command's TDM configuration parameter.
3070 */
3071struct afe_param_id_slot_mapping_cfg {
3072 u32 minor_version;
3073 /* < Minor version used for tracking TDM slot configuration.
3074 * @values #AFE_API_VERSION_TDM_SLOT_CONFIG
3075 */
3076
3077 u16 num_channel;
3078 /* < number of channel of the audio sample.
3079 * @values 1, 2, 4, 6, 8 @tablebulletend
3080 */
3081
3082 u16 bitwidth;
3083 /* < Slot bit width for each channel
3084 * @values 16, 24, 32
3085 */
3086
3087 u32 data_align_type;
3088 /* < indicate how data packed from slot_offset for 32 slot bit width
3089 * in case of sample bit width is 24.
3090 * @values
3091 * #AFE_SLOT_MAPPING_DATA_ALIGN_MSB
3092 * #AFE_SLOT_MAPPING_DATA_ALIGN_LSB
3093 */
3094
3095 u16 offset[AFE_PORT_MAX_AUDIO_CHAN_CNT];
3096 /* < Array of the slot mapping start offset in bytes for this frame.
3097 * The bytes is counted from 0. The 0 is mapped to the 1st byte
3098 * in or out of the digital serial data line this sub-frame belong to.
3099 * slot_offset[] setting is per-channel based.
3100 * The max num of channel supported is 8.
3101 * The valid offset value must always be continuly placed in from
3102 * index 0.
3103 * Set offset as AFE_SLOT_MAPPING_OFFSET_INVALID for not used arrays.
3104 * If "slot_bitwidth_per_channel" is 32 and "sample_bitwidth" is 24,
3105 * "data_align_type" is used to indicate how 24 bit sample data in
3106 * aligning with 32 bit slot width per-channel.
3107 * @values, in byte
3108 */
3109} __packed;
3110
3111/* ID of the parameter used by #AFE_MODULE_TDM to configure
3112 * the customer TDM header. #AFE_PORT_CMD_SET_PARAM can use this parameter ID.
3113 */
3114#define AFE_PARAM_ID_CUSTOM_TDM_HEADER_CONFIG 0x00010298
3115
3116/* Version information used to handle future additions to custom TDM header
3117 * configuration (for backward compatibility).
3118 */
3119#define AFE_API_VERSION_CUSTOM_TDM_HEADER_CONFIG 0x1
3120
3121#define AFE_CUSTOM_TDM_HEADER_TYPE_INVALID 0x0
3122#define AFE_CUSTOM_TDM_HEADER_TYPE_DEFAULT 0x1
3123#define AFE_CUSTOM_TDM_HEADER_TYPE_ENTERTAINMENT_MOST 0x2
3124
3125#define AFE_CUSTOM_TDM_HEADER_MAX_CNT 0x8
3126
3127/* Payload of the AFE_PARAM_ID_CUSTOM_TDM_HEADER_CONFIG parameter ID */
3128struct afe_param_id_custom_tdm_header_cfg {
3129 u32 minor_version;
3130 /* < Minor version used for tracking custom TDM header configuration.
3131 * @values #AFE_API_VERSION_CUSTOM_TDM_HEADER_CONFIG
3132 */
3133
3134 u16 start_offset;
3135 /* < the slot mapping start offset in bytes from this sub-frame
3136 * The bytes is counted from 0. The 0 is mapped to the 1st byte in or
3137 * out of the digital serial data line this sub-frame belong to.
3138 * @values, in byte,
3139 * supported values are 0, 4, 8
3140 */
3141
3142 u16 header_width;
3143 /* < the header width per-frame followed.
3144 * 2 bytes for MOST/TDM case
3145 * @values, in byte
3146 * supported value is 2
3147 */
3148
3149 u16 header_type;
3150 /* < Indicate what kind of custom TDM header it is.
3151 * @values #AFE_CUSTOM_TDM_HEADER_TYPE_INVALID = 0
3152 * #AFE_CUSTOM_TDM_HEADER_TYPE_DEFAULT = 1 (for AAN channel per MOST)
3153 * #AFE_CUSTOM_TDM_HEADER_TYPE_ENTERTAINMENT_MOST = 2
3154 * (for entertainment channel, which will overwrite
3155 * AFE_API_VERSION_TDM_SAD_HEADER_TYPE_DEFAULT per MOST)
3156 */
3157
3158 u16 num_frame_repeat;
3159 /* < num of header followed.
3160 * @values, supported value is 8
3161 */
3162 u16 header[AFE_CUSTOM_TDM_HEADER_MAX_CNT];
3163 /* < SAD header for MOST/TDM case is followed as payload as below.
3164 * The size of followed SAD header in bytes is num_of_frame_repeat *
3165 * header_width_per_frame, which is 2 * 8 = 16 bytes here.
3166 * the supported payload format is in uint16_t as below
3167 * uint16_t header0; SyncHi 0x3C Info[4] - CodecType -> 0x3C00
3168 * uint16_t header1; SyncLo 0xB2 Info[5] - SampleWidth -> 0xB218
3169 * uint16_t header2; DTCP Info Info[6] - unused -> 0x0
3170 * uint16_t header3; Extension Info[7] - ASAD-Value -> 0xC0
3171 * uint16_t header4; Reserved Info[0] - Num of bytes following -> 0x7
3172 * uint16_t header5; Reserved Info[1] - Media Type -> 0x0
3173 * uint16_t header6; Reserved Info[2] - Bitrate[kbps] - High Byte -> 0x0
3174 * uint16_t header7; Reserved Info[3] - Bitrate[kbps] - Low Byte -> 0x0
3175 */
3176} __packed;
3177
3178struct afe_slot_mapping_config_command {
3179 struct apr_hdr hdr;
3180 struct afe_port_cmd_set_param_v2 param;
3181 struct afe_port_param_data_v2 pdata;
3182 struct afe_param_id_slot_mapping_cfg slot_mapping;
3183} __packed;
3184
3185struct afe_custom_tdm_header_config_command {
3186 struct apr_hdr hdr;
3187 struct afe_port_cmd_set_param_v2 param;
3188 struct afe_port_param_data_v2 pdata;
3189 struct afe_param_id_custom_tdm_header_cfg custom_tdm_header;
3190} __packed;
3191
3192struct afe_tdm_port_config {
3193 struct afe_param_id_tdm_cfg tdm;
3194 struct afe_param_id_slot_mapping_cfg slot_mapping;
3195 struct afe_param_id_custom_tdm_header_cfg custom_tdm_header;
3196} __packed;
3197
3198#define AFE_PARAM_ID_DEVICE_HW_DELAY 0x00010243
3199#define AFE_API_VERSION_DEVICE_HW_DELAY 0x1
3200
3201struct afe_param_id_device_hw_delay_cfg {
3202 uint32_t device_hw_delay_minor_version;
3203 uint32_t delay_in_us;
3204} __packed;
3205
3206#define AFE_PARAM_ID_SET_TOPOLOGY 0x0001025A
3207#define AFE_API_VERSION_TOPOLOGY_V1 0x1
3208
3209struct afe_param_id_set_topology_cfg {
3210 /*
3211 * Minor version used for tracking afe topology id configuration.
3212 * @values #AFE_API_VERSION_TOPOLOGY_V1
3213 */
3214 u32 minor_version;
3215 /*
3216 * Id of the topology for the afe session.
3217 * @values Any valid AFE topology ID
3218 */
3219 u32 topology_id;
3220} __packed;
3221
Aniket Kumar Lataf8664712018-02-22 14:46:09 -08003222#define MAX_ABR_LEVELS 5
3223
3224struct afe_bit_rate_level_map_t {
3225 /*
3226 * Key value pair for link quality level to bitrate
3227 * mapping in AFE
3228 */
3229 uint32_t link_quality_level;
3230 uint32_t bitrate;
3231} __packed;
3232
3233struct afe_quality_level_to_bitrate_info {
3234 /*
3235 * Number of quality levels being mapped.
3236 * This will be equal to the size of mapping table.
3237 */
3238 uint32_t num_levels;
3239 /*
3240 * Quality level to bitrate mapping table
3241 */
3242 struct afe_bit_rate_level_map_t bit_rate_level_map[MAX_ABR_LEVELS];
3243} __packed;
3244
3245struct afe_imc_dec_enc_info {
3246 /*
3247 * Decoder to encoder communication direction.
3248 * Transmit = 0 / Receive = 1
3249 */
3250 uint32_t direction;
3251 /*
3252 * Enable / disable IMC between decoder and encoder
3253 */
3254 uint32_t enable;
3255 /*
3256 * Purpose of IMC being set up between decoder and encoder.
3257 * Param ID defined for link quality feedback in LPASS will
3258 * be the default value sent as purpose.
3259 * Supported values:
3260 * AFE_ENCDEC_PURPOSE_ID_BT_INFO
3261 */
3262 uint32_t purpose;
3263 /*
3264 * Unique communication instance ID.
3265 * Data type a2dp_abr_instance used to set instance ID.
3266 * purpose and comm_instance together form the actual key
3267 * used in IMC registration, which must be the same for
3268 * encoder and decoder for which IMC is being set up.
3269 */
3270 uint32_t comm_instance;
3271} __packed;
3272
3273struct afe_abr_dec_cfg_t {
3274 struct afe_imc_dec_enc_info imc_info;
3275} __packed;
3276
3277struct afe_abr_enc_cfg_t {
3278 /*
3279 * Link quality level to bitrate mapping info sent to DSP.
3280 */
3281 struct afe_quality_level_to_bitrate_info mapping_info;
3282 /*
3283 * Information to set up IMC between decoder and encoder.
3284 */
3285 struct afe_imc_dec_enc_info imc_info;
3286} __packed;
3287
Preetam Singh Ranawat899b78b2017-09-07 12:36:06 -07003288#define AFE_PARAM_ID_APTX_SYNC_MODE 0x00013205
3289
3290struct afe_param_id_aptx_sync_mode {
3291 /*
3292 * sync mode: 0x0 = stereo sync mode (default)
3293 * 0x01 = dual mono sync mode
3294 * 0x02 = dual mono with no sync on either L or R
3295 */
3296 uint32_t sync_mode;
3297} __packed;
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05303298
3299/*
3300 * Generic encoder module ID.
3301 * This module supports the following parameter IDs:
3302 * #AVS_ENCODER_PARAM_ID_ENC_FMT_ID (cannot be set run time)
3303 * #AVS_ENCODER_PARAM_ID_ENC_CFG_BLK (may be set run time)
3304 * #AVS_ENCODER_PARAM_ID_ENC_BITRATE (may be set run time)
3305 * #AVS_ENCODER_PARAM_ID_PACKETIZER_ID (cannot be set run time)
3306 * Opcode - AVS_MODULE_ID_ENCODER
3307 * AFE Command AFE_PORT_CMD_SET_PARAM_V2 supports this module ID.
3308 */
3309#define AFE_MODULE_ID_ENCODER 0x00013229
3310
3311/* Macro for defining the packetizer ID: COP. */
3312#define AFE_MODULE_ID_PACKETIZER_COP 0x0001322A
3313
3314/*
3315 * Packetizer type parameter for the #AVS_MODULE_ID_ENCODER module.
3316 * This parameter cannot be set runtime.
3317 */
3318#define AFE_ENCODER_PARAM_ID_PACKETIZER_ID 0x0001322E
3319
3320/*
3321 * Encoder config block parameter for the #AVS_MODULE_ID_ENCODER module.
3322 * This parameter may be set runtime.
3323 */
3324#define AFE_ENCODER_PARAM_ID_ENC_CFG_BLK 0x0001322C
3325
3326/*
3327 * Encoder format ID parameter for the #AVS_MODULE_ID_ENCODER module.
3328 * This parameter cannot be set runtime.
3329 */
3330#define AFE_ENCODER_PARAM_ID_ENC_FMT_ID 0x0001322B
3331
3332/*
Preetam Singh Ranawatf746a872017-10-20 18:13:14 +05303333 * Encoder scrambler parameter for the #AVS_MODULE_ID_ENCODER module.
3334 * This parameter cannot be set runtime.
3335 */
3336#define AFE_ENCODER_PARAM_ID_ENABLE_SCRAMBLING 0x0001323C
3337
3338/*
Aniket Kumar Lataf8664712018-02-22 14:46:09 -08003339 * Link quality level to bitrate mapping info sent to AFE Encoder.
3340 * This parameter may be set runtime.
3341 */
3342#define AFE_ENCODER_PARAM_ID_BIT_RATE_LEVEL_MAP 0x000132E1
3343
3344/*
3345 * Parameter to set up Inter Module Communication (IMC) between
3346 * AFE Decoder and Encoder.
3347 * This parameter may be set runtime.
3348 */
3349#define AFE_ENCDEC_PARAM_ID_DEC_TO_ENC_COMMUNICATION 0x0001323D
3350
3351/*
3352 * Purpose of IMC set up between encoder and decoder.
3353 * Communication instance and purpose together form the
3354 * actual key used for IMC registration.
3355 */
3356#define AFE_ENCDEC_PURPOSE_ID_BT_INFO 0x000132E2
3357
3358#define AFE_MODULE_ID_DECODER 0x00013231
3359
3360/*
3361 * Macro for defining the depacketizer ID: COP.
3362 */
3363#define AFE_MODULE_ID_DEPACKETIZER_COP 0x00013233
3364
3365/*
3366 * Depacketizer type parameter for the #AVS_MODULE_ID_DECODER module.
3367 * This parameter cannot be set runtime.
3368 */
3369#define AFE_DECODER_PARAM_ID_DEPACKETIZER_ID 0x00013235
3370
Manisha Agarwal472fc1e2018-11-04 15:46:02 +05303371#define CAPI_V2_PARAM_ID_APTX_ENC_SWITCH_TO_MONO 0x0001332A
3372
3373struct aptx_channel_mode_param_t {
3374 struct apr_hdr hdr;
3375 struct afe_port_cmd_set_param_v2 param;
3376 struct afe_port_param_data_v2 pdata;
3377 u32 channel_mode;
3378} __packed;
Aniket Kumar Lataf8664712018-02-22 14:46:09 -08003379/*
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05303380 * Data format to send compressed data
3381 * is transmitted/received over Slimbus lines.
3382 */
3383#define AFE_SB_DATA_FORMAT_GENERIC_COMPRESSED 0x3
3384
3385/*
3386 * ID for AFE port module. This will be used to define port properties.
3387 * This module supports following parameter IDs:
3388 * #AFE_PARAM_ID_PORT_MEDIA_TYPE
3389 * To configure the port property, the client must use the
3390 * #AFE_PORT_CMD_SET_PARAM_V2 command,
3391 * and fill the module ID with the respective parameter IDs as listed above.
3392 * @apr_hdr_fields
3393 * Opcode -- AFE_MODULE_PORT
3394 */
3395#define AFE_MODULE_PORT 0x000102a6
3396
3397/*
3398 * ID of the parameter used by #AFE_MODULE_PORT to set the port media type.
3399 * parameter ID is currently supported using#AFE_PORT_CMD_SET_PARAM_V2 command.
3400 */
3401#define AFE_PARAM_ID_PORT_MEDIA_TYPE 0x000102a7
3402
3403/*
3404 * Macros for defining the "data_format" field in the
3405 * #AFE_PARAM_ID_PORT_MEDIA_TYPE
3406 */
3407#define AFE_PORT_DATA_FORMAT_PCM 0x0
3408#define AFE_PORT_DATA_FORMAT_GENERIC_COMPRESSED 0x1
3409
3410/*
3411 * Macro for defining the "minor_version" field in the
3412 * #AFE_PARAM_ID_PORT_MEDIA_TYPE
3413 */
3414#define AFE_API_VERSION_PORT_MEDIA_TYPE 0x1
3415
3416#define ASM_MEDIA_FMT_NONE 0x0
3417
3418/*
3419 * Media format ID for SBC encode configuration.
3420 * @par SBC encode configuration (asm_sbc_enc_cfg_t)
3421 * @table{weak__asm__sbc__enc__cfg__t}
3422 */
3423#define ASM_MEDIA_FMT_SBC 0x00010BF2
3424
3425/* SBC channel Mono mode.*/
3426#define ASM_MEDIA_FMT_SBC_CHANNEL_MODE_MONO 1
3427
3428/* SBC channel Stereo mode. */
3429#define ASM_MEDIA_FMT_SBC_CHANNEL_MODE_STEREO 2
3430
3431/* SBC channel Dual Mono mode. */
3432#define ASM_MEDIA_FMT_SBC_CHANNEL_MODE_DUAL_MONO 8
3433
3434/* SBC channel Joint Stereo mode. */
3435#define ASM_MEDIA_FMT_SBC_CHANNEL_MODE_JOINT_STEREO 9
3436
3437/* SBC bit allocation method = loudness. */
3438#define ASM_MEDIA_FMT_SBC_ALLOCATION_METHOD_LOUDNESS 0
3439
3440/* SBC bit allocation method = SNR. */
3441#define ASM_MEDIA_FMT_SBC_ALLOCATION_METHOD_SNR 1
3442
3443
3444/*
3445 * Payload of the SBC encoder configuration parameters in the
3446 * #ASM_MEDIA_FMT_SBC media format.
3447 */
3448struct asm_sbc_enc_cfg_t {
3449 /*
3450 * Number of subbands.
3451 * @values 4, 8
3452 */
3453 uint32_t num_subbands;
3454
3455 /*
3456 * Size of the encoded block in samples.
3457 * @values 4, 8, 12, 16
3458 */
3459 uint32_t blk_len;
3460
3461 /*
3462 * Mode used to allocate bits between channels.
3463 * @values
3464 * 0 (Native mode)
3465 * #ASM_MEDIA_FMT_SBC_CHANNEL_MODE_MONO
3466 * #ASM_MEDIA_FMT_SBC_CHANNEL_MODE_STEREO
3467 * #ASM_MEDIA_FMT_SBC_CHANNEL_MODE_DUAL_MONO
3468 * #ASM_MEDIA_FMT_SBC_CHANNEL_MODE_JOINT_STEREO
3469 * Native mode indicates that encoding must be performed with the number
3470 * of channels at the input.
3471 * If postprocessing outputs one-channel data, Mono mode is used. If
3472 * postprocessing outputs two-channel data, Stereo mode is used.
3473 * The number of channels must not change during encoding.
3474 */
3475 uint32_t channel_mode;
3476
3477 /*
3478 * Encoder bit allocation method.
3479 * @values
3480 * #ASM_MEDIA_FMT_SBC_ALLOCATION_METHOD_LOUDNESS
3481 * #ASM_MEDIA_FMT_SBC_ALLOCATION_METHOD_SNR @tablebulletend
3482 */
3483 uint32_t alloc_method;
3484
3485 /*
3486 * Number of encoded bits per second.
3487 * @values
3488 * Mono channel -- Maximum of 320 kbps
3489 * Stereo channel -- Maximum of 512 kbps @tablebulletend
3490 */
3491 uint32_t bit_rate;
3492
3493 /*
3494 * Number of samples per second.
3495 * @values 0 (Native mode), 16000, 32000, 44100, 48000&nbsp;Hz
3496 * Native mode indicates that encoding must be performed with the
3497 * sampling rate at the input.
3498 * The sampling rate must not change during encoding.
3499 */
3500 uint32_t sample_rate;
3501};
3502
3503#define ASM_MEDIA_FMT_AAC_AOT_LC 2
3504#define ASM_MEDIA_FMT_AAC_AOT_SBR 5
3505#define ASM_MEDIA_FMT_AAC_AOT_PS 29
3506#define ASM_MEDIA_FMT_AAC_FORMAT_FLAG_ADTS 0
3507#define ASM_MEDIA_FMT_AAC_FORMAT_FLAG_RAW 3
3508
3509struct asm_aac_enc_cfg_v2_t {
3510
3511 /* Encoding rate in bits per second.*/
3512 uint32_t bit_rate;
3513
3514 /*
3515 * Encoding mode.
3516 * Supported values:
3517 * #ASM_MEDIA_FMT_AAC_AOT_LC
3518 * #ASM_MEDIA_FMT_AAC_AOT_SBR
3519 * #ASM_MEDIA_FMT_AAC_AOT_PS
3520 */
3521 uint32_t enc_mode;
3522
3523 /*
3524 * AAC format flag.
3525 * Supported values:
3526 * #ASM_MEDIA_FMT_AAC_FORMAT_FLAG_ADTS
3527 * #ASM_MEDIA_FMT_AAC_FORMAT_FLAG_RAW
3528 */
3529 uint16_t aac_fmt_flag;
3530
3531 /*
3532 * Number of channels to encode.
3533 * Supported values:
3534 * 0 - Native mode
3535 * 1 - Mono
3536 * 2 - Stereo
3537 * Other values are not supported.
3538 * @note1hang The eAAC+ encoder mode supports only stereo.
3539 * Native mode indicates that encoding must be performed with the
3540 * number of channels at the input.
3541 * The number of channels must not change during encoding.
3542 */
3543 uint16_t channel_cfg;
3544
3545 /*
3546 * Number of samples per second.
3547 * Supported values: - 0 -- Native mode - For other values,
3548 * Native mode indicates that encoding must be performed with the
3549 * sampling rate at the input.
3550 * The sampling rate must not change during encoding.
3551 */
3552 uint32_t sample_rate;
3553} __packed;
3554
3555/* FMT ID for apt-X Classic */
3556#define ASM_MEDIA_FMT_APTX 0x000131ff
3557
3558/* FMT ID for apt-X HD */
3559#define ASM_MEDIA_FMT_APTX_HD 0x00013200
3560
3561#define PCM_CHANNEL_L 1
3562#define PCM_CHANNEL_R 2
3563#define PCM_CHANNEL_C 3
3564
Preetam Singh Ranawat54028492017-09-04 11:42:26 +05303565struct asm_custom_enc_cfg_t {
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05303566 uint32_t sample_rate;
3567 /* Mono or stereo */
3568 uint16_t num_channels;
3569 uint16_t reserved;
3570 /* num_ch == 1, then PCM_CHANNEL_C,
3571 * num_ch == 2, then {PCM_CHANNEL_L, PCM_CHANNEL_R}
3572 */
3573 uint8_t channel_mapping[8];
3574 uint32_t custom_size;
3575} __packed;
Preetam Singh Ranawat899b78b2017-09-07 12:36:06 -07003576
3577struct asm_aptx_v2_enc_cfg_ext_t {
3578 /*
3579 * sync mode: 0x0 = stereo sync mode (default)
3580 * 0x01 = dual mono sync mode
3581 * 0x02 = dual mono with no sync on either L or R
3582 */
3583 uint32_t sync_mode;
3584} __packed;
3585
3586struct asm_aptx_enc_cfg_t {
3587 struct asm_custom_enc_cfg_t custom_cfg;
3588 struct asm_aptx_v2_enc_cfg_ext_t aptx_v2_cfg;
3589} __packed;
3590
Preetam Singh Ranawat54028492017-09-04 11:42:26 +05303591#define ASM_MEDIA_FMT_CELT 0x00013221
3592struct asm_celt_specific_enc_cfg_t {
3593 /*
3594 * Bit rate used for encoding.
3595 * This is used to calculate the upper threshold
3596 * for bytes per frame if vbr_flag is 1.
3597 * Or else, this will be used as a regular constant
3598 * bit rate for encoder output.
3599 * @Range : 32000 to 1536000
3600 * @Default: 128
3601 */
3602 uint32_t bit_rate;
3603 /*
3604 * Frame size used for encoding.
3605 * @Range : 64, 128, 256, 512
3606 * @Default: 256
3607 */
3608 uint16_t frame_size;
3609 /*
3610 * complexity of algorithm.
3611 * @Range : 0-10
3612 * @Default: 3
3613 */
3614 uint16_t complexity;
3615 /*
3616 * Switch variable for prediction feature.
3617 * Used to choose between the level of interframe
3618 * predictions allowed while encoding.
3619 * @Range:
3620 * 0: Independent Frames.
3621 * 1: Short Term interframe prediction allowed.
3622 * 2: Long term prediction allowed.
3623 * @Default: 2
3624 */
3625 uint16_t prediction_mode;
3626 /*
3627 * Variable Bit Rate flag.
3628 * @Default: 0
3629 */
3630 uint16_t vbr_flag;
3631} __packed;
3632
3633struct asm_celt_enc_cfg_t {
3634 struct asm_custom_enc_cfg_t custom_config;
3635 struct asm_celt_specific_enc_cfg_t celt_specific_config;
3636} __packed;
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05303637
Preetam Singh Ranawat0a087af2017-10-25 15:02:28 +05303638#define ASM_MEDIA_FMT_LDAC 0x00013224
3639struct asm_ldac_specific_enc_cfg_t {
3640 /*
3641 * This is used to calculate the encoder output
3642 * bytes per frame (i.e. bytes per packet).
3643 * Bit rate also configures the EQMID.
3644 * The min bit rate 303000 bps is calculated for
3645 * 44.1 kHz and 88.2 KHz sampling frequencies with
3646 * Mobile use Quality.
3647 * The max bit rate of 990000 bps is calculated for
3648 * 96kHz and 48 KHz with High Quality
3649 * @Range(in bits per second)
3650 * 303000 for Mobile use Quality
3651 * 606000 for standard Quality
3652 * 909000 for High Quality
3653 */
3654 uint32_t bit_rate;
3655 /*
3656 * The channel setting information for LDAC specification
3657 * of Bluetooth A2DP which is determined by SRC and SNK
3658 * devices in Bluetooth transmission.
3659 * @Range:
3660 * 0 for native mode
3661 * 4 for mono
3662 * 2 for dual channel
3663 * 1 for stereo
3664 */
3665 uint16_t channel_mode;
3666 /*
3667 * Maximum Transmission Unit (MTU).
3668 * The minimum MTU that a L2CAP implementation for LDAC shall
3669 * support is 679 bytes, because LDAC is optimized with 2-DH5
3670 * packet as its target.
3671 * @Range : 679
3672 * @Default: 679 for LDACBT_MTU_2DH5
3673 */
3674 uint16_t mtu;
3675} __packed;
3676
3677struct asm_ldac_enc_cfg_t {
3678 struct asm_custom_enc_cfg_t custom_config;
3679 struct asm_ldac_specific_enc_cfg_t ldac_specific_config;
Aniket Kumar Lataf8664712018-02-22 14:46:09 -08003680 struct afe_abr_enc_cfg_t abr_config;
Preetam Singh Ranawat0a087af2017-10-25 15:02:28 +05303681} __packed;
3682
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05303683struct afe_enc_fmt_id_param_t {
3684 /*
3685 * Supported values:
3686 * #ASM_MEDIA_FMT_SBC
3687 * #ASM_MEDIA_FMT_AAC_V2
3688 * Any OpenDSP supported values
3689 */
3690 uint32_t fmt_id;
3691} __packed;
3692
3693struct afe_port_media_type_t {
3694 /*
3695 * Minor version
3696 * @values #AFE_API_VERSION_PORT_MEDIA_TYPE.
3697 */
3698 uint32_t minor_version;
3699
3700 /*
3701 * Sampling rate of the port.
3702 * @values
3703 * #AFE_PORT_SAMPLE_RATE_8K
3704 * #AFE_PORT_SAMPLE_RATE_11_025K
3705 * #AFE_PORT_SAMPLE_RATE_12K
3706 * #AFE_PORT_SAMPLE_RATE_16K
3707 * #AFE_PORT_SAMPLE_RATE_22_05K
3708 * #AFE_PORT_SAMPLE_RATE_24K
3709 * #AFE_PORT_SAMPLE_RATE_32K
3710 * #AFE_PORT_SAMPLE_RATE_44_1K
3711 * #AFE_PORT_SAMPLE_RATE_48K
3712 * #AFE_PORT_SAMPLE_RATE_88_2K
3713 * #AFE_PORT_SAMPLE_RATE_96K
3714 * #AFE_PORT_SAMPLE_RATE_176_4K
3715 * #AFE_PORT_SAMPLE_RATE_192K
3716 * #AFE_PORT_SAMPLE_RATE_352_8K
3717 * #AFE_PORT_SAMPLE_RATE_384K
3718 */
3719 uint32_t sample_rate;
3720
3721 /*
3722 * Bit width of the sample.
3723 * @values 16, 24
3724 */
3725 uint16_t bit_width;
3726
3727 /*
3728 * Number of channels.
3729 * @values 1 to #AFE_PORT_MAX_AUDIO_CHAN_CNT
3730 */
3731 uint16_t num_channels;
3732
3733 /*
3734 * Data format supported by this port.
3735 * If the port media type and device media type are different,
3736 * it signifies a encoding/decoding use case
3737 * @values
3738 * #AFE_PORT_DATA_FORMAT_PCM
3739 * #AFE_PORT_DATA_FORMAT_GENERIC_COMPRESSED
3740 */
3741 uint16_t data_format;
3742
3743 /*This field must be set to zero.*/
3744 uint16_t reserved;
3745} __packed;
3746
3747union afe_enc_config_data {
3748 struct asm_sbc_enc_cfg_t sbc_config;
3749 struct asm_aac_enc_cfg_v2_t aac_config;
Preetam Singh Ranawat54028492017-09-04 11:42:26 +05303750 struct asm_custom_enc_cfg_t custom_config;
3751 struct asm_celt_enc_cfg_t celt_config;
Preetam Singh Ranawat899b78b2017-09-07 12:36:06 -07003752 struct asm_aptx_enc_cfg_t aptx_config;
Preetam Singh Ranawat0a087af2017-10-25 15:02:28 +05303753 struct asm_ldac_enc_cfg_t ldac_config;
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05303754};
3755
3756struct afe_enc_config {
3757 u32 format;
Preetam Singh Ranawatf746a872017-10-20 18:13:14 +05303758 u32 scrambler_mode;
Manisha Agarwal472fc1e2018-11-04 15:46:02 +05303759 u32 mono_mode;
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05303760 union afe_enc_config_data data;
3761};
3762
Aniket Kumar Lataf8664712018-02-22 14:46:09 -08003763struct afe_dec_config {
3764 u32 format;
3765 struct afe_abr_dec_cfg_t abr_dec_cfg;
3766};
3767
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05303768struct afe_enc_cfg_blk_param_t {
3769 uint32_t enc_cfg_blk_size;
3770 /*
3771 *Size of the encoder configuration block that follows this member
3772 */
3773 union afe_enc_config_data enc_blk_config;
3774};
3775
3776/*
3777 * Payload of the AVS_ENCODER_PARAM_ID_PACKETIZER_ID parameter.
3778 */
3779struct avs_enc_packetizer_id_param_t {
3780 /*
3781 * Supported values:
3782 * #AVS_MODULE_ID_PACKETIZER_COP
3783 * Any OpenDSP supported values
3784 */
3785 uint32_t enc_packetizer_id;
3786};
3787
Preetam Singh Ranawatf746a872017-10-20 18:13:14 +05303788/*
3789 * Payload of the AVS_ENCODER_PARAM_ID_ENABLE_SCRAMBLING parameter.
3790 */
3791struct avs_enc_set_scrambler_param_t {
3792 /*
3793 * Supported values:
3794 * 1 : enable scrambler
3795 * 0 : disable scrambler
3796 */
3797 uint32_t enable_scrambler;
3798};
3799
Aniket Kumar Lataf8664712018-02-22 14:46:09 -08003800/*
Manisha Agarwal472fc1e2018-11-04 15:46:02 +05303801 * Payload of the CAPI_V2_PARAM_ID_APTX_ENC_SWITCH_TO_MONO parameter.
3802 */
3803struct afe_enc_set_channel_mode_param_t {
3804 /*
3805 * Supported values:
3806 * 1 : mono
3807 * 2 : dual_mono
3808 */
3809 u32 channel_mode;
3810};
3811
3812/*
Aniket Kumar Lataf8664712018-02-22 14:46:09 -08003813 * Payload of the AVS_ENCODER_PARAM_ID_BIT_RATE_LEVEL_MAP parameter.
3814 */
3815struct afe_enc_level_to_bitrate_map_param_t {
3816 /*
3817 * Parameter for mapping link quality level to bitrate.
3818 */
3819 struct afe_quality_level_to_bitrate_info mapping_table;
3820};
3821
3822/*
3823 * Payload of the AVS_ENCDEC_PARAM_ID_DEC_TO_ENC_COMMUNICATION parameter.
3824 */
3825struct afe_enc_dec_imc_info_param_t {
3826 /*
3827 * Parameter to set up Inter Module Communication (IMC) between
3828 * AFE Decoder and Encoder.
3829 */
3830 struct afe_imc_dec_enc_info imc_info;
3831};
3832
3833/*
3834 * Payload of the AVS_DECODER_PARAM_ID_DEPACKETIZER_ID parameter.
3835 */
3836struct avs_dec_depacketizer_id_param_t {
3837 /*
3838 * Supported values:
3839 * #AVS_MODULE_ID_DEPACKETIZER_COP
3840 * Any OpenDSP supported values
3841 */
3842 uint32_t dec_depacketizer_id;
3843};
3844
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05303845union afe_port_config {
3846 struct afe_param_id_pcm_cfg pcm;
3847 struct afe_param_id_i2s_cfg i2s;
3848 struct afe_param_id_hdmi_multi_chan_audio_cfg hdmi_multi_ch;
3849 struct afe_param_id_slimbus_cfg slim_sch;
3850 struct afe_param_id_rt_proxy_port_cfg rtproxy;
3851 struct afe_param_id_internal_bt_fm_cfg int_bt_fm;
3852 struct afe_param_id_pseudo_port_cfg pseudo_port;
3853 struct afe_param_id_device_hw_delay_cfg hw_delay;
3854 struct afe_param_id_spdif_cfg spdif;
3855 struct afe_param_id_set_topology_cfg topology;
3856 struct afe_param_id_tdm_cfg tdm;
3857 struct afe_param_id_usb_audio_cfg usb_audio;
Preetam Singh Ranawat899b78b2017-09-07 12:36:06 -07003858 struct afe_param_id_aptx_sync_mode sync_mode_param;
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05303859 struct afe_enc_fmt_id_param_t enc_fmt;
3860 struct afe_port_media_type_t media_type;
3861 struct afe_enc_cfg_blk_param_t enc_blk_param;
3862 struct avs_enc_packetizer_id_param_t enc_pkt_id_param;
Preetam Singh Ranawatf746a872017-10-20 18:13:14 +05303863 struct avs_enc_set_scrambler_param_t enc_set_scrambler_param;
Aniket Kumar Lataf8664712018-02-22 14:46:09 -08003864 struct avs_dec_depacketizer_id_param_t dec_depkt_id_param;
3865 struct afe_enc_level_to_bitrate_map_param_t map_param;
3866 struct afe_enc_dec_imc_info_param_t imc_info_param;
Manisha Agarwal472fc1e2018-11-04 15:46:02 +05303867 struct afe_enc_set_channel_mode_param_t channel_mode_param;
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05303868} __packed;
3869
3870struct afe_audioif_config_command_no_payload {
3871 struct apr_hdr hdr;
3872 struct afe_port_cmd_set_param_v2 param;
3873} __packed;
3874
3875struct afe_audioif_config_command {
3876 struct apr_hdr hdr;
3877 struct afe_port_cmd_set_param_v2 param;
3878 struct afe_port_param_data_v2 pdata;
3879 union afe_port_config port;
3880} __packed;
3881
3882#define AFE_PORT_CMD_DEVICE_START 0x000100E5
3883
3884/* Payload of the #AFE_PORT_CMD_DEVICE_START.*/
3885struct afe_port_cmd_device_start {
3886 struct apr_hdr hdr;
3887 u16 port_id;
3888/* Port interface and direction (Rx or Tx) to start. An even
3889 * number represents the Rx direction, and an odd number represents
3890 * the Tx direction.
3891 */
3892
3893
3894 u16 reserved;
3895/* Reserved for 32-bit alignment. This field must be set to 0.*/
3896
3897} __packed;
3898
3899#define AFE_PORT_CMD_DEVICE_STOP 0x000100E6
3900
3901/* Payload of the #AFE_PORT_CMD_DEVICE_STOP. */
3902struct afe_port_cmd_device_stop {
3903 struct apr_hdr hdr;
3904 u16 port_id;
3905/* Port interface and direction (Rx or Tx) to start. An even
3906 * number represents the Rx direction, and an odd number represents
3907 * the Tx direction.
3908 */
3909
3910 u16 reserved;
3911/* Reserved for 32-bit alignment. This field must be set to 0.*/
3912} __packed;
3913
3914#define AFE_SERVICE_CMD_SHARED_MEM_MAP_REGIONS 0x000100EA
3915
3916/* Memory map regions command payload used by the
3917 * #AFE_SERVICE_CMD_SHARED_MEM_MAP_REGIONS .
3918 * This structure allows clients to map multiple shared memory
3919 * regions in a single command. Following this structure are
3920 * num_regions of afe_service_shared_map_region_payload.
3921 */
3922struct afe_service_cmd_shared_mem_map_regions {
3923 struct apr_hdr hdr;
3924u16 mem_pool_id;
3925/* Type of memory on which this memory region is mapped.
3926 * Supported values:
3927 * - #ADSP_MEMORY_MAP_EBI_POOL
3928 * - #ADSP_MEMORY_MAP_SMI_POOL
3929 * - #ADSP_MEMORY_MAP_SHMEM8_4K_POOL
3930 * - Other values are reserved
3931 *
3932 * The memory pool ID implicitly defines the characteristics of the
3933 * memory. Characteristics may include alignment type, permissions,
3934 * etc.
3935 *
3936 * ADSP_MEMORY_MAP_EBI_POOL is External Buffer Interface type memory
3937 * ADSP_MEMORY_MAP_SMI_POOL is Shared Memory Interface type memory
3938 * ADSP_MEMORY_MAP_SHMEM8_4K_POOL is shared memory, byte
3939 * addressable, and 4 KB aligned.
3940 */
3941
3942
3943 u16 num_regions;
3944/* Number of regions to map.
3945 * Supported values:
3946 * - Any value greater than zero
3947 */
3948
3949 u32 property_flag;
3950/* Configures one common property for all the regions in the
3951 * payload.
3952 *
3953 * Supported values: - 0x00000000 to 0x00000001
3954 *
3955 * b0 - bit 0 indicates physical or virtual mapping 0 Shared memory
3956 * address provided in afe_service_shared_map_region_payloadis a
3957 * physical address. The shared memory needs to be mapped( hardware
3958 * TLB entry) and a software entry needs to be added for internal
3959 * book keeping.
3960 *
3961 * 1 Shared memory address provided in
3962 * afe_service_shared_map_region_payloadis a virtual address. The
3963 * shared memory must not be mapped (since hardware TLB entry is
3964 * already available) but a software entry needs to be added for
3965 * internal book keeping. This can be useful if two services with in
3966 * ADSP is communicating via APR. They can now directly communicate
3967 * via the Virtual address instead of Physical address. The virtual
3968 * regions must be contiguous. num_regions must be 1 in this case.
3969 *
3970 * b31-b1 - reserved bits. must be set to zero
3971 */
3972
3973
3974} __packed;
3975/* Map region payload used by the
3976 * afe_service_shared_map_region_payloadstructure.
3977 */
3978struct afe_service_shared_map_region_payload {
3979 u32 shm_addr_lsw;
3980/* least significant word of starting address in the memory
3981 * region to map. It must be contiguous memory, and it must be 4 KB
3982 * aligned.
3983 * Supported values: - Any 32 bit value
3984 */
3985
3986
3987 u32 shm_addr_msw;
3988/* most significant word of startng address in the memory region
3989 * to map. For 32 bit shared memory address, this field must be set
3990 * to zero. For 36 bit shared memory address, bit31 to bit 4 must be
3991 * set to zero
3992 *
3993 * Supported values: - For 32 bit shared memory address, this field
3994 * must be set to zero. - For 36 bit shared memory address, bit31 to
3995 * bit 4 must be set to zero - For 64 bit shared memory address, any
3996 * 32 bit value
3997 */
3998
3999
4000 u32 mem_size_bytes;
4001/* Number of bytes in the region. The aDSP will always map the
4002 * regions as virtual contiguous memory, but the memory size must be
4003 * in multiples of 4 KB to avoid gaps in the virtually contiguous
4004 * mapped memory.
4005 *
4006 * Supported values: - multiples of 4KB
4007 */
4008
4009} __packed;
4010
4011#define AFE_SERVICE_CMDRSP_SHARED_MEM_MAP_REGIONS 0x000100EB
4012struct afe_service_cmdrsp_shared_mem_map_regions {
4013 u32 mem_map_handle;
4014/* A memory map handle encapsulating shared memory attributes is
4015 * returned iff AFE_SERVICE_CMD_SHARED_MEM_MAP_REGIONS command is
4016 * successful. In the case of failure , a generic APR error response
4017 * is returned to the client.
4018 *
4019 * Supported Values: - Any 32 bit value
4020 */
4021
4022} __packed;
4023#define AFE_SERVICE_CMD_SHARED_MEM_UNMAP_REGIONS 0x000100EC
4024/* Memory unmap regions command payload used by the
4025 * #AFE_SERVICE_CMD_SHARED_MEM_UNMAP_REGIONS
4026 *
4027 * This structure allows clients to unmap multiple shared memory
4028 * regions in a single command.
4029 */
4030
4031
4032struct afe_service_cmd_shared_mem_unmap_regions {
4033 struct apr_hdr hdr;
4034u32 mem_map_handle;
4035/* memory map handle returned by
4036 * AFE_SERVICE_CMD_SHARED_MEM_MAP_REGIONS commands
4037 *
4038 * Supported Values:
4039 * - Any 32 bit value
4040 */
4041} __packed;
4042
4043#define AFE_PORT_CMD_GET_PARAM_V2 0x000100F0
4044
4045/* Payload of the #AFE_PORT_CMD_GET_PARAM_V2 command,
4046 * which queries for one post/preprocessing parameter of a
4047 * stream.
4048 */
4049struct afe_port_cmd_get_param_v2 {
4050 u16 port_id;
4051/* Port interface and direction (Rx or Tx) to start. */
4052
4053 u16 payload_size;
4054/* Maximum data size of the parameter ID/module ID combination.
4055 * This is a multiple of four bytes
4056 * Supported values: > 0
4057 */
4058
4059 u32 payload_address_lsw;
4060/* LSW of 64 bit Payload address. Address should be 32-byte,
4061 * 4kbyte aligned and must be contig memory.
4062 */
4063
4064
4065 u32 payload_address_msw;
4066/* MSW of 64 bit Payload address. In case of 32-bit shared
4067 * memory address, this field must be set to zero. In case of 36-bit
4068 * shared memory address, bit-4 to bit-31 must be set to zero.
4069 * Address should be 32-byte, 4kbyte aligned and must be contiguous
4070 * memory.
4071 */
4072
4073 u32 mem_map_handle;
4074/* Memory map handle returned by
4075 * AFE_SERVICE_CMD_SHARED_MEM_MAP_REGIONS commands.
4076 * Supported Values: - NULL -- Message. The parameter data is
4077 * in-band. - Non-NULL -- The parameter data is Out-band.Pointer to
4078 * - the physical address in shared memory of the payload data.
4079 * For detailed payload content, see the afe_port_param_data_v2
4080 * structure
4081 */
4082
4083
4084 u32 module_id;
4085/* ID of the module to be queried.
4086 * Supported values: Valid module ID
4087 */
4088
4089 u32 param_id;
4090/* ID of the parameter to be queried.
4091 * Supported values: Valid parameter ID
4092 */
4093} __packed;
4094
4095#define AFE_PORT_CMDRSP_GET_PARAM_V2 0x00010106
4096
4097/* Payload of the #AFE_PORT_CMDRSP_GET_PARAM_V2 message, which
4098 * responds to an #AFE_PORT_CMD_GET_PARAM_V2 command.
4099 *
4100 * Immediately following this structure is the parameters structure
4101 * (afe_port_param_data) containing the response(acknowledgment)
4102 * parameter payload. This payload is included for an in-band
4103 * scenario. For an address/shared memory-based set parameter, this
4104 * payload is not needed.
4105 */
4106
4107
4108struct afe_port_cmdrsp_get_param_v2 {
4109 u32 status;
4110} __packed;
4111
4112#define AFE_PARAM_ID_LPASS_CORE_SHARED_CLOCK_CONFIG 0x0001028C
4113#define AFE_API_VERSION_LPASS_CORE_SHARED_CLK_CONFIG 0x1
4114
4115/* Payload of the AFE_PARAM_ID_LPASS_CORE_SHARED_CLOCK_CONFIG parameter used by
4116 * AFE_MODULE_AUDIO_DEV_INTERFACE.
4117 */
4118struct afe_param_id_lpass_core_shared_clk_cfg {
4119 u32 lpass_core_shared_clk_cfg_minor_version;
4120/*
4121 * Minor version used for lpass core shared clock configuration
4122 * Supported value: AFE_API_VERSION_LPASS_CORE_SHARED_CLK_CONFIG
4123 */
4124 u32 enable;
4125/*
4126 * Specifies whether the lpass core shared clock is
4127 * enabled (1) or disabled (0).
4128 */
4129} __packed;
4130
4131struct afe_lpass_core_shared_clk_config_command {
4132 struct apr_hdr hdr;
4133 struct afe_port_cmd_set_param_v2 param;
4134 struct afe_port_param_data_v2 pdata;
4135 struct afe_param_id_lpass_core_shared_clk_cfg clk_cfg;
4136} __packed;
4137
4138/* adsp_afe_service_commands.h */
4139
4140#define ADSP_MEMORY_MAP_EBI_POOL 0
4141
4142#define ADSP_MEMORY_MAP_SMI_POOL 1
4143#define ADSP_MEMORY_MAP_IMEM_POOL 2
4144#define ADSP_MEMORY_MAP_SHMEM8_4K_POOL 3
4145
4146/* Definition of virtual memory flag */
4147#define ADSP_MEMORY_MAP_VIRTUAL_MEMORY 1
4148
4149/* Definition of physical memory flag */
4150#define ADSP_MEMORY_MAP_PHYSICAL_MEMORY 0
4151
4152#define NULL_POPP_TOPOLOGY 0x00010C68
4153#define NULL_COPP_TOPOLOGY 0x00010312
4154#define DEFAULT_COPP_TOPOLOGY 0x00010314
4155#define DEFAULT_POPP_TOPOLOGY 0x00010BE4
4156#define COMPRESSED_PASSTHROUGH_DEFAULT_TOPOLOGY 0x0001076B
4157#define COMPRESSED_PASSTHROUGH_NONE_TOPOLOGY 0x00010774
Bala Kishore Pati798cbf82018-10-22 11:58:41 +05304158#define VPM_TX_SM_ECNS_COPP_TOPOLOGY 0x00010F71
Laxminath Kasam8f7ccc22017-08-28 17:35:04 +05304159#define VPM_TX_SM_ECNS_V2_COPP_TOPOLOGY 0x00010F89
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05304160#define VPM_TX_DM_FLUENCE_COPP_TOPOLOGY 0x00010F72
4161#define VPM_TX_QMIC_FLUENCE_COPP_TOPOLOGY 0x00010F75
4162#define VPM_TX_DM_RFECNS_COPP_TOPOLOGY 0x00010F86
4163#define ADM_CMD_COPP_OPEN_TOPOLOGY_ID_DTS_HPX 0x10015002
4164#define ADM_CMD_COPP_OPEN_TOPOLOGY_ID_AUDIOSPHERE 0x10028000
4165
4166/* Memory map regions command payload used by the
4167 * #ASM_CMD_SHARED_MEM_MAP_REGIONS ,#ADM_CMD_SHARED_MEM_MAP_REGIONS
4168 * commands.
4169 *
4170 * This structure allows clients to map multiple shared memory
4171 * regions in a single command. Following this structure are
4172 * num_regions of avs_shared_map_region_payload.
4173 */
4174
4175
4176struct avs_cmd_shared_mem_map_regions {
4177 struct apr_hdr hdr;
4178 u16 mem_pool_id;
4179/* Type of memory on which this memory region is mapped.
4180 *
4181 * Supported values: - #ADSP_MEMORY_MAP_EBI_POOL -
4182 * #ADSP_MEMORY_MAP_SMI_POOL - #ADSP_MEMORY_MAP_IMEM_POOL
4183 * (unsupported) - #ADSP_MEMORY_MAP_SHMEM8_4K_POOL - Other values
4184 * are reserved
4185 *
4186 * The memory ID implicitly defines the characteristics of the
4187 * memory. Characteristics may include alignment type, permissions,
4188 * etc.
4189 *
4190 * SHMEM8_4K is shared memory, byte addressable, and 4 KB aligned.
4191 */
4192
4193
4194 u16 num_regions;
4195 /* Number of regions to map.*/
4196
4197 u32 property_flag;
4198/* Configures one common property for all the regions in the
4199 * payload. No two regions in the same memory map regions cmd can
4200 * have differnt property. Supported values: - 0x00000000 to
4201 * 0x00000001
4202 *
4203 * b0 - bit 0 indicates physical or virtual mapping 0 shared memory
4204 * address provided in avs_shared_map_regions_payload is physical
4205 * address. The shared memory needs to be mapped( hardware TLB
4206 * entry)
4207 *
4208 * and a software entry needs to be added for internal book keeping.
4209 *
4210 * 1 Shared memory address provided in MayPayload[usRegions] is
4211 * virtual address. The shared memory must not be mapped (since
4212 * hardware TLB entry is already available) but a software entry
4213 * needs to be added for internal book keeping. This can be useful
4214 * if two services with in ADSP is communicating via APR. They can
4215 * now directly communicate via the Virtual address instead of
4216 * Physical address. The virtual regions must be contiguous.
4217 *
4218 * b31-b1 - reserved bits. must be set to zero
4219 */
4220
4221} __packed;
4222
4223struct avs_shared_map_region_payload {
4224 u32 shm_addr_lsw;
4225/* least significant word of shared memory address of the memory
4226 * region to map. It must be contiguous memory, and it must be 4 KB
4227 * aligned.
4228 */
4229
4230 u32 shm_addr_msw;
4231/* most significant word of shared memory address of the memory
4232 * region to map. For 32 bit shared memory address, this field must
4233 * tbe set to zero. For 36 bit shared memory address, bit31 to bit 4
4234 * must be set to zero
4235 */
4236
4237 u32 mem_size_bytes;
4238/* Number of bytes in the region.
4239 *
4240 * The aDSP will always map the regions as virtual contiguous
4241 * memory, but the memory size must be in multiples of 4 KB to avoid
4242 * gaps in the virtually contiguous mapped memory.
4243 */
4244
4245} __packed;
4246
4247struct avs_cmd_shared_mem_unmap_regions {
4248 struct apr_hdr hdr;
4249 u32 mem_map_handle;
4250/* memory map handle returned by ASM_CMD_SHARED_MEM_MAP_REGIONS
4251 * , ADM_CMD_SHARED_MEM_MAP_REGIONS, commands
4252 */
4253
4254} __packed;
4255
4256/* Memory map command response payload used by the
4257 * #ASM_CMDRSP_SHARED_MEM_MAP_REGIONS
4258 * ,#ADM_CMDRSP_SHARED_MEM_MAP_REGIONS
4259 */
4260
4261
4262struct avs_cmdrsp_shared_mem_map_regions {
4263 u32 mem_map_handle;
4264/* A memory map handle encapsulating shared memory attributes is
4265 * returned
4266 */
4267
4268} __packed;
4269
4270/*adsp_audio_memmap_api.h*/
4271
4272/* ASM related data structures */
4273struct asm_wma_cfg {
4274 u16 format_tag;
4275 u16 ch_cfg;
4276 u32 sample_rate;
4277 u32 avg_bytes_per_sec;
4278 u16 block_align;
4279 u16 valid_bits_per_sample;
4280 u32 ch_mask;
4281 u16 encode_opt;
4282 u16 adv_encode_opt;
4283 u32 adv_encode_opt2;
4284 u32 drc_peak_ref;
4285 u32 drc_peak_target;
4286 u32 drc_ave_ref;
4287 u32 drc_ave_target;
4288} __packed;
4289
4290struct asm_wmapro_cfg {
4291 u16 format_tag;
4292 u16 ch_cfg;
4293 u32 sample_rate;
4294 u32 avg_bytes_per_sec;
4295 u16 block_align;
4296 u16 valid_bits_per_sample;
4297 u32 ch_mask;
4298 u16 encode_opt;
4299 u16 adv_encode_opt;
4300 u32 adv_encode_opt2;
4301 u32 drc_peak_ref;
4302 u32 drc_peak_target;
4303 u32 drc_ave_ref;
4304 u32 drc_ave_target;
4305} __packed;
4306
4307struct asm_aac_cfg {
4308 u16 format;
4309 u16 aot;
4310 u16 ep_config;
4311 u16 section_data_resilience;
4312 u16 scalefactor_data_resilience;
4313 u16 spectral_data_resilience;
4314 u16 ch_cfg;
4315 u16 reserved;
4316 u32 sample_rate;
4317} __packed;
4318
4319struct asm_amrwbplus_cfg {
4320 u32 size_bytes;
4321 u32 version;
4322 u32 num_channels;
4323 u32 amr_band_mode;
4324 u32 amr_dtx_mode;
4325 u32 amr_frame_fmt;
4326 u32 amr_lsf_idx;
4327} __packed;
4328
4329struct asm_flac_cfg {
4330 u32 sample_rate;
4331 u32 ext_sample_rate;
4332 u32 min_frame_size;
4333 u32 max_frame_size;
4334 u16 stream_info_present;
4335 u16 min_blk_size;
4336 u16 max_blk_size;
4337 u16 ch_cfg;
4338 u16 sample_size;
4339 u16 md5_sum;
4340};
4341
4342struct asm_alac_cfg {
4343 u32 frame_length;
4344 u8 compatible_version;
4345 u8 bit_depth;
4346 u8 pb;
4347 u8 mb;
4348 u8 kb;
4349 u8 num_channels;
4350 u16 max_run;
4351 u32 max_frame_bytes;
4352 u32 avg_bit_rate;
4353 u32 sample_rate;
4354 u32 channel_layout_tag;
4355};
4356
4357struct asm_g711_dec_cfg {
4358 u32 sample_rate;
4359};
4360
4361struct asm_vorbis_cfg {
4362 u32 bit_stream_fmt;
4363};
4364
4365struct asm_ape_cfg {
4366 u16 compatible_version;
4367 u16 compression_level;
4368 u32 format_flags;
4369 u32 blocks_per_frame;
4370 u32 final_frame_blocks;
4371 u32 total_frames;
4372 u16 bits_per_sample;
4373 u16 num_channels;
4374 u32 sample_rate;
4375 u32 seek_table_present;
4376};
4377
4378struct asm_dsd_cfg {
4379 u16 num_version;
4380 u16 is_bitwise_big_endian;
4381 u16 dsd_channel_block_size;
4382 u16 num_channels;
4383 u8 channel_mapping[8];
4384 u32 dsd_data_rate;
4385};
4386
4387struct asm_softpause_params {
4388 u32 enable;
4389 u32 period;
4390 u32 step;
4391 u32 rampingcurve;
4392} __packed;
4393
4394struct asm_softvolume_params {
4395 u32 period;
4396 u32 step;
4397 u32 rampingcurve;
4398} __packed;
4399
4400#define ASM_END_POINT_DEVICE_MATRIX 0
4401
4402#define PCM_CHANNEL_NULL 0
4403
4404/* Front left channel. */
4405#define PCM_CHANNEL_FL 1
4406
4407/* Front right channel. */
4408#define PCM_CHANNEL_FR 2
4409
4410/* Front center channel. */
4411#define PCM_CHANNEL_FC 3
4412
4413/* Left surround channel.*/
4414#define PCM_CHANNEL_LS 4
4415
4416/* Right surround channel.*/
4417#define PCM_CHANNEL_RS 5
4418
4419/* Low frequency effect channel. */
4420#define PCM_CHANNEL_LFE 6
4421
4422/* Center surround channel; Rear center channel. */
4423#define PCM_CHANNEL_CS 7
4424
4425/* Left back channel; Rear left channel. */
4426#define PCM_CHANNEL_LB 8
4427
4428/* Right back channel; Rear right channel. */
4429#define PCM_CHANNEL_RB 9
4430
4431/* Top surround channel. */
4432#define PCM_CHANNELS 10
4433
4434/* Center vertical height channel.*/
4435#define PCM_CHANNEL_CVH 11
4436
4437/* Mono surround channel.*/
4438#define PCM_CHANNEL_MS 12
4439
4440/* Front left of center. */
4441#define PCM_CHANNEL_FLC 13
4442
4443/* Front right of center. */
4444#define PCM_CHANNEL_FRC 14
4445
4446/* Rear left of center. */
4447#define PCM_CHANNEL_RLC 15
4448
Rohit kumar4ea92b12019-02-01 18:05:33 +05304449/* Rear right of center. Update PCM_MAX_CHMAP_ID when
4450 * this list is extended.
4451 */
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05304452#define PCM_CHANNEL_RRC 16
4453
Dieter Lueckinga8b8e3b2018-09-28 14:29:17 +02004454/* Second low frequency channel. */
4455#define PCM_CHANNEL_LFE2 17
4456
4457/* Side left channel. */
4458#define PCM_CHANNEL_SL 18
4459
4460/* Side right channel. */
4461#define PCM_CHANNEL_SR 19
4462
4463/* Top front left channel. */
4464#define PCM_CHANNEL_TFL 20
4465
4466/* Left vertical height channel. */
4467#define PCM_CHANNEL_LVH 20
4468
4469/* Top front right channel. */
4470#define PCM_CHANNEL_TFR 21
4471
4472/* Right vertical height channel. */
4473#define PCM_CHANNEL_RVH 21
4474
4475/* Top center channel. */
4476#define PCM_CHANNEL_TC 22
4477
4478/* Top back left channel. */
4479#define PCM_CHANNEL_TBL 23
4480
4481/* Top back right channel. */
4482#define PCM_CHANNEL_TBR 24
4483
4484/* Top side left channel. */
4485#define PCM_CHANNEL_TSL 25
4486
4487/* Top side right channel. */
4488#define PCM_CHANNEL_TSR 26
4489
4490/* Top back center channel. */
4491#define PCM_CHANNEL_TBC 27
4492
4493/* Bottom front center channel. */
4494#define PCM_CHANNEL_BFC 28
4495
4496/* Bottom front left channel. */
4497#define PCM_CHANNEL_BFL 29
4498
4499/* Bottom front right channel. */
4500#define PCM_CHANNEL_BFR 30
4501
4502/* Left wide channel. */
4503#define PCM_CHANNEL_LW 31
4504
4505/* Right wide channel. */
4506#define PCM_CHANNEL_RW 32
4507
4508/* Left side direct channel. */
4509#define PCM_CHANNEL_LSD 33
4510
4511
4512/* Right side direct channel. */
4513#define PCM_CHANNEL_RSD 34
4514
Rohit kumar4ea92b12019-02-01 18:05:33 +05304515#define PCM_MAX_CHMAP_ID PCM_CHANNEL_RRC
4516
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05304517#define PCM_FORMAT_MAX_NUM_CHANNEL 8
4518
Dieter Lueckinga8b8e3b2018-09-28 14:29:17 +02004519/* Used for ADM_CMD_DEVICE_OPEN_V8 */
4520#define PCM_FORMAT_MAX_NUM_CHANNEL_V8 32
4521
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05304522#define ASM_MEDIA_FMT_MULTI_CHANNEL_PCM_V2 0x00010DA5
4523
4524#define ASM_MEDIA_FMT_MULTI_CHANNEL_PCM_V3 0x00010DDC
4525
4526#define ASM_MEDIA_FMT_MULTI_CHANNEL_PCM_V4 0x0001320C
4527
Dieter Lueckinga8b8e3b2018-09-28 14:29:17 +02004528#define ASM_MEDIA_FMT_MULTI_CHANNEL_PCM_V5 0x00013222
4529
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05304530#define ASM_MEDIA_FMT_EVRCB_FS 0x00010BEF
4531
4532#define ASM_MEDIA_FMT_EVRCWB_FS 0x00010BF0
4533
4534#define ASM_MEDIA_FMT_GENERIC_COMPRESSED 0x00013212
4535
4536#define ASM_MAX_EQ_BANDS 12
4537
4538#define ASM_DATA_CMD_MEDIA_FMT_UPDATE_V2 0x00010D98
4539
4540struct asm_data_cmd_media_fmt_update_v2 {
4541u32 fmt_blk_size;
4542 /* Media format block size in bytes.*/
4543} __packed;
4544
4545struct asm_generic_compressed_fmt_blk_t {
4546 struct apr_hdr hdr;
4547 struct asm_data_cmd_media_fmt_update_v2 fmt_blk;
4548
4549 /*
4550 * Channel mapping array of bitstream output.
4551 * Channel[i] mapping describes channel i inside the buffer, where
4552 * i < num_channels. All valid used channels must be
4553 * present at the beginning of the array.
4554 */
4555 uint8_t channel_mapping[8];
4556
4557 /*
4558 * Number of channels of the incoming bitstream.
4559 * Supported values: 1,2,3,4,5,6,7,8
4560 */
4561 uint16_t num_channels;
4562
4563 /*
4564 * Nominal bits per sample value of the incoming bitstream.
4565 * Supported values: 16, 32
4566 */
4567 uint16_t bits_per_sample;
4568
4569 /*
4570 * Nominal sampling rate of the incoming bitstream.
4571 * Supported values: 8000, 11025, 16000, 22050, 24000, 32000,
4572 * 44100, 48000, 88200, 96000, 176400, 192000,
4573 * 352800, 384000
4574 */
4575 uint32_t sampling_rate;
4576
4577} __packed;
4578
4579
4580/* Command to send sample rate & channels for IEC61937 (compressed) or IEC60958
4581 * (pcm) streams. Both audio standards use the same format and are used for
4582 * HDMI or SPDIF.
4583 */
4584#define ASM_DATA_CMD_IEC_60958_MEDIA_FMT 0x0001321E
4585
4586struct asm_iec_compressed_fmt_blk_t {
4587 struct apr_hdr hdr;
4588
4589 /*
4590 * Nominal sampling rate of the incoming bitstream.
4591 * Supported values: 8000, 11025, 16000, 22050, 24000, 32000,
4592 * 44100, 48000, 88200, 96000, 176400, 192000,
4593 * 352800, 384000
4594 */
4595 uint32_t sampling_rate;
4596
4597 /*
4598 * Number of channels of the incoming bitstream.
4599 * Supported values: 1,2,3,4,5,6,7,8
4600 */
4601 uint32_t num_channels;
4602
4603} __packed;
4604
4605struct asm_multi_channel_pcm_fmt_blk_v2 {
4606 struct apr_hdr hdr;
4607 struct asm_data_cmd_media_fmt_update_v2 fmt_blk;
4608
4609 u16 num_channels;
4610 /* Number of channels. Supported values: 1 to 8 */
4611 u16 bits_per_sample;
4612/* Number of bits per sample per channel. * Supported values:
4613 * 16, 24 * When used for playback, the client must send 24-bit
4614 * samples packed in 32-bit words. The 24-bit samples must be placed
4615 * in the most significant 24 bits of the 32-bit word. When used for
4616 * recording, the aDSP sends 24-bit samples packed in 32-bit words.
4617 * The 24-bit samples are placed in the most significant 24 bits of
4618 * the 32-bit word.
4619 */
4620
4621
4622 u32 sample_rate;
4623/* Number of samples per second (in Hertz).
4624 * Supported values: 2000 to 48000
4625 */
4626
4627 u16 is_signed;
4628 /* Flag that indicates the samples are signed (1). */
4629
4630 u16 reserved;
4631 /* reserved field for 32 bit alignment. must be set to zero. */
4632
4633 u8 channel_mapping[8];
4634/* Channel array of size 8.
4635 * Supported values:
4636 * - #PCM_CHANNEL_L
4637 * - #PCM_CHANNEL_R
4638 * - #PCM_CHANNEL_C
4639 * - #PCM_CHANNEL_LS
4640 * - #PCM_CHANNEL_RS
4641 * - #PCM_CHANNEL_LFE
4642 * - #PCM_CHANNEL_CS
4643 * - #PCM_CHANNEL_LB
4644 * - #PCM_CHANNEL_RB
4645 * - #PCM_CHANNELS
4646 * - #PCM_CHANNEL_CVH
4647 * - #PCM_CHANNEL_MS
4648 * - #PCM_CHANNEL_FLC
4649 * - #PCM_CHANNEL_FRC
4650 * - #PCM_CHANNEL_RLC
4651 * - #PCM_CHANNEL_RRC
4652 *
4653 * Channel[i] mapping describes channel I. Each element i of the
4654 * array describes channel I inside the buffer where 0 @le I <
4655 * num_channels. An unused channel is set to zero.
4656 */
4657} __packed;
4658
4659struct asm_multi_channel_pcm_fmt_blk_v3 {
4660 uint16_t num_channels;
4661/*
4662 * Number of channels
4663 * Supported values: 1 to 8
4664 */
4665
4666 uint16_t bits_per_sample;
4667/*
4668 * Number of bits per sample per channel
4669 * Supported values: 16, 24
4670 */
4671
4672 uint32_t sample_rate;
4673/*
4674 * Number of samples per second
4675 * Supported values: 2000 to 48000, 96000,192000 Hz
4676 */
4677
4678 uint16_t is_signed;
4679/* Flag that indicates that PCM samples are signed (1) */
4680
4681 uint16_t sample_word_size;
4682/*
4683 * Size in bits of the word that holds a sample of a channel.
4684 * Supported values: 12,24,32
4685 */
4686
4687 uint8_t channel_mapping[8];
4688/*
4689 * Each element, i, in the array describes channel i inside the buffer where
4690 * 0 <= i < num_channels. Unused channels are set to 0.
4691 */
4692} __packed;
4693
4694struct asm_multi_channel_pcm_fmt_blk_v4 {
4695 uint16_t num_channels;
4696/*
4697 * Number of channels
4698 * Supported values: 1 to 8
4699 */
4700
4701 uint16_t bits_per_sample;
4702/*
4703 * Number of bits per sample per channel
4704 * Supported values: 16, 24, 32
4705 */
4706
4707 uint32_t sample_rate;
4708/*
4709 * Number of samples per second
4710 * Supported values: 2000 to 48000, 96000,192000 Hz
4711 */
4712
4713 uint16_t is_signed;
4714/* Flag that indicates that PCM samples are signed (1) */
4715
4716 uint16_t sample_word_size;
4717/*
4718 * Size in bits of the word that holds a sample of a channel.
4719 * Supported values: 12,24,32
4720 */
4721
4722 uint8_t channel_mapping[8];
4723/*
4724 * Each element, i, in the array describes channel i inside the buffer where
4725 * 0 <= i < num_channels. Unused channels are set to 0.
4726 */
4727 uint16_t endianness;
4728/*
4729 * Flag to indicate the endianness of the pcm sample
4730 * Supported values: 0 - Little endian (all other formats)
4731 * 1 - Big endian (AIFF)
4732 */
4733 uint16_t mode;
4734/*
4735 * Mode to provide additional info about the pcm input data.
4736 * Supported values: 0 - Default QFs (Q15 for 16b, Q23 for packed 24b,
4737 * Q31 for unpacked 24b or 32b)
4738 * 15 - for 16 bit
4739 * 23 - for 24b packed or 8.24 format
4740 * 31 - for 24b unpacked or 32bit
4741 */
4742} __packed;
4743
Dieter Lueckinga8b8e3b2018-09-28 14:29:17 +02004744
4745struct asm_multi_channel_pcm_fmt_blk_v5 {
4746 uint16_t num_channels;
4747/*
4748 * Number of channels
4749 * Supported values: 1 to 32
4750 */
4751
4752 uint16_t bits_per_sample;
4753/*
4754 * Number of bits per sample per channel
4755 * Supported values: 16, 24, 32
4756 */
4757
4758 uint32_t sample_rate;
4759/*
4760 * Number of samples per second
4761 * Supported values: 2000 to 48000, 96000,192000 Hz
4762 */
4763
4764 uint16_t is_signed;
4765/* Flag that indicates that PCM samples are signed (1) */
4766
4767 uint16_t sample_word_size;
4768/*
4769 * Size in bits of the word that holds a sample of a channel.
4770 * Supported values: 12,24,32
4771 */
4772 uint16_t endianness;
4773/*
4774 * Flag to indicate the endianness of the pcm sample
4775 * Supported values: 0 - Little endian (all other formats)
4776 * 1 - Big endian (AIFF)
4777 */
4778 uint16_t mode;
4779/*
4780 * Mode to provide additional info about the pcm input data.
4781 * Supported values: 0 - Default QFs (Q15 for 16b, Q23 for packed 24b,
4782 * Q31 for unpacked 24b or 32b)
4783 * 15 - for 16 bit
4784 * 23 - for 24b packed or 8.24 format
4785 * 31 - for 24b unpacked or 32bit
4786 */
4787
4788 uint8_t channel_mapping[32];
4789/*
4790 * Each element, i, in the array describes channel i inside the buffer where
4791 * 0 <= i < num_channels. Unused channels are set to 0.
4792 */
4793} __packed;
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05304794/*
4795 * Payload of the multichannel PCM configuration parameters in
4796 * the ASM_MEDIA_FMT_MULTI_CHANNEL_PCM_V3 media format.
4797 */
4798struct asm_multi_channel_pcm_fmt_blk_param_v3 {
4799 struct apr_hdr hdr;
4800 struct asm_data_cmd_media_fmt_update_v2 fmt_blk;
4801 struct asm_multi_channel_pcm_fmt_blk_v3 param;
4802} __packed;
4803
4804/*
4805 * Payload of the multichannel PCM configuration parameters in
4806 * the ASM_MEDIA_FMT_MULTI_CHANNEL_PCM_V4 media format.
4807 */
4808struct asm_multi_channel_pcm_fmt_blk_param_v4 {
4809 struct apr_hdr hdr;
4810 struct asm_data_cmd_media_fmt_update_v2 fmt_blk;
4811 struct asm_multi_channel_pcm_fmt_blk_v4 param;
4812} __packed;
4813
Dieter Lueckinga8b8e3b2018-09-28 14:29:17 +02004814/*
4815 * Payload of the multichannel PCM configuration parameters in
4816 * the ASM_MEDIA_FMT_MULTI_CHANNEL_PCM_V5 media format.
4817 */
4818struct asm_multi_channel_pcm_fmt_blk_param_v5 {
4819 struct apr_hdr hdr;
4820 struct asm_data_cmd_media_fmt_update_v2 fmt_blk;
4821 struct asm_multi_channel_pcm_fmt_blk_v5 param;
4822} __packed;
4823
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05304824struct asm_stream_cmd_set_encdec_param {
4825 u32 param_id;
4826 /* ID of the parameter. */
4827
4828 u32 param_size;
4829/* Data size of this parameter, in bytes. The size is a multiple
4830 * of 4 bytes.
4831 */
4832
4833} __packed;
4834
4835struct asm_enc_cfg_blk_param_v2 {
4836 u32 frames_per_buf;
4837/* Number of encoded frames to pack into each buffer.
4838 *
4839 * @note1hang This is only guidance information for the aDSP. The
4840 * number of encoded frames put into each buffer (specified by the
4841 * client) is less than or equal to this number.
4842 */
4843
4844 u32 enc_cfg_blk_size;
4845/* Size in bytes of the encoder configuration block that follows
4846 * this member.
4847 */
4848
4849} __packed;
4850
4851/* @brief Dolby Digital Plus end point configuration structure
4852 */
4853struct asm_dec_ddp_endp_param_v2 {
4854 struct apr_hdr hdr;
4855 struct asm_stream_cmd_set_encdec_param encdec;
4856 int endp_param_value;
4857} __packed;
4858
4859/*
4860 * Payload of the multichannel PCM encoder configuration parameters in
Dieter Lueckinga8b8e3b2018-09-28 14:29:17 +02004861 * the ASM_MEDIA_FMT_MULTI_CHANNEL_PCM_V5 media format.
4862 */
4863struct asm_multi_channel_pcm_enc_cfg_v5 {
4864 struct apr_hdr hdr;
4865 struct asm_stream_cmd_set_encdec_param encdec;
4866 struct asm_enc_cfg_blk_param_v2 encblk;
4867 uint16_t num_channels;
4868/*
4869 * Number of PCM channels.
4870 * @values
4871 * - 0 -- Native mode
4872 * - 1 -- 8 channels
4873 * Native mode indicates that encoding must be performed with the number
4874 * of channels at the input.
4875 */
4876 uint16_t bits_per_sample;
4877/*
4878 * Number of bits per sample per channel.
4879 * @values 16, 24
4880 */
4881 uint32_t sample_rate;
4882/*
4883 * Number of samples per second.
4884 * @values 0, 8000 to 48000 Hz
4885 * A value of 0 indicates the native sampling rate. Encoding is
4886 * performed at the input sampling rate.
4887 */
4888 uint16_t is_signed;
4889/*
4890 * Flag that indicates the PCM samples are signed (1). Currently, only
4891 * signed PCM samples are supported.
4892 */
4893 uint16_t sample_word_size;
4894/*
4895 * The size in bits of the word that holds a sample of a channel.
4896 * @values 16, 24, 32
4897 * 16-bit samples are always placed in 16-bit words:
4898 * sample_word_size = 1.
4899 * 24-bit samples can be placed in 32-bit words or in consecutive
4900 * 24-bit words.
4901 * - If sample_word_size = 32, 24-bit samples are placed in the
4902 * most significant 24 bits of a 32-bit word.
4903 * - If sample_word_size = 24, 24-bit samples are placed in
4904 * 24-bit words. @tablebulletend
4905 */
4906 uint16_t endianness;
4907/*
4908 * Flag to indicate the endianness of the pcm sample
4909 * Supported values: 0 - Little endian (all other formats)
4910 * 1 - Big endian (AIFF)
4911 */
4912 uint16_t mode;
4913/*
4914 * Mode to provide additional info about the pcm input data.
4915 * Supported values: 0 - Default QFs (Q15 for 16b, Q23 for packed 24b,
4916 * Q31 for unpacked 24b or 32b)
4917 * 15 - for 16 bit
4918 * 23 - for 24b packed or 8.24 format
4919 */
4920 uint8_t channel_mapping[PCM_FORMAT_MAX_NUM_CHANNEL_V8];
4921/*
4922 * Channel mapping array expected at the encoder output.
4923 * Channel[i] mapping describes channel i inside the buffer, where
4924 * 0 @le i < num_channels. All valid used channels must be present at
4925 * the beginning of the array.
4926 * If Native mode is set for the channels, this field is ignored.
4927 * @values See Section @xref{dox:PcmChannelDefs}
4928 */
4929} __packed;
4930
4931/*
4932 * Payload of the multichannel PCM encoder configuration parameters in
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05304933 * the ASM_MEDIA_FMT_MULTI_CHANNEL_PCM_V4 media format.
4934 */
4935
4936struct asm_multi_channel_pcm_enc_cfg_v4 {
4937 struct apr_hdr hdr;
4938 struct asm_stream_cmd_set_encdec_param encdec;
4939 struct asm_enc_cfg_blk_param_v2 encblk;
4940 uint16_t num_channels;
4941 /*
4942 * Number of PCM channels.
4943 * @values
4944 * - 0 -- Native mode
4945 * - 1 -- 8 channels
4946 * Native mode indicates that encoding must be performed with the number
4947 * of channels at the input.
4948 */
4949 uint16_t bits_per_sample;
4950 /*
4951 * Number of bits per sample per channel.
4952 * @values 16, 24
4953 */
4954 uint32_t sample_rate;
4955 /*
4956 * Number of samples per second.
4957 * @values 0, 8000 to 48000 Hz
4958 * A value of 0 indicates the native sampling rate. Encoding is
4959 * performed at the input sampling rate.
4960 */
4961 uint16_t is_signed;
4962 /*
4963 * Flag that indicates the PCM samples are signed (1). Currently, only
4964 * signed PCM samples are supported.
4965 */
4966 uint16_t sample_word_size;
4967 /*
4968 * The size in bits of the word that holds a sample of a channel.
4969 * @values 16, 24, 32
4970 * 16-bit samples are always placed in 16-bit words:
4971 * sample_word_size = 1.
4972 * 24-bit samples can be placed in 32-bit words or in consecutive
4973 * 24-bit words.
4974 * - If sample_word_size = 32, 24-bit samples are placed in the
4975 * most significant 24 bits of a 32-bit word.
4976 * - If sample_word_size = 24, 24-bit samples are placed in
4977 * 24-bit words. @tablebulletend
4978 */
4979 uint8_t channel_mapping[8];
4980 /*
4981 * Channel mapping array expected at the encoder output.
4982 * Channel[i] mapping describes channel i inside the buffer, where
4983 * 0 @le i < num_channels. All valid used channels must be present at
4984 * the beginning of the array.
4985 * If Native mode is set for the channels, this field is ignored.
4986 * @values See Section @xref{dox:PcmChannelDefs}
4987 */
4988 uint16_t endianness;
4989 /*
4990 * Flag to indicate the endianness of the pcm sample
4991 * Supported values: 0 - Little endian (all other formats)
4992 * 1 - Big endian (AIFF)
4993 */
4994 uint16_t mode;
4995 /*
4996 * Mode to provide additional info about the pcm input data.
4997 * Supported values: 0 - Default QFs (Q15 for 16b, Q23 for packed 24b,
4998 * Q31 for unpacked 24b or 32b)
4999 * 15 - for 16 bit
5000 * 23 - for 24b packed or 8.24 format
5001 * 31 - for 24b unpacked or 32bit
5002 */
5003} __packed;
5004
5005/*
5006 * Payload of the multichannel PCM encoder configuration parameters in
5007 * the ASM_MEDIA_FMT_MULTI_CHANNEL_PCM_V3 media format.
5008 */
5009
5010struct asm_multi_channel_pcm_enc_cfg_v3 {
5011 struct apr_hdr hdr;
5012 struct asm_stream_cmd_set_encdec_param encdec;
5013 struct asm_enc_cfg_blk_param_v2 encblk;
5014 uint16_t num_channels;
5015 /*
5016 * Number of PCM channels.
5017 * @values
5018 * - 0 -- Native mode
5019 * - 1 -- 8 channels
5020 * Native mode indicates that encoding must be performed with the number
5021 * of channels at the input.
5022 */
5023 uint16_t bits_per_sample;
5024 /*
5025 * Number of bits per sample per channel.
5026 * @values 16, 24
5027 */
5028 uint32_t sample_rate;
5029 /*
5030 * Number of samples per second.
5031 * @values 0, 8000 to 48000 Hz
5032 * A value of 0 indicates the native sampling rate. Encoding is
5033 * performed at the input sampling rate.
5034 */
5035 uint16_t is_signed;
5036 /*
5037 * Flag that indicates the PCM samples are signed (1). Currently, only
5038 * signed PCM samples are supported.
5039 */
5040 uint16_t sample_word_size;
5041 /*
5042 * The size in bits of the word that holds a sample of a channel.
5043 * @values 16, 24, 32
5044 * 16-bit samples are always placed in 16-bit words:
5045 * sample_word_size = 1.
5046 * 24-bit samples can be placed in 32-bit words or in consecutive
5047 * 24-bit words.
5048 * - If sample_word_size = 32, 24-bit samples are placed in the
5049 * most significant 24 bits of a 32-bit word.
5050 * - If sample_word_size = 24, 24-bit samples are placed in
5051 * 24-bit words. @tablebulletend
5052 */
5053 uint8_t channel_mapping[8];
5054 /*
5055 * Channel mapping array expected at the encoder output.
5056 * Channel[i] mapping describes channel i inside the buffer, where
5057 * 0 @le i < num_channels. All valid used channels must be present at
5058 * the beginning of the array.
5059 * If Native mode is set for the channels, this field is ignored.
5060 * @values See Section @xref{dox:PcmChannelDefs}
5061 */
5062};
5063
5064/* @brief Multichannel PCM encoder configuration structure used
5065 * in the #ASM_PARAM_ID_ENCDEC_ENC_CFG_BLK_V2 command.
5066 */
5067
5068struct asm_multi_channel_pcm_enc_cfg_v2 {
5069 struct apr_hdr hdr;
5070 struct asm_stream_cmd_set_encdec_param encdec;
5071 struct asm_enc_cfg_blk_param_v2 encblk;
5072 uint16_t num_channels;
5073/*< Number of PCM channels.
5074 *
5075 * Supported values: - 0 -- Native mode - 1 -- 8 Native mode
5076 * indicates that encoding must be performed with the number of
5077 * channels at the input.
5078 */
5079
5080 uint16_t bits_per_sample;
5081/*< Number of bits per sample per channel.
5082 * Supported values: 16, 24
5083 */
5084
5085 uint32_t sample_rate;
5086/*< Number of samples per second (in Hertz).
5087 *
5088 * Supported values: 0, 8000 to 48000 A value of 0 indicates the
5089 * native sampling rate. Encoding is performed at the input sampling
5090 * rate.
5091 */
5092
5093 uint16_t is_signed;
5094/*< Specifies whether the samples are signed (1). Currently,
5095 * only signed samples are supported.
5096 */
5097
5098 uint16_t reserved;
5099/*< reserved field for 32 bit alignment. must be set to zero.*/
5100
5101
5102 uint8_t channel_mapping[8];
5103} __packed;
5104
5105#define ASM_MEDIA_FMT_MP3 0x00010BE9
5106#define ASM_MEDIA_FMT_AAC_V2 0x00010DA6
5107
5108/* @xreflabel
5109 * {hdr:AsmMediaFmtDolbyAac} Media format ID for the
5110 * Dolby AAC decoder. This format ID is be used if the client wants
5111 * to use the Dolby AAC decoder to decode MPEG2 and MPEG4 AAC
5112 * contents.
5113 */
5114
5115#define ASM_MEDIA_FMT_DOLBY_AAC 0x00010D86
5116
5117/* Enumeration for the audio data transport stream AAC format. */
5118#define ASM_MEDIA_FMT_AAC_FORMAT_FLAG_ADTS 0
5119
5120/* Enumeration for low overhead audio stream AAC format. */
5121#define ASM_MEDIA_FMT_AAC_FORMAT_FLAG_LOAS 1
5122
5123/* Enumeration for the audio data interchange format
5124 * AAC format.
5125 */
5126#define ASM_MEDIA_FMT_AAC_FORMAT_FLAG_ADIF 2
5127
5128/* Enumeration for the raw AAC format. */
5129#define ASM_MEDIA_FMT_AAC_FORMAT_FLAG_RAW 3
5130
5131/* Enumeration for the AAC LATM format. */
5132#define ASM_MEDIA_FMT_AAC_FORMAT_FLAG_LATM 4
5133
5134#define ASM_MEDIA_FMT_AAC_AOT_LC 2
5135#define ASM_MEDIA_FMT_AAC_AOT_SBR 5
5136#define ASM_MEDIA_FMT_AAC_AOT_PS 29
5137#define ASM_MEDIA_FMT_AAC_AOT_BSAC 22
5138
5139struct asm_aac_fmt_blk_v2 {
5140 struct apr_hdr hdr;
5141 struct asm_data_cmd_media_fmt_update_v2 fmt_blk;
5142
5143 u16 aac_fmt_flag;
5144/* Bitstream format option.
5145 * Supported values:
5146 * - #ASM_MEDIA_FMT_AAC_FORMAT_FLAG_ADTS
5147 * - #ASM_MEDIA_FMT_AAC_FORMAT_FLAG_LOAS
5148 * - #ASM_MEDIA_FMT_AAC_FORMAT_FLAG_ADIF
5149 * - #ASM_MEDIA_FMT_AAC_FORMAT_FLAG_RAW
5150 */
5151
5152 u16 audio_objype;
5153/* Audio Object Type (AOT) present in the AAC stream.
5154 * Supported values:
5155 * - #ASM_MEDIA_FMT_AAC_AOT_LC
5156 * - #ASM_MEDIA_FMT_AAC_AOT_SBR
5157 * - #ASM_MEDIA_FMT_AAC_AOT_BSAC
5158 * - #ASM_MEDIA_FMT_AAC_AOT_PS
5159 * - Otherwise -- Not supported
5160 */
5161
5162 u16 channel_config;
5163/* Number of channels present in the AAC stream.
5164 * Supported values:
5165 * - 1 -- Mono
5166 * - 2 -- Stereo
5167 * - 6 -- 5.1 content
5168 */
5169
5170 u16 total_size_of_PCE_bits;
5171/* greater or equal to zero. * -In case of RAW formats and
5172 * channel config = 0 (PCE), client can send * the bit stream
5173 * containing PCE immediately following this structure * (in-band).
5174 * -This number does not include bits included for 32 bit alignment.
5175 * -If zero, then the PCE info is assumed to be available in the
5176 * audio -bit stream & not in-band.
5177 */
5178
5179 u32 sample_rate;
5180/* Number of samples per second (in Hertz).
5181 *
5182 * Supported values: 8000, 11025, 12000, 16000, 22050, 24000, 32000,
5183 * 44100, 48000
5184 *
5185 * This field must be equal to the sample rate of the AAC-LC
5186 * decoder's output. - For MP4 or 3GP containers, this is indicated
5187 * by the samplingFrequencyIndex field in the AudioSpecificConfig
5188 * element. - For ADTS format, this is indicated by the
5189 * samplingFrequencyIndex in the ADTS fixed header. - For ADIF
5190 * format, this is indicated by the samplingFrequencyIndex in the
5191 * program_config_element present in the ADIF header.
5192 */
5193
5194} __packed;
5195
5196struct asm_aac_enc_cfg_v2 {
5197 struct apr_hdr hdr;
5198 struct asm_stream_cmd_set_encdec_param encdec;
5199 struct asm_enc_cfg_blk_param_v2 encblk;
5200
5201 u32 bit_rate;
5202 /* Encoding rate in bits per second. */
5203 u32 enc_mode;
5204/* Encoding mode.
5205 * Supported values:
5206 * - #ASM_MEDIA_FMT_AAC_AOT_LC
5207 * - #ASM_MEDIA_FMT_AAC_AOT_SBR
5208 * - #ASM_MEDIA_FMT_AAC_AOT_PS
5209 */
5210 u16 aac_fmt_flag;
5211/* AAC format flag.
5212 * Supported values:
5213 * - #ASM_MEDIA_FMT_AAC_FORMAT_FLAG_ADTS
5214 * - #ASM_MEDIA_FMT_AAC_FORMAT_FLAG_RAW
5215 */
5216 u16 channel_cfg;
5217/* Number of channels to encode.
5218 * Supported values:
5219 * - 0 -- Native mode
5220 * - 1 -- Mono
5221 * - 2 -- Stereo
5222 * - Other values are not supported.
5223 * @note1hang The eAAC+ encoder mode supports only stereo.
5224 * Native mode indicates that encoding must be performed with the
5225 * number of channels at the input.
5226 * The number of channels must not change during encoding.
5227 */
5228
5229 u32 sample_rate;
5230/* Number of samples per second.
5231 * Supported values: - 0 -- Native mode - For other values,
5232 * Native mode indicates that encoding must be performed with the
5233 * sampling rate at the input.
5234 * The sampling rate must not change during encoding.
5235 */
5236
5237} __packed;
5238
5239#define ASM_MEDIA_FMT_G711_ALAW_FS 0x00010BF7
5240#define ASM_MEDIA_FMT_G711_MLAW_FS 0x00010C2E
5241
5242struct asm_g711_enc_cfg_v2 {
5243 struct apr_hdr hdr;
5244 struct asm_stream_cmd_set_encdec_param encdec;
5245 struct asm_enc_cfg_blk_param_v2 encblk;
5246
5247 u32 sample_rate;
5248/*
5249 * Number of samples per second.
5250 * Supported values: 8000, 16000 Hz
5251 */
5252
5253} __packed;
5254
5255struct asm_vorbis_fmt_blk_v2 {
5256 struct apr_hdr hdr;
5257 struct asm_data_cmd_media_fmt_update_v2 fmtblk;
5258 u32 bit_stream_fmt;
5259/* Bit stream format.
5260 * Supported values:
5261 * - 0 -- Raw bitstream
5262 * - 1 -- Transcoded bitstream
5263 *
5264 * Transcoded bitstream containing the size of the frame as the first
5265 * word in each frame.
5266 */
5267
5268} __packed;
5269
5270struct asm_flac_fmt_blk_v2 {
5271 struct apr_hdr hdr;
5272 struct asm_data_cmd_media_fmt_update_v2 fmtblk;
5273
5274 u16 is_stream_info_present;
5275/* Specifies whether stream information is present in the FLAC format
5276 * block.
5277 *
5278 * Supported values:
5279 * - 0 -- Stream information is not present in this message
5280 * - 1 -- Stream information is present in this message
5281 *
5282 * When set to 1, the FLAC bitstream was successfully parsed by the
5283 * client, and other fields in the FLAC format block can be read by the
5284 * decoder to get metadata stream information.
5285 */
5286
5287 u16 num_channels;
5288/* Number of channels for decoding.
5289 * Supported values: 1 to 2
5290 */
5291
5292 u16 min_blk_size;
5293/* Minimum block size (in samples) used in the stream. It must be less
5294 * than or equal to max_blk_size.
5295 */
5296
5297 u16 max_blk_size;
5298/* Maximum block size (in samples) used in the stream. If the
5299 * minimum block size equals the maximum block size, a fixed block
5300 * size stream is implied.
5301 */
5302
5303 u16 md5_sum[8];
5304/* MD5 signature array of the unencoded audio data. This allows the
5305 * decoder to determine if an error exists in the audio data, even when
5306 * the error does not result in an invalid bitstream.
5307 */
5308
5309 u32 sample_rate;
5310/* Number of samples per second.
5311 * Supported values: 8000 to 48000 Hz
5312 */
5313
5314 u32 min_frame_size;
5315/* Minimum frame size used in the stream.
5316 * Supported values:
5317 * - > 0 bytes
5318 * - 0 -- The value is unknown
5319 */
5320
5321 u32 max_frame_size;
5322/* Maximum frame size used in the stream.
5323 * Supported values:
5324 * -- > 0 bytes
5325 * -- 0 . The value is unknown
5326 */
5327
5328 u16 sample_size;
5329/* Bits per sample.Supported values: 8, 16 */
5330
5331 u16 reserved;
5332/* Clients must set this field to zero
5333 */
5334
5335} __packed;
5336
5337struct asm_alac_fmt_blk_v2 {
5338 struct apr_hdr hdr;
5339 struct asm_data_cmd_media_fmt_update_v2 fmtblk;
5340
5341 u32 frame_length;
5342 u8 compatible_version;
5343 u8 bit_depth;
5344 u8 pb;
5345 u8 mb;
5346 u8 kb;
5347 u8 num_channels;
5348 u16 max_run;
5349 u32 max_frame_bytes;
5350 u32 avg_bit_rate;
5351 u32 sample_rate;
5352 u32 channel_layout_tag;
5353
5354} __packed;
5355
5356struct asm_g711_dec_fmt_blk_v2 {
5357 struct apr_hdr hdr;
5358 struct asm_data_cmd_media_fmt_update_v2 fmtblk;
5359 u32 sample_rate;
5360} __packed;
5361
5362struct asm_ape_fmt_blk_v2 {
5363 struct apr_hdr hdr;
5364 struct asm_data_cmd_media_fmt_update_v2 fmtblk;
5365
5366 u16 compatible_version;
5367 u16 compression_level;
5368 u32 format_flags;
5369 u32 blocks_per_frame;
5370 u32 final_frame_blocks;
5371 u32 total_frames;
5372 u16 bits_per_sample;
5373 u16 num_channels;
5374 u32 sample_rate;
5375 u32 seek_table_present;
5376
5377} __packed;
5378
5379struct asm_dsd_fmt_blk_v2 {
5380 struct apr_hdr hdr;
5381 struct asm_data_cmd_media_fmt_update_v2 fmtblk;
5382
5383 u16 num_version;
5384 u16 is_bitwise_big_endian;
5385 u16 dsd_channel_block_size;
5386 u16 num_channels;
5387 u8 channel_mapping[8];
5388 u32 dsd_data_rate;
5389
5390} __packed;
5391
5392#define ASM_MEDIA_FMT_AMRNB_FS 0x00010BEB
5393
5394/* Enumeration for 4.75 kbps AMR-NB Encoding mode. */
5395#define ASM_MEDIA_FMT_AMRNB_FS_ENCODE_MODE_MR475 0
5396
5397/* Enumeration for 5.15 kbps AMR-NB Encoding mode. */
5398#define ASM_MEDIA_FMT_AMRNB_FS_ENCODE_MODE_MR515 1
5399
5400/* Enumeration for 5.90 kbps AMR-NB Encoding mode. */
5401#define ASM_MEDIA_FMT_AMRNB_FS_ENCODE_MODE_MMR59 2
5402
5403/* Enumeration for 6.70 kbps AMR-NB Encoding mode. */
5404#define ASM_MEDIA_FMT_AMRNB_FS_ENCODE_MODE_MMR67 3
5405
5406/* Enumeration for 7.40 kbps AMR-NB Encoding mode. */
5407#define ASM_MEDIA_FMT_AMRNB_FS_ENCODE_MODE_MMR74 4
5408
5409/* Enumeration for 7.95 kbps AMR-NB Encoding mode. */
5410#define ASM_MEDIA_FMT_AMRNB_FS_ENCODE_MODE_MMR795 5
5411
5412/* Enumeration for 10.20 kbps AMR-NB Encoding mode. */
5413#define ASM_MEDIA_FMT_AMRNB_FS_ENCODE_MODE_MMR102 6
5414
5415/* Enumeration for 12.20 kbps AMR-NB Encoding mode. */
5416#define ASM_MEDIA_FMT_AMRNB_FS_ENCODE_MODE_MMR122 7
5417
5418/* Enumeration for AMR-NB Discontinuous Transmission mode off. */
5419#define ASM_MEDIA_FMT_AMRNB_FS_DTX_MODE_OFF 0
5420
5421/* Enumeration for AMR-NB DTX mode VAD1. */
5422#define ASM_MEDIA_FMT_AMRNB_FS_DTX_MODE_VAD1 1
5423
5424/* Enumeration for AMR-NB DTX mode VAD2. */
5425#define ASM_MEDIA_FMT_AMRNB_FS_DTX_MODE_VAD2 2
5426
5427/* Enumeration for AMR-NB DTX mode auto. */
5428#define ASM_MEDIA_FMT_AMRNB_FS_DTX_MODE_AUTO 3
5429
5430struct asm_amrnb_enc_cfg {
5431 struct apr_hdr hdr;
5432 struct asm_stream_cmd_set_encdec_param encdec;
5433 struct asm_enc_cfg_blk_param_v2 encblk;
5434
5435 u16 enc_mode;
5436/* AMR-NB encoding rate.
5437 * Supported values:
5438 * Use the ASM_MEDIA_FMT_AMRNB_FS_ENCODE_MODE_*
5439 * macros
5440 */
5441
5442 u16 dtx_mode;
5443/* Specifies whether DTX mode is disabled or enabled.
5444 * Supported values:
5445 * - #ASM_MEDIA_FMT_AMRNB_FS_DTX_MODE_OFF
5446 * - #ASM_MEDIA_FMT_AMRNB_FS_DTX_MODE_VAD1
5447 */
5448} __packed;
5449
5450#define ASM_MEDIA_FMT_AMRWB_FS 0x00010BEC
5451
5452/* Enumeration for 6.6 kbps AMR-WB Encoding mode. */
5453#define ASM_MEDIA_FMT_AMRWB_FS_ENCODE_MODE_MR66 0
5454
5455/* Enumeration for 8.85 kbps AMR-WB Encoding mode. */
5456#define ASM_MEDIA_FMT_AMRWB_FS_ENCODE_MODE_MR885 1
5457
5458/* Enumeration for 12.65 kbps AMR-WB Encoding mode. */
5459#define ASM_MEDIA_FMT_AMRWB_FS_ENCODE_MODE_MR1265 2
5460
5461/* Enumeration for 14.25 kbps AMR-WB Encoding mode. */
5462#define ASM_MEDIA_FMT_AMRWB_FS_ENCODE_MODE_MR1425 3
5463
5464/* Enumeration for 15.85 kbps AMR-WB Encoding mode. */
5465#define ASM_MEDIA_FMT_AMRWB_FS_ENCODE_MODE_MR1585 4
5466
5467/* Enumeration for 18.25 kbps AMR-WB Encoding mode. */
5468#define ASM_MEDIA_FMT_AMRWB_FS_ENCODE_MODE_MR1825 5
5469
5470/* Enumeration for 19.85 kbps AMR-WB Encoding mode. */
5471#define ASM_MEDIA_FMT_AMRWB_FS_ENCODE_MODE_MR1985 6
5472
5473/* Enumeration for 23.05 kbps AMR-WB Encoding mode. */
5474#define ASM_MEDIA_FMT_AMRWB_FS_ENCODE_MODE_MR2305 7
5475
5476/* Enumeration for 23.85 kbps AMR-WB Encoding mode. */
5477#define ASM_MEDIA_FMT_AMRWB_FS_ENCODE_MODE_MR2385 8
5478
5479struct asm_amrwb_enc_cfg {
5480 struct apr_hdr hdr;
5481 struct asm_stream_cmd_set_encdec_param encdec;
5482 struct asm_enc_cfg_blk_param_v2 encblk;
5483
5484 u16 enc_mode;
5485/* AMR-WB encoding rate.
5486 * Suupported values:
5487 * Use the ASM_MEDIA_FMT_AMRWB_FS_ENCODE_MODE_*
5488 * macros
5489 */
5490
5491 u16 dtx_mode;
5492/* Specifies whether DTX mode is disabled or enabled.
5493 * Supported values:
5494 * - #ASM_MEDIA_FMT_AMRNB_FS_DTX_MODE_OFF
5495 * - #ASM_MEDIA_FMT_AMRNB_FS_DTX_MODE_VAD1
5496 */
5497} __packed;
5498
5499#define ASM_MEDIA_FMT_V13K_FS 0x00010BED
5500
5501/* Enumeration for 14.4 kbps V13K Encoding mode. */
5502#define ASM_MEDIA_FMT_V13K_FS_ENCODE_MODE_MR1440 0
5503
5504/* Enumeration for 12.2 kbps V13K Encoding mode. */
5505#define ASM_MEDIA_FMT_V13K_FS_ENCODE_MODE_MR1220 1
5506
5507/* Enumeration for 11.2 kbps V13K Encoding mode. */
5508#define ASM_MEDIA_FMT_V13K_FS_ENCODE_MODE_MR1120 2
5509
5510/* Enumeration for 9.0 kbps V13K Encoding mode. */
5511#define ASM_MEDIA_FMT_V13K_FS_ENCODE_MODE_MR90 3
5512
5513/* Enumeration for 7.2 kbps V13K eEncoding mode. */
5514#define ASM_MEDIA_FMT_V13K_FS_ENCODE_MODE_MR720 4
5515
5516/* Enumeration for 1/8 vocoder rate.*/
5517#define ASM_MEDIA_FMT_VOC_ONE_EIGHTH_RATE 1
5518
5519/* Enumeration for 1/4 vocoder rate. */
5520#define ASM_MEDIA_FMT_VOC_ONE_FOURTH_RATE 2
5521
5522/* Enumeration for 1/2 vocoder rate. */
5523#define ASM_MEDIA_FMT_VOC_HALF_RATE 3
5524
5525/* Enumeration for full vocoder rate. */
5526#define ASM_MEDIA_FMT_VOC_FULL_RATE 4
5527
5528struct asm_v13k_enc_cfg {
5529 struct apr_hdr hdr;
5530 struct asm_stream_cmd_set_encdec_param encdec;
5531 struct asm_enc_cfg_blk_param_v2 encblk;
5532 u16 max_rate;
5533/* Maximum allowed encoder frame rate.
5534 * Supported values:
5535 * - #ASM_MEDIA_FMT_VOC_ONE_EIGHTH_RATE
5536 * - #ASM_MEDIA_FMT_VOC_ONE_FOURTH_RATE
5537 * - #ASM_MEDIA_FMT_VOC_HALF_RATE
5538 * - #ASM_MEDIA_FMT_VOC_FULL_RATE
5539 */
5540
5541 u16 min_rate;
5542/* Minimum allowed encoder frame rate.
5543 * Supported values:
5544 * - #ASM_MEDIA_FMT_VOC_ONE_EIGHTH_RATE
5545 * - #ASM_MEDIA_FMT_VOC_ONE_FOURTH_RATE
5546 * - #ASM_MEDIA_FMT_VOC_HALF_RATE
5547 * - #ASM_MEDIA_FMT_VOC_FULL_RATE
5548 */
5549
5550 u16 reduced_rate_cmd;
5551/* Reduced rate command, used to change
5552 * the average bitrate of the V13K
5553 * vocoder.
5554 * Supported values:
5555 * - #ASM_MEDIA_FMT_V13K_FS_ENCODE_MODE_MR1440 (Default)
5556 * - #ASM_MEDIA_FMT_V13K_FS_ENCODE_MODE_MR1220
5557 * - #ASM_MEDIA_FMT_V13K_FS_ENCODE_MODE_MR1120
5558 * - #ASM_MEDIA_FMT_V13K_FS_ENCODE_MODE_MR90
5559 * - #ASM_MEDIA_FMT_V13K_FS_ENCODE_MODE_MR720
5560 */
5561
5562 u16 rate_mod_cmd;
5563/* Rate modulation command. Default = 0.
5564 *- If bit 0=1, rate control is enabled.
5565 *- If bit 1=1, the maximum number of consecutive full rate
5566 * frames is limited with numbers supplied in
5567 * bits 2 to 10.
5568 *- If bit 1=0, the minimum number of non-full rate frames
5569 * in between two full rate frames is forced to
5570 * the number supplied in bits 2 to 10. In both cases, if necessary,
5571 * half rate is used to substitute full rate. - Bits 15 to 10 are
5572 * reserved and must all be set to zero.
5573 */
5574
5575} __packed;
5576
5577#define ASM_MEDIA_FMT_EVRC_FS 0x00010BEE
5578
5579/* EVRC encoder configuration structure used in the
5580 * #ASM_PARAM_ID_ENCDEC_ENC_CFG_BLK_V2 command.
5581 */
5582struct asm_evrc_enc_cfg {
5583 struct apr_hdr hdr;
5584 struct asm_stream_cmd_set_encdec_param encdec;
5585 struct asm_enc_cfg_blk_param_v2 encblk;
5586 u16 max_rate;
5587/* Maximum allowed encoder frame rate.
5588 * Supported values:
5589 * - #ASM_MEDIA_FMT_VOC_ONE_EIGHTH_RATE
5590 * - #ASM_MEDIA_FMT_VOC_ONE_FOURTH_RATE
5591 * - #ASM_MEDIA_FMT_VOC_HALF_RATE
5592 * - #ASM_MEDIA_FMT_VOC_FULL_RATE
5593 */
5594
5595 u16 min_rate;
5596/* Minimum allowed encoder frame rate.
5597 * Supported values:
5598 * - #ASM_MEDIA_FMT_VOC_ONE_EIGHTH_RATE
5599 * - #ASM_MEDIA_FMT_VOC_ONE_FOURTH_RATE
5600 * - #ASM_MEDIA_FMT_VOC_HALF_RATE
5601 * - #ASM_MEDIA_FMT_VOC_FULL_RATE
5602 */
5603
5604 u16 rate_mod_cmd;
5605/* Rate modulation command. Default: 0.
5606 * - If bit 0=1, rate control is enabled.
5607 * - If bit 1=1, the maximum number of consecutive full rate frames
5608 * is limited with numbers supplied in bits 2 to 10.
5609 *
5610 * - If bit 1=0, the minimum number of non-full rate frames in
5611 * between two full rate frames is forced to the number supplied in
5612 * bits 2 to 10. In both cases, if necessary, half rate is used to
5613 * substitute full rate.
5614 *
5615 * - Bits 15 to 10 are reserved and must all be set to zero.
5616 */
5617
5618 u16 reserved;
5619 /* Reserved. Clients must set this field to zero. */
5620} __packed;
5621
5622#define ASM_MEDIA_FMT_WMA_V10PRO_V2 0x00010DA7
5623
5624struct asm_wmaprov10_fmt_blk_v2 {
5625 struct apr_hdr hdr;
5626 struct asm_data_cmd_media_fmt_update_v2 fmtblk;
5627
5628 u16 fmtag;
5629/* WMA format type.
5630 * Supported values:
5631 * - 0x162 -- WMA 9 Pro
5632 * - 0x163 -- WMA 9 Pro Lossless
5633 * - 0x166 -- WMA 10 Pro
5634 * - 0x167 -- WMA 10 Pro Lossless
5635 */
5636
5637 u16 num_channels;
5638/* Number of channels encoded in the input stream.
5639 * Supported values: 1 to 8
5640 */
5641
5642 u32 sample_rate;
5643/* Number of samples per second (in Hertz).
5644 * Supported values: 11025, 16000, 22050, 32000, 44100, 48000,
5645 * 88200, 96000
5646 */
5647
5648 u32 avg_bytes_per_sec;
5649/* Bitrate expressed as the average bytes per second.
5650 * Supported values: 2000 to 96000
5651 */
5652
5653 u16 blk_align;
5654/* Size of the bitstream packet size in bytes. WMA Pro files
5655 * have a payload of one block per bitstream packet.
5656 * Supported values: @le 13376
5657 */
5658
5659 u16 bits_per_sample;
5660/* Number of bits per sample in the encoded WMA stream.
5661 * Supported values: 16, 24
5662 */
5663
5664 u32 channel_mask;
5665/* Bit-packed double word (32-bits) that indicates the
5666 * recommended speaker positions for each source channel.
5667 */
5668
5669 u16 enc_options;
5670/* Bit-packed word with values that indicate whether certain
5671 * features of the bitstream are used.
5672 * Supported values: - 0x0001 -- ENCOPT3_PURE_LOSSLESS - 0x0006 --
5673 * ENCOPT3_FRM_SIZE_MOD - 0x0038 -- ENCOPT3_SUBFRM_DIV - 0x0040 --
5674 * ENCOPT3_WRITE_FRAMESIZE_IN_HDR - 0x0080 --
5675 * ENCOPT3_GENERATE_DRC_PARAMS - 0x0100 -- ENCOPT3_RTMBITS
5676 */
5677
5678
5679 u16 usAdvancedEncodeOpt;
5680 /* Advanced encoding option. */
5681
5682 u32 advanced_enc_options2;
5683 /* Advanced encoding option 2. */
5684
5685} __packed;
5686
5687#define ASM_MEDIA_FMT_WMA_V9_V2 0x00010DA8
5688struct asm_wmastdv9_fmt_blk_v2 {
5689 struct apr_hdr hdr;
5690 struct asm_data_cmd_media_fmt_update_v2 fmtblk;
5691 u16 fmtag;
5692/* WMA format tag.
5693 * Supported values: 0x161 (WMA 9 standard)
5694 */
5695
5696 u16 num_channels;
5697/* Number of channels in the stream.
5698 * Supported values: 1, 2
5699 */
5700
5701 u32 sample_rate;
5702/* Number of samples per second (in Hertz).
5703 * Supported values: 48000
5704 */
5705
5706 u32 avg_bytes_per_sec;
5707 /* Bitrate expressed as the average bytes per second. */
5708
5709 u16 blk_align;
5710/* Block align. All WMA files with a maximum packet size of
5711 * 13376 are supported.
5712 */
5713
5714
5715 u16 bits_per_sample;
5716/* Number of bits per sample in the output.
5717 * Supported values: 16
5718 */
5719
5720 u32 channel_mask;
5721/* Channel mask.
5722 * Supported values:
5723 * - 3 -- Stereo (front left/front right)
5724 * - 4 -- Mono (center)
5725 */
5726
5727 u16 enc_options;
5728 /* Options used during encoding. */
5729
5730 u16 reserved;
5731
5732} __packed;
5733
5734#define ASM_MEDIA_FMT_WMA_V8 0x00010D91
5735
5736struct asm_wmastdv8_enc_cfg {
5737 struct apr_hdr hdr;
5738 struct asm_stream_cmd_set_encdec_param encdec;
5739 struct asm_enc_cfg_blk_param_v2 encblk;
5740 u32 bit_rate;
5741 /* Encoding rate in bits per second. */
5742
5743 u32 sample_rate;
5744/* Number of samples per second.
5745 *
5746 * Supported values:
5747 * - 0 -- Native mode
5748 * - Other Supported values are 22050, 32000, 44100, and 48000.
5749 *
5750 * Native mode indicates that encoding must be performed with the
5751 * sampling rate at the input.
5752 * The sampling rate must not change during encoding.
5753 */
5754
5755 u16 channel_cfg;
5756/* Number of channels to encode.
5757 * Supported values:
5758 * - 0 -- Native mode
5759 * - 1 -- Mono
5760 * - 2 -- Stereo
5761 * - Other values are not supported.
5762 *
5763 * Native mode indicates that encoding must be performed with the
5764 * number of channels at the input.
5765 * The number of channels must not change during encoding.
5766 */
5767
5768 u16 reserved;
5769 /* Reserved. Clients must set this field to zero.*/
5770 } __packed;
5771
5772#define ASM_MEDIA_FMT_AMR_WB_PLUS_V2 0x00010DA9
5773
5774struct asm_amrwbplus_fmt_blk_v2 {
5775 struct apr_hdr hdr;
5776 struct asm_data_cmd_media_fmt_update_v2 fmtblk;
5777 u32 amr_frame_fmt;
5778/* AMR frame format.
5779 * Supported values:
5780 * - 6 -- Transport Interface Format (TIF)
5781 * - Any other value -- File storage format (FSF)
5782 *
5783 * TIF stream contains 2-byte header for each frame within the
5784 * superframe. FSF stream contains one 2-byte header per superframe.
5785 */
5786
5787} __packed;
5788
5789#define ASM_MEDIA_FMT_AC3 0x00010DEE
5790#define ASM_MEDIA_FMT_EAC3 0x00010DEF
5791#define ASM_MEDIA_FMT_DTS 0x00010D88
5792#define ASM_MEDIA_FMT_MP2 0x00010DE9
5793#define ASM_MEDIA_FMT_FLAC 0x00010C16
5794#define ASM_MEDIA_FMT_ALAC 0x00012F31
5795#define ASM_MEDIA_FMT_VORBIS 0x00010C15
5796#define ASM_MEDIA_FMT_APE 0x00012F32
5797#define ASM_MEDIA_FMT_DSD 0x00012F3E
5798#define ASM_MEDIA_FMT_TRUEHD 0x00013215
5799/* 0x0 is used for fomat ID since ADSP dynamically determines the
5800 * format encapsulated in the IEC61937 (compressed) or IEC60958
5801 * (pcm) packets.
5802 */
5803#define ASM_MEDIA_FMT_IEC 0x00000000
5804
5805/* Media format ID for adaptive transform acoustic coding. This
5806 * ID is used by the #ASM_STREAM_CMD_OPEN_WRITE_COMPRESSED command
5807 * only.
5808 */
5809
5810#define ASM_MEDIA_FMT_ATRAC 0x00010D89
5811
5812/* Media format ID for metadata-enhanced audio transmission.
5813 * This ID is used by the #ASM_STREAM_CMD_OPEN_WRITE_COMPRESSED
5814 * command only.
5815 */
5816
5817#define ASM_MEDIA_FMT_MAT 0x00010D8A
5818
5819/* adsp_media_fmt.h */
5820
5821#define ASM_DATA_CMD_WRITE_V2 0x00010DAB
5822
5823struct asm_data_cmd_write_v2 {
5824 struct apr_hdr hdr;
5825 u32 buf_addr_lsw;
5826/* The 64 bit address msw-lsw should be a valid, mapped address.
5827 * 64 bit address should be a multiple of 32 bytes
5828 */
5829
5830 u32 buf_addr_msw;
5831/* The 64 bit address msw-lsw should be a valid, mapped address.
5832 * 64 bit address should be a multiple of 32 bytes.
5833 * -Address of the buffer containing the data to be decoded.
5834 * The buffer should be aligned to a 32 byte boundary.
5835 * -In the case of 32 bit Shared memory address, msw field must
5836 * -be set to zero.
5837 * -In the case of 36 bit shared memory address, bit 31 to bit 4
5838 * -of msw must be set to zero.
5839 */
5840 u32 mem_map_handle;
5841/* memory map handle returned by DSP through
5842 * ASM_CMD_SHARED_MEM_MAP_REGIONS command
5843 */
5844 u32 buf_size;
5845/* Number of valid bytes available in the buffer for decoding. The
5846 * first byte starts at buf_addr.
5847 */
5848
5849 u32 seq_id;
5850 /* Optional buffer sequence ID. */
5851
5852 u32 timestamp_lsw;
5853/* Lower 32 bits of the 64-bit session time in microseconds of the
5854 * first buffer sample.
5855 */
5856
5857 u32 timestamp_msw;
5858/* Upper 32 bits of the 64-bit session time in microseconds of the
5859 * first buffer sample.
5860 */
5861
5862 u32 flags;
5863/* Bitfield of flags.
5864 * Supported values for bit 31:
5865 * - 1 -- Valid timestamp.
5866 * - 0 -- Invalid timestamp.
5867 * - Use #ASM_BIT_MASKIMESTAMP_VALID_FLAG as the bitmask and
5868 * #ASM_SHIFTIMESTAMP_VALID_FLAG as the shift value to set this bit.
5869 * Supported values for bit 30:
5870 * - 1 -- Last buffer.
5871 * - 0 -- Not the last buffer.
5872 *
5873 * Supported values for bit 29:
5874 * - 1 -- Continue the timestamp from the previous buffer.
5875 * - 0 -- Timestamp of the current buffer is not related
5876 * to the timestamp of the previous buffer.
5877 * - Use #ASM_BIT_MASKS_CONTINUE_FLAG and #ASM_SHIFTS_CONTINUE_FLAG
5878 * to set this bit.
5879 *
5880 * Supported values for bit 4:
5881 * - 1 -- End of the frame.
5882 * - 0 -- Not the end of frame, or this information is not known.
5883 * - Use #ASM_BIT_MASK_EOF_FLAG as the bitmask and #ASM_SHIFT_EOF_FLAG
5884 * as the shift value to set this bit.
5885 *
5886 * All other bits are reserved and must be set to 0.
5887 *
5888 * If bit 31=0 and bit 29=1: The timestamp of the first sample in
5889 * this buffer continues from the timestamp of the last sample in
5890 * the previous buffer. If there is no previous buffer (i.e., this
5891 * is the first buffer sent after opening the stream or after a
5892 * flush operation), or if the previous buffer does not have a valid
5893 * timestamp, the samples in the current buffer also do not have a
5894 * valid timestamp. They are played out as soon as possible.
5895 *
5896 *
5897 * If bit 31=0 and bit 29=0: No timestamp is associated with the
5898 * first sample in this buffer. The samples are played out as soon
5899 * as possible.
5900 *
5901 *
5902 * If bit 31=1 and bit 29 is ignored: The timestamp specified in
5903 * this payload is honored.
5904 *
5905 *
5906 * If bit 30=0: Not the last buffer in the stream. This is useful
5907 * in removing trailing samples.
5908 *
5909 *
5910 * For bit 4: The client can set this flag for every buffer sent in
5911 * which the last byte is the end of a frame. If this flag is set,
5912 * the buffer can contain data from multiple frames, but it should
5913 * always end at a frame boundary. Restrictions allow the aDSP to
5914 * detect an end of frame without requiring additional processing.
5915 */
5916
5917} __packed;
5918
5919#define ASM_DATA_CMD_READ_V2 0x00010DAC
5920
5921struct asm_data_cmd_read_v2 {
5922 struct apr_hdr hdr;
5923 u32 buf_addr_lsw;
5924/* the 64 bit address msw-lsw should be a valid mapped address
5925 * and should be a multiple of 32 bytes
5926 */
5927
5928
5929 u32 buf_addr_msw;
5930/* the 64 bit address msw-lsw should be a valid mapped address
5931 * and should be a multiple of 32 bytes.
5932 * - Address of the buffer where the DSP puts the encoded data,
5933 * potentially, at an offset specified by the uOffset field in
5934 * ASM_DATA_EVENT_READ_DONE structure. The buffer should be aligned
5935 * to a 32 byte boundary.
5936 * - In the case of 32 bit Shared memory address, msw field must
5937 * - be set to zero.
5938 * - In the case of 36 bit shared memory address, bit 31 to bit
5939 * - 4 of msw must be set to zero.
5940 */
5941 u32 mem_map_handle;
5942/* memory map handle returned by DSP through
5943 * ASM_CMD_SHARED_MEM_MAP_REGIONS command.
5944 */
5945
5946 u32 buf_size;
5947/* Number of bytes available for the aDSP to write. The aDSP
5948 * starts writing from buf_addr.
5949 */
5950
5951 u32 seq_id;
5952 /* Optional buffer sequence ID. */
5953} __packed;
5954
5955#define ASM_DATA_CMD_EOS 0x00010BDB
5956#define ASM_DATA_EVENT_RENDERED_EOS 0x00010C1C
5957#define ASM_DATA_EVENT_EOS 0x00010BDD
5958
5959#define ASM_DATA_EVENT_WRITE_DONE_V2 0x00010D99
5960struct asm_data_event_write_done_v2 {
5961 u32 buf_addr_lsw;
5962 /* lsw of the 64 bit address */
5963 u32 buf_addr_msw;
5964 /* msw of the 64 bit address. address given by the client in
5965 * ASM_DATA_CMD_WRITE_V2 command.
5966 */
5967 u32 mem_map_handle;
5968 /* memory map handle in the ASM_DATA_CMD_WRITE_V2 */
5969
5970 u32 status;
5971/* Status message (error code) that indicates whether the
5972 * referenced buffer has been successfully consumed.
5973 * Supported values: Refer to @xhyperref{Q3,[Q3]}
5974 */
5975} __packed;
5976
5977#define ASM_DATA_EVENT_READ_DONE_V2 0x00010D9A
5978
5979/* Definition of the frame metadata flag bitmask.*/
5980#define ASM_BIT_MASK_FRAME_METADATA_FLAG (0x40000000UL)
5981
5982/* Definition of the frame metadata flag shift value. */
5983#define ASM_SHIFT_FRAME_METADATA_FLAG 30
5984
5985struct asm_data_event_read_done_v2 {
5986 u32 status;
5987/* Status message (error code).
5988 * Supported values: Refer to @xhyperref{Q3,[Q3]}
5989 */
5990
5991u32 buf_addr_lsw;
5992/* 64 bit address msw-lsw is a valid, mapped address. 64 bit
5993 * address is a multiple of 32 bytes.
5994 */
5995
5996u32 buf_addr_msw;
5997/* 64 bit address msw-lsw is a valid, mapped address. 64 bit
5998 * address is a multiple of 32 bytes.
5999 *
6000 * -Same address provided by the client in ASM_DATA_CMD_READ_V2
6001 * -In the case of 32 bit Shared memory address, msw field is set to
6002 * zero.
6003 * -In the case of 36 bit shared memory address, bit 31 to bit 4
6004 * -of msw is set to zero.
6005 */
6006
6007u32 mem_map_handle;
6008/* memory map handle in the ASM_DATA_CMD_READ_V2 */
6009
6010u32 enc_framesotal_size;
6011/* Total size of the encoded frames in bytes.
6012 * Supported values: >0
6013 */
6014
6015u32 offset;
6016/* Offset (from buf_addr) to the first byte of the first encoded
6017 * frame. All encoded frames are consecutive, starting from this
6018 * offset.
6019 * Supported values: > 0
6020 */
6021
6022u32 timestamp_lsw;
6023/* Lower 32 bits of the 64-bit session time in microseconds of
6024 * the first sample in the buffer. If Bit 5 of mode_flags flag of
6025 * ASM_STREAM_CMD_OPEN_READ_V2 is 1 then the 64 bit timestamp is
6026 * absolute capture time otherwise it is relative session time. The
6027 * absolute timestamp doesn't reset unless the system is reset.
6028 */
6029
6030
6031u32 timestamp_msw;
6032/* Upper 32 bits of the 64-bit session time in microseconds of
6033 * the first sample in the buffer.
6034 */
6035
6036
6037u32 flags;
6038/* Bitfield of flags. Bit 30 indicates whether frame metadata is
6039 * present. If frame metadata is present, num_frames consecutive
6040 * instances of @xhyperref{hdr:FrameMetaData,Frame metadata} start
6041 * at the buffer address.
6042 * Supported values for bit 31:
6043 * - 1 -- Timestamp is valid.
6044 * - 0 -- Timestamp is invalid.
6045 * - Use #ASM_BIT_MASKIMESTAMP_VALID_FLAG and
6046 * #ASM_SHIFTIMESTAMP_VALID_FLAG to set this bit.
6047 *
6048 * Supported values for bit 30:
6049 * - 1 -- Frame metadata is present.
6050 * - 0 -- Frame metadata is absent.
6051 * - Use #ASM_BIT_MASK_FRAME_METADATA_FLAG and
6052 * #ASM_SHIFT_FRAME_METADATA_FLAG to set this bit.
6053 *
6054 * All other bits are reserved; the aDSP sets them to 0.
6055 */
6056
6057u32 num_frames;
6058/* Number of encoded frames in the buffer. */
6059
6060u32 seq_id;
6061/* Optional buffer sequence ID. */
6062} __packed;
6063
6064struct asm_data_read_buf_metadata_v2 {
6065 u32 offset;
6066/* Offset from buf_addr in #ASM_DATA_EVENT_READ_DONE_PAYLOAD to
6067 * the frame associated with this metadata.
6068 * Supported values: > 0
6069 */
6070
6071u32 frm_size;
6072/* Size of the encoded frame in bytes.
6073 * Supported values: > 0
6074 */
6075
6076u32 num_encoded_pcm_samples;
6077/* Number of encoded PCM samples (per channel) in the frame
6078 * associated with this metadata.
6079 * Supported values: > 0
6080 */
6081
6082u32 timestamp_lsw;
6083/* Lower 32 bits of the 64-bit session time in microseconds of the
6084 * first sample for this frame.
6085 * If Bit 5 of mode_flags flag of ASM_STREAM_CMD_OPEN_READ_V2 is 1
6086 * then the 64 bit timestamp is absolute capture time otherwise it
6087 * is relative session time. The absolute timestamp doesn't reset
6088 * unless the system is reset.
6089 */
6090
6091
6092u32 timestamp_msw;
6093/* Lower 32 bits of the 64-bit session time in microseconds of the
6094 * first sample for this frame.
6095 */
6096
6097u32 flags;
6098/* Frame flags.
6099 * Supported values for bit 31:
6100 * - 1 -- Time stamp is valid
6101 * - 0 -- Time stamp is not valid
6102 * - All other bits are reserved; the aDSP sets them to 0.
6103 */
6104} __packed;
6105
6106/* Notifies the client of a change in the data sampling rate or
6107 * Channel mode. This event is raised by the decoder service. The
6108 * event is enabled through the mode flags of
6109 * #ASM_STREAM_CMD_OPEN_WRITE_V2 or
6110 * #ASM_STREAM_CMD_OPEN_READWRITE_V2. - The decoder detects a change
6111 * in the output sampling frequency or the number/positioning of
6112 * output channels, or if it is the first frame decoded.The new
6113 * sampling frequency or the new channel configuration is
6114 * communicated back to the client asynchronously.
6115 */
6116
6117#define ASM_DATA_EVENT_SR_CM_CHANGE_NOTIFY 0x00010C65
6118
6119/* Payload of the #ASM_DATA_EVENT_SR_CM_CHANGE_NOTIFY event.
6120 * This event is raised when the following conditions are both true:
6121 * - The event is enabled through the mode_flags of
6122 * #ASM_STREAM_CMD_OPEN_WRITE_V2 or
6123 * #ASM_STREAM_CMD_OPEN_READWRITE_V2. - The decoder detects a change
6124 * in either the output sampling frequency or the number/positioning
6125 * of output channels, or if it is the first frame decoded.
6126 * This event is not raised (even if enabled) if the decoder is
6127 * MIDI, because
6128 */
6129
6130
6131struct asm_data_event_sr_cm_change_notify {
6132 u32 sample_rate;
6133/* New sampling rate (in Hertz) after detecting a change in the
6134 * bitstream.
6135 * Supported values: 2000 to 48000
6136 */
6137
6138 u16 num_channels;
6139/* New number of channels after detecting a change in the
6140 * bitstream.
6141 * Supported values: 1 to 8
6142 */
6143
6144
6145 u16 reserved;
6146 /* Reserved for future use. This field must be set to 0.*/
6147
6148 u8 channel_mapping[8];
6149
6150} __packed;
6151
6152/* Notifies the client of a data sampling rate or channel mode
6153 * change. This event is raised by the encoder service.
6154 * This event is raised when :
6155 * - Native mode encoding was requested in the encoder
6156 * configuration (i.e., the channel number was 0), the sample rate
6157 * was 0, or both were 0.
6158 *
6159 * - The input data frame at the encoder is the first one, or the
6160 * sampling rate/channel mode is different from the previous input
6161 * data frame.
6162 *
6163 */
6164#define ASM_DATA_EVENT_ENC_SR_CM_CHANGE_NOTIFY 0x00010BDE
6165
6166struct asm_data_event_enc_sr_cm_change_notify {
6167 u32 sample_rate;
6168/* New sampling rate (in Hertz) after detecting a change in the
6169 * input data.
6170 * Supported values: 2000 to 48000
6171 */
6172
6173
6174 u16 num_channels;
6175/* New number of channels after detecting a change in the input
6176 * data. Supported values: 1 to 8
6177 */
6178
6179
6180 u16 bits_per_sample;
6181/* New bits per sample after detecting a change in the input
6182 * data.
6183 * Supported values: 16, 24
6184 */
6185
6186
6187 u8 channel_mapping[8];
6188
6189} __packed;
6190#define ASM_DATA_CMD_IEC_60958_FRAME_RATE 0x00010D87
6191
6192
6193/* Payload of the #ASM_DATA_CMD_IEC_60958_FRAME_RATE command,
6194 * which is used to indicate the IEC 60958 frame rate of a given
6195 * packetized audio stream.
6196 */
6197
6198struct asm_data_cmd_iec_60958_frame_rate {
6199 u32 frame_rate;
6200/* IEC 60958 frame rate of the incoming IEC 61937 packetized stream.
6201 * Supported values: Any valid frame rate
6202 */
6203} __packed;
6204
6205/* adsp_asm_data_commands.h*/
6206/* Definition of the stream ID bitmask.*/
6207#define ASM_BIT_MASK_STREAM_ID (0x000000FFUL)
6208
6209/* Definition of the stream ID shift value.*/
6210#define ASM_SHIFT_STREAM_ID 0
6211
6212/* Definition of the session ID bitmask.*/
6213#define ASM_BIT_MASK_SESSION_ID (0x0000FF00UL)
6214
6215/* Definition of the session ID shift value.*/
6216#define ASM_SHIFT_SESSION_ID 8
6217
6218/* Definition of the service ID bitmask.*/
6219#define ASM_BIT_MASK_SERVICE_ID (0x00FF0000UL)
6220
6221/* Definition of the service ID shift value.*/
6222#define ASM_SHIFT_SERVICE_ID 16
6223
6224/* Definition of the domain ID bitmask.*/
6225#define ASM_BIT_MASK_DOMAIN_ID (0xFF000000UL)
6226
6227/* Definition of the domain ID shift value.*/
6228#define ASM_SHIFT_DOMAIN_ID 24
6229
6230#define ASM_CMD_SHARED_MEM_MAP_REGIONS 0x00010D92
6231#define ASM_CMDRSP_SHARED_MEM_MAP_REGIONS 0x00010D93
6232#define ASM_CMD_SHARED_MEM_UNMAP_REGIONS 0x00010D94
6233
6234/* adsp_asm_service_commands.h */
6235
6236#define ASM_MAX_SESSION_ID (15)
6237
6238/* Maximum number of sessions.*/
6239#define ASM_MAX_NUM_SESSIONS ASM_MAX_SESSION_ID
6240
6241/* Maximum number of streams per session.*/
6242#define ASM_MAX_STREAMS_PER_SESSION (8)
6243#define ASM_SESSION_CMD_RUN_V2 0x00010DAA
6244#define ASM_SESSION_CMD_RUN_STARTIME_RUN_IMMEDIATE 0
6245#define ASM_SESSION_CMD_RUN_STARTIME_RUN_AT_ABSOLUTEIME 1
6246#define ASM_SESSION_CMD_RUN_STARTIME_RUN_AT_RELATIVEIME 2
6247#define ASM_SESSION_CMD_RUN_STARTIME_RUN_WITH_DELAY 3
6248
6249#define ASM_BIT_MASK_RUN_STARTIME (0x00000003UL)
6250
6251/* Bit shift value used to specify the start time for the
6252 * ASM_SESSION_CMD_RUN_V2 command.
6253 */
6254#define ASM_SHIFT_RUN_STARTIME 0
6255struct asm_session_cmd_run_v2 {
6256 struct apr_hdr hdr;
6257 u32 flags;
6258/* Specifies whether to run immediately or at a specific
6259 * rendering time or with a specified delay. Run with delay is
6260 * useful for delaying in case of ASM loopback opened through
6261 * ASM_STREAM_CMD_OPEN_LOOPBACK_V2. Use #ASM_BIT_MASK_RUN_STARTIME
6262 * and #ASM_SHIFT_RUN_STARTIME to set this 2-bit flag.
6263 *
6264 *
6265 *Bits 0 and 1 can take one of four possible values:
6266 *
6267 *- #ASM_SESSION_CMD_RUN_STARTIME_RUN_IMMEDIATE
6268 *- #ASM_SESSION_CMD_RUN_STARTIME_RUN_AT_ABSOLUTEIME
6269 *- #ASM_SESSION_CMD_RUN_STARTIME_RUN_AT_RELATIVEIME
6270 *- #ASM_SESSION_CMD_RUN_STARTIME_RUN_WITH_DELAY
6271 *
6272 *All other bits are reserved; clients must set them to zero.
6273 */
6274
6275 u32 time_lsw;
6276/* Lower 32 bits of the time in microseconds used to align the
6277 * session origin time. When bits 0-1 of flags is
6278 * ASM_SESSION_CMD_RUN_START_RUN_WITH_DELAY, time lsw is the lsw of
6279 * the delay in us. For ASM_SESSION_CMD_RUN_START_RUN_WITH_DELAY,
6280 * maximum value of the 64 bit delay is 150 ms.
6281 */
6282
6283 u32 time_msw;
6284/* Upper 32 bits of the time in microseconds used to align the
6285 * session origin time. When bits 0-1 of flags is
6286 * ASM_SESSION_CMD_RUN_START_RUN_WITH_DELAY, time msw is the msw of
6287 * the delay in us. For ASM_SESSION_CMD_RUN_START_RUN_WITH_DELAY,
6288 * maximum value of the 64 bit delay is 150 ms.
6289 */
6290
6291} __packed;
6292
6293#define ASM_SESSION_CMD_PAUSE 0x00010BD3
6294#define ASM_SESSION_CMD_SUSPEND 0x00010DEC
6295#define ASM_SESSION_CMD_GET_SESSIONTIME_V3 0x00010D9D
6296#define ASM_SESSION_CMD_REGISTER_FOR_RX_UNDERFLOW_EVENTS 0x00010BD5
6297
6298struct asm_session_cmd_rgstr_rx_underflow {
6299 struct apr_hdr hdr;
6300 u16 enable_flag;
6301/* Specifies whether a client is to receive events when an Rx
6302 * session underflows.
6303 * Supported values:
6304 * - 0 -- Do not send underflow events
6305 * - 1 -- Send underflow events
6306 */
6307 u16 reserved;
6308 /* Reserved. This field must be set to zero.*/
6309} __packed;
6310
6311#define ASM_SESSION_CMD_REGISTER_FORX_OVERFLOW_EVENTS 0x00010BD6
6312
6313struct asm_session_cmd_regx_overflow {
6314 struct apr_hdr hdr;
6315 u16 enable_flag;
6316/* Specifies whether a client is to receive events when a Tx
6317 * session overflows.
6318 * Supported values:
6319 * - 0 -- Do not send overflow events
6320 * - 1 -- Send overflow events
6321 */
6322
6323 u16 reserved;
6324 /* Reserved. This field must be set to zero.*/
6325} __packed;
6326
6327#define ASM_SESSION_EVENT_RX_UNDERFLOW 0x00010C17
6328#define ASM_SESSION_EVENTX_OVERFLOW 0x00010C18
6329#define ASM_SESSION_CMDRSP_GET_SESSIONTIME_V3 0x00010D9E
6330
6331struct asm_session_cmdrsp_get_sessiontime_v3 {
6332 u32 status;
6333 /* Status message (error code).
6334 * Supported values: Refer to @xhyperref{Q3,[Q3]}
6335 */
6336
6337 u32 sessiontime_lsw;
6338 /* Lower 32 bits of the current session time in microseconds.*/
6339
6340 u32 sessiontime_msw;
6341 /* Upper 32 bits of the current session time in microseconds.*/
6342
6343 u32 absolutetime_lsw;
6344/* Lower 32 bits in micro seconds of the absolute time at which
6345 * the * sample corresponding to the above session time gets
6346 * rendered * to hardware. This absolute time may be slightly in the
6347 * future or past.
6348 */
6349
6350
6351 u32 absolutetime_msw;
6352/* Upper 32 bits in micro seconds of the absolute time at which
6353 * the * sample corresponding to the above session time gets
6354 * rendered to * hardware. This absolute time may be slightly in the
6355 * future or past.
6356 */
6357
6358} __packed;
6359
6360#define ASM_SESSION_CMD_ADJUST_SESSION_CLOCK_V2 0x00010D9F
6361
6362struct asm_session_cmd_adjust_session_clock_v2 {
6363 struct apr_hdr hdr;
6364u32 adjustime_lsw;
6365/* Lower 32 bits of the signed 64-bit quantity that specifies the
6366 * adjustment time in microseconds to the session clock.
6367 *
6368 * Positive values indicate advancement of the session clock.
6369 * Negative values indicate delay of the session clock.
6370 */
6371
6372
6373 u32 adjustime_msw;
6374/* Upper 32 bits of the signed 64-bit quantity that specifies
6375 * the adjustment time in microseconds to the session clock.
6376 * Positive values indicate advancement of the session clock.
6377 * Negative values indicate delay of the session clock.
6378 */
6379
6380} __packed;
6381
6382#define ASM_SESSION_CMDRSP_ADJUST_SESSION_CLOCK_V2 0x00010DA0
6383
6384struct asm_session_cmdrsp_adjust_session_clock_v2 {
6385 u32 status;
6386/* Status message (error code).
6387 * Supported values: Refer to @xhyperref{Q3,[Q3]}
6388 * An error means the session clock is not adjusted. In this case,
6389 * the next two fields are irrelevant.
6390 */
6391
6392
6393 u32 actual_adjustime_lsw;
6394/* Lower 32 bits of the signed 64-bit quantity that specifies
6395 * the actual adjustment in microseconds performed by the aDSP.
6396 * A positive value indicates advancement of the session clock. A
6397 * negative value indicates delay of the session clock.
6398 */
6399
6400
6401 u32 actual_adjustime_msw;
6402/* Upper 32 bits of the signed 64-bit quantity that specifies
6403 * the actual adjustment in microseconds performed by the aDSP.
6404 * A positive value indicates advancement of the session clock. A
6405 * negative value indicates delay of the session clock.
6406 */
6407
6408
6409 u32 cmd_latency_lsw;
6410/* Lower 32 bits of the unsigned 64-bit quantity that specifies
6411 * the amount of time in microseconds taken to perform the session
6412 * clock adjustment.
6413 */
6414
6415
6416 u32 cmd_latency_msw;
6417/* Upper 32 bits of the unsigned 64-bit quantity that specifies
6418 * the amount of time in microseconds taken to perform the session
6419 * clock adjustment.
6420 */
6421
6422} __packed;
6423
6424#define ASM_SESSION_CMD_GET_PATH_DELAY_V2 0x00010DAF
6425#define ASM_SESSION_CMDRSP_GET_PATH_DELAY_V2 0x00010DB0
6426
6427struct asm_session_cmdrsp_get_path_delay_v2 {
6428 u32 status;
6429/* Status message (error code). Whether this get delay operation
6430 * is successful or not. Delay value is valid only if status is
6431 * success.
6432 * Supported values: Refer to @xhyperref{Q5,[Q5]}
6433 */
6434
6435 u32 audio_delay_lsw;
6436 /* Upper 32 bits of the aDSP delay in microseconds. */
6437
6438 u32 audio_delay_msw;
6439 /* Lower 32 bits of the aDSP delay in microseconds. */
6440
6441} __packed;
6442
6443/* adsp_asm_session_command.h*/
6444#define ASM_STREAM_CMD_OPEN_WRITE_V3 0x00010DB3
6445
6446#define ASM_LOW_LATENCY_STREAM_SESSION 0x10000000
6447
6448#define ASM_ULTRA_LOW_LATENCY_STREAM_SESSION 0x20000000
6449
6450#define ASM_ULL_POST_PROCESSING_STREAM_SESSION 0x40000000
6451
6452#define ASM_LEGACY_STREAM_SESSION 0
6453
6454
6455struct asm_stream_cmd_open_write_v3 {
6456 struct apr_hdr hdr;
6457 uint32_t mode_flags;
6458/* Mode flags that configure the stream to notify the client
6459 * whenever it detects an SR/CM change at the input to its POPP.
6460 * Supported values for bits 0 to 1:
6461 * - Reserved; clients must set them to zero.
6462 * Supported values for bit 2:
6463 * - 0 -- SR/CM change notification event is disabled.
6464 * - 1 -- SR/CM change notification event is enabled.
6465 * - Use #ASM_BIT_MASK_SR_CM_CHANGE_NOTIFY_FLAG and
6466 * #ASM_SHIFT_SR_CM_CHANGE_NOTIFY_FLAG to set or get this bit.
6467 *
6468 * Supported values for bit 31:
6469 * - 0 -- Stream to be opened in on-Gapless mode.
6470 * - 1 -- Stream to be opened in Gapless mode. In Gapless mode,
6471 * successive streams must be opened with same session ID but
6472 * different stream IDs.
6473 *
6474 * - Use #ASM_BIT_MASK_GAPLESS_MODE_FLAG and
6475 * #ASM_SHIFT_GAPLESS_MODE_FLAG to set or get this bit.
6476 *
6477 *
6478 * @note1hang MIDI and DTMF streams cannot be opened in Gapless mode.
6479 */
6480
6481 uint16_t sink_endpointype;
6482/*< Sink point type.
6483 * Supported values:
6484 * - 0 -- Device matrix
6485 * - Other values are reserved.
6486 *
6487 * The device matrix is the gateway to the hardware ports.
6488 */
6489
6490 uint16_t bits_per_sample;
6491/*< Number of bits per sample processed by ASM modules.
6492 * Supported values: 16 and 24 bits per sample
6493 */
6494
6495 uint32_t postprocopo_id;
6496/*< Specifies the topology (order of processing) of
6497 * postprocessing algorithms. <i>None</i> means no postprocessing.
6498 * Supported values:
6499 * - #ASM_STREAM_POSTPROCOPO_ID_DEFAULT
6500 * - #ASM_STREAM_POSTPROCOPO_ID_MCH_PEAK_VOL
6501 * - #ASM_STREAM_POSTPROCOPO_ID_NONE
6502 *
6503 * This field can also be enabled through SetParams flags.
6504 */
6505
6506 uint32_t dec_fmt_id;
6507/*< Configuration ID of the decoder media format.
6508 *
6509 * Supported values:
6510 * - #ASM_MEDIA_FMT_MULTI_CHANNEL_PCM_V2
6511 * - #ASM_MEDIA_FMT_ADPCM
6512 * - #ASM_MEDIA_FMT_MP3
6513 * - #ASM_MEDIA_FMT_AAC_V2
6514 * - #ASM_MEDIA_FMT_DOLBY_AAC
6515 * - #ASM_MEDIA_FMT_AMRNB_FS
6516 * - #ASM_MEDIA_FMT_AMRWB_FS
6517 * - #ASM_MEDIA_FMT_AMR_WB_PLUS_V2
6518 * - #ASM_MEDIA_FMT_V13K_FS
6519 * - #ASM_MEDIA_FMT_EVRC_FS
6520 * - #ASM_MEDIA_FMT_EVRCB_FS
6521 * - #ASM_MEDIA_FMT_EVRCWB_FS
6522 * - #ASM_MEDIA_FMT_SBC
6523 * - #ASM_MEDIA_FMT_WMA_V10PRO_V2
6524 * - #ASM_MEDIA_FMT_WMA_V9_V2
6525 * - #ASM_MEDIA_FMT_AC3
6526 * - #ASM_MEDIA_FMT_EAC3
6527 * - #ASM_MEDIA_FMT_G711_ALAW_FS
6528 * - #ASM_MEDIA_FMT_G711_MLAW_FS
6529 * - #ASM_MEDIA_FMT_G729A_FS
6530 * - #ASM_MEDIA_FMT_FR_FS
6531 * - #ASM_MEDIA_FMT_VORBIS
6532 * - #ASM_MEDIA_FMT_FLAC
6533 * - #ASM_MEDIA_FMT_ALAC
6534 * - #ASM_MEDIA_FMT_APE
6535 * - #ASM_MEDIA_FMT_EXAMPLE
6536 */
6537} __packed;
6538
6539#define ASM_STREAM_CMD_OPEN_PULL_MODE_WRITE 0x00010DD9
6540
6541/* Bitmask for the stream_perf_mode subfield. */
6542#define ASM_BIT_MASK_STREAM_PERF_FLAG_PULL_MODE_WRITE 0xE0000000UL
6543
6544/* Bitmask for the stream_perf_mode subfield. */
6545#define ASM_SHIFT_STREAM_PERF_FLAG_PULL_MODE_WRITE 29
6546
6547#define ASM_STREAM_CMD_OPEN_PUSH_MODE_READ 0x00010DDA
6548
6549#define ASM_BIT_MASK_STREAM_PERF_FLAG_PUSH_MODE_READ 0xE0000000UL
6550
6551#define ASM_SHIFT_STREAM_PERF_FLAG_PUSH_MODE_READ 29
6552
6553#define ASM_DATA_EVENT_WATERMARK 0x00010DDB
6554
6555struct asm_shared_position_buffer {
6556 volatile uint32_t frame_counter;
6557/* Counter used to handle interprocessor synchronization issues.
6558 * When frame_counter is 0: read_index, wall_clock_us_lsw, and
6559 * wall_clock_us_msw are invalid.
6560 * Supported values: >= 0.
6561 */
6562
6563 volatile uint32_t index;
6564/* Index in bytes from where the aDSP is reading/writing.
6565 * Supported values: 0 to circular buffer size - 1
6566 */
6567
6568 volatile uint32_t wall_clock_us_lsw;
6569/* Lower 32 bits of the 64-bit wall clock time in microseconds when the
6570 * read index was updated.
6571 * Supported values: >= 0
6572 */
6573
6574 volatile uint32_t wall_clock_us_msw;
6575/* Upper 32 bits of the 64 bit wall clock time in microseconds when the
6576 * read index was updated
6577 * Supported values: >= 0
6578 */
6579} __packed;
6580
6581struct asm_shared_watermark_level {
6582 uint32_t watermark_level_bytes;
6583} __packed;
6584
6585struct asm_stream_cmd_open_shared_io {
6586 struct apr_hdr hdr;
6587 uint32_t mode_flags;
6588 uint16_t endpoint_type;
6589 uint16_t topo_bits_per_sample;
6590 uint32_t topo_id;
6591 uint32_t fmt_id;
6592 uint32_t shared_pos_buf_phy_addr_lsw;
6593 uint32_t shared_pos_buf_phy_addr_msw;
6594 uint16_t shared_pos_buf_mem_pool_id;
6595 uint16_t shared_pos_buf_num_regions;
6596 uint32_t shared_pos_buf_property_flag;
6597 uint32_t shared_circ_buf_start_phy_addr_lsw;
6598 uint32_t shared_circ_buf_start_phy_addr_msw;
6599 uint32_t shared_circ_buf_size;
6600 uint16_t shared_circ_buf_mem_pool_id;
6601 uint16_t shared_circ_buf_num_regions;
6602 uint32_t shared_circ_buf_property_flag;
6603 uint32_t num_watermark_levels;
6604 struct asm_multi_channel_pcm_fmt_blk_v3 fmt;
6605 struct avs_shared_map_region_payload map_region_pos_buf;
6606 struct avs_shared_map_region_payload map_region_circ_buf;
6607 struct asm_shared_watermark_level watermark[0];
6608} __packed;
6609
6610#define ASM_STREAM_CMD_OPEN_READ_V3 0x00010DB4
6611
6612/* Definition of the timestamp type flag bitmask */
6613#define ASM_BIT_MASKIMESTAMPYPE_FLAG (0x00000020UL)
6614
6615/* Definition of the timestamp type flag shift value. */
6616#define ASM_SHIFTIMESTAMPYPE_FLAG 5
6617
6618/* Relative timestamp is identified by this value.*/
6619#define ASM_RELATIVEIMESTAMP 0
6620
6621/* Absolute timestamp is identified by this value.*/
6622#define ASM_ABSOLUTEIMESTAMP 1
6623
6624/* Bit value for Low Latency Tx stream subfield */
6625#define ASM_LOW_LATENCY_TX_STREAM_SESSION 1
6626
6627/* Bit shift for the stream_perf_mode subfield. */
6628#define ASM_SHIFT_STREAM_PERF_MODE_FLAG_IN_OPEN_READ 29
6629
6630struct asm_stream_cmd_open_read_v3 {
6631 struct apr_hdr hdr;
6632 u32 mode_flags;
6633/* Mode flags that indicate whether meta information per encoded
6634 * frame is to be provided.
6635 * Supported values for bit 4:
6636 *
6637 * - 0 -- Return data buffer contains all encoded frames only; it
6638 * does not contain frame metadata.
6639 *
6640 * - 1 -- Return data buffer contains an array of metadata and
6641 * encoded frames.
6642 *
6643 * - Use #ASM_BIT_MASK_META_INFO_FLAG as the bitmask and
6644 * #ASM_SHIFT_META_INFO_FLAG as the shift value for this bit.
6645 *
6646 *
6647 * Supported values for bit 5:
6648 *
6649 * - ASM_RELATIVEIMESTAMP -- ASM_DATA_EVENT_READ_DONE_V2 will have
6650 * - relative time-stamp.
6651 * - ASM_ABSOLUTEIMESTAMP -- ASM_DATA_EVENT_READ_DONE_V2 will
6652 * - have absolute time-stamp.
6653 *
6654 * - Use #ASM_BIT_MASKIMESTAMPYPE_FLAG as the bitmask and
6655 * #ASM_SHIFTIMESTAMPYPE_FLAG as the shift value for this bit.
6656 *
6657 * All other bits are reserved; clients must set them to zero.
6658 */
6659
6660 u32 src_endpointype;
6661/* Specifies the endpoint providing the input samples.
6662 * Supported values:
6663 * - 0 -- Device matrix
6664 * - All other values are reserved; clients must set them to zero.
6665 * Otherwise, an error is returned.
6666 * The device matrix is the gateway from the tunneled Tx ports.
6667 */
6668
6669 u32 preprocopo_id;
6670/* Specifies the topology (order of processing) of preprocessing
6671 * algorithms. <i>None</i> means no preprocessing.
6672 * Supported values:
6673 * - #ASM_STREAM_PREPROCOPO_ID_DEFAULT
6674 * - #ASM_STREAM_PREPROCOPO_ID_NONE
6675 *
6676 * This field can also be enabled through SetParams flags.
6677 */
6678
6679 u32 enc_cfg_id;
6680/* Media configuration ID for encoded output.
6681 * Supported values:
6682 * - #ASM_MEDIA_FMT_MULTI_CHANNEL_PCM_V2
6683 * - #ASM_MEDIA_FMT_AAC_V2
6684 * - #ASM_MEDIA_FMT_AMRNB_FS
6685 * - #ASM_MEDIA_FMT_AMRWB_FS
6686 * - #ASM_MEDIA_FMT_V13K_FS
6687 * - #ASM_MEDIA_FMT_EVRC_FS
6688 * - #ASM_MEDIA_FMT_EVRCB_FS
6689 * - #ASM_MEDIA_FMT_EVRCWB_FS
6690 * - #ASM_MEDIA_FMT_SBC
6691 * - #ASM_MEDIA_FMT_G711_ALAW_FS
6692 * - #ASM_MEDIA_FMT_G711_MLAW_FS
6693 * - #ASM_MEDIA_FMT_G729A_FS
6694 * - #ASM_MEDIA_FMT_EXAMPLE
6695 * - #ASM_MEDIA_FMT_WMA_V8
6696 */
6697
6698 u16 bits_per_sample;
6699/* Number of bits per sample processed by ASM modules.
6700 * Supported values: 16 and 24 bits per sample
6701 */
6702
6703 u16 reserved;
6704/* Reserved for future use. This field must be set to zero.*/
6705} __packed;
6706
6707#define ASM_POPP_OUTPUT_SR_NATIVE_RATE 0
6708
6709/* Enumeration for the maximum sampling rate at the POPP output.*/
6710#define ASM_POPP_OUTPUT_SR_MAX_RATE 48000
6711
6712#define ASM_STREAM_CMD_OPEN_READWRITE_V2 0x00010D8D
6713#define ASM_STREAM_CMD_OPEN_READWRITE_V2 0x00010D8D
6714
6715struct asm_stream_cmd_open_readwrite_v2 {
6716 struct apr_hdr hdr;
6717 u32 mode_flags;
6718/* Mode flags.
6719 * Supported values for bit 2:
6720 * - 0 -- SR/CM change notification event is disabled.
6721 * - 1 -- SR/CM change notification event is enabled. Use
6722 * #ASM_BIT_MASK_SR_CM_CHANGE_NOTIFY_FLAG and
6723 * #ASM_SHIFT_SR_CM_CHANGE_NOTIFY_FLAG to set or
6724 * getting this flag.
6725 *
6726 * Supported values for bit 4:
6727 * - 0 -- Return read data buffer contains all encoded frames only; it
6728 * does not contain frame metadata.
6729 * - 1 -- Return read data buffer contains an array of metadata and
6730 * encoded frames.
6731 *
6732 * All other bits are reserved; clients must set them to zero.
6733 */
6734
6735 u32 postprocopo_id;
6736/* Specifies the topology (order of processing) of postprocessing
6737 * algorithms. <i>None</i> means no postprocessing.
6738 *
6739 * Supported values:
6740 * - #ASM_STREAM_POSTPROCOPO_ID_DEFAULT
6741 * - #ASM_STREAM_POSTPROCOPO_ID_MCH_PEAK_VOL
6742 * - #ASM_STREAM_POSTPROCOPO_ID_NONE
6743 */
6744
6745 u32 dec_fmt_id;
6746/* Specifies the media type of the input data. PCM indicates that
6747 * no decoding must be performed, e.g., this is an NT encoder
6748 * session.
6749 * Supported values:
6750 * - #ASM_MEDIA_FMT_MULTI_CHANNEL_PCM_V2
6751 * - #ASM_MEDIA_FMT_ADPCM
6752 * - #ASM_MEDIA_FMT_MP3
6753 * - #ASM_MEDIA_FMT_AAC_V2
6754 * - #ASM_MEDIA_FMT_DOLBY_AAC
6755 * - #ASM_MEDIA_FMT_AMRNB_FS
6756 * - #ASM_MEDIA_FMT_AMRWB_FS
6757 * - #ASM_MEDIA_FMT_V13K_FS
6758 * - #ASM_MEDIA_FMT_EVRC_FS
6759 * - #ASM_MEDIA_FMT_EVRCB_FS
6760 * - #ASM_MEDIA_FMT_EVRCWB_FS
6761 * - #ASM_MEDIA_FMT_SBC
6762 * - #ASM_MEDIA_FMT_WMA_V10PRO_V2
6763 * - #ASM_MEDIA_FMT_WMA_V9_V2
6764 * - #ASM_MEDIA_FMT_AMR_WB_PLUS_V2
6765 * - #ASM_MEDIA_FMT_AC3
6766 * - #ASM_MEDIA_FMT_G711_ALAW_FS
6767 * - #ASM_MEDIA_FMT_G711_MLAW_FS
6768 * - #ASM_MEDIA_FMT_G729A_FS
6769 * - #ASM_MEDIA_FMT_EXAMPLE
6770 */
6771
6772 u32 enc_cfg_id;
6773/* Specifies the media type for the output of the stream. PCM
6774 * indicates that no encoding must be performed, e.g., this is an NT
6775 * decoder session.
6776 * Supported values:
6777 * - #ASM_MEDIA_FMT_MULTI_CHANNEL_PCM_V2
6778 * - #ASM_MEDIA_FMT_AAC_V2
6779 * - #ASM_MEDIA_FMT_AMRNB_FS
6780 * - #ASM_MEDIA_FMT_AMRWB_FS
6781 * - #ASM_MEDIA_FMT_V13K_FS
6782 * - #ASM_MEDIA_FMT_EVRC_FS
6783 * - #ASM_MEDIA_FMT_EVRCB_FS
6784 * - #ASM_MEDIA_FMT_EVRCWB_FS
6785 * - #ASM_MEDIA_FMT_SBC
6786 * - #ASM_MEDIA_FMT_G711_ALAW_FS
6787 * - #ASM_MEDIA_FMT_G711_MLAW_FS
6788 * - #ASM_MEDIA_FMT_G729A_FS
6789 * - #ASM_MEDIA_FMT_EXAMPLE
6790 * - #ASM_MEDIA_FMT_WMA_V8
6791 */
6792
6793 u16 bits_per_sample;
6794/* Number of bits per sample processed by ASM modules.
6795 * Supported values: 16 and 24 bits per sample
6796 */
6797
6798 u16 reserved;
6799/* Reserved for future use. This field must be set to zero.*/
6800
6801} __packed;
6802
6803#define ASM_STREAM_CMD_OPEN_LOOPBACK_V2 0x00010D8E
6804struct asm_stream_cmd_open_loopback_v2 {
6805 struct apr_hdr hdr;
6806 u32 mode_flags;
6807/* Mode flags.
6808 * Bit 0-31: reserved; client should set these bits to 0
6809 */
6810 u16 src_endpointype;
6811 /* Endpoint type. 0 = Tx Matrix */
6812 u16 sink_endpointype;
6813 /* Endpoint type. 0 = Rx Matrix */
6814 u32 postprocopo_id;
6815/* Postprocessor topology ID. Specifies the topology of
6816 * postprocessing algorithms.
6817 */
6818
6819 u16 bits_per_sample;
6820/* The number of bits per sample processed by ASM modules
6821 * Supported values: 16 and 24 bits per sample
6822 */
6823 u16 reserved;
6824/* Reserved for future use. This field must be set to zero. */
6825} __packed;
6826
6827
6828#define ASM_STREAM_CMD_OPEN_TRANSCODE_LOOPBACK 0x00010DBA
6829
6830/* Bitmask for the stream's Performance mode. */
6831#define ASM_BIT_MASK_STREAM_PERF_MODE_FLAG_IN_OPEN_TRANSCODE_LOOPBACK \
6832 (0x70000000UL)
6833
6834/* Bit shift for the stream's Performance mode. */
6835#define ASM_SHIFT_STREAM_PERF_MODE_FLAG_IN_OPEN_TRANSCODE_LOOPBACK 28
6836
6837/* Bitmask for the decoder converter enable flag. */
6838#define ASM_BIT_MASK_DECODER_CONVERTER_FLAG (0x00000078UL)
6839
6840/* Shift value for the decoder converter enable flag. */
6841#define ASM_SHIFT_DECODER_CONVERTER_FLAG 3
6842
6843/* Converter mode is None (Default). */
6844#define ASM_CONVERTER_MODE_NONE 0
6845
6846/* Converter mode is DDP-to-DD. */
6847#define ASM_DDP_DD_CONVERTER_MODE 1
6848
6849/* Identifies a special converter mode where source and sink formats
6850 * are the same but postprocessing must applied. Therefore, Decode
6851 * @rarrow Re-encode is necessary.
6852 */
6853#define ASM_POST_PROCESS_CONVERTER_MODE 2
6854
6855
6856struct asm_stream_cmd_open_transcode_loopback_t {
6857 struct apr_hdr hdr;
6858 u32 mode_flags;
6859/* Mode Flags specifies the performance mode in which this stream
6860 * is to be opened.
6861 * Supported values{for bits 30 to 28}(stream_perf_mode flag)
6862 *
6863 * #ASM_LEGACY_STREAM_SESSION -- This mode ensures backward
6864 * compatibility to the original behavior
6865 * of ASM_STREAM_CMD_OPEN_TRANSCODE_LOOPBACK
6866 *
6867 * #ASM_LOW_LATENCY_STREAM_SESSION -- Opens a loopback session by using
6868 * shortened buffers in low latency POPP
6869 * - Recommendation: Do not enable high latency algorithms. They might
6870 * negate the benefits of opening a low latency stream, and they
6871 * might also suffer quality degradation from unexpected jitter.
6872 * - This Low Latency mode is supported only for PCM In and PCM Out
6873 * loopbacks. An error is returned if Low Latency mode is opened for
6874 * other transcode loopback modes.
6875 * - To configure this subfield, use
6876 * ASM_BIT_MASK_STREAM_PERF_MODE_FLAG_IN_OPEN_TRANSCODE_LOOPBACK and
6877 * ASM_SHIFT_STREAM_PERF_MODE_FLAG_IN_OPEN_TRANSCODE_LOOPBACK.
6878 *
6879 * Supported values{for bits 6 to 3} (decoder-converter compatibility)
6880 * #ASM_CONVERTER_MODE_NONE (0x0) -- Default
6881 * #ASM_DDP_DD_CONVERTER_MODE (0x1)
6882 * #ASM_POST_PROCESS_CONVERTER_MODE (0x2)
6883 * 0x3-0xF -- Reserved for future use
6884 * - Use #ASM_BIT_MASK_DECODER_CONVERTER_FLAG and
6885 * ASM_SHIFT_DECODER_CONVERTER_FLAG to set this bit
6886 * All other bits are reserved; clients must set them to 0.
6887 */
6888
6889 u32 src_format_id;
6890/* Specifies the media format of the input audio stream.
6891 *
6892 * Supported values
6893 * - #ASM_MEDIA_FMT_MULTI_CHANNEL_PCM_V2
6894 * - #ASM_MEDIA_FMT_MULTI_CHANNEL_PCM_V3
6895 * - #ASM_MEDIA_FMT_DTS
6896 * - #ASM_MEDIA_FMT_EAC3_DEC
6897 * - #ASM_MEDIA_FMT_EAC3
6898 * - #ASM_MEDIA_FMT_AC3_DEC
6899 * - #ASM_MEDIA_FMT_AC3
6900 */
6901 u32 sink_format_id;
6902/* Specifies the media format of the output stream.
6903 *
6904 * Supported values
6905 * - #ASM_MEDIA_FMT_MULTI_CHANNEL_PCM_V2
6906 * - #ASM_MEDIA_FMT_MULTI_CHANNEL_PCM_V3
6907 * - #ASM_MEDIA_FMT_DTS (not supported in Low Latency mode)
6908 * - #ASM_MEDIA_FMT_EAC3_DEC (not supported in Low Latency mode)
6909 * - #ASM_MEDIA_FMT_EAC3 (not supported in Low Latency mode)
6910 * - #ASM_MEDIA_FMT_AC3_DEC (not supported in Low Latency mode)
6911 * - #ASM_MEDIA_FMT_AC3 (not supported in Low Latency mode)
6912 */
6913
6914 u32 audproc_topo_id;
6915/* Postprocessing topology ID, which specifies the topology (order of
6916 * processing) of postprocessing algorithms.
6917 *
6918 * Supported values
6919 * - #ASM_STREAM_POSTPROC_TOPO_ID_DEFAULT
6920 * - #ASM_STREAM_POSTPROC_TOPO_ID_PEAKMETER
6921 * - #ASM_STREAM_POSTPROC_TOPO_ID_MCH_PEAK_VOL
6922 * - #ASM_STREAM_POSTPROC_TOPO_ID_NONE
6923 * Topologies can be added through #ASM_CMD_ADD_TOPOLOGIES.
6924 * This field is ignored for the Converter mode, in which no
6925 * postprocessing is performed.
6926 */
6927
6928 u16 src_endpoint_type;
6929/* Specifies the source endpoint that provides the input samples.
6930 *
6931 * Supported values
6932 * - 0 -- Tx device matrix or stream router (gateway to the hardware
6933 * ports)
6934 * - All other values are reserved
6935 * Clients must set this field to 0. Otherwise, an error is returned.
6936 */
6937
6938 u16 sink_endpoint_type;
6939/* Specifies the sink endpoint type.
6940 *
6941 * Supported values
6942 * - 0 -- Rx device matrix or stream router (gateway to the hardware
6943 * ports)
6944 * - All other values are reserved
6945 * Clients must set this field to 0. Otherwise, an error is returned.
6946 */
6947
6948 u16 bits_per_sample;
6949/* Number of bits per sample processed by the ASM modules.
6950 * Supported values 16, 24
6951 */
6952
6953 u16 reserved;
6954/* This field must be set to 0.
6955 */
6956} __packed;
6957
6958
6959#define ASM_STREAM_CMD_CLOSE 0x00010BCD
6960#define ASM_STREAM_CMD_FLUSH 0x00010BCE
6961
6962
6963#define ASM_STREAM_CMD_FLUSH_READBUFS 0x00010C09
6964#define ASM_STREAM_CMD_SET_PP_PARAMS_V2 0x00010DA1
6965
6966struct asm_stream_cmd_set_pp_params_v2 {
6967 u32 data_payload_addr_lsw;
6968/* LSW of parameter data payload address. Supported values: any. */
6969 u32 data_payload_addr_msw;
6970/* MSW of Parameter data payload address. Supported values: any.
6971 * - Must be set to zero for in-band data.
6972 * - In the case of 32 bit Shared memory address, msw field must be
6973 * - set to zero.
6974 * - In the case of 36 bit shared memory address, bit 31 to bit 4 of
6975 * msw
6976 *
6977 * - must be set to zero.
6978 */
6979 u32 mem_map_handle;
6980/* Supported Values: Any.
6981 * memory map handle returned by DSP through
6982 * ASM_CMD_SHARED_MEM_MAP_REGIONS
6983 * command.
6984 * if mmhandle is NULL, the ParamData payloads are within the
6985 * message payload (in-band).
6986 * If mmhandle is non-NULL, the ParamData payloads begin at the
6987 * address specified in the address msw and lsw (out-of-band).
6988 */
6989
6990 u32 data_payload_size;
6991/* Size in bytes of the variable payload accompanying the
6992 * message, or in shared memory. This field is used for parsing the
6993 * parameter payload.
6994 */
6995} __packed;
6996
6997
6998struct asm_stream_param_data_v2 {
6999 u32 module_id;
7000 /* Unique module ID. */
7001
7002 u32 param_id;
7003 /* Unique parameter ID. */
7004
7005 u16 param_size;
7006/* Data size of the param_id/module_id combination. This is
7007 * a multiple of 4 bytes.
7008 */
7009
7010 u16 reserved;
7011/* Reserved for future enhancements. This field must be set to
7012 * zero.
7013 */
7014
7015} __packed;
7016
7017#define ASM_STREAM_CMD_GET_PP_PARAMS_V2 0x00010DA2
7018
7019struct asm_stream_cmd_get_pp_params_v2 {
7020 u32 data_payload_addr_lsw;
7021 /* LSW of the parameter data payload address. */
7022 u32 data_payload_addr_msw;
7023/* MSW of the parameter data payload address.
7024 * - Size of the shared memory, if specified, shall be large enough
7025 * to contain the whole ParamData payload, including Module ID,
7026 * Param ID, Param Size, and Param Values
7027 * - Must be set to zero for in-band data
7028 * - In the case of 32 bit Shared memory address, msw field must be
7029 * set to zero.
7030 * - In the case of 36 bit shared memory address, bit 31 to bit 4 of
7031 * msw must be set to zero.
7032 */
7033
7034 u32 mem_map_handle;
7035/* Supported Values: Any.
7036 * memory map handle returned by DSP through ASM_CMD_SHARED_MEM_MAP_REGIONS
7037 * command.
7038 * if mmhandle is NULL, the ParamData payloads in the ACK are within the
7039 * message payload (in-band).
7040 * If mmhandle is non-NULL, the ParamData payloads in the ACK begin at the
7041 * address specified in the address msw and lsw.
7042 * (out-of-band).
7043 */
7044
7045 u32 module_id;
7046/* Unique module ID. */
7047
7048 u32 param_id;
7049/* Unique parameter ID. */
7050
7051 u16 param_max_size;
7052/* Maximum data size of the module_id/param_id combination. This
7053 * is a multiple of 4 bytes.
7054 */
7055
7056
7057 u16 reserved;
7058/* Reserved for backward compatibility. Clients must set this
7059 * field to zero.
7060 */
7061} __packed;
7062
7063#define ASM_STREAM_CMD_SET_ENCDEC_PARAM 0x00010C10
7064
7065#define ASM_STREAM_CMD_SET_ENCDEC_PARAM_V2 0x00013218
7066
7067struct asm_stream_cmd_set_encdec_param_v2 {
7068 u16 service_id;
7069 /* 0 - ASM_ENCODER_SVC; 1 - ASM_DECODER_SVC */
7070
7071 u16 reserved;
7072
7073 u32 param_id;
7074 /* ID of the parameter. */
7075
7076 u32 param_size;
7077 /*
7078 * Data size of this parameter, in bytes. The size is a multiple
7079 * of 4 bytes.
7080 */
7081} __packed;
7082
7083#define ASM_STREAM_CMD_REGISTER_ENCDEC_EVENTS 0x00013219
7084
7085#define ASM_STREAM_CMD_ENCDEC_EVENTS 0x0001321A
7086
7087#define AVS_PARAM_ID_RTIC_SHARED_MEMORY_ADDR 0x00013237
7088
7089struct avs_rtic_shared_mem_addr {
7090 struct apr_hdr hdr;
7091 struct asm_stream_cmd_set_encdec_param_v2 encdec;
7092 u32 shm_buf_addr_lsw;
7093 /* Lower 32 bit of the RTIC shared memory */
7094
7095 u32 shm_buf_addr_msw;
7096 /* Upper 32 bit of the RTIC shared memory */
7097
7098 u32 buf_size;
7099 /* Size of buffer */
7100
7101 u16 shm_buf_mem_pool_id;
7102 /* ADSP_MEMORY_MAP_SHMEM8_4K_POOL */
7103
7104 u16 shm_buf_num_regions;
7105 /* number of regions to map */
7106
7107 u32 shm_buf_flag;
7108 /* buffer property flag */
7109
7110 struct avs_shared_map_region_payload map_region;
7111 /* memory map region*/
7112} __packed;
7113
7114#define AVS_PARAM_ID_RTIC_EVENT_ACK 0x00013238
7115
7116struct avs_param_rtic_event_ack {
7117 struct apr_hdr hdr;
7118 struct asm_stream_cmd_set_encdec_param_v2 encdec;
7119} __packed;
7120
7121#define ASM_PARAM_ID_ENCDEC_BITRATE 0x00010C13
7122
7123struct asm_bitrate_param {
7124 u32 bitrate;
7125/* Maximum supported bitrate. Only the AAC encoder is supported.*/
7126
7127} __packed;
7128
7129#define ASM_PARAM_ID_ENCDEC_ENC_CFG_BLK_V2 0x00010DA3
7130#define ASM_PARAM_ID_AAC_SBR_PS_FLAG 0x00010C63
7131
7132/* Flag to turn off both SBR and PS processing, if they are
7133 * present in the bitstream.
7134 */
7135
7136#define ASM_AAC_SBR_OFF_PS_OFF (2)
7137
7138/* Flag to turn on SBR but turn off PS processing,if they are
7139 * present in the bitstream.
7140 */
7141
7142#define ASM_AAC_SBR_ON_PS_OFF (1)
7143
7144/* Flag to turn on both SBR and PS processing, if they are
7145 * present in the bitstream (default behavior).
7146 */
7147
7148
7149#define ASM_AAC_SBR_ON_PS_ON (0)
7150
7151/* Structure for an AAC SBR PS processing flag. */
7152
7153/* Payload of the #ASM_PARAM_ID_AAC_SBR_PS_FLAG parameter in the
7154 * #ASM_STREAM_CMD_SET_ENCDEC_PARAM command.
7155 */
7156struct asm_aac_sbr_ps_flag_param {
7157 struct apr_hdr hdr;
7158 struct asm_stream_cmd_set_encdec_param encdec;
7159 struct asm_enc_cfg_blk_param_v2 encblk;
7160
7161 u32 sbr_ps_flag;
7162/* Control parameter to enable or disable SBR/PS processing in
7163 * the AAC bitstream. Use the following macros to set this field:
7164 * - #ASM_AAC_SBR_OFF_PS_OFF -- Turn off both SBR and PS
7165 * processing, if they are present in the bitstream.
7166 * - #ASM_AAC_SBR_ON_PS_OFF -- Turn on SBR processing, but not PS
7167 * processing, if they are present in the bitstream.
7168 * - #ASM_AAC_SBR_ON_PS_ON -- Turn on both SBR and PS processing,
7169 * if they are present in the bitstream (default behavior).
7170 * - All other values are invalid.
7171 * Changes are applied to the next decoded frame.
7172 */
7173} __packed;
7174
7175#define ASM_PARAM_ID_AAC_DUAL_MONO_MAPPING 0x00010C64
7176
7177/* First single channel element in a dual mono bitstream.*/
7178#define ASM_AAC_DUAL_MONO_MAP_SCE_1 (1)
7179
7180/* Second single channel element in a dual mono bitstream.*/
7181#define ASM_AAC_DUAL_MONO_MAP_SCE_2 (2)
7182
7183/* Structure for AAC decoder dual mono channel mapping. */
7184
7185
7186struct asm_aac_dual_mono_mapping_param {
7187 struct apr_hdr hdr;
7188 struct asm_stream_cmd_set_encdec_param encdec;
7189 u16 left_channel_sce;
7190 u16 right_channel_sce;
7191
7192} __packed;
7193
7194#define ASM_STREAM_CMDRSP_GET_PP_PARAMS_V2 0x00010DA4
7195
7196struct asm_stream_cmdrsp_get_pp_params_v2 {
7197 u32 status;
7198} __packed;
7199
7200#define ASM_PARAM_ID_AC3_KARAOKE_MODE 0x00010D73
7201
7202/* Enumeration for both vocals in a karaoke stream.*/
7203#define AC3_KARAOKE_MODE_NO_VOCAL (0)
7204
7205/* Enumeration for only the left vocal in a karaoke stream.*/
7206#define AC3_KARAOKE_MODE_LEFT_VOCAL (1)
7207
7208/* Enumeration for only the right vocal in a karaoke stream.*/
7209#define AC3_KARAOKE_MODE_RIGHT_VOCAL (2)
7210
7211/* Enumeration for both vocal channels in a karaoke stream.*/
7212#define AC3_KARAOKE_MODE_BOTH_VOCAL (3)
7213#define ASM_PARAM_ID_AC3_DRC_MODE 0x00010D74
7214/* Enumeration for the Custom Analog mode.*/
7215#define AC3_DRC_MODE_CUSTOM_ANALOG (0)
7216
7217/* Enumeration for the Custom Digital mode.*/
7218#define AC3_DRC_MODE_CUSTOM_DIGITAL (1)
7219/* Enumeration for the Line Out mode (light compression).*/
7220#define AC3_DRC_MODE_LINE_OUT (2)
7221
7222/* Enumeration for the RF remodulation mode (heavy compression).*/
7223#define AC3_DRC_MODE_RF_REMOD (3)
7224#define ASM_PARAM_ID_AC3_DUAL_MONO_MODE 0x00010D75
7225
7226/* Enumeration for playing dual mono in stereo mode.*/
7227#define AC3_DUAL_MONO_MODE_STEREO (0)
7228
7229/* Enumeration for playing left mono.*/
7230#define AC3_DUAL_MONO_MODE_LEFT_MONO (1)
7231
7232/* Enumeration for playing right mono.*/
7233#define AC3_DUAL_MONO_MODE_RIGHT_MONO (2)
7234
7235/* Enumeration for mixing both dual mono channels and playing them.*/
7236#define AC3_DUAL_MONO_MODE_MIXED_MONO (3)
7237#define ASM_PARAM_ID_AC3_STEREO_DOWNMIX_MODE 0x00010D76
7238
7239/* Enumeration for using the Downmix mode indicated in the bitstream. */
7240
7241#define AC3_STEREO_DOWNMIX_MODE_AUTO_DETECT (0)
7242
7243/* Enumeration for Surround Compatible mode (preserves the
7244 * surround information).
7245 */
7246
7247#define AC3_STEREO_DOWNMIX_MODE_LT_RT (1)
7248/* Enumeration for Mono Compatible mode (if the output is to be
7249 * further downmixed to mono).
7250 */
7251
7252#define AC3_STEREO_DOWNMIX_MODE_LO_RO (2)
7253
7254/* ID of the AC3 PCM scale factor parameter in the
7255 * #ASM_STREAM_CMD_SET_ENCDEC_PARAM command.
7256 */
7257#define ASM_PARAM_ID_AC3_PCM_SCALEFACTOR 0x00010D78
7258
7259/* ID of the AC3 DRC boost scale factor parameter in the
7260 * #ASM_STREAM_CMD_SET_ENCDEC_PARAM command.
7261 */
7262#define ASM_PARAM_ID_AC3_DRC_BOOST_SCALEFACTOR 0x00010D79
7263
7264/* ID of the AC3 DRC cut scale factor parameter in the
7265 * #ASM_STREAM_CMD_SET_ENCDEC_PARAM command.
7266 */
7267#define ASM_PARAM_ID_AC3_DRC_CUT_SCALEFACTOR 0x00010D7A
7268
7269/* Structure for AC3 Generic Parameter. */
7270
7271/* Payload of the AC3 parameters in the
7272 * #ASM_STREAM_CMD_SET_ENCDEC_PARAM command.
7273 */
7274struct asm_ac3_generic_param {
7275 struct apr_hdr hdr;
7276 struct asm_stream_cmd_set_encdec_param encdec;
7277 struct asm_enc_cfg_blk_param_v2 encblk;
7278 u32 generic_parameter;
7279/* AC3 generic parameter. Select from one of the following
7280 * possible values.
7281 *
7282 * For #ASM_PARAM_ID_AC3_KARAOKE_MODE, supported values are:
7283 * - AC3_KARAOKE_MODE_NO_VOCAL
7284 * - AC3_KARAOKE_MODE_LEFT_VOCAL
7285 * - AC3_KARAOKE_MODE_RIGHT_VOCAL
7286 * - AC3_KARAOKE_MODE_BOTH_VOCAL
7287 *
7288 * For #ASM_PARAM_ID_AC3_DRC_MODE, supported values are:
7289 * - AC3_DRC_MODE_CUSTOM_ANALOG
7290 * - AC3_DRC_MODE_CUSTOM_DIGITAL
7291 * - AC3_DRC_MODE_LINE_OUT
7292 * - AC3_DRC_MODE_RF_REMOD
7293 *
7294 * For #ASM_PARAM_ID_AC3_DUAL_MONO_MODE, supported values are:
7295 * - AC3_DUAL_MONO_MODE_STEREO
7296 * - AC3_DUAL_MONO_MODE_LEFT_MONO
7297 * - AC3_DUAL_MONO_MODE_RIGHT_MONO
7298 * - AC3_DUAL_MONO_MODE_MIXED_MONO
7299 *
7300 * For #ASM_PARAM_ID_AC3_STEREO_DOWNMIX_MODE, supported values are:
7301 * - AC3_STEREO_DOWNMIX_MODE_AUTO_DETECT
7302 * - AC3_STEREO_DOWNMIX_MODE_LT_RT
7303 * - AC3_STEREO_DOWNMIX_MODE_LO_RO
7304 *
7305 * For #ASM_PARAM_ID_AC3_PCM_SCALEFACTOR, supported values are
7306 * 0 to 1 in Q31 format.
7307 *
7308 * For #ASM_PARAM_ID_AC3_DRC_BOOST_SCALEFACTOR, supported values are
7309 * 0 to 1 in Q31 format.
7310 *
7311 * For #ASM_PARAM_ID_AC3_DRC_CUT_SCALEFACTOR, supported values are
7312 * 0 to 1 in Q31 format.
7313 */
7314} __packed;
7315
7316/* Enumeration for Raw mode (no downmixing), which specifies
7317 * that all channels in the bitstream are to be played out as is
7318 * without any downmixing. (Default)
7319 */
7320
7321#define WMAPRO_CHANNEL_MASK_RAW (-1)
7322
7323/* Enumeration for setting the channel mask to 0. The 7.1 mode
7324 * (Home Theater) is assigned.
7325 */
7326
7327
7328#define WMAPRO_CHANNEL_MASK_ZERO 0x0000
7329
7330/* Speaker layout mask for one channel (Home Theater, mono).
7331 * - Speaker front center
7332 */
7333#define WMAPRO_CHANNEL_MASK_1_C 0x0004
7334
7335/* Speaker layout mask for two channels (Home Theater, stereo).
7336 * - Speaker front left
7337 * - Speaker front right
7338 */
7339#define WMAPRO_CHANNEL_MASK_2_L_R 0x0003
7340
7341/* Speaker layout mask for three channels (Home Theater).
7342 * - Speaker front left
7343 * - Speaker front right
7344 * - Speaker front center
7345 */
7346#define WMAPRO_CHANNEL_MASK_3_L_C_R 0x0007
7347
7348/* Speaker layout mask for two channels (stereo).
7349 * - Speaker back left
7350 * - Speaker back right
7351 */
7352#define WMAPRO_CHANNEL_MASK_2_Bl_Br 0x0030
7353
7354/* Speaker layout mask for four channels.
7355 * - Speaker front left
7356 * - Speaker front right
7357 * - Speaker back left
7358 * - Speaker back right
7359 */
7360#define WMAPRO_CHANNEL_MASK_4_L_R_Bl_Br 0x0033
7361
7362/* Speaker layout mask for four channels (Home Theater).
7363 * - Speaker front left
7364 * - Speaker front right
7365 * - Speaker front center
7366 * - Speaker back center
7367 */
7368#define WMAPRO_CHANNEL_MASK_4_L_R_C_Bc_HT 0x0107
7369/* Speaker layout mask for five channels.
7370 * - Speaker front left
7371 * - Speaker front right
7372 * - Speaker front center
7373 * - Speaker back left
7374 * - Speaker back right
7375 */
7376#define WMAPRO_CHANNEL_MASK_5_L_C_R_Bl_Br 0x0037
7377
7378/* Speaker layout mask for five channels (5 mode, Home Theater).
7379 * - Speaker front left
7380 * - Speaker front right
7381 * - Speaker front center
7382 * - Speaker side left
7383 * - Speaker side right
7384 */
7385#define WMAPRO_CHANNEL_MASK_5_L_C_R_Sl_Sr_HT 0x0607
7386/* Speaker layout mask for six channels (5.1 mode).
7387 * - Speaker front left
7388 * - Speaker front right
7389 * - Speaker front center
7390 * - Speaker low frequency
7391 * - Speaker back left
7392 * - Speaker back right
7393 */
7394#define WMAPRO_CHANNEL_MASK_5DOT1_L_C_R_Bl_Br_SLF 0x003F
7395/* Speaker layout mask for six channels (5.1 mode, Home Theater).
7396 * - Speaker front left
7397 * - Speaker front right
7398 * - Speaker front center
7399 * - Speaker low frequency
7400 * - Speaker side left
7401 * - Speaker side right
7402 */
7403#define WMAPRO_CHANNEL_MASK_5DOT1_L_C_R_Sl_Sr_SLF_HT 0x060F
7404/* Speaker layout mask for six channels (5.1 mode, no LFE).
7405 * - Speaker front left
7406 * - Speaker front right
7407 * - Speaker front center
7408 * - Speaker back left
7409 * - Speaker back right
7410 * - Speaker back center
7411 */
7412#define WMAPRO_CHANNEL_MASK_5DOT1_L_C_R_Bl_Br_Bc 0x0137
7413/* Speaker layout mask for six channels (5.1 mode, Home Theater,
7414 * no LFE).
7415 * - Speaker front left
7416 * - Speaker front right
7417 * - Speaker front center
7418 * - Speaker back center
7419 * - Speaker side left
7420 * - Speaker side right
7421 */
7422#define WMAPRO_CHANNEL_MASK_5DOT1_L_C_R_Sl_Sr_Bc_HT 0x0707
7423
7424/* Speaker layout mask for seven channels (6.1 mode).
7425 * - Speaker front left
7426 * - Speaker front right
7427 * - Speaker front center
7428 * - Speaker low frequency
7429 * - Speaker back left
7430 * - Speaker back right
7431 * - Speaker back center
7432 */
7433#define WMAPRO_CHANNEL_MASK_6DOT1_L_C_R_Bl_Br_Bc_SLF 0x013F
7434
7435/* Speaker layout mask for seven channels (6.1 mode, Home
7436 * Theater).
7437 * - Speaker front left
7438 * - Speaker front right
7439 * - Speaker front center
7440 * - Speaker low frequency
7441 * - Speaker back center
7442 * - Speaker side left
7443 * - Speaker side right
7444 */
7445#define WMAPRO_CHANNEL_MASK_6DOT1_L_C_R_Sl_Sr_Bc_SLF_HT 0x070F
7446
7447/* Speaker layout mask for seven channels (6.1 mode, no LFE).
7448 * - Speaker front left
7449 * - Speaker front right
7450 * - Speaker front center
7451 * - Speaker back left
7452 * - Speaker back right
7453 * - Speaker front left of center
7454 * - Speaker front right of center
7455 */
7456#define WMAPRO_CHANNEL_MASK_6DOT1_L_C_R_Bl_Br_SFLOC_SFROC 0x00F7
7457
7458/* Speaker layout mask for seven channels (6.1 mode, Home
7459 * Theater, no LFE).
7460 * - Speaker front left
7461 * - Speaker front right
7462 * - Speaker front center
7463 * - Speaker side left
7464 * - Speaker side right
7465 * - Speaker front left of center
7466 * - Speaker front right of center
7467 */
7468#define WMAPRO_CHANNEL_MASK_6DOT1_L_C_R_Sl_Sr_SFLOC_SFROC_HT 0x0637
7469
7470/* Speaker layout mask for eight channels (7.1 mode).
7471 * - Speaker front left
7472 * - Speaker front right
7473 * - Speaker front center
7474 * - Speaker back left
7475 * - Speaker back right
7476 * - Speaker low frequency
7477 * - Speaker front left of center
7478 * - Speaker front right of center
7479 */
7480#define WMAPRO_CHANNEL_MASK_7DOT1_L_C_R_Bl_Br_SLF_SFLOC_SFROC \
7481 0x00FF
7482
7483/* Speaker layout mask for eight channels (7.1 mode, Home Theater).
7484 * - Speaker front left
7485 * - Speaker front right
7486 * - Speaker front center
7487 * - Speaker side left
7488 * - Speaker side right
7489 * - Speaker low frequency
7490 * - Speaker front left of center
7491 * - Speaker front right of center
7492 *
7493 */
7494#define WMAPRO_CHANNEL_MASK_7DOT1_L_C_R_Sl_Sr_SLF_SFLOC_SFROC_HT \
7495 0x063F
7496
7497#define ASM_PARAM_ID_DEC_OUTPUT_CHAN_MAP 0x00010D82
7498
7499/* Maximum number of decoder output channels. */
7500#define MAX_CHAN_MAP_CHANNELS 16
7501
7502/* Structure for decoder output channel mapping. */
7503
7504/* Payload of the #ASM_PARAM_ID_DEC_OUTPUT_CHAN_MAP parameter in the
7505 * #ASM_STREAM_CMD_SET_ENCDEC_PARAM command.
7506 */
7507struct asm_dec_out_chan_map_param {
7508 struct apr_hdr hdr;
7509 struct asm_stream_cmd_set_encdec_param encdec;
7510 u32 num_channels;
7511/* Number of decoder output channels.
7512 * Supported values: 0 to #MAX_CHAN_MAP_CHANNELS
7513 *
7514 * A value of 0 indicates native channel mapping, which is valid
7515 * only for NT mode. This means the output of the decoder is to be
7516 * preserved as is.
7517 */
7518 u8 channel_mapping[MAX_CHAN_MAP_CHANNELS];
7519} __packed;
7520
7521#define ASM_STREAM_CMD_OPEN_WRITE_COMPRESSED 0x00010D84
7522
7523/* Bitmask for the IEC 61937 enable flag.*/
7524#define ASM_BIT_MASK_IEC_61937_STREAM_FLAG (0x00000001UL)
7525
7526/* Shift value for the IEC 61937 enable flag.*/
7527#define ASM_SHIFT_IEC_61937_STREAM_FLAG 0
7528
7529/* Bitmask for the IEC 60958 enable flag.*/
7530#define ASM_BIT_MASK_IEC_60958_STREAM_FLAG (0x00000002UL)
7531
7532/* Shift value for the IEC 60958 enable flag.*/
7533#define ASM_SHIFT_IEC_60958_STREAM_FLAG 1
7534
7535/* Payload format for open write compressed command */
7536
7537/* Payload format for the #ASM_STREAM_CMD_OPEN_WRITE_COMPRESSED
7538 * command, which opens a stream for a given session ID and stream ID
7539 * to be rendered in the compressed format.
7540 */
7541
7542struct asm_stream_cmd_open_write_compressed {
7543 struct apr_hdr hdr;
7544 u32 flags;
7545/* Mode flags that configure the stream for a specific format.
7546 * Supported values:
7547 * - Bit 0 -- IEC 61937 compatibility
7548 * - 0 -- Stream is not in IEC 61937 format
7549 * - 1 -- Stream is in IEC 61937 format
7550 * - Bit 1 -- IEC 60958 compatibility
7551 * - 0 -- Stream is not in IEC 60958 format
7552 * - 1 -- Stream is in IEC 60958 format
7553 * - Bits 2 to 31 -- 0 (Reserved)
7554 *
7555 * For the same stream, bit 0 cannot be set to 0 and bit 1 cannot
7556 * be set to 1. A compressed stream connot have IEC 60958
7557 * packetization applied without IEC 61937 packetization.
7558 * @note1hang Currently, IEC 60958 packetized input streams are not
7559 * supported.
7560 */
7561
7562
7563 u32 fmt_id;
7564/* Specifies the media type of the HDMI stream to be opened.
7565 * Supported values:
7566 * - #ASM_MEDIA_FMT_AC3
7567 * - #ASM_MEDIA_FMT_EAC3
7568 * - #ASM_MEDIA_FMT_DTS
7569 * - #ASM_MEDIA_FMT_ATRAC
7570 * - #ASM_MEDIA_FMT_MAT
7571 *
7572 * @note1hang This field must be set to a valid media type even if
7573 * IEC 61937 packetization is not performed by the aDSP.
7574 */
7575
7576} __packed;
7577
7578
7579/* Indicates the number of samples per channel to be removed from the
7580 * beginning of the stream.
7581 */
7582#define ASM_DATA_CMD_REMOVE_INITIAL_SILENCE 0x00010D67
7583
7584/* Indicates the number of samples per channel to be removed from
7585 * the end of the stream.
7586 */
7587#define ASM_DATA_CMD_REMOVE_TRAILING_SILENCE 0x00010D68
7588
7589struct asm_data_cmd_remove_silence {
7590 struct apr_hdr hdr;
7591 u32 num_samples_to_remove;
7592 /* < Number of samples per channel to be removed.
7593 * @values 0 to (2@sscr{32}-1)
7594 */
7595} __packed;
7596
7597#define ASM_STREAM_CMD_OPEN_READ_COMPRESSED 0x00010D95
7598
7599struct asm_stream_cmd_open_read_compressed {
7600 struct apr_hdr hdr;
7601 u32 mode_flags;
7602/* Mode flags that indicate whether meta information per encoded
7603 * frame is to be provided.
7604 * Supported values for bit 4:
7605 * - 0 -- Return data buffer contains all encoded frames only; it does
7606 * not contain frame metadata.
7607 * - 1 -- Return data buffer contains an array of metadata and encoded
7608 * frames.
7609 * - Use #ASM_BIT_MASK_META_INFO_FLAG to set the bitmask and
7610 * #ASM_SHIFT_META_INFO_FLAG to set the shift value for this bit.
7611 * All other bits are reserved; clients must set them to zero.
7612 */
7613
7614 u32 frames_per_buf;
7615/* Indicates the number of frames that need to be returned per
7616 * read buffer
7617 * Supported values: should be greater than 0
7618 */
7619
7620} __packed;
7621
7622/* adsp_asm_stream_commands.h*/
7623
7624
7625/* adsp_asm_api.h (no changes)*/
7626#define ASM_STREAM_POSTPROCOPO_ID_DEFAULT \
7627 0x00010BE4
7628#define ASM_STREAM_POSTPROCOPO_ID_PEAKMETER \
7629 0x00010D83
7630#define ASM_STREAM_POSTPROCOPO_ID_NONE \
7631 0x00010C68
7632#define ASM_STREAM_POSTPROCOPO_ID_MCH_PEAK_VOL \
7633 0x00010D8B
7634#define ASM_STREAM_PREPROCOPO_ID_DEFAULT \
7635 ASM_STREAM_POSTPROCOPO_ID_DEFAULT
7636#define ASM_STREAM_PREPROCOPO_ID_NONE \
7637 ASM_STREAM_POSTPROCOPO_ID_NONE
7638#define ADM_CMD_COPP_OPENOPOLOGY_ID_NONE_AUDIO_COPP \
7639 0x00010312
7640#define ADM_CMD_COPP_OPENOPOLOGY_ID_SPEAKER_MONO_AUDIO_COPP \
7641 0x00010313
7642#define ADM_CMD_COPP_OPENOPOLOGY_ID_SPEAKER_STEREO_AUDIO_COPP \
7643 0x00010314
7644#define ADM_CMD_COPP_OPENOPOLOGY_ID_SPEAKER_STEREO_IIR_AUDIO_COPP\
7645 0x00010704
7646#define ADM_CMD_COPP_OPENOPOLOGY_ID_SPEAKER_MONO_AUDIO_COPP_MBDRCV2\
7647 0x0001070D
7648#define ADM_CMD_COPP_OPENOPOLOGY_ID_SPEAKER_STEREO_AUDIO_COPP_MBDRCV2\
7649 0x0001070E
7650#define ADM_CMD_COPP_OPENOPOLOGY_ID_SPEAKER_STEREO_IIR_AUDIO_COPP_MBDRCV2\
7651 0x0001070F
7652#define ADM_CMD_COPP_OPENOPOLOGY_ID_SPEAKER_STEREO_AUDIO_COPP_MBDRC_V3 \
7653 0x11000000
7654#define ADM_CMD_COPP_OPENOPOLOGY_ID_SPEAKER_MCH_PEAK_VOL \
7655 0x0001031B
7656#define ADM_CMD_COPP_OPENOPOLOGY_ID_MIC_MONO_AUDIO_COPP 0x00010315
7657#define ADM_CMD_COPP_OPENOPOLOGY_ID_MIC_STEREO_AUDIO_COPP 0x00010316
7658#define AUDPROC_COPPOPOLOGY_ID_MCHAN_IIR_AUDIO 0x00010715
7659#define ADM_CMD_COPP_OPENOPOLOGY_ID_DEFAULT_AUDIO_COPP 0x00010BE3
7660#define ADM_CMD_COPP_OPENOPOLOGY_ID_PEAKMETER_AUDIO_COPP 0x00010317
7661#define AUDPROC_MODULE_ID_AIG 0x00010716
7662#define AUDPROC_PARAM_ID_AIG_ENABLE 0x00010717
7663#define AUDPROC_PARAM_ID_AIG_CONFIG 0x00010718
7664
7665struct Audio_AigParam {
7666 uint16_t mode;
7667/*< Mode word for enabling AIG/SIG mode .
7668 * Byte offset: 0
7669 */
7670 int16_t staticGainL16Q12;
7671/*< Static input gain when aigMode is set to 1.
7672 * Byte offset: 2
7673 */
7674 int16_t initialGainDBL16Q7;
7675/*<Initial value that the adaptive gain update starts from dB
7676 * Q7 Byte offset: 4
7677 */
7678 int16_t idealRMSDBL16Q7;
7679/*<Average RMS level that AIG attempts to achieve Q8.7
7680 * Byte offset: 6
7681 */
7682 int32_t noiseGateL32;
7683/*Threshold below which signal is considered as noise and AIG
7684 * Byte offset: 8
7685 */
7686 int32_t minGainL32Q15;
7687/*Minimum gain that can be provided by AIG Q16.15
7688 * Byte offset: 12
7689 */
7690 int32_t maxGainL32Q15;
7691/*Maximum gain that can be provided by AIG Q16.15
7692 * Byte offset: 16
7693 */
7694 uint32_t gainAtRtUL32Q31;
7695/*Attack/release time for AIG update Q1.31
7696 * Byte offset: 20
7697 */
7698 uint32_t longGainAtRtUL32Q31;
7699/*Long attack/release time while updating gain for
7700 * noise/silence Q1.31 Byte offset: 24
7701 */
7702
7703 uint32_t rmsTavUL32Q32;
7704/* RMS smoothing time constant used for long-term RMS estimate
7705 * Q0.32 Byte offset: 28
7706 */
7707
7708 uint32_t gainUpdateStartTimMsUL32Q0;
7709/* The waiting time before which AIG starts to apply adaptive
7710 * gain update Q32.0 Byte offset: 32
7711 */
7712
7713} __packed;
7714
7715
7716#define ADM_MODULE_ID_EANS 0x00010C4A
7717#define ADM_PARAM_ID_EANS_ENABLE 0x00010C4B
7718#define ADM_PARAM_ID_EANS_PARAMS 0x00010C4C
7719
7720struct adm_eans_enable {
7721
7722 uint32_t enable_flag;
7723/*< Specifies whether EANS is disabled (0) or enabled
7724 * (nonzero).
7725 * This is supported only for sampling rates of 8, 12, 16, 24, 32,
7726 * and 48 kHz. It is not supported for sampling rates of 11.025,
7727 * 22.05, or 44.1 kHz.
7728 */
7729
7730} __packed;
7731
7732
7733struct adm_eans_params {
7734 int16_t eans_mode;
7735/*< Mode word for enabling/disabling submodules.
7736 * Byte offset: 0
7737 */
7738
7739 int16_t eans_input_gain;
7740/*< Q2.13 input gain to the EANS module.
7741 * Byte offset: 2
7742 */
7743
7744 int16_t eans_output_gain;
7745/*< Q2.13 output gain to the EANS module.
7746 * Byte offset: 4
7747 */
7748
7749 int16_t eansarget_ns;
7750/*< Target noise suppression level in dB.
7751 * Byte offset: 6
7752 */
7753
7754 int16_t eans_s_alpha;
7755/*< Q3.12 over-subtraction factor for stationary noise
7756 * suppression.
7757 * Byte offset: 8
7758 */
7759
7760 int16_t eans_n_alpha;
7761/* < Q3.12 over-subtraction factor for nonstationary noise
7762 * suppression.
7763 * Byte offset: 10
7764 */
7765
7766 int16_t eans_n_alphamax;
7767/*< Q3.12 maximum over-subtraction factor for nonstationary
7768 * noise suppression.
7769 * Byte offset: 12
7770 */
7771 int16_t eans_e_alpha;
7772/*< Q15 scaling factor for excess noise suppression.
7773 * Byte offset: 14
7774 */
7775
7776 int16_t eans_ns_snrmax;
7777/*< Upper boundary in dB for SNR estimation.
7778 * Byte offset: 16
7779 */
7780
7781 int16_t eans_sns_block;
7782/*< Quarter block size for stationary noise suppression.
7783 * Byte offset: 18
7784 */
7785
7786 int16_t eans_ns_i;
7787/*< Initialization block size for noise suppression.
7788 * Byte offset: 20
7789 */
7790 int16_t eans_np_scale;
7791/*< Power scale factor for nonstationary noise update.
7792 * Byte offset: 22
7793 */
7794
7795 int16_t eans_n_lambda;
7796/*< Smoothing factor for higher level nonstationary noise
7797 * update.
7798 * Byte offset: 24
7799 */
7800
7801 int16_t eans_n_lambdaf;
7802/*< Medium averaging factor for noise update.
7803 * Byte offset: 26
7804 */
7805
7806 int16_t eans_gs_bias;
7807/*< Bias factor in dB for gain calculation.
7808 * Byte offset: 28
7809 */
7810
7811 int16_t eans_gs_max;
7812/*< SNR lower boundary in dB for aggressive gain calculation.
7813 * Byte offset: 30
7814 */
7815
7816 int16_t eans_s_alpha_hb;
7817/*< Q3.12 over-subtraction factor for high-band stationary
7818 * noise suppression.
7819 * Byte offset: 32
7820 */
7821
7822 int16_t eans_n_alphamax_hb;
7823/*< Q3.12 maximum over-subtraction factor for high-band
7824 * nonstationary noise suppression.
7825 * Byte offset: 34
7826 */
7827
7828 int16_t eans_e_alpha_hb;
7829/*< Q15 scaling factor for high-band excess noise suppression.
7830 * Byte offset: 36
7831 */
7832
7833 int16_t eans_n_lambda0;
7834/*< Smoothing factor for nonstationary noise update during
7835 * speech activity.
7836 * Byte offset: 38
7837 */
7838
7839 int16_t thresh;
7840/*< Threshold for generating a binary VAD decision.
7841 * Byte offset: 40
7842 */
7843
7844 int16_t pwr_scale;
7845/*< Indirect lower boundary of the noise level estimate.
7846 * Byte offset: 42
7847 */
7848
7849 int16_t hangover_max;
7850/*< Avoids mid-speech clipping and reliably detects weak speech
7851 * bursts at the end of speech activity.
7852 * Byte offset: 44
7853 */
7854
7855 int16_t alpha_snr;
7856/*< Controls responsiveness of the VAD.
7857 * Byte offset: 46
7858 */
7859
7860 int16_t snr_diff_max;
7861/*< Maximum SNR difference. Decreasing this parameter value may
7862 * help in making correct decisions during abrupt changes; however,
7863 * decreasing too much may increase false alarms during long
7864 * pauses/silences.
7865 * Byte offset: 48
7866 */
7867
7868 int16_t snr_diff_min;
7869/*< Minimum SNR difference. Decreasing this parameter value may
7870 * help in making correct decisions during abrupt changes; however,
7871 * decreasing too much may increase false alarms during long
7872 * pauses/silences.
7873 * Byte offset: 50
7874 */
7875
7876 int16_t init_length;
7877/*< Defines the number of frames for which a noise level
7878 * estimate is set to a fixed value.
7879 * Byte offset: 52
7880 */
7881
7882 int16_t max_val;
7883/*< Defines the upper limit of the noise level.
7884 * Byte offset: 54
7885 */
7886
7887 int16_t init_bound;
7888/*< Defines the initial bounding value for the noise level
7889 * estimate. This is used during the initial segment defined by the
7890 * init_length parameter.
7891 * Byte offset: 56
7892 */
7893
7894 int16_t reset_bound;
7895/*< Reset boundary for noise tracking.
7896 * Byte offset: 58
7897 */
7898
7899 int16_t avar_scale;
7900/*< Defines the bias factor in noise estimation.
7901 * Byte offset: 60
7902 */
7903
7904 int16_t sub_nc;
7905/*< Defines the window length for noise estimation.
7906 * Byte offset: 62
7907 */
7908
7909 int16_t spow_min;
7910/*< Defines the minimum signal power required to update the
7911 * boundaries for the noise floor estimate.
7912 * Byte offset: 64
7913 */
7914
7915 int16_t eans_gs_fast;
7916/*< Fast smoothing factor for postprocessor gain.
7917 * Byte offset: 66
7918 */
7919
7920 int16_t eans_gs_med;
7921/*< Medium smoothing factor for postprocessor gain.
7922 * Byte offset: 68
7923 */
7924
7925 int16_t eans_gs_slow;
7926/*< Slow smoothing factor for postprocessor gain.
7927 * Byte offset: 70
7928 */
7929
7930 int16_t eans_swb_salpha;
7931/*< Q3.12 super wideband aggressiveness factor for stationary
7932 * noise suppression.
7933 * Byte offset: 72
7934 */
7935
7936 int16_t eans_swb_nalpha;
7937/*< Q3.12 super wideband aggressiveness factor for
7938 * nonstationary noise suppression.
7939 * Byte offset: 74
7940 */
7941} __packed;
7942#define ADM_MODULE_IDX_MIC_GAIN_CTRL 0x00010C35
7943
7944/* @addtogroup audio_pp_param_ids
7945 * ID of the Tx mic gain control parameter used by the
7946 * #ADM_MODULE_IDX_MIC_GAIN_CTRL module.
7947 * @messagepayload
7948 * @structure{admx_mic_gain}
7949 * @tablespace
7950 * @inputtable{Audio_Postproc_ADM_PARAM_IDX_MIC_GAIN.tex}
7951 */
7952#define ADM_PARAM_IDX_MIC_GAIN 0x00010C36
7953
7954/* Structure for a Tx mic gain parameter for the mic gain
7955 * control module.
7956 */
7957
7958
7959/* @brief Payload of the #ADM_PARAM_IDX_MIC_GAIN parameter in the
7960 * Tx Mic Gain Control module.
7961 */
7962struct admx_mic_gain {
7963 uint16_t tx_mic_gain;
7964 /*< Linear gain in Q13 format. */
7965
7966 uint16_t reserved;
7967 /*< Clients must set this field to zero. */
7968} __packed;
7969
7970struct adm_set_mic_gain_params {
7971 struct adm_cmd_set_pp_params_v5 params;
7972 struct adm_param_data_v5 data;
7973 struct admx_mic_gain mic_gain_data;
7974} __packed;
7975
7976/* end_addtogroup audio_pp_param_ids */
7977
7978/* @ingroup audio_pp_module_ids
7979 * ID of the Rx Codec Gain Control module.
7980 *
7981 * This module supports the following parameter ID:
7982 * - #ADM_PARAM_ID_RX_CODEC_GAIN
7983 */
7984#define ADM_MODULE_ID_RX_CODEC_GAIN_CTRL 0x00010C37
7985
7986/* @addtogroup audio_pp_param_ids
7987 * ID of the Rx codec gain control parameter used by the
7988 * #ADM_MODULE_ID_RX_CODEC_GAIN_CTRL module.
7989 *
7990 * @messagepayload
7991 * @structure{adm_rx_codec_gain}
7992 * @tablespace
7993 * @inputtable{Audio_Postproc_ADM_PARAM_ID_RX_CODEC_GAIN.tex}
7994 */
7995#define ADM_PARAM_ID_RX_CODEC_GAIN 0x00010C38
7996
7997/* Structure for the Rx common codec gain control module. */
7998
7999
8000/* @brief Payload of the #ADM_PARAM_ID_RX_CODEC_GAIN parameter
8001 * in the Rx Codec Gain Control module.
8002 */
8003
8004
8005struct adm_rx_codec_gain {
8006 uint16_t rx_codec_gain;
8007 /* Linear gain in Q13 format. */
8008
8009 uint16_t reserved;
8010 /* Clients must set this field to zero.*/
8011} __packed;
8012
8013/* end_addtogroup audio_pp_param_ids */
8014
8015/* @ingroup audio_pp_module_ids
8016 * ID of the HPF Tuning Filter module on the Tx path.
8017 * This module supports the following parameter IDs:
8018 * - #ADM_PARAM_ID_HPF_IIRX_FILTER_ENABLE_CONFIG
8019 * - #ADM_PARAM_ID_HPF_IIRX_FILTER_PRE_GAIN
8020 * - #ADM_PARAM_ID_HPF_IIRX_FILTER_CONFIG_PARAMS
8021 */
8022#define ADM_MODULE_ID_HPF_IIRX_FILTER 0x00010C3D
8023
8024/* @addtogroup audio_pp_param_ids */
8025/* ID of the Tx HPF IIR filter enable parameter used by the
8026 * #ADM_MODULE_ID_HPF_IIRX_FILTER module.
8027 * @parspace Message payload
8028 * @structure{adm_hpfx_iir_filter_enable_cfg}
8029 * @tablespace
8030 * @inputtable{Audio_Postproc_ADM_PARAM_ID_HPF_IIRX_FILTER_ENABLE_CONFIG.tex}
8031 */
8032#define ADM_PARAM_ID_HPF_IIRX_FILTER_ENABLE_CONFIG 0x00010C3E
8033
8034/* ID of the Tx HPF IIR filter pregain parameter used by the
8035 * #ADM_MODULE_ID_HPF_IIRX_FILTER module.
8036 * @parspace Message payload
8037 * @structure{adm_hpfx_iir_filter_pre_gain}
8038 * @tablespace
8039 * @inputtable{Audio_Postproc_ADM_PARAM_ID_HPF_IIRX_FILTER_PRE_GAIN.tex}
8040 */
8041#define ADM_PARAM_ID_HPF_IIRX_FILTER_PRE_GAIN 0x00010C3F
8042
8043/* ID of the Tx HPF IIR filter configuration parameters used by the
8044 * #ADM_MODULE_ID_HPF_IIRX_FILTER module.
8045 * @parspace Message payload
8046 * @structure{adm_hpfx_iir_filter_cfg_params}
8047 * @tablespace
8048 * @inputtable{Audio_Postproc_ADM_PARAM_ID_HPF_IIRX_FILTER_CONFIG_PA
8049 * RAMS.tex}
8050 */
8051#define ADM_PARAM_ID_HPF_IIRX_FILTER_CONFIG_PARAMS 0x00010C40
8052
8053/* Structure for enabling a configuration parameter for
8054 * the HPF IIR tuning filter module on the Tx path.
8055 */
8056
8057/* @brief Payload of the #ADM_PARAM_ID_HPF_IIRX_FILTER_ENABLE_CONFIG
8058 * parameter in the Tx path HPF Tuning Filter module.
8059 */
8060struct adm_hpfx_iir_filter_enable_cfg {
8061 uint32_t enable_flag;
8062/* Specifies whether the HPF tuning filter is disabled (0) or
8063 * enabled (nonzero).
8064 */
8065} __packed;
8066
8067
8068/* Structure for the pregain parameter for the HPF
8069 * IIR tuning filter module on the Tx path.
8070 */
8071
8072
8073/* @brief Payload of the #ADM_PARAM_ID_HPF_IIRX_FILTER_PRE_GAIN parameter
8074 * in the Tx path HPF Tuning Filter module.
8075 */
8076struct adm_hpfx_iir_filter_pre_gain {
8077 uint16_t pre_gain;
8078 /* Linear gain in Q13 format. */
8079
8080 uint16_t reserved;
8081 /* Clients must set this field to zero.*/
8082} __packed;
8083
8084
8085/* Structure for the configuration parameter for the
8086 * HPF IIR tuning filter module on the Tx path.
8087 */
8088
8089
8090/* @brief Payload of the #ADM_PARAM_ID_HPF_IIRX_FILTER_CONFIG_PARAMS
8091 * parameters in the Tx path HPF Tuning Filter module. \n
8092 * \n
8093 * This structure is followed by tuning filter coefficients as follows: \n
8094 * - Sequence of int32_t FilterCoeffs.
8095 * Each band has five coefficients, each in int32_t format in the order of
8096 * b0, b1, b2, a1, a2.
8097 * - Sequence of int16_t NumShiftFactor.
8098 * One int16_t per band. The numerator shift factor is related to the Q
8099 * factor of the filter coefficients.
8100 * - Sequence of uint16_t PanSetting.
8101 * One uint16_t for each band to indicate application of the filter to
8102 * left (0), right (1), or both (2) channels.
8103 */
8104struct adm_hpfx_iir_filter_cfg_params {
8105 uint16_t num_biquad_stages;
8106/*< Number of bands.
8107 * Supported values: 0 to 20
8108 */
8109
8110 uint16_t reserved;
8111 /*< Clients must set this field to zero.*/
8112} __packed;
8113
8114/* end_addtogroup audio_pp_module_ids */
8115
8116/* @addtogroup audio_pp_module_ids */
8117/* ID of the Tx path IIR Tuning Filter module.
8118 * This module supports the following parameter IDs:
8119 * - #ADM_PARAM_IDX_IIR_FILTER_ENABLE_CONFIG
8120 */
8121#define ADM_MODULE_IDX_IIR_FILTER 0x00010C41
8122
8123/* ID of the Rx path IIR Tuning Filter module for the left channel.
8124 * The parameter IDs of the IIR tuning filter module
8125 * (#ASM_MODULE_ID_IIRUNING_FILTER) are used for the left IIR Rx tuning
8126 * filter.
8127 *
8128 * Pan parameters are not required for this per-channel IIR filter; the pan
8129 * parameters are ignored by this module.
8130 */
8131#define ADM_MODULE_ID_LEFT_IIRUNING_FILTER 0x00010705
8132
8133/* ID of the the Rx path IIR Tuning Filter module for the right
8134 * channel.
8135 * The parameter IDs of the IIR tuning filter module
8136 * (#ASM_MODULE_ID_IIRUNING_FILTER) are used for the right IIR Rx
8137 * tuning filter.
8138 *
8139 * Pan parameters are not required for this per-channel IIR filter;
8140 * the pan parameters are ignored by this module.
8141 */
8142#define ADM_MODULE_ID_RIGHT_IIRUNING_FILTER 0x00010706
8143
8144/* end_addtogroup audio_pp_module_ids */
8145
8146/* @addtogroup audio_pp_param_ids */
8147
8148/* ID of the Tx IIR filter enable parameter used by the
8149 * #ADM_MODULE_IDX_IIR_FILTER module.
8150 * @parspace Message payload
8151 * @structure{admx_iir_filter_enable_cfg}
8152 * @tablespace
8153 * @inputtable{Audio_Postproc_ADM_PARAM_IDX_IIR_FILTER_ENABLE_CONFIG.tex}
8154 */
8155#define ADM_PARAM_IDX_IIR_FILTER_ENABLE_CONFIG 0x00010C42
8156
8157/* ID of the Tx IIR filter pregain parameter used by the
8158 * #ADM_MODULE_IDX_IIR_FILTER module.
8159 * @parspace Message payload
8160 * @structure{admx_iir_filter_pre_gain}
8161 * @tablespace
8162 * @inputtable{Audio_Postproc_ADM_PARAM_IDX_IIR_FILTER_PRE_GAIN.tex}
8163 */
8164#define ADM_PARAM_IDX_IIR_FILTER_PRE_GAIN 0x00010C43
8165
8166/* ID of the Tx IIR filter configuration parameters used by the
8167 * #ADM_MODULE_IDX_IIR_FILTER module.
8168 * @parspace Message payload
8169 * @structure{admx_iir_filter_cfg_params}
8170 * @tablespace
8171 * @inputtable{Audio_Postproc_ADM_PARAM_IDX_IIR_FILTER_CONFIG_PARAMS.tex}
8172 */
8173#define ADM_PARAM_IDX_IIR_FILTER_CONFIG_PARAMS 0x00010C44
8174
8175/* Structure for enabling the configuration parameter for the
8176 * IIR filter module on the Tx path.
8177 */
8178
8179/* @brief Payload of the #ADM_PARAM_IDX_IIR_FILTER_ENABLE_CONFIG
8180 * parameter in the Tx Path IIR Tuning Filter module.
8181 */
8182
8183struct admx_iir_filter_enable_cfg {
8184 uint32_t enable_flag;
8185/*< Specifies whether the IIR tuning filter is disabled (0) or
8186 * enabled (nonzero).
8187 */
8188
8189} __packed;
8190
8191
8192/* Structure for the pregain parameter for the
8193 * IIR filter module on the Tx path.
8194 */
8195
8196
8197/* @brief Payload of the #ADM_PARAM_IDX_IIR_FILTER_PRE_GAIN
8198 * parameter in the Tx Path IIR Tuning Filter module.
8199 */
8200
8201struct admx_iir_filter_pre_gain {
8202 uint16_t pre_gain;
8203 /*< Linear gain in Q13 format. */
8204
8205 uint16_t reserved;
8206 /*< Clients must set this field to zero.*/
8207} __packed;
8208
8209
8210/* Structure for the configuration parameter for the
8211 * IIR filter module on the Tx path.
8212 */
8213
8214
8215/* @brief Payload of the #ADM_PARAM_IDX_IIR_FILTER_CONFIG_PARAMS
8216 * parameter in the Tx Path IIR Tuning Filter module. \n
8217 * \n
8218 * This structure is followed by the HPF IIR filter coefficients on
8219 * the Tx path as follows: \n
8220 * - Sequence of int32_t ulFilterCoeffs. Each band has five
8221 * coefficients, each in int32_t format in the order of b0, b1, b2,
8222 * a1, a2.
8223 * - Sequence of int16_t sNumShiftFactor. One int16_t per band. The
8224 * numerator shift factor is related to the Q factor of the filter
8225 * coefficients.
8226 * - Sequence of uint16_t usPanSetting. One uint16_t for each band
8227 * to indicate if the filter is applied to left (0), right (1), or
8228 * both (2) channels.
8229 */
8230struct admx_iir_filter_cfg_params {
8231 uint16_t num_biquad_stages;
8232/*< Number of bands.
8233 * Supported values: 0 to 20
8234 */
8235
8236 uint16_t reserved;
8237 /*< Clients must set this field to zero.*/
8238} __packed;
8239
8240/* end_addtogroup audio_pp_module_ids */
8241
8242/* @ingroup audio_pp_module_ids
8243 * ID of the QEnsemble module.
8244 * This module supports the following parameter IDs:
8245 * - #ADM_PARAM_ID_QENSEMBLE_ENABLE
8246 * - #ADM_PARAM_ID_QENSEMBLE_BACKGAIN
8247 * - #ADM_PARAM_ID_QENSEMBLE_SET_NEW_ANGLE
8248 */
8249#define ADM_MODULE_ID_QENSEMBLE 0x00010C59
8250
8251/* @addtogroup audio_pp_param_ids */
8252/* ID of the QEnsemble enable parameter used by the
8253 * #ADM_MODULE_ID_QENSEMBLE module.
8254 * @messagepayload
8255 * @structure{adm_qensemble_enable}
8256 * @tablespace
8257 * @inputtable{Audio_Postproc_ADM_PARAM_ID_QENSEMBLE_ENABLE.tex}
8258 */
8259#define ADM_PARAM_ID_QENSEMBLE_ENABLE 0x00010C60
8260
8261/* ID of the QEnsemble back gain parameter used by the
8262 * #ADM_MODULE_ID_QENSEMBLE module.
8263 * @messagepayload
8264 * @structure{adm_qensemble_param_backgain}
8265 * @tablespace
8266 * @inputtable{Audio_Postproc_ADM_PARAM_ID_QENSEMBLE_BACKGAIN.tex}
8267 */
8268#define ADM_PARAM_ID_QENSEMBLE_BACKGAIN 0x00010C61
8269
8270/* ID of the QEnsemble new angle parameter used by the
8271 * #ADM_MODULE_ID_QENSEMBLE module.
8272 * @messagepayload
8273 * @structure{adm_qensemble_param_set_new_angle}
8274 * @tablespace
8275 * @inputtable{Audio_Postproc_ADM_PARAM_ID_QENSEMBLE_SET_NEW_ANGLE.tex}
8276 */
8277#define ADM_PARAM_ID_QENSEMBLE_SET_NEW_ANGLE 0x00010C62
8278
8279/* Structure for enabling the configuration parameter for the
8280 * QEnsemble module.
8281 */
8282
8283
8284/* @brief Payload of the #ADM_PARAM_ID_QENSEMBLE_ENABLE
8285 * parameter used by the QEnsemble module.
8286 */
8287struct adm_qensemble_enable {
8288 uint32_t enable_flag;
8289/*< Specifies whether the QEnsemble module is disabled (0) or enabled
8290 * (nonzero).
8291 */
8292} __packed;
8293
8294
8295/* Structure for the background gain for the QEnsemble module. */
8296
8297
8298/* @brief Payload of the #ADM_PARAM_ID_QENSEMBLE_BACKGAIN
8299 * parameter used by
8300 * the QEnsemble module.
8301 */
8302struct adm_qensemble_param_backgain {
8303 int16_t back_gain;
8304/*< Linear gain in Q15 format.
8305 * Supported values: 0 to 32767
8306 */
8307
8308 uint16_t reserved;
8309 /*< Clients must set this field to zero.*/
8310} __packed;
8311/* Structure for setting a new angle for the QEnsemble module. */
8312
8313
8314/* @brief Payload of the #ADM_PARAM_ID_QENSEMBLE_SET_NEW_ANGLE
8315 * parameter used
8316 * by the QEnsemble module.
8317 */
8318struct adm_qensemble_param_set_new_angle {
8319 int16_t new_angle;
8320/*< New angle in degrees.
8321 * Supported values: 0 to 359
8322 */
8323
8324 int16_t time_ms;
8325/*< Transition time in milliseconds to set the new angle.
8326 * Supported values: 0 to 32767
8327 */
8328} __packed;
8329
8330
8331#define ADM_CMD_GET_PP_TOPO_MODULE_LIST 0x00010349
8332#define ADM_CMDRSP_GET_PP_TOPO_MODULE_LIST 0x00010350
8333#define AUDPROC_PARAM_ID_ENABLE 0x00010904
8334 /*
8335 * Payload of the ADM_CMD_GET_PP_TOPO_MODULE_LIST command.
8336 */
8337struct adm_cmd_get_pp_topo_module_list_t {
8338 struct apr_hdr hdr;
8339 /* Lower 32 bits of the 64-bit parameter data payload address. */
8340 uint32_t data_payload_addr_lsw;
8341 /*
8342 * Upper 32 bits of the 64-bit parameter data payload address.
8343 *
8344 *
8345 * The size of the shared memory, if specified, must be large enough to
8346 * contain the entire parameter data payload, including the module ID,
8347 * parameter ID, parameter size, and parameter values.
8348 */
8349 uint32_t data_payload_addr_msw;
8350 /*
8351 * Unique identifier for an address.
8352 *
8353 * This memory map handle is returned by the aDSP through the
8354 * #ADM_CMD_SHARED_MEM_MAP_REGIONS command.
8355 *
8356 * @values
8357 * - Non-NULL -- On acknowledgment, the parameter data payloads begin at
8358 * the address specified (out-of-band)
8359 * - NULL -- The acknowledgment's payload contains the parameter data
8360 * (in-band) @tablebulletend
8361 */
8362 uint32_t mem_map_handle;
8363 /*
8364 * Maximum data size of the list of modules. This
8365 * field is a multiple of 4 bytes.
8366 */
8367 uint16_t param_max_size;
8368 /* This field must be set to zero. */
8369 uint16_t reserved;
8370} __packed;
8371
8372/*
8373 * Payload of the ADM_CMDRSP_GET_PP_TOPO_MODULE_LIST message, which returns
8374 * module ids in response to an ADM_CMD_GET_PP_TOPO_MODULE_LIST command.
8375 * Immediately following this structure is the acknowledgment <b>module id
8376 * data variable payload</b> containing the pre/postprocessing module id
8377 * values. For an in-band scenario, the variable payload depends on the size
8378 * of the parameter.
8379 */
8380struct adm_cmd_rsp_get_pp_topo_module_list_t {
8381 /* Status message (error code). */
8382 uint32_t status;
8383} __packed;
8384
8385struct audproc_topology_module_id_info_t {
8386 uint32_t num_modules;
8387} __packed;
8388
8389/* end_addtogroup audio_pp_module_ids */
8390
8391/* @ingroup audio_pp_module_ids
8392 * ID of the Volume Control module pre/postprocessing block.
8393 * This module supports the following parameter IDs:
8394 * - #ASM_PARAM_ID_VOL_CTRL_MASTER_GAIN
8395 * - #ASM_PARAM_ID_MULTICHANNEL_GAIN
8396 * - #ASM_PARAM_ID_VOL_CTRL_MUTE_CONFIG
8397 * - #ASM_PARAM_ID_SOFT_VOL_STEPPING_PARAMETERS
8398 * - #ASM_PARAM_ID_SOFT_PAUSE_PARAMETERS
8399 * - #ASM_PARAM_ID_MULTICHANNEL_GAIN
8400 * - #ASM_PARAM_ID_MULTICHANNEL_MUTE
8401 */
8402#define ASM_MODULE_ID_VOL_CTRL 0x00010BFE
8403#define ASM_MODULE_ID_VOL_CTRL2 0x00010910
8404#define AUDPROC_MODULE_ID_VOL_CTRL ASM_MODULE_ID_VOL_CTRL
8405
8406/* @addtogroup audio_pp_param_ids */
8407/* ID of the master gain parameter used by the #ASM_MODULE_ID_VOL_CTRL
8408 * module.
8409 * @messagepayload
8410 * @structure{asm_volume_ctrl_master_gain}
8411 * @tablespace
8412 * @inputtable{Audio_Postproc_ASM_PARAM_ID_VOL_CTRL_MASTER_GAIN.tex}
8413 */
8414#define ASM_PARAM_ID_VOL_CTRL_MASTER_GAIN 0x00010BFF
8415#define AUDPROC_PARAM_ID_VOL_CTRL_MASTER_GAIN ASM_PARAM_ID_VOL_CTRL_MASTER_GAIN
8416
8417/* ID of the left/right channel gain parameter used by the
8418 * #ASM_MODULE_ID_VOL_CTRL module.
8419 * @messagepayload
8420 * @structure{asm_volume_ctrl_lr_chan_gain}
8421 * @tablespace
8422 * @inputtable{Audio_Postproc_ASM_PARAM_ID_MULTICHANNEL_GAIN.tex}
8423 */
8424#define ASM_PARAM_ID_VOL_CTRL_LR_CHANNEL_GAIN 0x00010C00
8425
8426/* ID of the mute configuration parameter used by the
8427 * #ASM_MODULE_ID_VOL_CTRL module.
8428 * @messagepayload
8429 * @structure{asm_volume_ctrl_mute_config}
8430 * @tablespace
8431 * @inputtable{Audio_Postproc_ASM_PARAM_ID_VOL_CTRL_MUTE_CONFIG.tex}
8432 */
8433#define ASM_PARAM_ID_VOL_CTRL_MUTE_CONFIG 0x00010C01
8434
8435/* ID of the soft stepping volume parameters used by the
8436 * #ASM_MODULE_ID_VOL_CTRL module.
8437 * @messagepayload
8438 * @structure{asm_soft_step_volume_params}
8439 * @tablespace
8440 * @inputtable{Audio_Postproc_ASM_PARAM_ID_SOFT_VOL_STEPPING_PARAMET
8441 * ERS.tex}
8442 */
8443#define ASM_PARAM_ID_SOFT_VOL_STEPPING_PARAMETERS 0x00010C29
8444#define AUDPROC_PARAM_ID_SOFT_VOL_STEPPING_PARAMETERS\
8445 ASM_PARAM_ID_SOFT_VOL_STEPPING_PARAMETERS
8446
8447/* ID of the soft pause parameters used by the #ASM_MODULE_ID_VOL_CTRL
8448 * module.
8449 */
8450#define ASM_PARAM_ID_SOFT_PAUSE_PARAMETERS 0x00010D6A
8451
8452/* ID of the multiple-channel volume control parameters used by the
8453 * #ASM_MODULE_ID_VOL_CTRL module.
8454 */
8455#define ASM_PARAM_ID_MULTICHANNEL_GAIN 0x00010713
8456
8457/* ID of the multiple-channel mute configuration parameters used by the
8458 * #ASM_MODULE_ID_VOL_CTRL module.
8459 */
8460
8461#define ASM_PARAM_ID_MULTICHANNEL_MUTE 0x00010714
8462
8463/* Structure for the master gain parameter for a volume control
8464 * module.
8465 */
8466
8467
8468/* @brief Payload of the #ASM_PARAM_ID_VOL_CTRL_MASTER_GAIN
8469 * parameter used by the Volume Control module.
8470 */
8471
8472
8473
8474struct asm_volume_ctrl_master_gain {
8475 struct apr_hdr hdr;
8476 struct asm_stream_cmd_set_pp_params_v2 param;
8477 struct asm_stream_param_data_v2 data;
8478 uint16_t master_gain;
8479 /* Linear gain in Q13 format. */
8480
8481 uint16_t reserved;
8482 /* Clients must set this field to zero. */
8483} __packed;
8484
8485
8486struct asm_volume_ctrl_lr_chan_gain {
8487 struct apr_hdr hdr;
8488 struct asm_stream_cmd_set_pp_params_v2 param;
8489 struct asm_stream_param_data_v2 data;
8490
8491 uint16_t l_chan_gain;
8492 /*< Linear gain in Q13 format for the left channel. */
8493
8494 uint16_t r_chan_gain;
8495 /*< Linear gain in Q13 format for the right channel.*/
8496} __packed;
8497
8498
8499/* Structure for the mute configuration parameter for a
8500 * volume control module.
8501 */
8502
8503
8504/* @brief Payload of the #ASM_PARAM_ID_VOL_CTRL_MUTE_CONFIG
8505 * parameter used by the Volume Control module.
8506 */
8507
8508
8509struct asm_volume_ctrl_mute_config {
8510 struct apr_hdr hdr;
8511 struct asm_stream_cmd_set_pp_params_v2 param;
8512 struct asm_stream_param_data_v2 data;
8513 uint32_t mute_flag;
8514/*< Specifies whether mute is disabled (0) or enabled (nonzero).*/
8515
8516} __packed;
8517
8518/*
8519 * Supported parameters for a soft stepping linear ramping curve.
8520 */
8521#define ASM_PARAM_SVC_RAMPINGCURVE_LINEAR 0
8522
8523/*
8524 * Exponential ramping curve.
8525 */
8526#define ASM_PARAM_SVC_RAMPINGCURVE_EXP 1
8527
8528/*
8529 * Logarithmic ramping curve.
8530 */
8531#define ASM_PARAM_SVC_RAMPINGCURVE_LOG 2
8532
8533/* Structure for holding soft stepping volume parameters. */
8534
8535
8536/* Payload of the #ASM_PARAM_ID_SOFT_VOL_STEPPING_PARAMETERS
8537 * parameters used by the Volume Control module.
8538 */
8539struct asm_soft_step_volume_params {
8540 struct apr_hdr hdr;
8541 struct asm_stream_cmd_set_pp_params_v2 param;
8542 struct asm_stream_param_data_v2 data;
8543 uint32_t period;
8544/*< Period in milliseconds.
8545 * Supported values: 0 to 15000
8546 */
8547
8548 uint32_t step;
8549/*< Step in microseconds.
8550 * Supported values: 0 to 15000000
8551 */
8552
8553 uint32_t ramping_curve;
8554/*< Ramping curve type.
8555 * Supported values:
8556 * - #ASM_PARAM_SVC_RAMPINGCURVE_LINEAR
8557 * - #ASM_PARAM_SVC_RAMPINGCURVE_EXP
8558 * - #ASM_PARAM_SVC_RAMPINGCURVE_LOG
8559 */
8560} __packed;
8561
8562
8563/* Structure for holding soft pause parameters. */
8564
8565
8566/* Payload of the #ASM_PARAM_ID_SOFT_PAUSE_PARAMETERS
8567 * parameters used by the Volume Control module.
8568 */
8569
8570
8571struct asm_soft_pause_params {
8572 struct apr_hdr hdr;
8573 struct asm_stream_cmd_set_pp_params_v2 param;
8574 struct asm_stream_param_data_v2 data;
8575 uint32_t enable_flag;
8576/*< Specifies whether soft pause is disabled (0) or enabled
8577 * (nonzero).
8578 */
8579
8580
8581
8582 uint32_t period;
8583/*< Period in milliseconds.
8584 * Supported values: 0 to 15000
8585 */
8586
8587 uint32_t step;
8588/*< Step in microseconds.
8589 * Supported values: 0 to 15000000
8590 */
8591
8592 uint32_t ramping_curve;
8593/*< Ramping curve.
8594 * Supported values:
8595 * - #ASM_PARAM_SVC_RAMPINGCURVE_LINEAR
8596 * - #ASM_PARAM_SVC_RAMPINGCURVE_EXP
8597 * - #ASM_PARAM_SVC_RAMPINGCURVE_LOG
8598 */
8599} __packed;
8600
8601
8602/* Maximum number of channels.*/
8603#define VOLUME_CONTROL_MAX_CHANNELS 8
8604
8605/* Structure for holding one channel type - gain pair. */
8606
8607
8608/* Payload of the #ASM_PARAM_ID_MULTICHANNEL_GAIN channel
8609 * type/gain pairs used by the Volume Control module. \n \n This
8610 * structure immediately follows the
8611 * asm_volume_ctrl_multichannel_gain structure.
8612 */
8613
8614
8615struct asm_volume_ctrl_channeltype_gain_pair {
8616 uint8_t channeltype;
8617 /*
8618 * Channel type for which the gain setting is to be applied.
8619 * Supported values:
8620 * - #PCM_CHANNEL_L
8621 * - #PCM_CHANNEL_R
8622 * - #PCM_CHANNEL_C
8623 * - #PCM_CHANNEL_LS
8624 * - #PCM_CHANNEL_RS
8625 * - #PCM_CHANNEL_LFE
8626 * - #PCM_CHANNEL_CS
8627 * - #PCM_CHANNEL_LB
8628 * - #PCM_CHANNEL_RB
8629 * - #PCM_CHANNELS
8630 * - #PCM_CHANNEL_CVH
8631 * - #PCM_CHANNEL_MS
8632 * - #PCM_CHANNEL_FLC
8633 * - #PCM_CHANNEL_FRC
8634 * - #PCM_CHANNEL_RLC
8635 * - #PCM_CHANNEL_RRC
8636 */
8637
8638 uint8_t reserved1;
8639 /* Clients must set this field to zero. */
8640
8641 uint8_t reserved2;
8642 /* Clients must set this field to zero. */
8643
8644 uint8_t reserved3;
8645 /* Clients must set this field to zero. */
8646
8647 uint32_t gain;
8648 /*
8649 * Gain value for this channel in Q28 format.
8650 * Supported values: Any
8651 */
8652} __packed;
8653
8654
8655/* Structure for the multichannel gain command */
8656
8657
8658/* Payload of the #ASM_PARAM_ID_MULTICHANNEL_GAIN
8659 * parameters used by the Volume Control module.
8660 */
8661
8662
8663struct asm_volume_ctrl_multichannel_gain {
8664 struct apr_hdr hdr;
8665 struct asm_stream_cmd_set_pp_params_v2 param;
8666 struct asm_stream_param_data_v2 data;
8667 uint32_t num_channels;
8668 /*
8669 * Number of channels for which gain values are provided. Any
8670 * channels present in the data for which gain is not provided are
8671 * set to unity gain.
8672 * Supported values: 1 to 8
8673 */
8674
8675 struct asm_volume_ctrl_channeltype_gain_pair
8676 gain_data[VOLUME_CONTROL_MAX_CHANNELS];
8677 /* Array of channel type/gain pairs.*/
8678} __packed;
8679
8680
8681/* Structure for holding one channel type - mute pair. */
8682
8683
8684/* Payload of the #ASM_PARAM_ID_MULTICHANNEL_MUTE channel
8685 * type/mute setting pairs used by the Volume Control module. \n \n
8686 * This structure immediately follows the
8687 * asm_volume_ctrl_multichannel_mute structure.
8688 */
8689
8690
8691struct asm_volume_ctrl_channelype_mute_pair {
8692 struct apr_hdr hdr;
8693 struct asm_stream_cmd_set_pp_params_v2 param;
8694 struct asm_stream_param_data_v2 data;
8695 uint8_t channelype;
8696/*< Channel type for which the mute setting is to be applied.
8697 * Supported values:
8698 * - #PCM_CHANNEL_L
8699 * - #PCM_CHANNEL_R
8700 * - #PCM_CHANNEL_C
8701 * - #PCM_CHANNEL_LS
8702 * - #PCM_CHANNEL_RS
8703 * - #PCM_CHANNEL_LFE
8704 * - #PCM_CHANNEL_CS
8705 * - #PCM_CHANNEL_LB
8706 * - #PCM_CHANNEL_RB
8707 * - #PCM_CHANNELS
8708 * - #PCM_CHANNEL_CVH
8709 * - #PCM_CHANNEL_MS
8710 * - #PCM_CHANNEL_FLC
8711 * - #PCM_CHANNEL_FRC
8712 * - #PCM_CHANNEL_RLC
8713 * - #PCM_CHANNEL_RRC
8714 */
8715
8716 uint8_t reserved1;
8717 /*< Clients must set this field to zero. */
8718
8719 uint8_t reserved2;
8720 /*< Clients must set this field to zero. */
8721
8722 uint8_t reserved3;
8723 /*< Clients must set this field to zero. */
8724
8725 uint32_t mute;
8726/*< Mute setting for this channel.
8727 * Supported values:
8728 * - 0 = Unmute
8729 * - Nonzero = Mute
8730 */
8731} __packed;
8732
8733
8734/* Structure for the multichannel mute command */
8735
8736
8737/* @brief Payload of the #ASM_PARAM_ID_MULTICHANNEL_MUTE
8738 * parameters used by the Volume Control module.
8739 */
8740
8741
8742struct asm_volume_ctrl_multichannel_mute {
8743 struct apr_hdr hdr;
8744 struct asm_stream_cmd_set_pp_params_v2 param;
8745 struct asm_stream_param_data_v2 data;
8746 uint32_t num_channels;
8747/*< Number of channels for which mute configuration is
8748 * provided. Any channels present in the data for which mute
8749 * configuration is not provided are set to unmute.
8750 * Supported values: 1 to 8
8751 */
8752
8753struct asm_volume_ctrl_channelype_mute_pair
8754 mute_data[VOLUME_CONTROL_MAX_CHANNELS];
8755 /*< Array of channel type/mute setting pairs.*/
8756} __packed;
8757/* end_addtogroup audio_pp_param_ids */
8758
8759/* audio_pp_module_ids
8760 * ID of the IIR Tuning Filter module.
8761 * This module supports the following parameter IDs:
8762 * - #ASM_PARAM_ID_IIRUNING_FILTER_ENABLE_CONFIG
8763 * - #ASM_PARAM_ID_IIRUNING_FILTER_PRE_GAIN
8764 * - #ASM_PARAM_ID_IIRUNING_FILTER_CONFIG_PARAMS
8765 */
8766#define ASM_MODULE_ID_IIRUNING_FILTER 0x00010C02
8767
8768/* @addtogroup audio_pp_param_ids */
8769/* ID of the IIR tuning filter enable parameter used by the
8770 * #ASM_MODULE_ID_IIRUNING_FILTER module.
8771 * @messagepayload
8772 * @structure{asm_iiruning_filter_enable}
8773 * @tablespace
8774 * @inputtable{Audio_Postproc_ASM_PARAM_ID_IIRUNING_FILTER_ENABLE_CO
8775 * NFIG.tex}
8776 */
8777#define ASM_PARAM_ID_IIRUNING_FILTER_ENABLE_CONFIG 0x00010C03
8778
8779/* ID of the IIR tuning filter pregain parameter used by the
8780 * #ASM_MODULE_ID_IIRUNING_FILTER module.
8781 */
8782#define ASM_PARAM_ID_IIRUNING_FILTER_PRE_GAIN 0x00010C04
8783
8784/* ID of the IIR tuning filter configuration parameters used by the
8785 * #ASM_MODULE_ID_IIRUNING_FILTER module.
8786 */
8787#define ASM_PARAM_ID_IIRUNING_FILTER_CONFIG_PARAMS 0x00010C05
8788
8789/* Structure for an enable configuration parameter for an
8790 * IIR tuning filter module.
8791 */
8792
8793
8794/* @brief Payload of the #ASM_PARAM_ID_IIRUNING_FILTER_ENABLE_CONFIG
8795 * parameter used by the IIR Tuning Filter module.
8796 */
8797struct asm_iiruning_filter_enable {
8798 uint32_t enable_flag;
8799/*< Specifies whether the IIR tuning filter is disabled (0) or
8800 * enabled (1).
8801 */
8802} __packed;
8803
8804/* Structure for the pregain parameter for an IIR tuning filter module. */
8805
8806
8807/* Payload of the #ASM_PARAM_ID_IIRUNING_FILTER_PRE_GAIN
8808 * parameters used by the IIR Tuning Filter module.
8809 */
8810struct asm_iiruning_filter_pregain {
8811 uint16_t pregain;
8812 /*< Linear gain in Q13 format. */
8813
8814 uint16_t reserved;
8815 /*< Clients must set this field to zero.*/
8816} __packed;
8817
8818/* Structure for the configuration parameter for an IIR tuning filter
8819 * module.
8820 */
8821
8822
8823/* @brief Payload of the #ASM_PARAM_ID_IIRUNING_FILTER_CONFIG_PARAMS
8824 * parameters used by the IIR Tuning Filter module. \n
8825 * \n
8826 * This structure is followed by the IIR filter coefficients: \n
8827 * - Sequence of int32_t FilterCoeffs \n
8828 * Five coefficients for each band. Each coefficient is in int32_t format, in
8829 * the order of b0, b1, b2, a1, a2.
8830 * - Sequence of int16_t NumShiftFactor \n
8831 * One int16_t per band. The numerator shift factor is related to the Q
8832 * factor of the filter coefficients.
8833 * - Sequence of uint16_t PanSetting \n
8834 * One uint16_t per band, indicating if the filter is applied to left (0),
8835 * right (1), or both (2) channels.
8836 */
8837struct asm_iir_filter_config_params {
8838 uint16_t num_biquad_stages;
8839/*< Number of bands.
8840 * Supported values: 0 to 20
8841 */
8842
8843 uint16_t reserved;
8844 /*< Clients must set this field to zero.*/
8845} __packed;
8846
8847/* audio_pp_module_ids
8848 * ID of the Multiband Dynamic Range Control (MBDRC) module on the Tx/Rx
8849 * paths.
8850 * This module supports the following parameter IDs:
8851 * - #ASM_PARAM_ID_MBDRC_ENABLE
8852 * - #ASM_PARAM_ID_MBDRC_CONFIG_PARAMS
8853 */
8854#define ASM_MODULE_ID_MBDRC 0x00010C06
8855
8856/* audio_pp_param_ids */
8857/* ID of the MBDRC enable parameter used by the #ASM_MODULE_ID_MBDRC module.
8858 * @messagepayload
8859 * @structure{asm_mbdrc_enable}
8860 * @tablespace
8861 * @inputtable{Audio_Postproc_ASM_PARAM_ID_MBDRC_ENABLE.tex}
8862 */
8863#define ASM_PARAM_ID_MBDRC_ENABLE 0x00010C07
8864
8865/* ID of the MBDRC configuration parameters used by the
8866 * #ASM_MODULE_ID_MBDRC module.
8867 * @messagepayload
8868 * @structure{asm_mbdrc_config_params}
8869 * @tablespace
8870 * @inputtable{Audio_Postproc_ASM_PARAM_ID_MBDRC_CONFIG_PARAMS.tex}
8871 *
8872 * @parspace Sub-band DRC configuration parameters
8873 * @structure{asm_subband_drc_config_params}
8874 * @tablespace
8875 * @inputtable{Audio_Postproc_ASM_PARAM_ID_MBDRC_CONFIG_PARAMS_subband_DRC.tex}
8876 *
8877 * @keep{6}
8878 * To obtain legacy ADRC from MBDRC, use the calibration tool to:
8879 *
8880 * - Enable MBDRC (EnableFlag = TRUE)
8881 * - Set number of bands to 1 (uiNumBands = 1)
8882 * - Enable the first MBDRC band (DrcMode[0] = DRC_ENABLED = 1)
8883 * - Clear the first band mute flag (MuteFlag[0] = 0)
8884 * - Set the first band makeup gain to unity (compMakeUpGain[0] = 0x2000)
8885 * - Use the legacy ADRC parameters to calibrate the rest of the MBDRC
8886 * parameters.
8887 */
8888#define ASM_PARAM_ID_MBDRC_CONFIG_PARAMS 0x00010C08
8889
8890/* end_addtogroup audio_pp_param_ids */
8891
8892/* audio_pp_module_ids
8893 * ID of the MMBDRC module version 2 pre/postprocessing block.
8894 * This module differs from the original MBDRC (#ASM_MODULE_ID_MBDRC) in
8895 * the length of the filters used in each sub-band.
8896 * This module supports the following parameter ID:
8897 * - #ASM_PARAM_ID_MBDRC_CONFIG_PARAMS_IMPROVED_FILTBANK_V2
8898 */
8899#define ASM_MODULE_ID_MBDRCV2 0x0001070B
8900
8901/* @addtogroup audio_pp_param_ids */
8902/* ID of the configuration parameters used by the
8903 * #ASM_MODULE_ID_MBDRCV2 module for the improved filter structure
8904 * of the MBDRC v2 pre/postprocessing block.
8905 * The update to this configuration structure from the original
8906 * MBDRC is the number of filter coefficients in the filter
8907 * structure. The sequence for is as follows:
8908 * - 1 band = 0 FIR coefficient + 1 mute flag + uint16_t padding
8909 * - 2 bands = 141 FIR coefficients + 2 mute flags + uint16_t padding
8910 * - 3 bands = 141+81 FIR coefficients + 3 mute flags + uint16_t padding
8911 * - 4 bands = 141+81+61 FIR coefficients + 4 mute flags + uint16_t
8912 * padding
8913 * - 5 bands = 141+81+61+61 FIR coefficients + 5 mute flags +
8914 * uint16_t padding
8915 * This block uses the same parameter structure as
8916 * #ASM_PARAM_ID_MBDRC_CONFIG_PARAMS.
8917 */
8918#define ASM_PARAM_ID_MBDRC_CONFIG_PARAMS_IMPROVED_FILTBANK_V2 \
8919 0x0001070C
8920
8921#define ASM_MODULE_ID_MBDRCV3 0x0001090B
8922/*
8923 * ID of the MMBDRC module version 3 pre/postprocessing block.
8924 * This module differs from MBDRCv2 (#ASM_MODULE_ID_MBDRCV2) in
8925 * that it supports both 16- and 24-bit data.
8926 * This module supports the following parameter ID:
8927 * - #ASM_PARAM_ID_MBDRC_ENABLE
8928 * - #ASM_PARAM_ID_MBDRC_CONFIG_PARAMS
8929 * - #ASM_PARAM_ID_MBDRC_CONFIG_PARAMS_V3
8930 * - #ASM_PARAM_ID_MBDRC_FILTER_XOVER_FREQS
8931 */
8932
8933/* Structure for the enable parameter for an MBDRC module. */
8934
8935
8936/* Payload of the #ASM_PARAM_ID_MBDRC_ENABLE parameter used by the
8937 * MBDRC module.
8938 */
8939struct asm_mbdrc_enable {
8940 uint32_t enable_flag;
8941/*< Specifies whether MBDRC is disabled (0) or enabled (nonzero).*/
8942} __packed;
8943
8944/* Structure for the configuration parameters for an MBDRC module. */
8945
8946
8947/* Payload of the #ASM_PARAM_ID_MBDRC_CONFIG_PARAMS
8948 * parameters used by the MBDRC module. \n \n Following this
8949 * structure is the payload for sub-band DRC configuration
8950 * parameters (asm_subband_drc_config_params). This sub-band
8951 * structure must be repeated for each band.
8952 */
8953
8954
8955struct asm_mbdrc_config_params {
8956 uint16_t num_bands;
8957/*< Number of bands.
8958 * Supported values: 1 to 5
8959 */
8960
8961 int16_t limiterhreshold;
8962/*< Threshold in decibels for the limiter output.
8963 * Supported values: -72 to 18 \n
8964 * Recommended value: 3994 (-0.22 db in Q3.12 format)
8965 */
8966
8967 int16_t limiter_makeup_gain;
8968/*< Makeup gain in decibels for the limiter output.
8969 * Supported values: -42 to 42 \n
8970 * Recommended value: 256 (0 dB in Q7.8 format)
8971 */
8972
8973 int16_t limiter_gc;
8974/*< Limiter gain recovery coefficient.
8975 * Supported values: 0.5 to 0.99 \n
8976 * Recommended value: 32440 (0.99 in Q15 format)
8977 */
8978
8979 int16_t limiter_delay;
8980/*< Limiter delay in samples.
8981 * Supported values: 0 to 10 \n
8982 * Recommended value: 262 (0.008 samples in Q15 format)
8983 */
8984
8985 int16_t limiter_max_wait;
8986/*< Maximum limiter waiting time in samples.
8987 * Supported values: 0 to 10 \n
8988 * Recommended value: 262 (0.008 samples in Q15 format)
8989 */
8990} __packed;
8991
8992/* DRC configuration structure for each sub-band of an MBDRC module. */
8993
8994
8995/* Payload of the #ASM_PARAM_ID_MBDRC_CONFIG_PARAMS DRC
8996 * configuration parameters for each sub-band in the MBDRC module.
8997 * After this DRC structure is configured for valid bands, the next
8998 * MBDRC setparams expects the sequence of sub-band MBDRC filter
8999 * coefficients (the length depends on the number of bands) plus the
9000 * mute flag for that band plus uint16_t padding.
9001 *
9002 * @keep{10}
9003 * The filter coefficient and mute flag are of type int16_t:
9004 * - FIR coefficient = int16_t firFilter
9005 * - Mute flag = int16_t fMuteFlag
9006 *
9007 * The sequence is as follows:
9008 * - 1 band = 0 FIR coefficient + 1 mute flag + uint16_t padding
9009 * - 2 bands = 97 FIR coefficients + 2 mute flags + uint16_t padding
9010 * - 3 bands = 97+33 FIR coefficients + 3 mute flags + uint16_t padding
9011 * - 4 bands = 97+33+33 FIR coefficients + 4 mute flags + uint16_t padding
9012 * - 5 bands = 97+33+33+33 FIR coefficients + 5 mute flags + uint16_t padding
9013 *
9014 * For improved filterbank, the sequence is as follows:
9015 * - 1 band = 0 FIR coefficient + 1 mute flag + uint16_t padding
9016 * - 2 bands = 141 FIR coefficients + 2 mute flags + uint16_t padding
9017 * - 3 bands = 141+81 FIR coefficients + 3 mute flags + uint16_t padding
9018 * - 4 bands = 141+81+61 FIR coefficients + 4 mute flags + uint16_t padding
9019 * - 5 bands = 141+81+61+61 FIR coefficients + 5 mute flags + uint16_t padding
9020 */
9021struct asm_subband_drc_config_params {
9022 int16_t drc_stereo_linked_flag;
9023/*< Specifies whether all stereo channels have the same applied
9024 * dynamics (1) or if they process their dynamics independently (0).
9025 * Supported values:
9026 * - 0 -- Not linked
9027 * - 1 -- Linked
9028 */
9029
9030 int16_t drc_mode;
9031/*< Specifies whether DRC mode is bypassed for sub-bands.
9032 * Supported values:
9033 * - 0 -- Disabled
9034 * - 1 -- Enabled
9035 */
9036
9037 int16_t drc_down_sample_level;
9038/*< DRC down sample level.
9039 * Supported values: @ge 1
9040 */
9041
9042 int16_t drc_delay;
9043/*< DRC delay in samples.
9044 * Supported values: 0 to 1200
9045 */
9046
9047 uint16_t drc_rmsime_avg_const;
9048/*< RMS signal energy time-averaging constant.
9049 * Supported values: 0 to 2^16-1
9050 */
9051
9052 uint16_t drc_makeup_gain;
9053/*< DRC makeup gain in decibels.
9054 * Supported values: 258 to 64917
9055 */
9056 /* Down expander settings */
9057 int16_t down_expdrhreshold;
9058/*< Down expander threshold.
9059 * Supported Q7 format values: 1320 to up_cmpsrhreshold
9060 */
9061
9062 int16_t down_expdr_slope;
9063/*< Down expander slope.
9064 * Supported Q8 format values: -32768 to 0.
9065 */
9066
9067 uint32_t down_expdr_attack;
9068/*< Down expander attack constant.
9069 * Supported Q31 format values: 196844 to 2^31.
9070 */
9071
9072 uint32_t down_expdr_release;
9073/*< Down expander release constant.
9074 * Supported Q31 format values: 19685 to 2^31
9075 */
9076
9077 uint16_t down_expdr_hysteresis;
9078/*< Down expander hysteresis constant.
9079 * Supported Q14 format values: 1 to 32690
9080 */
9081
9082 uint16_t reserved;
9083 /*< Clients must set this field to zero. */
9084
9085 int32_t down_expdr_min_gain_db;
9086/*< Down expander minimum gain.
9087 * Supported Q23 format values: -805306368 to 0.
9088 */
9089
9090 /* Up compressor settings */
9091
9092 int16_t up_cmpsrhreshold;
9093/*< Up compressor threshold.
9094 * Supported Q7 format values: down_expdrhreshold to
9095 * down_cmpsrhreshold.
9096 */
9097
9098 uint16_t up_cmpsr_slope;
9099/*< Up compressor slope.
9100 * Supported Q16 format values: 0 to 64881.
9101 */
9102
9103 uint32_t up_cmpsr_attack;
9104/*< Up compressor attack constant.
9105 * Supported Q31 format values: 196844 to 2^31.
9106 */
9107
9108 uint32_t up_cmpsr_release;
9109/*< Up compressor release constant.
9110 * Supported Q31 format values: 19685 to 2^31.
9111 */
9112
9113 uint16_t up_cmpsr_hysteresis;
9114/*< Up compressor hysteresis constant.
9115 * Supported Q14 format values: 1 to 32690.
9116 */
9117
9118 /* Down compressor settings */
9119
9120 int16_t down_cmpsrhreshold;
9121/*< Down compressor threshold.
9122 * Supported Q7 format values: up_cmpsrhreshold to 11560.
9123 */
9124
9125 uint16_t down_cmpsr_slope;
9126/*< Down compressor slope.
9127 * Supported Q16 format values: 0 to 64881.
9128 */
9129
9130 uint16_t reserved1;
9131/*< Clients must set this field to zero. */
9132
9133 uint32_t down_cmpsr_attack;
9134/*< Down compressor attack constant.
9135 * Supported Q31 format values: 196844 to 2^31.
9136 */
9137
9138 uint32_t down_cmpsr_release;
9139/*< Down compressor release constant.
9140 * Supported Q31 format values: 19685 to 2^31.
9141 */
9142
9143 uint16_t down_cmpsr_hysteresis;
9144/*< Down compressor hysteresis constant.
9145 * Supported Q14 values: 1 to 32690.
9146 */
9147
9148 uint16_t reserved2;
9149/*< Clients must set this field to zero.*/
9150} __packed;
9151
9152#define ASM_MODULE_ID_EQUALIZER 0x00010C27
9153#define ASM_PARAM_ID_EQUALIZER_PARAMETERS 0x00010C28
9154
9155#define ASM_MAX_EQ_BANDS 12
9156
9157struct asm_eq_per_band_params {
9158 uint32_t band_idx;
9159/*< Band index.
9160 * Supported values: 0 to 11
9161 */
9162
9163 uint32_t filterype;
9164/*< Type of filter.
9165 * Supported values:
9166 * - #ASM_PARAM_EQYPE_NONE
9167 * - #ASM_PARAM_EQ_BASS_BOOST
9168 * - #ASM_PARAM_EQ_BASS_CUT
9169 * - #ASM_PARAM_EQREBLE_BOOST
9170 * - #ASM_PARAM_EQREBLE_CUT
9171 * - #ASM_PARAM_EQ_BAND_BOOST
9172 * - #ASM_PARAM_EQ_BAND_CUT
9173 */
9174
9175 uint32_t center_freq_hz;
9176 /*< Filter band center frequency in Hertz. */
9177
9178 int32_t filter_gain;
9179/*< Filter band initial gain.
9180 * Supported values: +12 to -12 dB in 1 dB increments
9181 */
9182
9183 int32_t q_factor;
9184/*< Filter band quality factor expressed as a Q8 number, i.e., a
9185 * fixed-point number with q factor of 8. For example, 3000/(2^8).
9186 */
9187} __packed;
9188
9189struct asm_eq_params {
9190 struct apr_hdr hdr;
9191 struct asm_stream_cmd_set_pp_params_v2 param;
9192 struct asm_stream_param_data_v2 data;
9193 uint32_t enable_flag;
9194/*< Specifies whether the equalizer module is disabled (0) or enabled
9195 * (nonzero).
9196 */
9197
9198 uint32_t num_bands;
9199/*< Number of bands.
9200 * Supported values: 1 to 12
9201 */
9202 struct asm_eq_per_band_params eq_bands[ASM_MAX_EQ_BANDS];
9203
9204} __packed;
9205
9206/* No equalizer effect.*/
9207#define ASM_PARAM_EQYPE_NONE 0
9208
9209/* Bass boost equalizer effect.*/
9210#define ASM_PARAM_EQ_BASS_BOOST 1
9211
9212/*Bass cut equalizer effect.*/
9213#define ASM_PARAM_EQ_BASS_CUT 2
9214
9215/* Treble boost equalizer effect */
9216#define ASM_PARAM_EQREBLE_BOOST 3
9217
9218/* Treble cut equalizer effect.*/
9219#define ASM_PARAM_EQREBLE_CUT 4
9220
9221/* Band boost equalizer effect.*/
9222#define ASM_PARAM_EQ_BAND_BOOST 5
9223
9224/* Band cut equalizer effect.*/
9225#define ASM_PARAM_EQ_BAND_CUT 6
9226
9227/* Get & set params */
9228#define VSS_ICOMMON_CMD_SET_PARAM_V2 0x0001133D
9229#define VSS_ICOMMON_CMD_GET_PARAM_V2 0x0001133E
9230#define VSS_ICOMMON_RSP_GET_PARAM 0x00011008
9231
Laxminath Kasam38070be2017-08-17 18:21:59 +05309232#define VSS_MAX_AVCS_NUM_SERVICES 25
9233
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05309234/* ID of the Bass Boost module.
9235 * This module supports the following parameter IDs:
9236 * - #AUDPROC_PARAM_ID_BASS_BOOST_ENABLE
9237 * - #AUDPROC_PARAM_ID_BASS_BOOST_MODE
9238 * - #AUDPROC_PARAM_ID_BASS_BOOST_STRENGTH
9239 */
9240#define AUDPROC_MODULE_ID_BASS_BOOST 0x000108A1
9241/* ID of the Bass Boost enable parameter used by
9242 * AUDPROC_MODULE_ID_BASS_BOOST.
9243 */
9244#define AUDPROC_PARAM_ID_BASS_BOOST_ENABLE 0x000108A2
9245/* ID of the Bass Boost mode parameter used by
9246 * AUDPROC_MODULE_ID_BASS_BOOST.
9247 */
9248#define AUDPROC_PARAM_ID_BASS_BOOST_MODE 0x000108A3
9249/* ID of the Bass Boost strength parameter used by
9250 * AUDPROC_MODULE_ID_BASS_BOOST.
9251 */
9252#define AUDPROC_PARAM_ID_BASS_BOOST_STRENGTH 0x000108A4
9253
9254/* ID of the PBE module.
9255 * This module supports the following parameter IDs:
9256 * - #AUDPROC_PARAM_ID_PBE_ENABLE
9257 * - #AUDPROC_PARAM_ID_PBE_PARAM_CONFIG
9258 */
9259#define AUDPROC_MODULE_ID_PBE 0x00010C2A
9260/* ID of the Bass Boost enable parameter used by
9261 * AUDPROC_MODULE_ID_BASS_BOOST.
9262 */
9263#define AUDPROC_PARAM_ID_PBE_ENABLE 0x00010C2B
9264/* ID of the Bass Boost mode parameter used by
9265 * AUDPROC_MODULE_ID_BASS_BOOST.
9266 */
9267#define AUDPROC_PARAM_ID_PBE_PARAM_CONFIG 0x00010C49
9268
9269/* ID of the Virtualizer module. This module supports the
9270 * following parameter IDs:
9271 * - #AUDPROC_PARAM_ID_VIRTUALIZER_ENABLE
9272 * - #AUDPROC_PARAM_ID_VIRTUALIZER_STRENGTH
9273 * - #AUDPROC_PARAM_ID_VIRTUALIZER_OUT_TYPE
9274 * - #AUDPROC_PARAM_ID_VIRTUALIZER_GAIN_ADJUST
9275 */
9276#define AUDPROC_MODULE_ID_VIRTUALIZER 0x000108A5
9277/* ID of the Virtualizer enable parameter used by
9278 * AUDPROC_MODULE_ID_VIRTUALIZER.
9279 */
9280#define AUDPROC_PARAM_ID_VIRTUALIZER_ENABLE 0x000108A6
9281/* ID of the Virtualizer strength parameter used by
9282 * AUDPROC_MODULE_ID_VIRTUALIZER.
9283 */
9284#define AUDPROC_PARAM_ID_VIRTUALIZER_STRENGTH 0x000108A7
9285/* ID of the Virtualizer out type parameter used by
9286 * AUDPROC_MODULE_ID_VIRTUALIZER.
9287 */
9288#define AUDPROC_PARAM_ID_VIRTUALIZER_OUT_TYPE 0x000108A8
9289/* ID of the Virtualizer out type parameter used by
9290 * AUDPROC_MODULE_ID_VIRTUALIZER.
9291 */
9292#define AUDPROC_PARAM_ID_VIRTUALIZER_GAIN_ADJUST 0x000108A9
9293
9294/* ID of the Reverb module. This module supports the following
9295 * parameter IDs:
9296 * - #AUDPROC_PARAM_ID_REVERB_ENABLE
9297 * - #AUDPROC_PARAM_ID_REVERB_MODE
9298 * - #AUDPROC_PARAM_ID_REVERB_PRESET
9299 * - #AUDPROC_PARAM_ID_REVERB_WET_MIX
9300 * - #AUDPROC_PARAM_ID_REVERB_GAIN_ADJUST
9301 * - #AUDPROC_PARAM_ID_REVERB_ROOM_LEVEL
9302 * - #AUDPROC_PARAM_ID_REVERB_ROOM_HF_LEVEL
9303 * - #AUDPROC_PARAM_ID_REVERB_DECAY_TIME
9304 * - #AUDPROC_PARAM_ID_REVERB_DECAY_HF_RATIO
9305 * - #AUDPROC_PARAM_ID_REVERB_REFLECTIONS_LEVEL
9306 * - #AUDPROC_PARAM_ID_REVERB_REFLECTIONS_DELAY
9307 * - #AUDPROC_PARAM_ID_REVERB_LEVEL
9308 * - #AUDPROC_PARAM_ID_REVERB_DELAY
9309 * - #AUDPROC_PARAM_ID_REVERB_DIFFUSION
9310 * - #AUDPROC_PARAM_ID_REVERB_DENSITY
9311 */
9312#define AUDPROC_MODULE_ID_REVERB 0x000108AA
9313/* ID of the Reverb enable parameter used by
9314 * AUDPROC_MODULE_ID_REVERB.
9315 */
9316#define AUDPROC_PARAM_ID_REVERB_ENABLE 0x000108AB
9317/* ID of the Reverb mode parameter used by
9318 * AUDPROC_MODULE_ID_REVERB.
9319 */
9320#define AUDPROC_PARAM_ID_REVERB_MODE 0x000108AC
9321/* ID of the Reverb preset parameter used by
9322 * AUDPROC_MODULE_ID_REVERB.
9323 */
9324#define AUDPROC_PARAM_ID_REVERB_PRESET 0x000108AD
9325/* ID of the Reverb wet mix parameter used by
9326 * AUDPROC_MODULE_ID_REVERB.
9327 */
9328#define AUDPROC_PARAM_ID_REVERB_WET_MIX 0x000108AE
9329/* ID of the Reverb gain adjust parameter used by
9330 * AUDPROC_MODULE_ID_REVERB.
9331 */
9332#define AUDPROC_PARAM_ID_REVERB_GAIN_ADJUST 0x000108AF
9333/* ID of the Reverb room level parameter used by
9334 * AUDPROC_MODULE_ID_REVERB.
9335 */
9336#define AUDPROC_PARAM_ID_REVERB_ROOM_LEVEL 0x000108B0
9337/* ID of the Reverb room hf level parameter used by
9338 * AUDPROC_MODULE_ID_REVERB.
9339 */
9340#define AUDPROC_PARAM_ID_REVERB_ROOM_HF_LEVEL 0x000108B1
9341/* ID of the Reverb decay time parameter used by
9342 * AUDPROC_MODULE_ID_REVERB.
9343 */
9344#define AUDPROC_PARAM_ID_REVERB_DECAY_TIME 0x000108B2
9345/* ID of the Reverb decay hf ratio parameter used by
9346 * AUDPROC_MODULE_ID_REVERB.
9347 */
9348#define AUDPROC_PARAM_ID_REVERB_DECAY_HF_RATIO 0x000108B3
9349/* ID of the Reverb reflections level parameter used by
9350 * AUDPROC_MODULE_ID_REVERB.
9351 */
9352#define AUDPROC_PARAM_ID_REVERB_REFLECTIONS_LEVEL 0x000108B4
9353/* ID of the Reverb reflections delay parameter used by
9354 * AUDPROC_MODULE_ID_REVERB.
9355 */
9356#define AUDPROC_PARAM_ID_REVERB_REFLECTIONS_DELAY 0x000108B5
9357/* ID of the Reverb level parameter used by
9358 * AUDPROC_MODULE_ID_REVERB.
9359 */
9360#define AUDPROC_PARAM_ID_REVERB_LEVEL 0x000108B6
9361/* ID of the Reverb delay parameter used by
9362 * AUDPROC_MODULE_ID_REVERB.
9363 */
9364#define AUDPROC_PARAM_ID_REVERB_DELAY 0x000108B7
9365/* ID of the Reverb diffusion parameter used by
9366 * AUDPROC_MODULE_ID_REVERB.
9367 */
9368#define AUDPROC_PARAM_ID_REVERB_DIFFUSION 0x000108B8
9369/* ID of the Reverb density parameter used by
9370 * AUDPROC_MODULE_ID_REVERB.
9371 */
9372#define AUDPROC_PARAM_ID_REVERB_DENSITY 0x000108B9
9373
9374/* ID of the Popless Equalizer module. This module supports the
9375 * following parameter IDs:
9376 * - #AUDPROC_PARAM_ID_EQ_ENABLE
9377 * - #AUDPROC_PARAM_ID_EQ_CONFIG
9378 * - #AUDPROC_PARAM_ID_EQ_NUM_BANDS
9379 * - #AUDPROC_PARAM_ID_EQ_BAND_LEVELS
9380 * - #AUDPROC_PARAM_ID_EQ_BAND_LEVEL_RANGE
9381 * - #AUDPROC_PARAM_ID_EQ_BAND_FREQS
9382 * - #AUDPROC_PARAM_ID_EQ_SINGLE_BAND_FREQ_RANGE
9383 * - #AUDPROC_PARAM_ID_EQ_SINGLE_BAND_FREQ
9384 * - #AUDPROC_PARAM_ID_EQ_BAND_INDEX
9385 * - #AUDPROC_PARAM_ID_EQ_PRESET_ID
9386 * - #AUDPROC_PARAM_ID_EQ_NUM_PRESETS
9387 * - #AUDPROC_PARAM_ID_EQ_GET_PRESET_NAME
9388 */
9389#define AUDPROC_MODULE_ID_POPLESS_EQUALIZER 0x000108BA
9390/* ID of the Popless Equalizer enable parameter used by
9391 * AUDPROC_MODULE_ID_POPLESS_EQUALIZER.
9392 */
9393#define AUDPROC_PARAM_ID_EQ_ENABLE 0x000108BB
9394/* ID of the Popless Equalizer config parameter used by
9395 * AUDPROC_MODULE_ID_POPLESS_EQUALIZER.
9396 */
9397#define AUDPROC_PARAM_ID_EQ_CONFIG 0x000108BC
9398/* ID of the Popless Equalizer number of bands parameter used
9399 * by AUDPROC_MODULE_ID_POPLESS_EQUALIZER. This param ID is
9400 * used for get param only.
9401 */
9402#define AUDPROC_PARAM_ID_EQ_NUM_BANDS 0x000108BD
9403/* ID of the Popless Equalizer band levels parameter used by
9404 * AUDPROC_MODULE_ID_POPLESS_EQUALIZER. This param ID is
9405 * used for get param only.
9406 */
9407#define AUDPROC_PARAM_ID_EQ_BAND_LEVELS 0x000108BE
9408/* ID of the Popless Equalizer band level range parameter used
9409 * by AUDPROC_MODULE_ID_POPLESS_EQUALIZER. This param ID is
9410 * used for get param only.
9411 */
9412#define AUDPROC_PARAM_ID_EQ_BAND_LEVEL_RANGE 0x000108BF
9413/* ID of the Popless Equalizer band frequencies parameter used
9414 * by AUDPROC_MODULE_ID_POPLESS_EQUALIZER. This param ID is
9415 * used for get param only.
9416 */
9417#define AUDPROC_PARAM_ID_EQ_BAND_FREQS 0x000108C0
9418/* ID of the Popless Equalizer single band frequency range
9419 * parameter used by AUDPROC_MODULE_ID_POPLESS_EQUALIZER.
9420 * This param ID is used for get param only.
9421 */
9422#define AUDPROC_PARAM_ID_EQ_SINGLE_BAND_FREQ_RANGE 0x000108C1
9423/* ID of the Popless Equalizer single band frequency parameter
9424 * used by AUDPROC_MODULE_ID_POPLESS_EQUALIZER. This param ID
9425 * is used for set param only.
9426 */
9427#define AUDPROC_PARAM_ID_EQ_SINGLE_BAND_FREQ 0x000108C2
9428/* ID of the Popless Equalizer band index parameter used by
9429 * AUDPROC_MODULE_ID_POPLESS_EQUALIZER.
9430 */
9431#define AUDPROC_PARAM_ID_EQ_BAND_INDEX 0x000108C3
9432/* ID of the Popless Equalizer preset id parameter used by
9433 * AUDPROC_MODULE_ID_POPLESS_EQUALIZER. This param ID is used
9434 * for get param only.
9435 */
9436#define AUDPROC_PARAM_ID_EQ_PRESET_ID 0x000108C4
9437/* ID of the Popless Equalizer number of presets parameter used
9438 * by AUDPROC_MODULE_ID_POPLESS_EQUALIZER. This param ID is used
9439 * for get param only.
9440 */
9441#define AUDPROC_PARAM_ID_EQ_NUM_PRESETS 0x000108C5
9442/* ID of the Popless Equalizer preset name parameter used by
9443 * AUDPROC_MODULE_ID_POPLESS_EQUALIZER. This param ID is used
9444 * for get param only.
9445 */
9446#define AUDPROC_PARAM_ID_EQ_PRESET_NAME 0x000108C6
9447
9448/* Set Q6 topologies */
9449#define ASM_CMD_ADD_TOPOLOGIES 0x00010DBE
9450#define ADM_CMD_ADD_TOPOLOGIES 0x00010335
9451#define AFE_CMD_ADD_TOPOLOGIES 0x000100f8
9452/* structure used for both ioctls */
9453struct cmd_set_topologies {
9454 struct apr_hdr hdr;
9455 u32 payload_addr_lsw;
9456 /* LSW of parameter data payload address.*/
9457 u32 payload_addr_msw;
9458 /* MSW of parameter data payload address.*/
9459 u32 mem_map_handle;
9460 /* Memory map handle returned by mem map command */
9461 u32 payload_size;
9462 /* Size in bytes of the variable payload in shared memory */
9463} __packed;
9464
9465/* This module represents the Rx processing of Feedback speaker protection.
9466 * It contains the excursion control, thermal protection,
9467 * analog clip manager features in it.
9468 * This module id will support following param ids.
9469 * - AFE_PARAM_ID_FBSP_MODE_RX_CFG
9470 */
9471
9472#define AFE_MODULE_FB_SPKR_PROT_RX 0x0001021C
9473#define AFE_MODULE_FB_SPKR_PROT_V2_RX 0x0001025F
Xiaojun Sang12120ab2017-09-28 18:21:21 +08009474#define AFE_PARAM_ID_SP_RX_LIMITER_TH 0x000102B1
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05309475#define AFE_PARAM_ID_FBSP_MODE_RX_CFG 0x0001021D
9476#define AFE_PARAM_ID_FBSP_PTONE_RAMP_CFG 0x00010260
9477
9478struct asm_fbsp_mode_rx_cfg {
9479 uint32_t minor_version;
9480 uint32_t mode;
9481} __packed;
9482
9483/* This module represents the VI processing of feedback speaker protection.
9484 * It will receive Vsens and Isens from codec and generates necessary
9485 * parameters needed by Rx processing.
9486 * This module id will support following param ids.
9487 * - AFE_PARAM_ID_SPKR_CALIB_VI_PROC_CFG
9488 * - AFE_PARAM_ID_CALIB_RES_CFG
9489 * - AFE_PARAM_ID_FEEDBACK_PATH_CFG
9490 */
9491
9492#define AFE_MODULE_FB_SPKR_PROT_VI_PROC 0x00010226
9493#define AFE_MODULE_FB_SPKR_PROT_VI_PROC_V2 0x0001026A
9494
9495#define AFE_PARAM_ID_SPKR_CALIB_VI_PROC_CFG 0x0001022A
9496#define AFE_PARAM_ID_SPKR_CALIB_VI_PROC_CFG_V2 0x0001026B
9497
9498struct asm_spkr_calib_vi_proc_cfg {
9499 uint32_t minor_version;
9500 uint32_t operation_mode;
9501 uint32_t r0_t0_selection_flag[SP_V2_NUM_MAX_SPKR];
9502 int32_t r0_cali_q24[SP_V2_NUM_MAX_SPKR];
9503 int16_t t0_cali_q6[SP_V2_NUM_MAX_SPKR];
9504 uint32_t quick_calib_flag;
9505} __packed;
9506
9507#define AFE_PARAM_ID_CALIB_RES_CFG 0x0001022B
9508#define AFE_PARAM_ID_CALIB_RES_CFG_V2 0x0001026E
9509
9510struct asm_calib_res_cfg {
9511 uint32_t minor_version;
9512 int32_t r0_cali_q24[SP_V2_NUM_MAX_SPKR];
9513 uint32_t th_vi_ca_state;
9514} __packed;
9515
9516#define AFE_PARAM_ID_FEEDBACK_PATH_CFG 0x0001022C
9517#define AFE_MODULE_FEEDBACK 0x00010257
9518
9519struct asm_feedback_path_cfg {
9520 uint32_t minor_version;
9521 int32_t dst_portid;
9522 int32_t num_channels;
9523 int32_t chan_info[4];
9524} __packed;
9525
9526#define AFE_PARAM_ID_MODE_VI_PROC_CFG 0x00010227
9527
9528struct asm_mode_vi_proc_cfg {
9529 uint32_t minor_version;
9530 uint32_t cal_mode;
9531} __packed;
9532
9533#define AFE_MODULE_SPEAKER_PROTECTION_V2_TH_VI 0x0001026A
9534#define AFE_PARAM_ID_SP_V2_TH_VI_MODE_CFG 0x0001026B
9535#define AFE_PARAM_ID_SP_V2_TH_VI_FTM_CFG 0x0001029F
9536#define AFE_PARAM_ID_SP_V2_TH_VI_FTM_PARAMS 0x000102A0
9537
9538struct afe_sp_th_vi_mode_cfg {
9539 uint32_t minor_version;
9540 uint32_t operation_mode;
9541 /*
9542 * Operation mode of thermal VI module.
9543 * 0 -- Normal Running mode
9544 * 1 -- Calibration mode
9545 * 2 -- FTM mode
9546 */
9547 uint32_t r0t0_selection_flag[SP_V2_NUM_MAX_SPKR];
9548 /*
9549 * Specifies which set of R0, T0 values the algorithm will use.
9550 * This field is valid only in Normal mode (operation_mode = 0).
9551 * 0 -- Use calibrated R0, T0 value
9552 * 1 -- Use safe R0, T0 value
9553 */
9554 int32_t r0_cali_q24[SP_V2_NUM_MAX_SPKR];
9555 /*
9556 * Calibration point resistance per device. This field is valid
9557 * only in Normal mode (operation_mode = 0).
9558 * values 33554432 to 1073741824 Ohms (in Q24 format)
9559 */
9560 int16_t t0_cali_q6[SP_V2_NUM_MAX_SPKR];
9561 /*
9562 * Calibration point temperature per device. This field is valid
9563 * in both Normal mode and Calibration mode.
9564 * values -1920 to 5120 degrees C (in Q6 format)
9565 */
9566 uint32_t quick_calib_flag;
9567 /*
9568 * Indicates whether calibration is to be done in quick mode or not.
9569 * This field is valid only in Calibration mode (operation_mode = 1).
9570 * 0 -- Disabled
9571 * 1 -- Enabled
9572 */
9573} __packed;
9574
9575struct afe_sp_th_vi_ftm_cfg {
9576 uint32_t minor_version;
9577 uint32_t wait_time_ms[SP_V2_NUM_MAX_SPKR];
9578 /*
9579 * Wait time to heat up speaker before collecting statistics
9580 * for ftm mode in ms.
9581 * values 0 to 4294967295 ms
9582 */
9583 uint32_t ftm_time_ms[SP_V2_NUM_MAX_SPKR];
9584 /*
9585 * duration for which FTM statistics are collected in ms.
9586 * values 0 to 2000 ms
9587 */
9588} __packed;
9589
9590struct afe_sp_th_vi_ftm_params {
9591 uint32_t minor_version;
9592 int32_t dc_res_q24[SP_V2_NUM_MAX_SPKR];
9593 /*
9594 * DC resistance value in q24 format
9595 * values 0 to 2147483647 Ohms (in Q24 format)
9596 */
9597 int32_t temp_q22[SP_V2_NUM_MAX_SPKR];
9598 /*
9599 * temperature value in q22 format
9600 * values -125829120 to 2147483647 degC (in Q22 format)
9601 */
9602 uint32_t status[SP_V2_NUM_MAX_SPKR];
9603 /*
9604 * FTM packet status
9605 * 0 - Incorrect operation mode.This status is returned
9606 * when GET_PARAM is called in non FTM Mode
9607 * 1 - Inactive mode -- Port is not yet started.
9608 * 2 - Wait state. wait_time_ms has not yet elapsed
9609 * 3 - In progress state. ftm_time_ms has not yet elapsed.
9610 * 4 - Success.
9611 * 5 - Failed.
9612 */
9613} __packed;
9614
9615struct afe_sp_th_vi_get_param {
9616 struct apr_hdr hdr;
9617 struct afe_port_cmd_get_param_v2 get_param;
9618 struct afe_port_param_data_v2 pdata;
9619 struct afe_sp_th_vi_ftm_params param;
9620} __packed;
9621
9622struct afe_sp_th_vi_get_param_resp {
9623 uint32_t status;
9624 struct afe_port_param_data_v2 pdata;
9625 struct afe_sp_th_vi_ftm_params param;
9626} __packed;
9627
9628
9629#define AFE_MODULE_SPEAKER_PROTECTION_V2_EX_VI 0x0001026F
9630#define AFE_PARAM_ID_SP_V2_EX_VI_MODE_CFG 0x000102A1
9631#define AFE_PARAM_ID_SP_V2_EX_VI_FTM_CFG 0x000102A2
9632#define AFE_PARAM_ID_SP_V2_EX_VI_FTM_PARAMS 0x000102A3
9633
9634struct afe_sp_ex_vi_mode_cfg {
9635 uint32_t minor_version;
9636 uint32_t operation_mode;
9637 /*
9638 * Operation mode of Excursion VI module.
9639 * 0 - Normal Running mode
9640 * 2 - FTM mode
9641 */
9642} __packed;
9643
9644struct afe_sp_ex_vi_ftm_cfg {
9645 uint32_t minor_version;
9646 uint32_t wait_time_ms[SP_V2_NUM_MAX_SPKR];
9647 /*
9648 * Wait time to heat up speaker before collecting statistics
9649 * for ftm mode in ms.
9650 * values 0 to 4294967295 ms
9651 */
9652 uint32_t ftm_time_ms[SP_V2_NUM_MAX_SPKR];
9653 /*
9654 * duration for which FTM statistics are collected in ms.
9655 * values 0 to 2000 ms
9656 */
9657} __packed;
9658
9659struct afe_sp_ex_vi_ftm_params {
9660 uint32_t minor_version;
9661 int32_t freq_q20[SP_V2_NUM_MAX_SPKR];
9662 /*
9663 * Resonance frequency in q20 format
9664 * values 0 to 2147483647 Hz (in Q20 format)
9665 */
9666 int32_t resis_q24[SP_V2_NUM_MAX_SPKR];
9667 /*
9668 * Mechanical resistance in q24 format
9669 * values 0 to 2147483647 Ohms (in Q24 format)
9670 */
9671 int32_t qmct_q24[SP_V2_NUM_MAX_SPKR];
9672 /*
9673 * Mechanical Qfactor in q24 format
9674 * values 0 to 2147483647 (in Q24 format)
9675 */
9676 uint32_t status[SP_V2_NUM_MAX_SPKR];
9677 /*
9678 * FTM packet status
9679 * 0 - Incorrect operation mode.This status is returned
9680 * when GET_PARAM is called in non FTM Mode.
9681 * 1 - Inactive mode -- Port is not yet started.
9682 * 2 - Wait state. wait_time_ms has not yet elapsed
9683 * 3 - In progress state. ftm_time_ms has not yet elapsed.
9684 * 4 - Success.
9685 * 5 - Failed.
9686 */
9687} __packed;
9688
9689struct afe_sp_ex_vi_get_param {
9690 struct apr_hdr hdr;
9691 struct afe_port_cmd_get_param_v2 get_param;
9692 struct afe_port_param_data_v2 pdata;
9693 struct afe_sp_ex_vi_ftm_params param;
9694} __packed;
9695
9696struct afe_sp_ex_vi_get_param_resp {
9697 uint32_t status;
9698 struct afe_port_param_data_v2 pdata;
9699 struct afe_sp_ex_vi_ftm_params param;
9700} __packed;
9701
Xiaojun Sang12120ab2017-09-28 18:21:21 +08009702struct afe_sp_rx_limiter_th_param {
9703 uint32_t minor_version;
9704 uint32_t lim_thr_per_calib_q27[SP_V2_NUM_MAX_SPKR];
9705} __packed;
9706
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05309707union afe_spkr_prot_config {
9708 struct asm_fbsp_mode_rx_cfg mode_rx_cfg;
9709 struct asm_spkr_calib_vi_proc_cfg vi_proc_cfg;
9710 struct asm_feedback_path_cfg feedback_path_cfg;
9711 struct asm_mode_vi_proc_cfg mode_vi_proc_cfg;
9712 struct afe_sp_th_vi_mode_cfg th_vi_mode_cfg;
9713 struct afe_sp_th_vi_ftm_cfg th_vi_ftm_cfg;
9714 struct afe_sp_ex_vi_mode_cfg ex_vi_mode_cfg;
9715 struct afe_sp_ex_vi_ftm_cfg ex_vi_ftm_cfg;
Xiaojun Sang12120ab2017-09-28 18:21:21 +08009716 struct afe_sp_rx_limiter_th_param limiter_th_cfg;
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05309717} __packed;
9718
9719struct afe_spkr_prot_config_command {
9720 struct apr_hdr hdr;
9721 struct afe_port_cmd_set_param_v2 param;
9722 struct afe_port_param_data_v2 pdata;
9723 union afe_spkr_prot_config prot_config;
9724} __packed;
9725
9726struct afe_spkr_prot_get_vi_calib {
9727 struct apr_hdr hdr;
9728 struct afe_port_cmd_get_param_v2 get_param;
9729 struct afe_port_param_data_v2 pdata;
9730 struct asm_calib_res_cfg res_cfg;
9731} __packed;
9732
9733struct afe_spkr_prot_calib_get_resp {
9734 uint32_t status;
9735 struct afe_port_param_data_v2 pdata;
9736 struct asm_calib_res_cfg res_cfg;
9737} __packed;
9738
9739
9740/* SRS TRUMEDIA start */
9741/* topology */
9742#define SRS_TRUMEDIA_TOPOLOGY_ID 0x00010D90
9743/* module */
9744#define SRS_TRUMEDIA_MODULE_ID 0x10005010
9745/* parameters */
9746#define SRS_TRUMEDIA_PARAMS 0x10005011
9747#define SRS_TRUMEDIA_PARAMS_WOWHD 0x10005012
9748#define SRS_TRUMEDIA_PARAMS_CSHP 0x10005013
9749#define SRS_TRUMEDIA_PARAMS_HPF 0x10005014
9750#define SRS_TRUMEDIA_PARAMS_AEQ 0x10005015
9751#define SRS_TRUMEDIA_PARAMS_HL 0x10005016
9752#define SRS_TRUMEDIA_PARAMS_GEQ 0x10005017
9753
9754#define SRS_ID_GLOBAL 0x00000001
9755#define SRS_ID_WOWHD 0x00000002
9756#define SRS_ID_CSHP 0x00000003
9757#define SRS_ID_HPF 0x00000004
9758#define SRS_ID_AEQ 0x00000005
9759#define SRS_ID_HL 0x00000006
9760#define SRS_ID_GEQ 0x00000007
9761
9762#define SRS_CMD_UPLOAD 0x7FFF0000
9763#define SRS_PARAM_OFFSET_MASK 0x3FFF0000
9764#define SRS_PARAM_VALUE_MASK 0x0000FFFF
9765
9766struct srs_trumedia_params_GLOBAL {
9767 uint8_t v1;
9768 uint8_t v2;
9769 uint8_t v3;
9770 uint8_t v4;
9771 uint8_t v5;
9772 uint8_t v6;
9773 uint8_t v7;
9774 uint8_t v8;
9775 uint16_t v9;
9776} __packed;
9777
9778struct srs_trumedia_params_WOWHD {
9779 uint32_t v1;
9780 uint16_t v2;
9781 uint16_t v3;
9782 uint16_t v4;
9783 uint16_t v5;
9784 uint16_t v6;
9785 uint16_t v7;
9786 uint16_t v8;
9787 uint16_t v____A1;
9788 uint32_t v9;
9789 uint16_t v10;
9790 uint16_t v11;
9791 uint32_t v12[16];
9792 uint32_t v13[16];
9793 uint32_t v14[16];
9794 uint32_t v15[16];
9795 uint32_t v16;
9796 uint16_t v17;
9797 uint16_t v18;
9798} __packed;
9799
9800struct srs_trumedia_params_CSHP {
9801 uint32_t v1;
9802 uint16_t v2;
9803 uint16_t v3;
9804 uint16_t v4;
9805 uint16_t v5;
9806 uint16_t v6;
9807 uint16_t v____A1;
9808 uint32_t v7;
9809 uint16_t v8;
9810 uint16_t v9;
9811 uint32_t v10[16];
9812} __packed;
9813
9814struct srs_trumedia_params_HPF {
9815 uint32_t v1;
9816 uint32_t v2[26];
9817} __packed;
9818
9819struct srs_trumedia_params_AEQ {
9820 uint32_t v1;
9821 uint16_t v2;
9822 uint16_t v3;
9823 uint16_t v4;
9824 uint16_t v____A1;
9825 uint32_t v5[74];
9826 uint32_t v6[74];
9827 uint16_t v7[2048];
9828} __packed;
9829
9830struct srs_trumedia_params_HL {
9831 uint16_t v1;
9832 uint16_t v2;
9833 uint16_t v3;
9834 uint16_t v____A1;
9835 int32_t v4;
9836 uint32_t v5;
9837 uint16_t v6;
9838 uint16_t v____A2;
9839 uint32_t v7;
9840} __packed;
9841
9842struct srs_trumedia_params_GEQ {
9843 int16_t v1[10];
9844} __packed;
9845struct srs_trumedia_params {
9846 struct srs_trumedia_params_GLOBAL global;
9847 struct srs_trumedia_params_WOWHD wowhd;
9848 struct srs_trumedia_params_CSHP cshp;
9849 struct srs_trumedia_params_HPF hpf;
9850 struct srs_trumedia_params_AEQ aeq;
9851 struct srs_trumedia_params_HL hl;
9852 struct srs_trumedia_params_GEQ geq;
9853} __packed;
9854/* SRS TruMedia end */
9855
9856#define AUDPROC_PARAM_ID_ENABLE 0x00010904
9857#define ASM_STREAM_POSTPROC_TOPO_ID_SA_PLUS 0x1000FFFF
9858/* DTS Eagle */
9859#define AUDPROC_MODULE_ID_DTS_HPX_PREMIX 0x0001077C
9860#define AUDPROC_MODULE_ID_DTS_HPX_POSTMIX 0x0001077B
9861#define ASM_STREAM_POSTPROC_TOPO_ID_DTS_HPX 0x00010DED
9862#define ASM_STREAM_POSTPROC_TOPO_ID_HPX_PLUS 0x10015000
9863#define ASM_STREAM_POSTPROC_TOPO_ID_HPX_MASTER 0x10015001
9864struct asm_dts_eagle_param {
9865 struct apr_hdr hdr;
9866 struct asm_stream_cmd_set_pp_params_v2 param;
9867 struct asm_stream_param_data_v2 data;
9868} __packed;
9869
9870struct asm_dts_eagle_param_get {
9871 struct apr_hdr hdr;
9872 struct asm_stream_cmd_get_pp_params_v2 param;
9873} __packed;
9874
9875/* Opcode to set BT address and license for aptx decoder */
9876#define APTX_DECODER_BT_ADDRESS 0x00013201
9877#define APTX_CLASSIC_DEC_LICENSE_ID 0x00013202
9878
9879struct aptx_dec_bt_addr_cfg {
9880 uint32_t lap;
9881 uint32_t uap;
9882 uint32_t nap;
9883} __packed;
9884
9885struct aptx_dec_bt_dev_addr {
9886 struct apr_hdr hdr;
9887 struct asm_stream_cmd_set_encdec_param encdec;
9888 struct aptx_dec_bt_addr_cfg bt_addr_cfg;
9889} __packed;
9890
9891struct asm_aptx_dec_fmt_blk_v2 {
9892 struct apr_hdr hdr;
9893 struct asm_data_cmd_media_fmt_update_v2 fmtblk;
9894 u32 sample_rate;
9895/* Number of samples per second.
9896 * Supported values: 44100 and 48000 Hz
9897 */
9898} __packed;
9899
Laxminath Kasam38070be2017-08-17 18:21:59 +05309900/* Q6Core Specific */
9901#define AVCS_CMD_GET_FWK_VERSION (0x0001292C)
9902#define AVCS_CMDRSP_GET_FWK_VERSION (0x0001292D)
9903
9904#define AVCS_SERVICE_ID_ALL (0xFFFFFFFF)
Raja Mallike1b2f792018-06-01 13:17:36 +05309905#define AVCS_SERVICE_ID_AFE (0x4)
Laxminath Kasam38070be2017-08-17 18:21:59 +05309906#define APRV2_IDS_SERVICE_ID_ADSP_CVP_V (0xB)
9907
9908struct avcs_get_fwk_version {
9909 /*
9910 * Indicates the major version of the AVS build.
9911 * This value is incremented on chipset family boundaries.
9912 */
9913 uint32_t build_major_version;
9914
9915 /*
9916 * Minor version of the AVS build.
9917 * This value represents the mainline to which the AVS build belongs.
9918 */
9919 uint32_t build_minor_version;
9920
9921 /* Indicates the AVS branch version to which the image belongs. */
9922 uint32_t build_branch_version;
9923
9924 /* Indicates the AVS sub-branch or customer product line information. */
9925 uint32_t build_subbranch_version;
9926
9927 /* Number of supported AVS services in the current build. */
9928 uint32_t num_services;
9929};
9930
9931struct avs_svc_api_info {
9932 /*
9933 * APRV2 service IDs for the individual static services.
9934 *
9935 * @values
9936 * - APRV2_IDS_SERVICE_ID_ADSP_CORE_V
9937 * - APRV2_IDS_SERVICE_ID_ADSP_AFE_V
9938 * - APRV2_IDS_SERVICE_ID_ADSP_ASM_V
9939 * - APRV2_IDS_SERVICE_ID_ADSP_ADM_V
9940 * - APRV2_IDS_SERVICE_ID_ADSP_MVM_V
9941 * - APRV2_IDS_SERVICE_ID_ADSP_CVS_V
9942 * - APRV2_IDS_SERVICE_ID_ADSP_CVP_V
9943 * - APRV2_IDS_SERVICE_ID_ADSP_LSM_V
9944 */
9945 uint32_t service_id;
9946
9947 /*
9948 * Indicates the API version of the service.
9949 *
9950 * Each new API update that warrants a change on the HLOS side triggers
9951 * an increment in the version.
9952 */
9953 uint32_t api_version;
9954
9955 /*
9956 * Indicates the API increments on a sub-branch (not on the mainline).
9957 *
9958 * API branch version numbers can increment independently on different
9959 * sub-branches.
9960 */
9961 uint32_t api_branch_version;
9962};
9963
9964struct avcs_fwk_ver_info {
9965 struct avcs_get_fwk_version avcs_fwk_version;
Siena Richard2d0102d2017-09-05 11:15:45 -07009966 struct avs_svc_api_info services[0];
Laxminath Kasam38070be2017-08-17 18:21:59 +05309967} __packed;
9968
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05309969/* LSM Specific */
9970#define VW_FEAT_DIM (39)
9971
Dieter Lueckinga8b8e3b2018-09-28 14:29:17 +02009972#define APRV2_IDS_SERVICE_ID_ADSP_ASM_V (0x7)
9973#define APRV2_IDS_SERVICE_ID_ADSP_ADM_V (0x8)
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05309974#define APRV2_IDS_SERVICE_ID_ADSP_LSM_V (0xD)
9975#define APRV2_IDS_DOMAIN_ID_ADSP_V (0x4)
9976#define APRV2_IDS_DOMAIN_ID_APPS_V (0x5)
9977
9978#define LSM_SESSION_CMD_SHARED_MEM_MAP_REGIONS (0x00012A7F)
9979#define LSM_SESSION_CMDRSP_SHARED_MEM_MAP_REGIONS (0x00012A80)
9980#define LSM_SESSION_CMD_SHARED_MEM_UNMAP_REGIONS (0x00012A81)
9981#define LSM_SESSION_CMD_OPEN_TX (0x00012A82)
9982#define LSM_SESSION_CMD_CLOSE_TX (0x00012A88)
9983#define LSM_SESSION_CMD_SET_PARAMS (0x00012A83)
9984#define LSM_SESSION_CMD_SET_PARAMS_V2 (0x00012A8F)
9985#define LSM_SESSION_CMD_REGISTER_SOUND_MODEL (0x00012A84)
9986#define LSM_SESSION_CMD_DEREGISTER_SOUND_MODEL (0x00012A85)
9987#define LSM_SESSION_CMD_START (0x00012A86)
9988#define LSM_SESSION_CMD_STOP (0x00012A87)
9989#define LSM_SESSION_CMD_EOB (0x00012A89)
9990#define LSM_SESSION_CMD_READ (0x00012A8A)
9991#define LSM_SESSION_CMD_OPEN_TX_V2 (0x00012A8B)
9992#define LSM_CMD_ADD_TOPOLOGIES (0x00012A8C)
9993
9994#define LSM_SESSION_EVENT_DETECTION_STATUS (0x00012B00)
9995#define LSM_SESSION_EVENT_DETECTION_STATUS_V2 (0x00012B01)
9996#define LSM_DATA_EVENT_READ_DONE (0x00012B02)
9997#define LSM_DATA_EVENT_STATUS (0x00012B03)
9998#define LSM_SESSION_EVENT_DETECTION_STATUS_V3 (0x00012B04)
9999
10000#define LSM_MODULE_ID_VOICE_WAKEUP (0x00012C00)
10001#define LSM_PARAM_ID_ENDPOINT_DETECT_THRESHOLD (0x00012C01)
10002#define LSM_PARAM_ID_OPERATION_MODE (0x00012C02)
10003#define LSM_PARAM_ID_GAIN (0x00012C03)
10004#define LSM_PARAM_ID_CONNECT_TO_PORT (0x00012C04)
10005#define LSM_PARAM_ID_FEATURE_COMPENSATION_DATA (0x00012C07)
10006#define LSM_PARAM_ID_MIN_CONFIDENCE_LEVELS (0x00012C07)
10007#define LSM_MODULE_ID_LAB (0x00012C08)
10008#define LSM_PARAM_ID_LAB_ENABLE (0x00012C09)
10009#define LSM_PARAM_ID_LAB_CONFIG (0x00012C0A)
10010#define LSM_MODULE_ID_FRAMEWORK (0x00012C0E)
10011#define LSM_PARAM_ID_SWMAD_CFG (0x00012C18)
10012#define LSM_PARAM_ID_SWMAD_MODEL (0x00012C19)
10013#define LSM_PARAM_ID_SWMAD_ENABLE (0x00012C1A)
10014#define LSM_PARAM_ID_POLLING_ENABLE (0x00012C1B)
10015#define LSM_PARAM_ID_MEDIA_FMT (0x00012C1E)
10016#define LSM_PARAM_ID_FWK_MODE_CONFIG (0x00012C27)
10017
10018/* HW MAD specific */
10019#define AFE_MODULE_HW_MAD (0x00010230)
10020#define AFE_PARAM_ID_HW_MAD_CFG (0x00010231)
10021#define AFE_PARAM_ID_HW_MAD_CTRL (0x00010232)
10022#define AFE_PARAM_ID_SLIMBUS_SLAVE_PORT_CFG (0x00010233)
10023
10024/* SW MAD specific */
10025#define AFE_MODULE_SW_MAD (0x0001022D)
10026#define AFE_PARAM_ID_SW_MAD_CFG (0x0001022E)
10027#define AFE_PARAM_ID_SVM_MODEL (0x0001022F)
10028
10029/* Commands/Params to pass the codec/slimbus data to DSP */
10030#define AFE_SVC_CMD_SET_PARAM (0x000100f3)
10031#define AFE_MODULE_CDC_DEV_CFG (0x00010234)
10032#define AFE_PARAM_ID_CDC_SLIMBUS_SLAVE_CFG (0x00010235)
10033#define AFE_PARAM_ID_CDC_REG_CFG (0x00010236)
10034#define AFE_PARAM_ID_CDC_REG_CFG_INIT (0x00010237)
10035#define AFE_PARAM_ID_CDC_REG_PAGE_CFG (0x00010296)
10036
10037#define AFE_MAX_CDC_REGISTERS_TO_CONFIG (20)
10038
10039/* AANC Port Config Specific */
10040#define AFE_PARAM_ID_AANC_PORT_CONFIG (0x00010215)
10041#define AFE_API_VERSION_AANC_PORT_CONFIG (0x1)
10042#define AANC_TX_MIC_UNUSED (0)
10043#define AANC_TX_VOICE_MIC (1)
10044#define AANC_TX_ERROR_MIC (2)
10045#define AANC_TX_NOISE_MIC (3)
10046#define AFE_PORT_MAX_CHANNEL_CNT (8)
10047#define AFE_MODULE_AANC (0x00010214)
10048#define AFE_PARAM_ID_CDC_AANC_VERSION (0x0001023A)
10049#define AFE_API_VERSION_CDC_AANC_VERSION (0x1)
10050#define AANC_HW_BLOCK_VERSION_1 (1)
10051#define AANC_HW_BLOCK_VERSION_2 (2)
10052
10053/*Clip bank selection*/
10054#define AFE_API_VERSION_CLIP_BANK_SEL_CFG 0x1
10055#define AFE_CLIP_MAX_BANKS 4
10056#define AFE_PARAM_ID_CLIP_BANK_SEL_CFG 0x00010242
10057
10058struct afe_param_aanc_port_cfg {
10059 /* Minor version used for tracking the version of the module's
10060 * source port configuration.
10061 */
10062 uint32_t aanc_port_cfg_minor_version;
10063
10064 /* Sampling rate of the source Tx port. 8k - 192k*/
10065 uint32_t tx_port_sample_rate;
10066
10067 /* Channel mapping for the Tx port signal carrying Noise (X),
10068 * Error (E), and Voice (V) signals.
10069 */
10070 uint8_t tx_port_channel_map[AFE_PORT_MAX_CHANNEL_CNT];
10071
10072 /* Number of channels on the source Tx port. */
10073 uint16_t tx_port_num_channels;
10074
10075 /* Port ID of the Rx path reference signal. */
10076 uint16_t rx_path_ref_port_id;
10077
10078 /* Sampling rate of the reference port. 8k - 192k*/
10079 uint32_t ref_port_sample_rate;
10080} __packed;
10081
10082struct afe_param_id_cdc_aanc_version {
10083 /* Minor version used for tracking the version of the module's
10084 * hw version
10085 */
10086 uint32_t cdc_aanc_minor_version;
10087
10088 /* HW version. */
10089 uint32_t aanc_hw_version;
10090} __packed;
10091
10092struct afe_param_id_clip_bank_sel {
10093 /* Minor version used for tracking the version of the module's
10094 * hw version
10095 */
10096 uint32_t minor_version;
10097
10098 /* Number of banks to be read */
10099 uint32_t num_banks;
10100
10101 uint32_t bank_map[AFE_CLIP_MAX_BANKS];
10102} __packed;
10103
10104/* ERROR CODES */
10105/* Success. The operation completed with no errors. */
10106#define ADSP_EOK 0x00000000
10107/* General failure. */
10108#define ADSP_EFAILED 0x00000001
10109/* Bad operation parameter. */
10110#define ADSP_EBADPARAM 0x00000002
10111/* Unsupported routine or operation. */
10112#define ADSP_EUNSUPPORTED 0x00000003
10113/* Unsupported version. */
10114#define ADSP_EVERSION 0x00000004
10115/* Unexpected problem encountered. */
10116#define ADSP_EUNEXPECTED 0x00000005
10117/* Unhandled problem occurred. */
10118#define ADSP_EPANIC 0x00000006
10119/* Unable to allocate resource. */
10120#define ADSP_ENORESOURCE 0x00000007
10121/* Invalid handle. */
10122#define ADSP_EHANDLE 0x00000008
10123/* Operation is already processed. */
10124#define ADSP_EALREADY 0x00000009
10125/* Operation is not ready to be processed. */
10126#define ADSP_ENOTREADY 0x0000000A
10127/* Operation is pending completion. */
10128#define ADSP_EPENDING 0x0000000B
10129/* Operation could not be accepted or processed. */
10130#define ADSP_EBUSY 0x0000000C
10131/* Operation aborted due to an error. */
10132#define ADSP_EABORTED 0x0000000D
10133/* Operation preempted by a higher priority. */
10134#define ADSP_EPREEMPTED 0x0000000E
10135/* Operation requests intervention to complete. */
10136#define ADSP_ECONTINUE 0x0000000F
10137/* Operation requests immediate intervention to complete. */
10138#define ADSP_EIMMEDIATE 0x00000010
10139/* Operation is not implemented. */
10140#define ADSP_ENOTIMPL 0x00000011
10141/* Operation needs more data or resources. */
10142#define ADSP_ENEEDMORE 0x00000012
10143/* Operation does not have memory. */
10144#define ADSP_ENOMEMORY 0x00000014
10145/* Item does not exist. */
10146#define ADSP_ENOTEXIST 0x00000015
10147/* Max count for adsp error code sent to HLOS*/
10148#define ADSP_ERR_MAX (ADSP_ENOTEXIST + 1)
10149/* Operation is finished. */
10150#define ADSP_ETERMINATED 0x00011174
10151
10152/*bharath, adsp_error_codes.h */
10153
10154/* LPASS clock for I2S Interface */
10155
10156/* Supported OSR clock values */
10157#define Q6AFE_LPASS_OSR_CLK_12_P288_MHZ 0xBB8000
10158#define Q6AFE_LPASS_OSR_CLK_11_P2896_MHZ 0xAC4400
10159#define Q6AFE_LPASS_OSR_CLK_9_P600_MHZ 0x927C00
10160#define Q6AFE_LPASS_OSR_CLK_8_P192_MHZ 0x7D0000
10161#define Q6AFE_LPASS_OSR_CLK_6_P144_MHZ 0x5DC000
10162#define Q6AFE_LPASS_OSR_CLK_4_P096_MHZ 0x3E8000
10163#define Q6AFE_LPASS_OSR_CLK_3_P072_MHZ 0x2EE000
10164#define Q6AFE_LPASS_OSR_CLK_2_P048_MHZ 0x1F4000
10165#define Q6AFE_LPASS_OSR_CLK_1_P536_MHZ 0x177000
10166#define Q6AFE_LPASS_OSR_CLK_1_P024_MHZ 0xFA000
10167#define Q6AFE_LPASS_OSR_CLK_768_kHZ 0xBB800
10168#define Q6AFE_LPASS_OSR_CLK_512_kHZ 0x7D000
10169#define Q6AFE_LPASS_OSR_CLK_DISABLE 0x0
10170
10171/* Supported Bit clock values */
10172#define Q6AFE_LPASS_IBIT_CLK_12_P288_MHZ 0xBB8000
10173#define Q6AFE_LPASS_IBIT_CLK_11_P2896_MHZ 0xAC4400
10174#define Q6AFE_LPASS_IBIT_CLK_8_P192_MHZ 0x7D0000
10175#define Q6AFE_LPASS_IBIT_CLK_6_P144_MHZ 0x5DC000
10176#define Q6AFE_LPASS_IBIT_CLK_4_P096_MHZ 0x3E8000
10177#define Q6AFE_LPASS_IBIT_CLK_3_P072_MHZ 0x2EE000
10178#define Q6AFE_LPASS_IBIT_CLK_2_P8224_MHZ 0x2b1100
10179#define Q6AFE_LPASS_IBIT_CLK_2_P048_MHZ 0x1F4000
10180#define Q6AFE_LPASS_IBIT_CLK_1_P536_MHZ 0x177000
10181#define Q6AFE_LPASS_IBIT_CLK_1_P4112_MHZ 0x158880
10182#define Q6AFE_LPASS_IBIT_CLK_1_P024_MHZ 0xFA000
10183#define Q6AFE_LPASS_IBIT_CLK_768_KHZ 0xBB800
10184#define Q6AFE_LPASS_IBIT_CLK_512_KHZ 0x7D000
10185#define Q6AFE_LPASS_IBIT_CLK_256_KHZ 0x3E800
10186#define Q6AFE_LPASS_IBIT_CLK_DISABLE 0x0
10187
10188/* Supported LPASS CLK sources */
10189#define Q6AFE_LPASS_CLK_SRC_EXTERNAL 0
10190#define Q6AFE_LPASS_CLK_SRC_INTERNAL 1
10191
10192/* Supported LPASS CLK root*/
10193#define Q6AFE_LPASS_CLK_ROOT_DEFAULT 0
10194
10195enum afe_lpass_clk_mode {
10196 Q6AFE_LPASS_MODE_BOTH_INVALID,
10197 Q6AFE_LPASS_MODE_CLK1_VALID,
10198 Q6AFE_LPASS_MODE_CLK2_VALID,
10199 Q6AFE_LPASS_MODE_BOTH_VALID,
10200} __packed;
10201
10202/* Clock ID Enumeration Define. */
10203/* Clock ID for Primary I2S IBIT */
10204#define Q6AFE_LPASS_CLK_ID_PRI_MI2S_IBIT 0x100
10205/* Clock ID for Primary I2S EBIT */
10206#define Q6AFE_LPASS_CLK_ID_PRI_MI2S_EBIT 0x101
10207/* Clock ID for Secondary I2S IBIT */
10208#define Q6AFE_LPASS_CLK_ID_SEC_MI2S_IBIT 0x102
10209/* Clock ID for Secondary I2S EBIT */
10210#define Q6AFE_LPASS_CLK_ID_SEC_MI2S_EBIT 0x103
10211/* Clock ID for Tertiary I2S IBIT */
10212#define Q6AFE_LPASS_CLK_ID_TER_MI2S_IBIT 0x104
10213/* Clock ID for Tertiary I2S EBIT */
10214#define Q6AFE_LPASS_CLK_ID_TER_MI2S_EBIT 0x105
10215/* Clock ID for Quartnery I2S IBIT */
10216#define Q6AFE_LPASS_CLK_ID_QUAD_MI2S_IBIT 0x106
10217/* Clock ID for Quartnery I2S EBIT */
10218#define Q6AFE_LPASS_CLK_ID_QUAD_MI2S_EBIT 0x107
10219/* Clock ID for Speaker I2S IBIT */
10220#define Q6AFE_LPASS_CLK_ID_SPEAKER_I2S_IBIT 0x108
10221/* Clock ID for Speaker I2S EBIT */
10222#define Q6AFE_LPASS_CLK_ID_SPEAKER_I2S_EBIT 0x109
10223/* Clock ID for Speaker I2S OSR */
10224#define Q6AFE_LPASS_CLK_ID_SPEAKER_I2S_OSR 0x10A
10225
10226/* Clock ID for QUINARY I2S IBIT */
10227#define Q6AFE_LPASS_CLK_ID_QUI_MI2S_IBIT 0x10B
10228/* Clock ID for QUINARY I2S EBIT */
10229#define Q6AFE_LPASS_CLK_ID_QUI_MI2S_EBIT 0x10C
10230/* Clock ID for SENARY I2S IBIT */
10231#define Q6AFE_LPASS_CLK_ID_SEN_MI2S_IBIT 0x10D
10232/* Clock ID for SENARY I2S EBIT */
10233#define Q6AFE_LPASS_CLK_ID_SEN_MI2S_EBIT 0x10E
10234/* Clock ID for INT0 I2S IBIT */
10235#define Q6AFE_LPASS_CLK_ID_INT0_MI2S_IBIT 0x10F
10236/* Clock ID for INT1 I2S IBIT */
10237#define Q6AFE_LPASS_CLK_ID_INT1_MI2S_IBIT 0x110
10238/* Clock ID for INT2 I2S IBIT */
10239#define Q6AFE_LPASS_CLK_ID_INT2_MI2S_IBIT 0x111
10240/* Clock ID for INT3 I2S IBIT */
10241#define Q6AFE_LPASS_CLK_ID_INT3_MI2S_IBIT 0x112
10242/* Clock ID for INT4 I2S IBIT */
10243#define Q6AFE_LPASS_CLK_ID_INT4_MI2S_IBIT 0x113
10244/* Clock ID for INT5 I2S IBIT */
10245#define Q6AFE_LPASS_CLK_ID_INT5_MI2S_IBIT 0x114
10246/* Clock ID for INT6 I2S IBIT */
10247#define Q6AFE_LPASS_CLK_ID_INT6_MI2S_IBIT 0x115
10248
Rohit Kumara5077932017-09-10 22:05:05 +053010249/* Clock ID for QUINARY MI2S OSR CLK */
10250#define Q6AFE_LPASS_CLK_ID_QUI_MI2S_OSR 0x116
10251
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +053010252/* Clock ID for Primary PCM IBIT */
10253#define Q6AFE_LPASS_CLK_ID_PRI_PCM_IBIT 0x200
10254/* Clock ID for Primary PCM EBIT */
10255#define Q6AFE_LPASS_CLK_ID_PRI_PCM_EBIT 0x201
10256/* Clock ID for Secondary PCM IBIT */
10257#define Q6AFE_LPASS_CLK_ID_SEC_PCM_IBIT 0x202
10258/* Clock ID for Secondary PCM EBIT */
10259#define Q6AFE_LPASS_CLK_ID_SEC_PCM_EBIT 0x203
10260/* Clock ID for Tertiary PCM IBIT */
10261#define Q6AFE_LPASS_CLK_ID_TER_PCM_IBIT 0x204
10262/* Clock ID for Tertiary PCM EBIT */
10263#define Q6AFE_LPASS_CLK_ID_TER_PCM_EBIT 0x205
10264/* Clock ID for Quartery PCM IBIT */
10265#define Q6AFE_LPASS_CLK_ID_QUAD_PCM_IBIT 0x206
10266/* Clock ID for Quartery PCM EBIT */
10267#define Q6AFE_LPASS_CLK_ID_QUAD_PCM_EBIT 0x207
Rohit Kumara5077932017-09-10 22:05:05 +053010268/* Clock ID for Quinary PCM IBIT */
10269#define Q6AFE_LPASS_CLK_ID_QUIN_PCM_IBIT 0x208
10270/* Clock ID for Quinary PCM EBIT */
10271#define Q6AFE_LPASS_CLK_ID_QUIN_PCM_EBIT 0x209
10272/* Clock ID for QUINARY PCM OSR */
10273#define Q6AFE_LPASS_CLK_ID_QUI_PCM_OSR 0x20A
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +053010274
10275/** Clock ID for Primary TDM IBIT */
10276#define Q6AFE_LPASS_CLK_ID_PRI_TDM_IBIT 0x200
10277/** Clock ID for Primary TDM EBIT */
10278#define Q6AFE_LPASS_CLK_ID_PRI_TDM_EBIT 0x201
10279/** Clock ID for Secondary TDM IBIT */
10280#define Q6AFE_LPASS_CLK_ID_SEC_TDM_IBIT 0x202
10281/** Clock ID for Secondary TDM EBIT */
10282#define Q6AFE_LPASS_CLK_ID_SEC_TDM_EBIT 0x203
10283/** Clock ID for Tertiary TDM IBIT */
10284#define Q6AFE_LPASS_CLK_ID_TER_TDM_IBIT 0x204
10285/** Clock ID for Tertiary TDM EBIT */
10286#define Q6AFE_LPASS_CLK_ID_TER_TDM_EBIT 0x205
10287/** Clock ID for Quartery TDM IBIT */
10288#define Q6AFE_LPASS_CLK_ID_QUAD_TDM_IBIT 0x206
10289/** Clock ID for Quartery TDM EBIT */
10290#define Q6AFE_LPASS_CLK_ID_QUAD_TDM_EBIT 0x207
Rohit Kumara5077932017-09-10 22:05:05 +053010291/** Clock ID for Quinary TDM IBIT */
10292#define Q6AFE_LPASS_CLK_ID_QUIN_TDM_IBIT 0x208
10293/** Clock ID for Quinary TDM EBIT */
10294#define Q6AFE_LPASS_CLK_ID_QUIN_TDM_EBIT 0x209
10295/** Clock ID for Quinary TDM OSR */
10296#define Q6AFE_LPASS_CLK_ID_QUIN_TDM_OSR 0x20A
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +053010297
10298/* Clock ID for MCLK1 */
10299#define Q6AFE_LPASS_CLK_ID_MCLK_1 0x300
10300/* Clock ID for MCLK2 */
10301#define Q6AFE_LPASS_CLK_ID_MCLK_2 0x301
10302/* Clock ID for MCLK3 */
10303#define Q6AFE_LPASS_CLK_ID_MCLK_3 0x302
10304/* Clock ID for MCLK4 */
10305#define Q6AFE_LPASS_CLK_ID_MCLK_4 0x304
10306/* Clock ID for Internal Digital Codec Core */
10307#define Q6AFE_LPASS_CLK_ID_INTERNAL_DIGITAL_CODEC_CORE 0x303
10308/* Clock ID for INT MCLK0 */
10309#define Q6AFE_LPASS_CLK_ID_INT_MCLK_0 0x305
10310/* Clock ID for INT MCLK1 */
10311#define Q6AFE_LPASS_CLK_ID_INT_MCLK_1 0x306
10312/*
10313 * Clock ID for soundwire NPL.
10314 * This is the clock to be used to enable NPL clock for internal Soundwire.
10315 */
10316#define AFE_CLOCK_SET_CLOCK_ID_SWR_NPL_CLK 0x307
10317
10318/* Clock ID for AHB HDMI input */
10319#define Q6AFE_LPASS_CLK_ID_AHB_HDMI_INPUT 0x400
10320
10321/* Clock ID for SPDIF core */
10322#define Q6AFE_LPASS_CLK_ID_SPDIF_CORE 0x500
10323
10324
10325/* Clock attribute for invalid use (reserved for internal usage) */
10326#define Q6AFE_LPASS_CLK_ATTRIBUTE_INVALID 0x0
10327/* Clock attribute for no couple case */
10328#define Q6AFE_LPASS_CLK_ATTRIBUTE_COUPLE_NO 0x1
10329/* Clock attribute for dividend couple case */
10330#define Q6AFE_LPASS_CLK_ATTRIBUTE_COUPLE_DIVIDEND 0x2
10331/* Clock attribute for divisor couple case */
10332#define Q6AFE_LPASS_CLK_ATTRIBUTE_COUPLE_DIVISOR 0x3
10333/* Clock attribute for invert and no couple case */
10334#define Q6AFE_LPASS_CLK_ATTRIBUTE_INVERT_COUPLE_NO 0x4
10335/* Clock set API version */
10336#define Q6AFE_LPASS_CLK_CONFIG_API_VERSION 0x1
10337
10338struct afe_clk_set {
10339 /*
10340 * Minor version used for tracking clock set.
10341 * @values #AFE_API_VERSION_CLOCK_SET
10342 */
10343 uint32_t clk_set_minor_version;
10344
10345 /*
10346 * Clock ID
10347 * @values
10348 * - 0x100 to 0x10A - MSM8996
10349 * - 0x200 to 0x207 - MSM8996
10350 * - 0x300 to 0x302 - MSM8996 @tablebulletend
10351 */
10352 uint32_t clk_id;
10353
10354 /*
10355 * Clock frequency (in Hertz) to be set.
10356 * @values
10357 * - >= 0 for clock frequency to set @tablebulletend
10358 */
10359 uint32_t clk_freq_in_hz;
10360
10361 /* Use to specific divider for two clocks if needed.
10362 * Set to Q6AFE_LPASS_CLK_ATTRIBUTE_COUPLE_NO for no divider
10363 * relation clocks
10364 * @values
10365 * - #Q6AFE_LPASS_CLK_ATTRIBUTE_COUPLE_NO
10366 * - #Q6AFE_LPASS_CLK_ATTRIBUTE_COUPLE_DIVIDEND
10367 * - #Q6AFE_LPASS_CLK_ATTRIBUTE_COUPLE_DIVISOR @tablebulletend
10368 */
10369 uint16_t clk_attri;
10370
10371 /*
10372 * Specifies the root clock source.
10373 * Currently, only Q6AFE_LPASS_CLK_ROOT_DEFAULT is valid
10374 * @values
10375 * - 0 @tablebulletend
10376 */
10377 uint16_t clk_root;
10378
10379 /*
10380 * for enable and disable clock.
10381 * "clk_freq_in_hz", "clk_attri", and "clk_root"
10382 * are ignored in disable clock case.
10383 * @values 
10384 * - 0 -- Disabled
10385 * - 1 -- Enabled @tablebulletend
10386 */
10387 uint32_t enable;
10388};
10389
10390struct afe_clk_cfg {
10391/* Minor version used for tracking the version of the I2S
10392 * configuration interface.
10393 * Supported values: #AFE_API_VERSION_I2S_CONFIG
10394 */
10395 u32 i2s_cfg_minor_version;
10396
10397/* clk value 1 in MHz. */
10398 u32 clk_val1;
10399
10400/* clk value 2 in MHz. */
10401 u32 clk_val2;
10402
10403/* clk_src
10404 * #Q6AFE_LPASS_CLK_SRC_EXTERNAL
10405 * #Q6AFE_LPASS_CLK_SRC_INTERNAL
10406 */
10407
10408 u16 clk_src;
10409
10410/* clk_root -0 for default */
10411 u16 clk_root;
10412
10413/* clk_set_mode
10414 * #Q6AFE_LPASS_MODE_BOTH_INVALID
10415 * #Q6AFE_LPASS_MODE_CLK1_VALID
10416 * #Q6AFE_LPASS_MODE_CLK2_VALID
10417 * #Q6AFE_LPASS_MODE_BOTH_VALID
10418 */
10419 u16 clk_set_mode;
10420
10421/* This param id is used to configure I2S clk */
10422 u16 reserved;
10423} __packed;
10424
10425/* This param id is used to configure I2S clk */
10426#define AFE_PARAM_ID_LPAIF_CLK_CONFIG 0x00010238
10427#define AFE_MODULE_CLOCK_SET 0x0001028F
10428#define AFE_PARAM_ID_CLOCK_SET 0x00010290
10429
10430struct afe_lpass_clk_config_command {
10431 struct apr_hdr hdr;
10432 struct afe_port_cmd_set_param_v2 param;
10433 struct afe_port_param_data_v2 pdata;
10434 struct afe_clk_cfg clk_cfg;
10435} __packed;
10436
10437enum afe_lpass_digital_clk_src {
10438 Q6AFE_LPASS_DIGITAL_ROOT_INVALID,
10439 Q6AFE_LPASS_DIGITAL_ROOT_PRI_MI2S_OSR,
10440 Q6AFE_LPASS_DIGITAL_ROOT_SEC_MI2S_OSR,
10441 Q6AFE_LPASS_DIGITAL_ROOT_TER_MI2S_OSR,
10442 Q6AFE_LPASS_DIGITAL_ROOT_QUAD_MI2S_OSR,
10443 Q6AFE_LPASS_DIGITAL_ROOT_CDC_ROOT_CLK,
10444} __packed;
10445
10446/* This param id is used to configure internal clk */
10447#define AFE_PARAM_ID_INTERNAL_DIGIATL_CDC_CLK_CONFIG 0x00010239
10448
10449struct afe_digital_clk_cfg {
10450/* Minor version used for tracking the version of the I2S
10451 * configuration interface.
10452 * Supported values: #AFE_API_VERSION_I2S_CONFIG
10453 */
10454 u32 i2s_cfg_minor_version;
10455
10456/* clk value in MHz. */
10457 u32 clk_val;
10458
10459/* INVALID
10460 * PRI_MI2S_OSR
10461 * SEC_MI2S_OSR
10462 * TER_MI2S_OSR
10463 * QUAD_MI2S_OSR
10464 * DIGT_CDC_ROOT
10465 */
10466 u16 clk_root;
10467
10468/* This field must be set to zero. */
10469 u16 reserved;
10470} __packed;
10471
10472
10473struct afe_lpass_digital_clk_config_command {
10474 struct apr_hdr hdr;
10475 struct afe_port_cmd_set_param_v2 param;
10476 struct afe_port_param_data_v2 pdata;
10477 struct afe_digital_clk_cfg clk_cfg;
10478} __packed;
10479
10480/*
10481 * Opcode for AFE to start DTMF.
10482 */
10483#define AFE_PORTS_CMD_DTMF_CTL 0x00010102
10484
10485/** DTMF payload.*/
10486struct afe_dtmf_generation_command {
10487 struct apr_hdr hdr;
10488
10489 /*
10490 * Duration of the DTMF tone in ms.
10491 * -1 -> continuous,
10492 * 0 -> disable
10493 */
10494 int64_t duration_in_ms;
10495
10496 /*
10497 * The DTMF high tone frequency.
10498 */
10499 uint16_t high_freq;
10500
10501 /*
10502 * The DTMF low tone frequency.
10503 */
10504 uint16_t low_freq;
10505
10506 /*
10507 * The DTMF volume setting
10508 */
10509 uint16_t gain;
10510
10511 /*
10512 * The number of ports to enable/disable on.
10513 */
10514 uint16_t num_ports;
10515
10516 /*
10517 * The Destination ports - array .
10518 * For DTMF on multiple ports, portIds needs to
10519 * be populated numPorts times.
10520 */
10521 uint16_t port_ids;
10522
10523 /*
10524 * variable for 32 bit alignment of APR packet.
10525 */
10526 uint16_t reserved;
10527} __packed;
10528
10529enum afe_config_type {
10530 AFE_SLIMBUS_SLAVE_PORT_CONFIG,
10531 AFE_SLIMBUS_SLAVE_CONFIG,
10532 AFE_CDC_REGISTERS_CONFIG,
10533 AFE_AANC_VERSION,
10534 AFE_CDC_CLIP_REGISTERS_CONFIG,
10535 AFE_CLIP_BANK_SEL,
10536 AFE_CDC_REGISTER_PAGE_CONFIG,
10537 AFE_MAX_CONFIG_TYPES,
10538};
10539
10540struct afe_param_slimbus_slave_port_cfg {
10541 uint32_t minor_version;
10542 uint16_t slimbus_dev_id;
10543 uint16_t slave_dev_pgd_la;
10544 uint16_t slave_dev_intfdev_la;
10545 uint16_t bit_width;
10546 uint16_t data_format;
10547 uint16_t num_channels;
10548 uint16_t slave_port_mapping[AFE_PORT_MAX_AUDIO_CHAN_CNT];
10549} __packed;
10550
10551struct afe_param_cdc_slimbus_slave_cfg {
10552 uint32_t minor_version;
10553 uint32_t device_enum_addr_lsw;
10554 uint32_t device_enum_addr_msw;
10555 uint16_t tx_slave_port_offset;
10556 uint16_t rx_slave_port_offset;
10557} __packed;
10558
10559struct afe_param_cdc_reg_cfg {
10560 uint32_t minor_version;
10561 uint32_t reg_logical_addr;
10562 uint32_t reg_field_type;
10563 uint32_t reg_field_bit_mask;
10564 uint16_t reg_bit_width;
10565 uint16_t reg_offset_scale;
10566} __packed;
10567
10568#define AFE_API_VERSION_CDC_REG_PAGE_CFG 1
10569
10570enum {
10571 AFE_CDC_REG_PAGE_ASSIGN_PROC_ID_0 = 0,
10572 AFE_CDC_REG_PAGE_ASSIGN_PROC_ID_1,
10573 AFE_CDC_REG_PAGE_ASSIGN_PROC_ID_2,
10574 AFE_CDC_REG_PAGE_ASSIGN_PROC_ID_3,
10575};
10576
10577struct afe_param_cdc_reg_page_cfg {
10578 uint32_t minor_version;
10579 uint32_t enable;
10580 uint32_t proc_id;
10581} __packed;
10582
10583struct afe_param_cdc_reg_cfg_data {
10584 uint32_t num_registers;
10585 struct afe_param_cdc_reg_cfg *reg_data;
10586} __packed;
10587
10588struct afe_svc_cmd_set_param {
10589 uint32_t payload_size;
10590 uint32_t payload_address_lsw;
10591 uint32_t payload_address_msw;
10592 uint32_t mem_map_handle;
10593} __packed;
10594
10595struct afe_svc_param_data {
10596 uint32_t module_id;
10597 uint32_t param_id;
10598 uint16_t param_size;
10599 uint16_t reserved;
10600} __packed;
10601
10602struct afe_param_hw_mad_ctrl {
10603 uint32_t minor_version;
10604 uint16_t mad_type;
10605 uint16_t mad_enable;
10606} __packed;
10607
10608struct afe_cmd_hw_mad_ctrl {
10609 struct apr_hdr hdr;
10610 struct afe_port_cmd_set_param_v2 param;
10611 struct afe_port_param_data_v2 pdata;
10612 struct afe_param_hw_mad_ctrl payload;
10613} __packed;
10614
10615struct afe_cmd_hw_mad_slimbus_slave_port_cfg {
10616 struct apr_hdr hdr;
10617 struct afe_port_cmd_set_param_v2 param;
10618 struct afe_port_param_data_v2 pdata;
10619 struct afe_param_slimbus_slave_port_cfg sb_port_cfg;
10620} __packed;
10621
10622struct afe_cmd_sw_mad_enable {
10623 struct apr_hdr hdr;
10624 struct afe_port_cmd_set_param_v2 param;
10625 struct afe_port_param_data_v2 pdata;
10626} __packed;
10627
10628struct afe_param_cdc_reg_cfg_payload {
10629 struct afe_svc_param_data common;
10630 struct afe_param_cdc_reg_cfg reg_cfg;
10631} __packed;
10632
10633struct afe_lpass_clk_config_command_v2 {
10634 struct apr_hdr hdr;
10635 struct afe_svc_cmd_set_param param;
10636 struct afe_svc_param_data pdata;
10637 struct afe_clk_set clk_cfg;
10638} __packed;
10639
10640/*
10641 * reg_data's size can be up to AFE_MAX_CDC_REGISTERS_TO_CONFIG
10642 */
10643struct afe_svc_cmd_cdc_reg_cfg {
10644 struct apr_hdr hdr;
10645 struct afe_svc_cmd_set_param param;
10646 struct afe_param_cdc_reg_cfg_payload reg_data[0];
10647} __packed;
10648
10649struct afe_svc_cmd_init_cdc_reg_cfg {
10650 struct apr_hdr hdr;
10651 struct afe_svc_cmd_set_param param;
10652 struct afe_port_param_data_v2 init;
10653} __packed;
10654
10655struct afe_svc_cmd_sb_slave_cfg {
10656 struct apr_hdr hdr;
10657 struct afe_svc_cmd_set_param param;
10658 struct afe_port_param_data_v2 pdata;
10659 struct afe_param_cdc_slimbus_slave_cfg sb_slave_cfg;
10660} __packed;
10661
10662struct afe_svc_cmd_cdc_reg_page_cfg {
10663 struct apr_hdr hdr;
10664 struct afe_svc_cmd_set_param param;
10665 struct afe_port_param_data_v2 pdata;
10666 struct afe_param_cdc_reg_page_cfg cdc_reg_page_cfg;
10667} __packed;
10668
10669struct afe_svc_cmd_cdc_aanc_version {
10670 struct apr_hdr hdr;
10671 struct afe_svc_cmd_set_param param;
10672 struct afe_port_param_data_v2 pdata;
10673 struct afe_param_id_cdc_aanc_version version;
10674} __packed;
10675
10676struct afe_port_cmd_set_aanc_param {
10677 struct apr_hdr hdr;
10678 struct afe_port_cmd_set_param_v2 param;
10679 struct afe_port_param_data_v2 pdata;
10680 union {
10681 struct afe_param_aanc_port_cfg aanc_port_cfg;
10682 struct afe_mod_enable_param mod_enable;
10683 } __packed data;
10684} __packed;
10685
10686struct afe_port_cmd_set_aanc_acdb_table {
10687 struct apr_hdr hdr;
10688 struct afe_port_cmd_set_param_v2 param;
10689} __packed;
10690
10691/* Dolby DAP topology */
10692#define DOLBY_ADM_COPP_TOPOLOGY_ID 0x0001033B
10693#define DS2_ADM_COPP_TOPOLOGY_ID 0x1301033B
10694
10695/* RMS value from DSP */
10696#define RMS_MODULEID_APPI_PASSTHRU 0x10009011
10697#define RMS_PARAM_FIRST_SAMPLE 0x10009012
10698#define RMS_PAYLOAD_LEN 4
10699
10700/* Customized mixing in matix mixer */
10701#define MTMX_MODULE_ID_DEFAULT_CHMIXER 0x00010341
10702#define DEFAULT_CHMIXER_PARAM_ID_COEFF 0x00010342
10703#define CUSTOM_STEREO_PAYLOAD_SIZE 9
10704#define CUSTOM_STEREO_CMD_PARAM_SIZE 24
10705#define CUSTOM_STEREO_NUM_OUT_CH 0x0002
10706#define CUSTOM_STEREO_NUM_IN_CH 0x0002
10707#define CUSTOM_STEREO_INDEX_PARAM 0x0002
10708#define Q14_GAIN_ZERO_POINT_FIVE 0x2000
10709#define Q14_GAIN_UNITY 0x4000
10710
10711struct afe_svc_cmd_set_clip_bank_selection {
10712 struct apr_hdr hdr;
10713 struct afe_svc_cmd_set_param param;
10714 struct afe_port_param_data_v2 pdata;
10715 struct afe_param_id_clip_bank_sel bank_sel;
10716} __packed;
10717
10718/* Ultrasound supported formats */
10719#define US_POINT_EPOS_FORMAT_V2 0x0001272D
10720#define US_RAW_FORMAT_V2 0x0001272C
10721#define US_PROX_FORMAT_V4 0x0001273B
10722#define US_RAW_SYNC_FORMAT 0x0001272F
10723#define US_GES_SYNC_FORMAT 0x00012730
10724
10725#define AFE_MODULE_GROUP_DEVICE 0x00010254
10726#define AFE_PARAM_ID_GROUP_DEVICE_CFG 0x00010255
10727#define AFE_PARAM_ID_GROUP_DEVICE_ENABLE 0x00010256
10728#define AFE_GROUP_DEVICE_ID_SECONDARY_MI2S_RX 0x1102
10729
10730/* Payload of the #AFE_PARAM_ID_GROUP_DEVICE_CFG
10731 * parameter, which configures max of 8 AFE ports
10732 * into a group.
10733 * The fixed size of this structure is sixteen bytes.
10734 */
10735struct afe_group_device_group_cfg {
10736 u32 minor_version;
10737 u16 group_id;
10738 u16 num_channels;
10739 u16 port_id[8];
10740} __packed;
10741
10742#define AFE_GROUP_DEVICE_ID_PRIMARY_TDM_RX \
10743 (AFE_PORT_ID_PRIMARY_TDM_RX + 0x100)
10744#define AFE_GROUP_DEVICE_ID_PRIMARY_TDM_TX \
10745 (AFE_PORT_ID_PRIMARY_TDM_TX + 0x100)
10746#define AFE_GROUP_DEVICE_ID_SECONDARY_TDM_RX \
10747 (AFE_PORT_ID_SECONDARY_TDM_RX + 0x100)
10748#define AFE_GROUP_DEVICE_ID_SECONDARY_TDM_TX \
10749 (AFE_PORT_ID_SECONDARY_TDM_TX + 0x100)
10750#define AFE_GROUP_DEVICE_ID_TERTIARY_TDM_RX \
10751 (AFE_PORT_ID_TERTIARY_TDM_RX + 0x100)
10752#define AFE_GROUP_DEVICE_ID_TERTIARY_TDM_TX \
10753 (AFE_PORT_ID_TERTIARY_TDM_TX + 0x100)
10754#define AFE_GROUP_DEVICE_ID_QUATERNARY_TDM_RX \
10755 (AFE_PORT_ID_QUATERNARY_TDM_RX + 0x100)
10756#define AFE_GROUP_DEVICE_ID_QUATERNARY_TDM_TX \
10757 (AFE_PORT_ID_QUATERNARY_TDM_TX + 0x100)
Rohit Kumara5077932017-09-10 22:05:05 +053010758#define AFE_GROUP_DEVICE_ID_QUINARY_TDM_RX \
10759 (AFE_PORT_ID_QUINARY_TDM_RX + 0x100)
10760#define AFE_GROUP_DEVICE_ID_QUINARY_TDM_TX \
10761 (AFE_PORT_ID_QUINARY_TDM_TX + 0x100)
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +053010762
10763/* ID of the parameter used by #AFE_MODULE_GROUP_DEVICE to configure the
10764 * group device. #AFE_SVC_CMD_SET_PARAM can use this parameter ID.
10765 *
10766 * Requirements:
10767 * - Configure the group before the member ports in the group are
10768 * configured and started.
10769 * - Enable the group only after it is configured.
10770 * - Stop all member ports in the group before disabling the group.
10771 */
10772#define AFE_PARAM_ID_GROUP_DEVICE_TDM_CONFIG 0x0001029E
10773
10774/* Version information used to handle future additions to
10775 * AFE_PARAM_ID_GROUP_DEVICE_TDM_CONFIG processing (for backward compatibility).
10776 */
10777#define AFE_API_VERSION_GROUP_DEVICE_TDM_CONFIG 0x1
10778
10779/* Number of AFE ports in group device */
10780#define AFE_GROUP_DEVICE_NUM_PORTS 8
10781
10782/* Payload of the AFE_PARAM_ID_GROUP_DEVICE_TDM_CONFIG parameter ID
10783 * used by AFE_MODULE_GROUP_DEVICE.
10784 */
10785struct afe_param_id_group_device_tdm_cfg {
10786 u32 group_device_cfg_minor_version;
10787 /* Minor version used to track group device configuration.
10788 * @values #AFE_API_VERSION_GROUP_DEVICE_TDM_CONFIG
10789 */
10790
10791 u16 group_id;
10792 /* ID for the group device.
10793 * @values
10794 * - #AFE_GROUP_DEVICE_ID_PRIMARY_TDM_RX
10795 * - #AFE_GROUP_DEVICE_ID_PRIMARY_TDM_TX
10796 * - #AFE_GROUP_DEVICE_ID_SECONDARY_TDM_RX
10797 * - #AFE_GROUP_DEVICE_ID_SECONDARY_TDM_TX
10798 * - #AFE_GROUP_DEVICE_ID_TERTIARY_TDM_RX
10799 * - #AFE_GROUP_DEVICE_ID_TERTIARY_TDM_TX
10800 * - #AFE_GROUP_DEVICE_ID_QUATERNARY_TDM_RX
10801 * - #AFE_GROUP_DEVICE_ID_QUATERNARY_TDM_TX
10802 */
10803
10804 u16 reserved;
10805 /* 0 */
10806
10807 u16 port_id[AFE_GROUP_DEVICE_NUM_PORTS];
10808 /* Array of member port IDs of this group.
10809 * @values
10810 * - #AFE_PORT_ID_PRIMARY_TDM_RX
10811 * - #AFE_PORT_ID_PRIMARY_TDM_RX_1
10812 * - #AFE_PORT_ID_PRIMARY_TDM_RX_2
10813 * - #AFE_PORT_ID_PRIMARY_TDM_RX_3
10814 * - #AFE_PORT_ID_PRIMARY_TDM_RX_4
10815 * - #AFE_PORT_ID_PRIMARY_TDM_RX_5
10816 * - #AFE_PORT_ID_PRIMARY_TDM_RX_6
10817 * - #AFE_PORT_ID_PRIMARY_TDM_RX_7
10818
10819 * - #AFE_PORT_ID_PRIMARY_TDM_TX
10820 * - #AFE_PORT_ID_PRIMARY_TDM_TX_1
10821 * - #AFE_PORT_ID_PRIMARY_TDM_TX_2
10822 * - #AFE_PORT_ID_PRIMARY_TDM_TX_3
10823 * - #AFE_PORT_ID_PRIMARY_TDM_TX_4
10824 * - #AFE_PORT_ID_PRIMARY_TDM_TX_5
10825 * - #AFE_PORT_ID_PRIMARY_TDM_TX_6
10826 * - #AFE_PORT_ID_PRIMARY_TDM_TX_7
10827
10828 * - #AFE_PORT_ID_SECONDARY_TDM_RX
10829 * - #AFE_PORT_ID_SECONDARY_TDM_RX_1
10830 * - #AFE_PORT_ID_SECONDARY_TDM_RX_2
10831 * - #AFE_PORT_ID_SECONDARY_TDM_RX_3
10832 * - #AFE_PORT_ID_SECONDARY_TDM_RX_4
10833 * - #AFE_PORT_ID_SECONDARY_TDM_RX_5
10834 * - #AFE_PORT_ID_SECONDARY_TDM_RX_6
10835 * - #AFE_PORT_ID_SECONDARY_TDM_RX_7
10836
10837 * - #AFE_PORT_ID_SECONDARY_TDM_TX
10838 * - #AFE_PORT_ID_SECONDARY_TDM_TX_1
10839 * - #AFE_PORT_ID_SECONDARY_TDM_TX_2
10840 * - #AFE_PORT_ID_SECONDARY_TDM_TX_3
10841 * - #AFE_PORT_ID_SECONDARY_TDM_TX_4
10842 * - #AFE_PORT_ID_SECONDARY_TDM_TX_5
10843 * - #AFE_PORT_ID_SECONDARY_TDM_TX_6
10844 * - #AFE_PORT_ID_SECONDARY_TDM_TX_7
10845
10846 * - #AFE_PORT_ID_TERTIARY_TDM_RX
10847 * - #AFE_PORT_ID_TERTIARY_TDM_RX_1
10848 * - #AFE_PORT_ID_TERTIARY_TDM_RX_2
10849 * - #AFE_PORT_ID_TERTIARY_TDM_RX_3
10850 * - #AFE_PORT_ID_TERTIARY_TDM_RX_4
10851 * - #AFE_PORT_ID_TERTIARY_TDM_RX_5
10852 * - #AFE_PORT_ID_TERTIARY_TDM_RX_6
10853 * - #AFE_PORT_ID_TERTIARY_TDM_RX_7
10854
10855 * - #AFE_PORT_ID_TERTIARY_TDM_TX
10856 * - #AFE_PORT_ID_TERTIARY_TDM_TX_1
10857 * - #AFE_PORT_ID_TERTIARY_TDM_TX_2
10858 * - #AFE_PORT_ID_TERTIARY_TDM_TX_3
10859 * - #AFE_PORT_ID_TERTIARY_TDM_TX_4
10860 * - #AFE_PORT_ID_TERTIARY_TDM_TX_5
10861 * - #AFE_PORT_ID_TERTIARY_TDM_TX_6
10862 * - #AFE_PORT_ID_TERTIARY_TDM_TX_7
10863
10864 * - #AFE_PORT_ID_QUATERNARY_TDM_RX
10865 * - #AFE_PORT_ID_QUATERNARY_TDM_RX_1
10866 * - #AFE_PORT_ID_QUATERNARY_TDM_RX_2
10867 * - #AFE_PORT_ID_QUATERNARY_TDM_RX_3
10868 * - #AFE_PORT_ID_QUATERNARY_TDM_RX_4
10869 * - #AFE_PORT_ID_QUATERNARY_TDM_RX_5
10870 * - #AFE_PORT_ID_QUATERNARY_TDM_RX_6
10871 * - #AFE_PORT_ID_QUATERNARY_TDM_RX_7
10872
10873 * - #AFE_PORT_ID_QUATERNARY_TDM_TX
10874 * - #AFE_PORT_ID_QUATERNARY_TDM_TX_1
10875 * - #AFE_PORT_ID_QUATERNARY_TDM_TX_2
10876 * - #AFE_PORT_ID_QUATERNARY_TDM_TX_3
10877 * - #AFE_PORT_ID_QUATERNARY_TDM_TX_4
10878 * - #AFE_PORT_ID_QUATERNARY_TDM_TX_5
10879 * - #AFE_PORT_ID_QUATERNARY_TDM_TX_6
10880 * - #AFE_PORT_ID_QUATERNARY_TDM_TX_7
10881 * @tablebulletend
10882 */
10883
10884 u32 num_channels;
10885 /* Number of enabled slots for TDM frame.
10886 * @values 1 to 8
10887 */
10888
10889 u32 sample_rate;
10890 /* Sampling rate of the port.
10891 * @values
10892 * - #AFE_PORT_SAMPLE_RATE_8K
10893 * - #AFE_PORT_SAMPLE_RATE_16K
10894 * - #AFE_PORT_SAMPLE_RATE_24K
10895 * - #AFE_PORT_SAMPLE_RATE_32K
10896 * - #AFE_PORT_SAMPLE_RATE_48K @tablebulletend
10897 */
10898
10899 u32 bit_width;
10900 /* Bit width of the sample.
10901 * @values 16, 24, (32)
10902 */
10903
10904 u16 nslots_per_frame;
10905 /* Number of slots per frame. Typical : 1, 2, 4, 8, 16, 32.
10906 * @values 1 - 32
10907 */
10908
10909 u16 slot_width;
10910 /* Slot width of the slot in a TDM frame. (slot_width >= bit_width)
10911 * have to be satisfied.
10912 * @values 16, 24, 32
10913 */
10914
10915 u32 slot_mask;
10916 /* Position of active slots. When that bit is set, that paricular
10917 * slot is active.
10918 * Number of active slots can be inferred by number of bits set in
10919 * the mask. Only 8 individual bits can be enabled.
10920 * Bits 0..31 corresponding to slot 0..31
10921 * @values 1 to 2^32 -1
10922 */
10923} __packed;
10924
10925/* Payload of the #AFE_PARAM_ID_GROUP_DEVICE_ENABLE
10926 * parameter, which enables or
10927 * disables any module.
10928 * The fixed size of this structure is four bytes.
10929 */
10930
10931struct afe_group_device_enable {
10932 u16 group_id;
10933 /* valid value is AFE_GROUP_DEVICE_ID_SECONDARY_MI2S_RX */
10934 u16 enable;
10935 /* Enables (1) or disables (0) the module. */
10936} __packed;
10937
10938union afe_port_group_config {
10939 struct afe_group_device_group_cfg group_cfg;
10940 struct afe_group_device_enable group_enable;
10941 struct afe_param_id_group_device_tdm_cfg tdm_cfg;
10942} __packed;
10943
10944struct afe_port_group_create {
10945 struct apr_hdr hdr;
10946 struct afe_svc_cmd_set_param param;
10947 struct afe_port_param_data_v2 pdata;
10948 union afe_port_group_config data;
10949} __packed;
10950
10951/* ID of the parameter used by #AFE_MODULE_AUDIO_DEV_INTERFACE to specify
10952 * the timing statistics of the corresponding device interface.
10953 * Client can periodically query for the device time statistics to help adjust
10954 * the PLL based on the drift value. The get param command must be sent to
10955 * AFE port ID corresponding to device interface
10956
10957 * This parameter ID supports following get param commands:
10958 * #AFE_PORT_CMD_GET_PARAM_V2 and
10959 * #AFE_PORT_CMD_GET_PARAM_V3.
10960 */
10961#define AFE_PARAM_ID_DEV_TIMING_STATS 0x000102AD
10962
10963/* Version information used to handle future additions to AFE device
10964 * interface timing statistics (for backward compatibility).
10965 */
10966#define AFE_API_VERSION_DEV_TIMING_STATS 0x1
10967
10968/* Enumeration for specifying a sink(Rx) device */
10969#define AFE_SINK_DEVICE 0x0
10970
10971/* Enumeration for specifying a source(Tx) device */
10972#define AFE_SOURCE_DEVICE 0x1
10973
10974/* Enumeration for specifying the drift reference is of type AV Timer */
10975#define AFE_REF_TIMER_TYPE_AVTIMER 0x0
10976
10977/* Message payload structure for the
10978 * AFE_PARAM_ID_DEV_TIMING_STATS parameter.
10979 */
10980struct afe_param_id_dev_timing_stats {
10981 /* Minor version used to track the version of device interface timing
10982 * statistics. Currently, the supported version is 1.
10983 * @values #AFE_API_VERSION_DEV_TIMING_STATS
10984 */
10985 u32 minor_version;
10986
10987 /* Indicates the device interface direction as either
10988 * source (Tx) or sink (Rx).
10989 * @values
10990 * #AFE_SINK_DEVICE
10991 * #AFE_SOURCE_DEVICE
10992 */
10993 u16 device_direction;
10994
10995 /* Reference timer for drift accumulation and time stamp information.
10996 * @values
10997 * #AFE_REF_TIMER_TYPE_AVTIMER @tablebulletend
10998 */
10999 u16 reference_timer;
11000
11001 /*
11002 * Flag to indicate if resync is required on the client side for
11003 * drift correction. Flag is set to TRUE for the first get_param
11004 * response after device interface starts. This flag value can be
11005 * used by client to identify if device interface restart has
11006 * happened and if any re-sync is required at their end for drift
11007 * correction.
11008 * @values
11009 * 0: FALSE (Resync not required)
11010 * 1: TRUE (Resync required) @tablebulletend
11011 */
11012 u32 resync_flag;
11013
11014 /* Accumulated drift value in microseconds. This value is updated
11015 * every 100th ms.
11016 * Positive drift value indicates AV timer is running faster than device
11017 * Negative drift value indicates AV timer is running slower than device
11018 * @values Any valid int32 number
11019 */
11020 s32 acc_drift_value;
11021
11022 /* Lower 32 bits of the 64-bit absolute timestamp of reference
11023 * timer in microseconds.
11024
11025 * This timestamp corresponds to the time when the drift values
11026 * are accumlated for every 100th ms.
11027 * @values Any valid uint32 number
11028 */
11029 u32 ref_timer_abs_ts_lsw;
11030
11031 /* Upper 32 bits of the 64-bit absolute timestamp of reference
11032 * timer in microseconds.
11033 * This timestamp corresponds to the time when the drift values
11034 * are accumlated for every 100th ms.
11035 * @values Any valid uint32 number
11036 */
11037 u32 ref_timer_abs_ts_msw;
11038} __packed;
11039
11040struct afe_av_dev_drift_get_param {
11041 struct apr_hdr hdr;
11042 struct afe_port_cmd_get_param_v2 get_param;
11043 struct afe_port_param_data_v2 pdata;
11044 struct afe_param_id_dev_timing_stats timing_stats;
11045} __packed;
11046
11047struct afe_av_dev_drift_get_param_resp {
11048 uint32_t status;
11049 struct afe_port_param_data_v2 pdata;
11050 struct afe_param_id_dev_timing_stats timing_stats;
11051} __packed;
11052
11053/* Command for Matrix or Stream Router */
11054#define ASM_SESSION_CMD_SET_MTMX_STRTR_PARAMS_V2 0x00010DCE
11055/* Module for AVSYNC */
11056#define ASM_SESSION_MTMX_STRTR_MODULE_ID_AVSYNC 0x00010DC6
11057
11058/* Parameter used by #ASM_SESSION_MTMX_STRTR_MODULE_ID_AVSYNC to specify the
11059 * render window start value. This parameter is supported only for a Set
11060 * command (not a Get command) in the Rx direction
11061 * (#ASM_SESSION_CMD_SET_MTMX_STRTR_PARAMS_V2).
11062 * Render window start is a value (session time minus timestamp, or ST-TS)
11063 * below which frames are held, and after which frames are immediately
11064 * rendered.
11065 */
11066#define ASM_SESSION_MTMX_STRTR_PARAM_RENDER_WINDOW_START_V2 0x00010DD1
11067
11068/* Parameter used by #ASM_SESSION_MTMX_STRTR_MODULE_ID_AVSYNC to specify the
11069 * render window end value. This parameter is supported only for a Set
11070 * command (not a Get command) in the Rx direction
11071 * (#ASM_SESSION_CMD_SET_MTMX_STRTR_PARAMS_V2). Render window end is a value
11072 * (session time minus timestamp) above which frames are dropped, and below
11073 * which frames are immediately rendered.
11074 */
11075#define ASM_SESSION_MTMX_STRTR_PARAM_RENDER_WINDOW_END_V2 0x00010DD2
11076
11077/* Generic payload of the window parameters in the
11078 * #ASM_SESSION_MTMX_STRTR_MODULE_ID_AVSYNC module.
11079 * This payload is supported only for a Set command
11080 * (not a Get command) on the Rx path.
11081 */
11082struct asm_session_mtmx_strtr_param_window_v2_t {
11083 u32 window_lsw;
11084 /* Lower 32 bits of the render window start value. */
11085
11086 u32 window_msw;
11087 /* Upper 32 bits of the render window start value.
11088 *
11089 * The 64-bit number formed by window_lsw and window_msw specifies a
11090 * signed 64-bit window value in microseconds. The sign extension is
11091 * necessary. This value is used by the following parameter IDs:
11092 * #ASM_SESSION_MTMX_STRTR_PARAM_RENDER_WINDOW_START_V2
11093 * #ASM_SESSION_MTMX_STRTR_PARAM_RENDER_WINDOW_END_V2
11094 * #ASM_SESSION_MTMX_STRTR_PARAM_STAT_WINDOW_START_V2
11095 * #ASM_SESSION_MTMX_STRTR_PARAM_STAT_WINDOW_END_V2
11096 * The value depends on which parameter ID is used.
11097 * The aDSP honors the windows at a granularity of 1 ms.
11098 */
11099};
11100
11101struct asm_session_cmd_set_mtmx_strstr_params_v2 {
11102 uint32_t data_payload_addr_lsw;
11103 /* Lower 32 bits of the 64-bit data payload address. */
11104
11105 uint32_t data_payload_addr_msw;
11106 /* Upper 32 bits of the 64-bit data payload address.
11107 * If the address is not sent (NULL), the message is in the payload.
11108 * If the address is sent (non-NULL), the parameter data payloads
11109 * begin at the specified address.
11110 */
11111
11112 uint32_t mem_map_handle;
11113 /* Unique identifier for an address. This memory map handle is returned
11114 * by the aDSP through the #ASM_CMD_SHARED_MEM_MAP_REGIONS command.
11115 * values
11116 * - NULL -- Parameter data payloads are within the message payload
11117 * (in-band).
11118 * - Non-NULL -- Parameter data payloads begin at the address specified
11119 * in the data_payload_addr_lsw and data_payload_addr_msw fields
11120 * (out-of-band).
11121 */
11122
11123 uint32_t data_payload_size;
11124 /* Actual size of the variable payload accompanying the message, or in
11125 * shared memory. This field is used for parsing the parameter payload.
11126 * values > 0 bytes
11127 */
11128
11129 uint32_t direction;
11130 /* Direction of the entity (matrix mixer or stream router) on which
11131 * the parameter is to be set.
11132 * values
11133 * - 0 -- Rx (for Rx stream router or Rx matrix mixer)
11134 * - 1 -- Tx (for Tx stream router or Tx matrix mixer)
11135 */
11136};
11137
11138/* Parameter used by #ASM_SESSION_MTMX_STRTR_MODULE_ID_AVSYNC which allows the
11139 * audio client choose the rendering decision that the audio DSP should use.
11140 */
11141#define ASM_SESSION_MTMX_STRTR_PARAM_RENDER_MODE_CMD 0x00012F0D
11142
11143/* Indicates that rendering decision will be based on default rate
11144 * (session clock based rendering, device driven).
11145 * 1. The default session clock based rendering is inherently driven
11146 * by the timing of the device.
11147 * 2. After the initial decision is made (first buffer after a run
11148 * command), subsequent data rendering decisions are made with
11149 * respect to the rate at which the device is rendering, thus deriving
11150 * its timing from the device.
11151 * 3. While this decision making is simple, it has some inherent limitations
11152 * (mentioned in the next section).
11153 * 4. If this API is not set, the session clock based rendering will be assumed
11154 * and this will ensure that the DSP is backward compatible.
11155 */
11156#define ASM_SESSION_MTMX_STRTR_PARAM_RENDER_DEFAULT 0
11157
11158/* Indicates that rendering decision will be based on local clock rate.
11159 * 1. In the DSP loopback/client loopback use cases (frame based
11160 * inputs), the incoming data into audio DSP is time-stamped at the
11161 * local clock rate (STC).
11162 * 2. This TS rate may match the incoming data rate or maybe different
11163 * from the incoming data rate.
11164 * 3. Regardless, the data will be time-stamped with local STC and
11165 * therefore, the client is recommended to set this mode for these
11166 * use cases. This method is inherently more robust to sequencing
11167 * (AFE Start/Stop) and device switches, among other benefits.
11168 * 4. This API will inform the DSP to compare every incoming buffer TS
11169 * against local STC.
11170 * 5. DSP will continue to honor render windows APIs, as before.
11171 */
11172#define ASM_SESSION_MTMX_STRTR_PARAM_RENDER_LOCAL_STC 1
11173
11174/* Structure for rendering decision parameter */
11175struct asm_session_mtmx_strtr_param_render_mode_t {
11176 /* Specifies the type of rendering decision the audio DSP should use.
11177 *
11178 * @values
11179 * - #ASM_SESSION_MTMX_STRTR_PARAM_RENDER_DEFAULT
11180 * - #ASM_SESSION_MTMX_STRTR_PARAM_RENDER_LOCAL_STC
11181 */
11182 u32 flags;
11183} __packed;
11184
11185/* Parameter used by #ASM_SESSION_MTMX_STRTR_MODULE_ID_AVSYNC which allows the
11186 * audio client to specify the clock recovery mechanism that the audio DSP
11187 * should use.
11188 */
11189
11190#define ASM_SESSION_MTMX_STRTR_PARAM_CLK_REC_CMD 0x00012F0E
11191
11192/* Indicates that default clock recovery will be used (no clock recovery).
11193 * If the client wishes that no clock recovery be done, the client can
11194 * choose this. This means that no attempt will made by the DSP to try and
11195 * match the rates of the input and output audio.
11196 */
11197#define ASM_SESSION_MTMX_STRTR_PARAM_CLK_REC_NONE 0
11198
11199/* Indicates that independent clock recovery needs to be used.
11200 * 1. In the DSP loopback/client loopback use cases (frame based inputs),
11201 * the client should choose the independent clock recovery option.
11202 * 2. This basically de-couples the audio and video from knowing each others
11203 * clock sources and lets the audio DSP independently rate match the input
11204 * and output rates.
11205 * 3. After drift detection, the drift correction is achieved by either pulling
11206 * the PLLs (if applicable) or by stream to device rate matching
11207 * (for PCM use cases) by comparing drift with respect to STC.
11208 * 4. For passthrough use cases, since the PLL pulling is the only option,
11209 * a best effort will be made.
11210 * If PLL pulling is not possible / available, the rendering will be
11211 * done without rate matching.
11212 */
11213#define ASM_SESSION_MTMX_STRTR_PARAM_CLK_REC_AUTO 1
11214
11215/* Payload of the #ASM_SESSION_MTMX_STRTR_PARAM_CLK_REC parameter.
11216 */
11217struct asm_session_mtmx_strtr_param_clk_rec_t {
11218 /* Specifies the type of clock recovery that the audio DSP should
11219 * use for rate matching.
11220 */
11221
11222 /* @values
11223 * #ASM_SESSION_MTMX_STRTR_PARAM_CLK_REC_DEFAULT
11224 * #ASM_SESSION_MTMX_STRTR_PARAM_CLK_REC_INDEPENDENT
11225 */
11226 u32 flags;
11227} __packed;
11228
11229
11230/* Parameter used by #ASM_SESSION_MTMX_STRTR_MODULE_ID_AVSYNC to
11231 * realize smoother adjustment of audio session clock for a specified session.
11232 * The desired audio session clock adjustment(in micro seconds) is specified
11233 * using the command #ASM_SESSION_CMD_ADJUST_SESSION_CLOCK_V2.
11234 * Delaying/Advancing the session clock would be implemented by inserting
11235 * interpolated/dropping audio samples in the playback path respectively.
11236 * Also, this parameter has to be configured before the Audio Session is put
11237 * to RUN state to avoid cold start latency/glitches in the playback.
11238 */
11239
11240#define ASM_SESSION_MTMX_PARAM_ADJUST_SESSION_TIME_CTL 0x00013217
11241
11242struct asm_session_mtmx_param_adjust_session_time_ctl_t {
11243 /* Specifies whether the module is enabled or not
11244 * @values
11245 * 0 -- disabled
11246 * 1 -- enabled
11247 */
11248 u32 enable;
11249};
11250
11251union asm_session_mtmx_strtr_param_config {
11252 struct asm_session_mtmx_strtr_param_window_v2_t window_param;
11253 struct asm_session_mtmx_strtr_param_render_mode_t render_param;
11254 struct asm_session_mtmx_strtr_param_clk_rec_t clk_rec_param;
11255 struct asm_session_mtmx_param_adjust_session_time_ctl_t adj_time_param;
11256} __packed;
11257
11258struct asm_mtmx_strtr_params {
11259 struct apr_hdr hdr;
11260 struct asm_session_cmd_set_mtmx_strstr_params_v2 param;
11261 struct asm_stream_param_data_v2 data;
11262 union asm_session_mtmx_strtr_param_config config;
11263} __packed;
11264
11265#define ASM_SESSION_CMD_GET_MTMX_STRTR_PARAMS_V2 0x00010DCF
11266#define ASM_SESSION_CMDRSP_GET_MTMX_STRTR_PARAMS_V2 0x00010DD0
11267
11268#define ASM_SESSION_MTMX_STRTR_PARAM_SESSION_TIME_V3 0x00012F0B
11269#define ASM_SESSION_MTMX_STRTR_PARAM_STIME_TSTMP_FLG_BMASK (0x80000000UL)
11270
11271struct asm_session_cmd_get_mtmx_strstr_params_v2 {
11272 uint32_t data_payload_addr_lsw;
11273 /* Lower 32 bits of the 64-bit data payload address. */
11274
11275 uint32_t data_payload_addr_msw;
11276 /*
11277 * Upper 32 bits of the 64-bit data payload address.
11278 * If the address is not sent (NULL), the message is in the payload.
11279 * If the address is sent (non-NULL), the parameter data payloads
11280 * begin at the specified address.
11281 */
11282
11283 uint32_t mem_map_handle;
11284 /*
11285 * Unique identifier for an address. This memory map handle is returned
11286 * by the aDSP through the #ASM_CMD_SHARED_MEM_MAP_REGIONS command.
11287 * values
11288 * - NULL -- Parameter data payloads are within the message payload
11289 * (in-band).
11290 * - Non-NULL -- Parameter data payloads begin at the address specified
11291 * in the data_payload_addr_lsw and data_payload_addr_msw fields
11292 * (out-of-band).
11293 */
11294 uint32_t direction;
11295 /*
11296 * Direction of the entity (matrix mixer or stream router) on which
11297 * the parameter is to be set.
11298 * values
11299 * - 0 -- Rx (for Rx stream router or Rx matrix mixer)
11300 * - 1 -- Tx (for Tx stream router or Tx matrix mixer)
11301 */
11302 uint32_t module_id;
11303 /* Unique module ID. */
11304
11305 uint32_t param_id;
11306 /* Unique parameter ID. */
11307
11308 uint32_t param_max_size;
11309};
11310
11311struct asm_session_mtmx_strtr_param_session_time_v3_t {
11312 uint32_t session_time_lsw;
11313 /* Lower 32 bits of the current session time in microseconds */
11314
11315 uint32_t session_time_msw;
11316 /*
11317 * Upper 32 bits of the current session time in microseconds.
11318 * The 64-bit number formed by session_time_lsw and session_time_msw
11319 * is treated as signed.
11320 */
11321
11322 uint32_t absolute_time_lsw;
11323 /*
11324 * Lower 32 bits of the 64-bit absolute time in microseconds.
11325 * This is the time when the sample corresponding to the
11326 * session_time_lsw is rendered to the hardware. This absolute
11327 * time can be slightly in the future or past.
11328 */
11329
11330 uint32_t absolute_time_msw;
11331 /*
11332 * Upper 32 bits of the 64-bit absolute time in microseconds.
11333 * This is the time when the sample corresponding to the
11334 * session_time_msw is rendered to hardware. This absolute
11335 * time can be slightly in the future or past. The 64-bit number
11336 * formed by absolute_time_lsw and absolute_time_msw is treated as
11337 * unsigned.
11338 */
11339
11340 uint32_t time_stamp_lsw;
11341 /* Lower 32 bits of the last processed timestamp in microseconds */
11342
11343 uint32_t time_stamp_msw;
11344 /*
11345 * Upper 32 bits of the last processed timestamp in microseconds.
11346 * The 64-bit number formed by time_stamp_lsw and time_stamp_lsw
11347 * is treated as unsigned.
11348 */
11349
11350 uint32_t flags;
11351 /*
11352 * Keeps track of any additional flags needed.
11353 * @values{for bit 31}
11354 * - 0 -- Uninitialized/invalid
11355 * - 1 -- Valid
11356 * All other bits are reserved; clients must set them to zero.
11357 */
11358};
11359
11360union asm_session_mtmx_strtr_data_type {
11361 struct asm_session_mtmx_strtr_param_session_time_v3_t session_time;
11362};
11363
11364struct asm_mtmx_strtr_get_params {
11365 struct apr_hdr hdr;
11366 struct asm_session_cmd_get_mtmx_strstr_params_v2 param_info;
11367} __packed;
11368
11369struct asm_mtmx_strtr_get_params_cmdrsp {
11370 uint32_t err_code;
11371 struct asm_stream_param_data_v2 param_info;
11372 union asm_session_mtmx_strtr_data_type param_data;
11373} __packed;
11374
11375#define AUDPROC_MODULE_ID_RESAMPLER 0x00010719
11376
11377enum {
11378 LEGACY_PCM = 0,
11379 COMPRESSED_PASSTHROUGH,
11380 COMPRESSED_PASSTHROUGH_CONVERT,
11381 COMPRESSED_PASSTHROUGH_DSD,
11382 LISTEN,
11383 COMPRESSED_PASSTHROUGH_GEN,
11384 COMPRESSED_PASSTHROUGH_IEC61937
11385};
11386
11387#define AUDPROC_MODULE_ID_COMPRESSED_MUTE 0x00010770
11388#define AUDPROC_PARAM_ID_COMPRESSED_MUTE 0x00010771
11389
11390struct adm_set_compressed_device_mute {
11391 struct adm_cmd_set_pp_params_v5 command;
11392 struct adm_param_data_v5 params;
11393 u32 mute_on;
11394} __packed;
11395
11396#define AUDPROC_MODULE_ID_COMPRESSED_LATENCY 0x0001076E
11397#define AUDPROC_PARAM_ID_COMPRESSED_LATENCY 0x0001076F
11398
11399struct adm_set_compressed_device_latency {
11400 struct adm_cmd_set_pp_params_v5 command;
11401 struct adm_param_data_v5 params;
11402 u32 latency;
11403} __packed;
11404
11405#define VOICEPROC_MODULE_ID_GENERIC_TX 0x00010EF6
11406#define VOICEPROC_PARAM_ID_FLUENCE_SOUNDFOCUS 0x00010E37
11407#define VOICEPROC_PARAM_ID_FLUENCE_SOURCETRACKING 0x00010E38
11408#define MAX_SECTORS 8
11409#define MAX_NOISE_SOURCE_INDICATORS 3
11410#define MAX_POLAR_ACTIVITY_INDICATORS 360
11411
11412struct sound_focus_param {
11413 uint16_t start_angle[MAX_SECTORS];
11414 uint8_t enable[MAX_SECTORS];
11415 uint16_t gain_step;
11416} __packed;
11417
11418struct source_tracking_param {
11419 uint8_t vad[MAX_SECTORS];
11420 uint16_t doa_speech;
11421 uint16_t doa_noise[MAX_NOISE_SOURCE_INDICATORS];
11422 uint8_t polar_activity[MAX_POLAR_ACTIVITY_INDICATORS];
11423} __packed;
11424
11425struct adm_param_fluence_soundfocus_t {
11426 uint16_t start_angles[MAX_SECTORS];
11427 uint8_t enables[MAX_SECTORS];
11428 uint16_t gain_step;
11429 uint16_t reserved;
11430} __packed;
11431
11432struct adm_set_fluence_soundfocus_param {
11433 struct adm_cmd_set_pp_params_v5 params;
11434 struct adm_param_data_v5 data;
11435 struct adm_param_fluence_soundfocus_t soundfocus_data;
11436} __packed;
11437
11438struct adm_param_fluence_sourcetracking_t {
11439 uint8_t vad[MAX_SECTORS];
11440 uint16_t doa_speech;
11441 uint16_t doa_noise[MAX_NOISE_SOURCE_INDICATORS];
11442 uint8_t polar_activity[MAX_POLAR_ACTIVITY_INDICATORS];
11443} __packed;
11444
11445#define AUDPROC_MODULE_ID_AUDIOSPHERE 0x00010916
11446#define AUDPROC_PARAM_ID_AUDIOSPHERE_ENABLE 0x00010917
11447#define AUDPROC_PARAM_ID_AUDIOSPHERE_STRENGTH 0x00010918
11448#define AUDPROC_PARAM_ID_AUDIOSPHERE_CONFIG_MODE 0x00010919
11449
11450#define AUDPROC_PARAM_ID_AUDIOSPHERE_COEFFS_STEREO_INPUT 0x0001091A
11451#define AUDPROC_PARAM_ID_AUDIOSPHERE_COEFFS_MULTICHANNEL_INPUT 0x0001091B
11452#define AUDPROC_PARAM_ID_AUDIOSPHERE_DESIGN_STEREO_INPUT 0x0001091C
11453#define AUDPROC_PARAM_ID_AUDIOSPHERE_DESIGN_MULTICHANNEL_INPUT 0x0001091D
11454
11455#define AUDPROC_PARAM_ID_AUDIOSPHERE_OPERATING_INPUT_MEDIA_INFO 0x0001091E
11456
11457#define AUDPROC_MODULE_ID_VOICE_TX_SECNS 0x10027059
11458#define AUDPROC_PARAM_IDX_SEC_PRIMARY_MIC_CH 0x10014444
11459
11460struct admx_sec_primary_mic_ch {
11461 uint16_t version;
11462 uint16_t reserved;
11463 uint16_t sec_primary_mic_ch;
11464 uint16_t reserved1;
11465} __packed;
11466
11467
11468struct adm_set_sec_primary_ch_params {
11469 struct adm_cmd_set_pp_params_v5 params;
11470 struct adm_param_data_v5 data;
11471 struct admx_sec_primary_mic_ch sec_primary_mic_ch_data;
11472} __packed;
11473#endif /*_APR_AUDIO_V2_H_ */