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