blob: bc1763216cb2bc805be30f7b1b9d8b4c7842a32d [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
Preetam Singh Ranawat0a087af2017-10-25 15:02:28 +05303380#define ASM_MEDIA_FMT_LDAC 0x00013224
3381struct asm_ldac_specific_enc_cfg_t {
3382 /*
3383 * This is used to calculate the encoder output
3384 * bytes per frame (i.e. bytes per packet).
3385 * Bit rate also configures the EQMID.
3386 * The min bit rate 303000 bps is calculated for
3387 * 44.1 kHz and 88.2 KHz sampling frequencies with
3388 * Mobile use Quality.
3389 * The max bit rate of 990000 bps is calculated for
3390 * 96kHz and 48 KHz with High Quality
3391 * @Range(in bits per second)
3392 * 303000 for Mobile use Quality
3393 * 606000 for standard Quality
3394 * 909000 for High Quality
3395 */
3396 uint32_t bit_rate;
3397 /*
3398 * The channel setting information for LDAC specification
3399 * of Bluetooth A2DP which is determined by SRC and SNK
3400 * devices in Bluetooth transmission.
3401 * @Range:
3402 * 0 for native mode
3403 * 4 for mono
3404 * 2 for dual channel
3405 * 1 for stereo
3406 */
3407 uint16_t channel_mode;
3408 /*
3409 * Maximum Transmission Unit (MTU).
3410 * The minimum MTU that a L2CAP implementation for LDAC shall
3411 * support is 679 bytes, because LDAC is optimized with 2-DH5
3412 * packet as its target.
3413 * @Range : 679
3414 * @Default: 679 for LDACBT_MTU_2DH5
3415 */
3416 uint16_t mtu;
3417} __packed;
3418
3419struct asm_ldac_enc_cfg_t {
3420 struct asm_custom_enc_cfg_t custom_config;
3421 struct asm_ldac_specific_enc_cfg_t ldac_specific_config;
3422} __packed;
3423
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05303424struct afe_enc_fmt_id_param_t {
3425 /*
3426 * Supported values:
3427 * #ASM_MEDIA_FMT_SBC
3428 * #ASM_MEDIA_FMT_AAC_V2
3429 * Any OpenDSP supported values
3430 */
3431 uint32_t fmt_id;
3432} __packed;
3433
3434struct afe_port_media_type_t {
3435 /*
3436 * Minor version
3437 * @values #AFE_API_VERSION_PORT_MEDIA_TYPE.
3438 */
3439 uint32_t minor_version;
3440
3441 /*
3442 * Sampling rate of the port.
3443 * @values
3444 * #AFE_PORT_SAMPLE_RATE_8K
3445 * #AFE_PORT_SAMPLE_RATE_11_025K
3446 * #AFE_PORT_SAMPLE_RATE_12K
3447 * #AFE_PORT_SAMPLE_RATE_16K
3448 * #AFE_PORT_SAMPLE_RATE_22_05K
3449 * #AFE_PORT_SAMPLE_RATE_24K
3450 * #AFE_PORT_SAMPLE_RATE_32K
3451 * #AFE_PORT_SAMPLE_RATE_44_1K
3452 * #AFE_PORT_SAMPLE_RATE_48K
3453 * #AFE_PORT_SAMPLE_RATE_88_2K
3454 * #AFE_PORT_SAMPLE_RATE_96K
3455 * #AFE_PORT_SAMPLE_RATE_176_4K
3456 * #AFE_PORT_SAMPLE_RATE_192K
3457 * #AFE_PORT_SAMPLE_RATE_352_8K
3458 * #AFE_PORT_SAMPLE_RATE_384K
3459 */
3460 uint32_t sample_rate;
3461
3462 /*
3463 * Bit width of the sample.
3464 * @values 16, 24
3465 */
3466 uint16_t bit_width;
3467
3468 /*
3469 * Number of channels.
3470 * @values 1 to #AFE_PORT_MAX_AUDIO_CHAN_CNT
3471 */
3472 uint16_t num_channels;
3473
3474 /*
3475 * Data format supported by this port.
3476 * If the port media type and device media type are different,
3477 * it signifies a encoding/decoding use case
3478 * @values
3479 * #AFE_PORT_DATA_FORMAT_PCM
3480 * #AFE_PORT_DATA_FORMAT_GENERIC_COMPRESSED
3481 */
3482 uint16_t data_format;
3483
3484 /*This field must be set to zero.*/
3485 uint16_t reserved;
3486} __packed;
3487
3488union afe_enc_config_data {
3489 struct asm_sbc_enc_cfg_t sbc_config;
3490 struct asm_aac_enc_cfg_v2_t aac_config;
Preetam Singh Ranawat54028492017-09-04 11:42:26 +05303491 struct asm_custom_enc_cfg_t custom_config;
3492 struct asm_celt_enc_cfg_t celt_config;
Preetam Singh Ranawat899b78b2017-09-07 12:36:06 -07003493 struct asm_aptx_enc_cfg_t aptx_config;
Preetam Singh Ranawat0a087af2017-10-25 15:02:28 +05303494 struct asm_ldac_enc_cfg_t ldac_config;
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05303495};
3496
3497struct afe_enc_config {
3498 u32 format;
3499 union afe_enc_config_data data;
3500};
3501
3502struct afe_enc_cfg_blk_param_t {
3503 uint32_t enc_cfg_blk_size;
3504 /*
3505 *Size of the encoder configuration block that follows this member
3506 */
3507 union afe_enc_config_data enc_blk_config;
3508};
3509
3510/*
3511 * Payload of the AVS_ENCODER_PARAM_ID_PACKETIZER_ID parameter.
3512 */
3513struct avs_enc_packetizer_id_param_t {
3514 /*
3515 * Supported values:
3516 * #AVS_MODULE_ID_PACKETIZER_COP
3517 * Any OpenDSP supported values
3518 */
3519 uint32_t enc_packetizer_id;
3520};
3521
3522union afe_port_config {
3523 struct afe_param_id_pcm_cfg pcm;
3524 struct afe_param_id_i2s_cfg i2s;
3525 struct afe_param_id_hdmi_multi_chan_audio_cfg hdmi_multi_ch;
3526 struct afe_param_id_slimbus_cfg slim_sch;
3527 struct afe_param_id_rt_proxy_port_cfg rtproxy;
3528 struct afe_param_id_internal_bt_fm_cfg int_bt_fm;
3529 struct afe_param_id_pseudo_port_cfg pseudo_port;
3530 struct afe_param_id_device_hw_delay_cfg hw_delay;
3531 struct afe_param_id_spdif_cfg spdif;
3532 struct afe_param_id_set_topology_cfg topology;
3533 struct afe_param_id_tdm_cfg tdm;
3534 struct afe_param_id_usb_audio_cfg usb_audio;
Preetam Singh Ranawat899b78b2017-09-07 12:36:06 -07003535 struct afe_param_id_aptx_sync_mode sync_mode_param;
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05303536 struct afe_enc_fmt_id_param_t enc_fmt;
3537 struct afe_port_media_type_t media_type;
3538 struct afe_enc_cfg_blk_param_t enc_blk_param;
3539 struct avs_enc_packetizer_id_param_t enc_pkt_id_param;
3540} __packed;
3541
3542struct afe_audioif_config_command_no_payload {
3543 struct apr_hdr hdr;
3544 struct afe_port_cmd_set_param_v2 param;
3545} __packed;
3546
3547struct afe_audioif_config_command {
3548 struct apr_hdr hdr;
3549 struct afe_port_cmd_set_param_v2 param;
3550 struct afe_port_param_data_v2 pdata;
3551 union afe_port_config port;
3552} __packed;
3553
3554#define AFE_PORT_CMD_DEVICE_START 0x000100E5
3555
3556/* Payload of the #AFE_PORT_CMD_DEVICE_START.*/
3557struct afe_port_cmd_device_start {
3558 struct apr_hdr hdr;
3559 u16 port_id;
3560/* Port interface and direction (Rx or Tx) to start. An even
3561 * number represents the Rx direction, and an odd number represents
3562 * the Tx direction.
3563 */
3564
3565
3566 u16 reserved;
3567/* Reserved for 32-bit alignment. This field must be set to 0.*/
3568
3569} __packed;
3570
3571#define AFE_PORT_CMD_DEVICE_STOP 0x000100E6
3572
3573/* Payload of the #AFE_PORT_CMD_DEVICE_STOP. */
3574struct afe_port_cmd_device_stop {
3575 struct apr_hdr hdr;
3576 u16 port_id;
3577/* Port interface and direction (Rx or Tx) to start. An even
3578 * number represents the Rx direction, and an odd number represents
3579 * the Tx direction.
3580 */
3581
3582 u16 reserved;
3583/* Reserved for 32-bit alignment. This field must be set to 0.*/
3584} __packed;
3585
3586#define AFE_SERVICE_CMD_SHARED_MEM_MAP_REGIONS 0x000100EA
3587
3588/* Memory map regions command payload used by the
3589 * #AFE_SERVICE_CMD_SHARED_MEM_MAP_REGIONS .
3590 * This structure allows clients to map multiple shared memory
3591 * regions in a single command. Following this structure are
3592 * num_regions of afe_service_shared_map_region_payload.
3593 */
3594struct afe_service_cmd_shared_mem_map_regions {
3595 struct apr_hdr hdr;
3596u16 mem_pool_id;
3597/* Type of memory on which this memory region is mapped.
3598 * Supported values:
3599 * - #ADSP_MEMORY_MAP_EBI_POOL
3600 * - #ADSP_MEMORY_MAP_SMI_POOL
3601 * - #ADSP_MEMORY_MAP_SHMEM8_4K_POOL
3602 * - Other values are reserved
3603 *
3604 * The memory pool ID implicitly defines the characteristics of the
3605 * memory. Characteristics may include alignment type, permissions,
3606 * etc.
3607 *
3608 * ADSP_MEMORY_MAP_EBI_POOL is External Buffer Interface type memory
3609 * ADSP_MEMORY_MAP_SMI_POOL is Shared Memory Interface type memory
3610 * ADSP_MEMORY_MAP_SHMEM8_4K_POOL is shared memory, byte
3611 * addressable, and 4 KB aligned.
3612 */
3613
3614
3615 u16 num_regions;
3616/* Number of regions to map.
3617 * Supported values:
3618 * - Any value greater than zero
3619 */
3620
3621 u32 property_flag;
3622/* Configures one common property for all the regions in the
3623 * payload.
3624 *
3625 * Supported values: - 0x00000000 to 0x00000001
3626 *
3627 * b0 - bit 0 indicates physical or virtual mapping 0 Shared memory
3628 * address provided in afe_service_shared_map_region_payloadis a
3629 * physical address. The shared memory needs to be mapped( hardware
3630 * TLB entry) and a software entry needs to be added for internal
3631 * book keeping.
3632 *
3633 * 1 Shared memory address provided in
3634 * afe_service_shared_map_region_payloadis a virtual address. The
3635 * shared memory must not be mapped (since hardware TLB entry is
3636 * already available) but a software entry needs to be added for
3637 * internal book keeping. This can be useful if two services with in
3638 * ADSP is communicating via APR. They can now directly communicate
3639 * via the Virtual address instead of Physical address. The virtual
3640 * regions must be contiguous. num_regions must be 1 in this case.
3641 *
3642 * b31-b1 - reserved bits. must be set to zero
3643 */
3644
3645
3646} __packed;
3647/* Map region payload used by the
3648 * afe_service_shared_map_region_payloadstructure.
3649 */
3650struct afe_service_shared_map_region_payload {
3651 u32 shm_addr_lsw;
3652/* least significant word of starting address in the memory
3653 * region to map. It must be contiguous memory, and it must be 4 KB
3654 * aligned.
3655 * Supported values: - Any 32 bit value
3656 */
3657
3658
3659 u32 shm_addr_msw;
3660/* most significant word of startng address in the memory region
3661 * to map. For 32 bit shared memory address, this field must be set
3662 * to zero. For 36 bit shared memory address, bit31 to bit 4 must be
3663 * set to zero
3664 *
3665 * Supported values: - For 32 bit shared memory address, this field
3666 * must be set to zero. - For 36 bit shared memory address, bit31 to
3667 * bit 4 must be set to zero - For 64 bit shared memory address, any
3668 * 32 bit value
3669 */
3670
3671
3672 u32 mem_size_bytes;
3673/* Number of bytes in the region. The aDSP will always map the
3674 * regions as virtual contiguous memory, but the memory size must be
3675 * in multiples of 4 KB to avoid gaps in the virtually contiguous
3676 * mapped memory.
3677 *
3678 * Supported values: - multiples of 4KB
3679 */
3680
3681} __packed;
3682
3683#define AFE_SERVICE_CMDRSP_SHARED_MEM_MAP_REGIONS 0x000100EB
3684struct afe_service_cmdrsp_shared_mem_map_regions {
3685 u32 mem_map_handle;
3686/* A memory map handle encapsulating shared memory attributes is
3687 * returned iff AFE_SERVICE_CMD_SHARED_MEM_MAP_REGIONS command is
3688 * successful. In the case of failure , a generic APR error response
3689 * is returned to the client.
3690 *
3691 * Supported Values: - Any 32 bit value
3692 */
3693
3694} __packed;
3695#define AFE_SERVICE_CMD_SHARED_MEM_UNMAP_REGIONS 0x000100EC
3696/* Memory unmap regions command payload used by the
3697 * #AFE_SERVICE_CMD_SHARED_MEM_UNMAP_REGIONS
3698 *
3699 * This structure allows clients to unmap multiple shared memory
3700 * regions in a single command.
3701 */
3702
3703
3704struct afe_service_cmd_shared_mem_unmap_regions {
3705 struct apr_hdr hdr;
3706u32 mem_map_handle;
3707/* memory map handle returned by
3708 * AFE_SERVICE_CMD_SHARED_MEM_MAP_REGIONS commands
3709 *
3710 * Supported Values:
3711 * - Any 32 bit value
3712 */
3713} __packed;
3714
3715#define AFE_PORT_CMD_GET_PARAM_V2 0x000100F0
3716
3717/* Payload of the #AFE_PORT_CMD_GET_PARAM_V2 command,
3718 * which queries for one post/preprocessing parameter of a
3719 * stream.
3720 */
3721struct afe_port_cmd_get_param_v2 {
3722 u16 port_id;
3723/* Port interface and direction (Rx or Tx) to start. */
3724
3725 u16 payload_size;
3726/* Maximum data size of the parameter ID/module ID combination.
3727 * This is a multiple of four bytes
3728 * Supported values: > 0
3729 */
3730
3731 u32 payload_address_lsw;
3732/* LSW of 64 bit Payload address. Address should be 32-byte,
3733 * 4kbyte aligned and must be contig memory.
3734 */
3735
3736
3737 u32 payload_address_msw;
3738/* MSW of 64 bit Payload address. In case of 32-bit shared
3739 * memory address, this field must be set to zero. In case of 36-bit
3740 * shared memory address, bit-4 to bit-31 must be set to zero.
3741 * Address should be 32-byte, 4kbyte aligned and must be contiguous
3742 * memory.
3743 */
3744
3745 u32 mem_map_handle;
3746/* Memory map handle returned by
3747 * AFE_SERVICE_CMD_SHARED_MEM_MAP_REGIONS commands.
3748 * Supported Values: - NULL -- Message. The parameter data is
3749 * in-band. - Non-NULL -- The parameter data is Out-band.Pointer to
3750 * - the physical address in shared memory of the payload data.
3751 * For detailed payload content, see the afe_port_param_data_v2
3752 * structure
3753 */
3754
3755
3756 u32 module_id;
3757/* ID of the module to be queried.
3758 * Supported values: Valid module ID
3759 */
3760
3761 u32 param_id;
3762/* ID of the parameter to be queried.
3763 * Supported values: Valid parameter ID
3764 */
3765} __packed;
3766
3767#define AFE_PORT_CMDRSP_GET_PARAM_V2 0x00010106
3768
3769/* Payload of the #AFE_PORT_CMDRSP_GET_PARAM_V2 message, which
3770 * responds to an #AFE_PORT_CMD_GET_PARAM_V2 command.
3771 *
3772 * Immediately following this structure is the parameters structure
3773 * (afe_port_param_data) containing the response(acknowledgment)
3774 * parameter payload. This payload is included for an in-band
3775 * scenario. For an address/shared memory-based set parameter, this
3776 * payload is not needed.
3777 */
3778
3779
3780struct afe_port_cmdrsp_get_param_v2 {
3781 u32 status;
3782} __packed;
3783
3784#define AFE_PARAM_ID_LPASS_CORE_SHARED_CLOCK_CONFIG 0x0001028C
3785#define AFE_API_VERSION_LPASS_CORE_SHARED_CLK_CONFIG 0x1
3786
3787/* Payload of the AFE_PARAM_ID_LPASS_CORE_SHARED_CLOCK_CONFIG parameter used by
3788 * AFE_MODULE_AUDIO_DEV_INTERFACE.
3789 */
3790struct afe_param_id_lpass_core_shared_clk_cfg {
3791 u32 lpass_core_shared_clk_cfg_minor_version;
3792/*
3793 * Minor version used for lpass core shared clock configuration
3794 * Supported value: AFE_API_VERSION_LPASS_CORE_SHARED_CLK_CONFIG
3795 */
3796 u32 enable;
3797/*
3798 * Specifies whether the lpass core shared clock is
3799 * enabled (1) or disabled (0).
3800 */
3801} __packed;
3802
3803struct afe_lpass_core_shared_clk_config_command {
3804 struct apr_hdr hdr;
3805 struct afe_port_cmd_set_param_v2 param;
3806 struct afe_port_param_data_v2 pdata;
3807 struct afe_param_id_lpass_core_shared_clk_cfg clk_cfg;
3808} __packed;
3809
3810/* adsp_afe_service_commands.h */
3811
3812#define ADSP_MEMORY_MAP_EBI_POOL 0
3813
3814#define ADSP_MEMORY_MAP_SMI_POOL 1
3815#define ADSP_MEMORY_MAP_IMEM_POOL 2
3816#define ADSP_MEMORY_MAP_SHMEM8_4K_POOL 3
3817
3818/* Definition of virtual memory flag */
3819#define ADSP_MEMORY_MAP_VIRTUAL_MEMORY 1
3820
3821/* Definition of physical memory flag */
3822#define ADSP_MEMORY_MAP_PHYSICAL_MEMORY 0
3823
3824#define NULL_POPP_TOPOLOGY 0x00010C68
3825#define NULL_COPP_TOPOLOGY 0x00010312
3826#define DEFAULT_COPP_TOPOLOGY 0x00010314
3827#define DEFAULT_POPP_TOPOLOGY 0x00010BE4
3828#define COMPRESSED_PASSTHROUGH_DEFAULT_TOPOLOGY 0x0001076B
3829#define COMPRESSED_PASSTHROUGH_NONE_TOPOLOGY 0x00010774
Laxminath Kasam8f7ccc22017-08-28 17:35:04 +05303830#define VPM_TX_SM_ECNS_V2_COPP_TOPOLOGY 0x00010F89
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05303831#define VPM_TX_DM_FLUENCE_COPP_TOPOLOGY 0x00010F72
3832#define VPM_TX_QMIC_FLUENCE_COPP_TOPOLOGY 0x00010F75
3833#define VPM_TX_DM_RFECNS_COPP_TOPOLOGY 0x00010F86
3834#define ADM_CMD_COPP_OPEN_TOPOLOGY_ID_DTS_HPX 0x10015002
3835#define ADM_CMD_COPP_OPEN_TOPOLOGY_ID_AUDIOSPHERE 0x10028000
3836
3837/* Memory map regions command payload used by the
3838 * #ASM_CMD_SHARED_MEM_MAP_REGIONS ,#ADM_CMD_SHARED_MEM_MAP_REGIONS
3839 * commands.
3840 *
3841 * This structure allows clients to map multiple shared memory
3842 * regions in a single command. Following this structure are
3843 * num_regions of avs_shared_map_region_payload.
3844 */
3845
3846
3847struct avs_cmd_shared_mem_map_regions {
3848 struct apr_hdr hdr;
3849 u16 mem_pool_id;
3850/* Type of memory on which this memory region is mapped.
3851 *
3852 * Supported values: - #ADSP_MEMORY_MAP_EBI_POOL -
3853 * #ADSP_MEMORY_MAP_SMI_POOL - #ADSP_MEMORY_MAP_IMEM_POOL
3854 * (unsupported) - #ADSP_MEMORY_MAP_SHMEM8_4K_POOL - Other values
3855 * are reserved
3856 *
3857 * The memory ID implicitly defines the characteristics of the
3858 * memory. Characteristics may include alignment type, permissions,
3859 * etc.
3860 *
3861 * SHMEM8_4K is shared memory, byte addressable, and 4 KB aligned.
3862 */
3863
3864
3865 u16 num_regions;
3866 /* Number of regions to map.*/
3867
3868 u32 property_flag;
3869/* Configures one common property for all the regions in the
3870 * payload. No two regions in the same memory map regions cmd can
3871 * have differnt property. Supported values: - 0x00000000 to
3872 * 0x00000001
3873 *
3874 * b0 - bit 0 indicates physical or virtual mapping 0 shared memory
3875 * address provided in avs_shared_map_regions_payload is physical
3876 * address. The shared memory needs to be mapped( hardware TLB
3877 * entry)
3878 *
3879 * and a software entry needs to be added for internal book keeping.
3880 *
3881 * 1 Shared memory address provided in MayPayload[usRegions] is
3882 * virtual address. The shared memory must not be mapped (since
3883 * hardware TLB entry is already available) but a software entry
3884 * needs to be added for internal book keeping. This can be useful
3885 * if two services with in ADSP is communicating via APR. They can
3886 * now directly communicate via the Virtual address instead of
3887 * Physical address. The virtual regions must be contiguous.
3888 *
3889 * b31-b1 - reserved bits. must be set to zero
3890 */
3891
3892} __packed;
3893
3894struct avs_shared_map_region_payload {
3895 u32 shm_addr_lsw;
3896/* least significant word of shared memory address of the memory
3897 * region to map. It must be contiguous memory, and it must be 4 KB
3898 * aligned.
3899 */
3900
3901 u32 shm_addr_msw;
3902/* most significant word of shared memory address of the memory
3903 * region to map. For 32 bit shared memory address, this field must
3904 * tbe set to zero. For 36 bit shared memory address, bit31 to bit 4
3905 * must be set to zero
3906 */
3907
3908 u32 mem_size_bytes;
3909/* Number of bytes in the region.
3910 *
3911 * The aDSP will always map the regions as virtual contiguous
3912 * memory, but the memory size must be in multiples of 4 KB to avoid
3913 * gaps in the virtually contiguous mapped memory.
3914 */
3915
3916} __packed;
3917
3918struct avs_cmd_shared_mem_unmap_regions {
3919 struct apr_hdr hdr;
3920 u32 mem_map_handle;
3921/* memory map handle returned by ASM_CMD_SHARED_MEM_MAP_REGIONS
3922 * , ADM_CMD_SHARED_MEM_MAP_REGIONS, commands
3923 */
3924
3925} __packed;
3926
3927/* Memory map command response payload used by the
3928 * #ASM_CMDRSP_SHARED_MEM_MAP_REGIONS
3929 * ,#ADM_CMDRSP_SHARED_MEM_MAP_REGIONS
3930 */
3931
3932
3933struct avs_cmdrsp_shared_mem_map_regions {
3934 u32 mem_map_handle;
3935/* A memory map handle encapsulating shared memory attributes is
3936 * returned
3937 */
3938
3939} __packed;
3940
3941/*adsp_audio_memmap_api.h*/
3942
3943/* ASM related data structures */
3944struct asm_wma_cfg {
3945 u16 format_tag;
3946 u16 ch_cfg;
3947 u32 sample_rate;
3948 u32 avg_bytes_per_sec;
3949 u16 block_align;
3950 u16 valid_bits_per_sample;
3951 u32 ch_mask;
3952 u16 encode_opt;
3953 u16 adv_encode_opt;
3954 u32 adv_encode_opt2;
3955 u32 drc_peak_ref;
3956 u32 drc_peak_target;
3957 u32 drc_ave_ref;
3958 u32 drc_ave_target;
3959} __packed;
3960
3961struct asm_wmapro_cfg {
3962 u16 format_tag;
3963 u16 ch_cfg;
3964 u32 sample_rate;
3965 u32 avg_bytes_per_sec;
3966 u16 block_align;
3967 u16 valid_bits_per_sample;
3968 u32 ch_mask;
3969 u16 encode_opt;
3970 u16 adv_encode_opt;
3971 u32 adv_encode_opt2;
3972 u32 drc_peak_ref;
3973 u32 drc_peak_target;
3974 u32 drc_ave_ref;
3975 u32 drc_ave_target;
3976} __packed;
3977
3978struct asm_aac_cfg {
3979 u16 format;
3980 u16 aot;
3981 u16 ep_config;
3982 u16 section_data_resilience;
3983 u16 scalefactor_data_resilience;
3984 u16 spectral_data_resilience;
3985 u16 ch_cfg;
3986 u16 reserved;
3987 u32 sample_rate;
3988} __packed;
3989
3990struct asm_amrwbplus_cfg {
3991 u32 size_bytes;
3992 u32 version;
3993 u32 num_channels;
3994 u32 amr_band_mode;
3995 u32 amr_dtx_mode;
3996 u32 amr_frame_fmt;
3997 u32 amr_lsf_idx;
3998} __packed;
3999
4000struct asm_flac_cfg {
4001 u32 sample_rate;
4002 u32 ext_sample_rate;
4003 u32 min_frame_size;
4004 u32 max_frame_size;
4005 u16 stream_info_present;
4006 u16 min_blk_size;
4007 u16 max_blk_size;
4008 u16 ch_cfg;
4009 u16 sample_size;
4010 u16 md5_sum;
4011};
4012
4013struct asm_alac_cfg {
4014 u32 frame_length;
4015 u8 compatible_version;
4016 u8 bit_depth;
4017 u8 pb;
4018 u8 mb;
4019 u8 kb;
4020 u8 num_channels;
4021 u16 max_run;
4022 u32 max_frame_bytes;
4023 u32 avg_bit_rate;
4024 u32 sample_rate;
4025 u32 channel_layout_tag;
4026};
4027
4028struct asm_g711_dec_cfg {
4029 u32 sample_rate;
4030};
4031
4032struct asm_vorbis_cfg {
4033 u32 bit_stream_fmt;
4034};
4035
4036struct asm_ape_cfg {
4037 u16 compatible_version;
4038 u16 compression_level;
4039 u32 format_flags;
4040 u32 blocks_per_frame;
4041 u32 final_frame_blocks;
4042 u32 total_frames;
4043 u16 bits_per_sample;
4044 u16 num_channels;
4045 u32 sample_rate;
4046 u32 seek_table_present;
4047};
4048
4049struct asm_dsd_cfg {
4050 u16 num_version;
4051 u16 is_bitwise_big_endian;
4052 u16 dsd_channel_block_size;
4053 u16 num_channels;
4054 u8 channel_mapping[8];
4055 u32 dsd_data_rate;
4056};
4057
4058struct asm_softpause_params {
4059 u32 enable;
4060 u32 period;
4061 u32 step;
4062 u32 rampingcurve;
4063} __packed;
4064
4065struct asm_softvolume_params {
4066 u32 period;
4067 u32 step;
4068 u32 rampingcurve;
4069} __packed;
4070
4071#define ASM_END_POINT_DEVICE_MATRIX 0
4072
4073#define PCM_CHANNEL_NULL 0
4074
4075/* Front left channel. */
4076#define PCM_CHANNEL_FL 1
4077
4078/* Front right channel. */
4079#define PCM_CHANNEL_FR 2
4080
4081/* Front center channel. */
4082#define PCM_CHANNEL_FC 3
4083
4084/* Left surround channel.*/
4085#define PCM_CHANNEL_LS 4
4086
4087/* Right surround channel.*/
4088#define PCM_CHANNEL_RS 5
4089
4090/* Low frequency effect channel. */
4091#define PCM_CHANNEL_LFE 6
4092
4093/* Center surround channel; Rear center channel. */
4094#define PCM_CHANNEL_CS 7
4095
4096/* Left back channel; Rear left channel. */
4097#define PCM_CHANNEL_LB 8
4098
4099/* Right back channel; Rear right channel. */
4100#define PCM_CHANNEL_RB 9
4101
4102/* Top surround channel. */
4103#define PCM_CHANNELS 10
4104
4105/* Center vertical height channel.*/
4106#define PCM_CHANNEL_CVH 11
4107
4108/* Mono surround channel.*/
4109#define PCM_CHANNEL_MS 12
4110
4111/* Front left of center. */
4112#define PCM_CHANNEL_FLC 13
4113
4114/* Front right of center. */
4115#define PCM_CHANNEL_FRC 14
4116
4117/* Rear left of center. */
4118#define PCM_CHANNEL_RLC 15
4119
4120/* Rear right of center. */
4121#define PCM_CHANNEL_RRC 16
4122
4123#define PCM_FORMAT_MAX_NUM_CHANNEL 8
4124
4125#define ASM_MEDIA_FMT_MULTI_CHANNEL_PCM_V2 0x00010DA5
4126
4127#define ASM_MEDIA_FMT_MULTI_CHANNEL_PCM_V3 0x00010DDC
4128
4129#define ASM_MEDIA_FMT_MULTI_CHANNEL_PCM_V4 0x0001320C
4130
4131#define ASM_MEDIA_FMT_EVRCB_FS 0x00010BEF
4132
4133#define ASM_MEDIA_FMT_EVRCWB_FS 0x00010BF0
4134
4135#define ASM_MEDIA_FMT_GENERIC_COMPRESSED 0x00013212
4136
4137#define ASM_MAX_EQ_BANDS 12
4138
4139#define ASM_DATA_CMD_MEDIA_FMT_UPDATE_V2 0x00010D98
4140
4141struct asm_data_cmd_media_fmt_update_v2 {
4142u32 fmt_blk_size;
4143 /* Media format block size in bytes.*/
4144} __packed;
4145
4146struct asm_generic_compressed_fmt_blk_t {
4147 struct apr_hdr hdr;
4148 struct asm_data_cmd_media_fmt_update_v2 fmt_blk;
4149
4150 /*
4151 * Channel mapping array of bitstream output.
4152 * Channel[i] mapping describes channel i inside the buffer, where
4153 * i < num_channels. All valid used channels must be
4154 * present at the beginning of the array.
4155 */
4156 uint8_t channel_mapping[8];
4157
4158 /*
4159 * Number of channels of the incoming bitstream.
4160 * Supported values: 1,2,3,4,5,6,7,8
4161 */
4162 uint16_t num_channels;
4163
4164 /*
4165 * Nominal bits per sample value of the incoming bitstream.
4166 * Supported values: 16, 32
4167 */
4168 uint16_t bits_per_sample;
4169
4170 /*
4171 * Nominal sampling rate of the incoming bitstream.
4172 * Supported values: 8000, 11025, 16000, 22050, 24000, 32000,
4173 * 44100, 48000, 88200, 96000, 176400, 192000,
4174 * 352800, 384000
4175 */
4176 uint32_t sampling_rate;
4177
4178} __packed;
4179
4180
4181/* Command to send sample rate & channels for IEC61937 (compressed) or IEC60958
4182 * (pcm) streams. Both audio standards use the same format and are used for
4183 * HDMI or SPDIF.
4184 */
4185#define ASM_DATA_CMD_IEC_60958_MEDIA_FMT 0x0001321E
4186
4187struct asm_iec_compressed_fmt_blk_t {
4188 struct apr_hdr hdr;
4189
4190 /*
4191 * Nominal sampling rate of the incoming bitstream.
4192 * Supported values: 8000, 11025, 16000, 22050, 24000, 32000,
4193 * 44100, 48000, 88200, 96000, 176400, 192000,
4194 * 352800, 384000
4195 */
4196 uint32_t sampling_rate;
4197
4198 /*
4199 * Number of channels of the incoming bitstream.
4200 * Supported values: 1,2,3,4,5,6,7,8
4201 */
4202 uint32_t num_channels;
4203
4204} __packed;
4205
4206struct asm_multi_channel_pcm_fmt_blk_v2 {
4207 struct apr_hdr hdr;
4208 struct asm_data_cmd_media_fmt_update_v2 fmt_blk;
4209
4210 u16 num_channels;
4211 /* Number of channels. Supported values: 1 to 8 */
4212 u16 bits_per_sample;
4213/* Number of bits per sample per channel. * Supported values:
4214 * 16, 24 * When used for playback, the client must send 24-bit
4215 * samples packed in 32-bit words. The 24-bit samples must be placed
4216 * in the most significant 24 bits of the 32-bit word. When used for
4217 * recording, the aDSP sends 24-bit samples packed in 32-bit words.
4218 * The 24-bit samples are placed in the most significant 24 bits of
4219 * the 32-bit word.
4220 */
4221
4222
4223 u32 sample_rate;
4224/* Number of samples per second (in Hertz).
4225 * Supported values: 2000 to 48000
4226 */
4227
4228 u16 is_signed;
4229 /* Flag that indicates the samples are signed (1). */
4230
4231 u16 reserved;
4232 /* reserved field for 32 bit alignment. must be set to zero. */
4233
4234 u8 channel_mapping[8];
4235/* Channel array of size 8.
4236 * Supported values:
4237 * - #PCM_CHANNEL_L
4238 * - #PCM_CHANNEL_R
4239 * - #PCM_CHANNEL_C
4240 * - #PCM_CHANNEL_LS
4241 * - #PCM_CHANNEL_RS
4242 * - #PCM_CHANNEL_LFE
4243 * - #PCM_CHANNEL_CS
4244 * - #PCM_CHANNEL_LB
4245 * - #PCM_CHANNEL_RB
4246 * - #PCM_CHANNELS
4247 * - #PCM_CHANNEL_CVH
4248 * - #PCM_CHANNEL_MS
4249 * - #PCM_CHANNEL_FLC
4250 * - #PCM_CHANNEL_FRC
4251 * - #PCM_CHANNEL_RLC
4252 * - #PCM_CHANNEL_RRC
4253 *
4254 * Channel[i] mapping describes channel I. Each element i of the
4255 * array describes channel I inside the buffer where 0 @le I <
4256 * num_channels. An unused channel is set to zero.
4257 */
4258} __packed;
4259
4260struct asm_multi_channel_pcm_fmt_blk_v3 {
4261 uint16_t num_channels;
4262/*
4263 * Number of channels
4264 * Supported values: 1 to 8
4265 */
4266
4267 uint16_t bits_per_sample;
4268/*
4269 * Number of bits per sample per channel
4270 * Supported values: 16, 24
4271 */
4272
4273 uint32_t sample_rate;
4274/*
4275 * Number of samples per second
4276 * Supported values: 2000 to 48000, 96000,192000 Hz
4277 */
4278
4279 uint16_t is_signed;
4280/* Flag that indicates that PCM samples are signed (1) */
4281
4282 uint16_t sample_word_size;
4283/*
4284 * Size in bits of the word that holds a sample of a channel.
4285 * Supported values: 12,24,32
4286 */
4287
4288 uint8_t channel_mapping[8];
4289/*
4290 * Each element, i, in the array describes channel i inside the buffer where
4291 * 0 <= i < num_channels. Unused channels are set to 0.
4292 */
4293} __packed;
4294
4295struct asm_multi_channel_pcm_fmt_blk_v4 {
4296 uint16_t num_channels;
4297/*
4298 * Number of channels
4299 * Supported values: 1 to 8
4300 */
4301
4302 uint16_t bits_per_sample;
4303/*
4304 * Number of bits per sample per channel
4305 * Supported values: 16, 24, 32
4306 */
4307
4308 uint32_t sample_rate;
4309/*
4310 * Number of samples per second
4311 * Supported values: 2000 to 48000, 96000,192000 Hz
4312 */
4313
4314 uint16_t is_signed;
4315/* Flag that indicates that PCM samples are signed (1) */
4316
4317 uint16_t sample_word_size;
4318/*
4319 * Size in bits of the word that holds a sample of a channel.
4320 * Supported values: 12,24,32
4321 */
4322
4323 uint8_t channel_mapping[8];
4324/*
4325 * Each element, i, in the array describes channel i inside the buffer where
4326 * 0 <= i < num_channels. Unused channels are set to 0.
4327 */
4328 uint16_t endianness;
4329/*
4330 * Flag to indicate the endianness of the pcm sample
4331 * Supported values: 0 - Little endian (all other formats)
4332 * 1 - Big endian (AIFF)
4333 */
4334 uint16_t mode;
4335/*
4336 * Mode to provide additional info about the pcm input data.
4337 * Supported values: 0 - Default QFs (Q15 for 16b, Q23 for packed 24b,
4338 * Q31 for unpacked 24b or 32b)
4339 * 15 - for 16 bit
4340 * 23 - for 24b packed or 8.24 format
4341 * 31 - for 24b unpacked or 32bit
4342 */
4343} __packed;
4344
4345/*
4346 * Payload of the multichannel PCM configuration parameters in
4347 * the ASM_MEDIA_FMT_MULTI_CHANNEL_PCM_V3 media format.
4348 */
4349struct asm_multi_channel_pcm_fmt_blk_param_v3 {
4350 struct apr_hdr hdr;
4351 struct asm_data_cmd_media_fmt_update_v2 fmt_blk;
4352 struct asm_multi_channel_pcm_fmt_blk_v3 param;
4353} __packed;
4354
4355/*
4356 * Payload of the multichannel PCM configuration parameters in
4357 * the ASM_MEDIA_FMT_MULTI_CHANNEL_PCM_V4 media format.
4358 */
4359struct asm_multi_channel_pcm_fmt_blk_param_v4 {
4360 struct apr_hdr hdr;
4361 struct asm_data_cmd_media_fmt_update_v2 fmt_blk;
4362 struct asm_multi_channel_pcm_fmt_blk_v4 param;
4363} __packed;
4364
4365struct asm_stream_cmd_set_encdec_param {
4366 u32 param_id;
4367 /* ID of the parameter. */
4368
4369 u32 param_size;
4370/* Data size of this parameter, in bytes. The size is a multiple
4371 * of 4 bytes.
4372 */
4373
4374} __packed;
4375
4376struct asm_enc_cfg_blk_param_v2 {
4377 u32 frames_per_buf;
4378/* Number of encoded frames to pack into each buffer.
4379 *
4380 * @note1hang This is only guidance information for the aDSP. The
4381 * number of encoded frames put into each buffer (specified by the
4382 * client) is less than or equal to this number.
4383 */
4384
4385 u32 enc_cfg_blk_size;
4386/* Size in bytes of the encoder configuration block that follows
4387 * this member.
4388 */
4389
4390} __packed;
4391
4392/* @brief Dolby Digital Plus end point configuration structure
4393 */
4394struct asm_dec_ddp_endp_param_v2 {
4395 struct apr_hdr hdr;
4396 struct asm_stream_cmd_set_encdec_param encdec;
4397 int endp_param_value;
4398} __packed;
4399
4400/*
4401 * Payload of the multichannel PCM encoder configuration parameters in
4402 * the ASM_MEDIA_FMT_MULTI_CHANNEL_PCM_V4 media format.
4403 */
4404
4405struct asm_multi_channel_pcm_enc_cfg_v4 {
4406 struct apr_hdr hdr;
4407 struct asm_stream_cmd_set_encdec_param encdec;
4408 struct asm_enc_cfg_blk_param_v2 encblk;
4409 uint16_t num_channels;
4410 /*
4411 * Number of PCM channels.
4412 * @values
4413 * - 0 -- Native mode
4414 * - 1 -- 8 channels
4415 * Native mode indicates that encoding must be performed with the number
4416 * of channels at the input.
4417 */
4418 uint16_t bits_per_sample;
4419 /*
4420 * Number of bits per sample per channel.
4421 * @values 16, 24
4422 */
4423 uint32_t sample_rate;
4424 /*
4425 * Number of samples per second.
4426 * @values 0, 8000 to 48000 Hz
4427 * A value of 0 indicates the native sampling rate. Encoding is
4428 * performed at the input sampling rate.
4429 */
4430 uint16_t is_signed;
4431 /*
4432 * Flag that indicates the PCM samples are signed (1). Currently, only
4433 * signed PCM samples are supported.
4434 */
4435 uint16_t sample_word_size;
4436 /*
4437 * The size in bits of the word that holds a sample of a channel.
4438 * @values 16, 24, 32
4439 * 16-bit samples are always placed in 16-bit words:
4440 * sample_word_size = 1.
4441 * 24-bit samples can be placed in 32-bit words or in consecutive
4442 * 24-bit words.
4443 * - If sample_word_size = 32, 24-bit samples are placed in the
4444 * most significant 24 bits of a 32-bit word.
4445 * - If sample_word_size = 24, 24-bit samples are placed in
4446 * 24-bit words. @tablebulletend
4447 */
4448 uint8_t channel_mapping[8];
4449 /*
4450 * Channel mapping array expected at the encoder output.
4451 * Channel[i] mapping describes channel i inside the buffer, where
4452 * 0 @le i < num_channels. All valid used channels must be present at
4453 * the beginning of the array.
4454 * If Native mode is set for the channels, this field is ignored.
4455 * @values See Section @xref{dox:PcmChannelDefs}
4456 */
4457 uint16_t endianness;
4458 /*
4459 * Flag to indicate the endianness of the pcm sample
4460 * Supported values: 0 - Little endian (all other formats)
4461 * 1 - Big endian (AIFF)
4462 */
4463 uint16_t mode;
4464 /*
4465 * Mode to provide additional info about the pcm input data.
4466 * Supported values: 0 - Default QFs (Q15 for 16b, Q23 for packed 24b,
4467 * Q31 for unpacked 24b or 32b)
4468 * 15 - for 16 bit
4469 * 23 - for 24b packed or 8.24 format
4470 * 31 - for 24b unpacked or 32bit
4471 */
4472} __packed;
4473
4474/*
4475 * Payload of the multichannel PCM encoder configuration parameters in
4476 * the ASM_MEDIA_FMT_MULTI_CHANNEL_PCM_V3 media format.
4477 */
4478
4479struct asm_multi_channel_pcm_enc_cfg_v3 {
4480 struct apr_hdr hdr;
4481 struct asm_stream_cmd_set_encdec_param encdec;
4482 struct asm_enc_cfg_blk_param_v2 encblk;
4483 uint16_t num_channels;
4484 /*
4485 * Number of PCM channels.
4486 * @values
4487 * - 0 -- Native mode
4488 * - 1 -- 8 channels
4489 * Native mode indicates that encoding must be performed with the number
4490 * of channels at the input.
4491 */
4492 uint16_t bits_per_sample;
4493 /*
4494 * Number of bits per sample per channel.
4495 * @values 16, 24
4496 */
4497 uint32_t sample_rate;
4498 /*
4499 * Number of samples per second.
4500 * @values 0, 8000 to 48000 Hz
4501 * A value of 0 indicates the native sampling rate. Encoding is
4502 * performed at the input sampling rate.
4503 */
4504 uint16_t is_signed;
4505 /*
4506 * Flag that indicates the PCM samples are signed (1). Currently, only
4507 * signed PCM samples are supported.
4508 */
4509 uint16_t sample_word_size;
4510 /*
4511 * The size in bits of the word that holds a sample of a channel.
4512 * @values 16, 24, 32
4513 * 16-bit samples are always placed in 16-bit words:
4514 * sample_word_size = 1.
4515 * 24-bit samples can be placed in 32-bit words or in consecutive
4516 * 24-bit words.
4517 * - If sample_word_size = 32, 24-bit samples are placed in the
4518 * most significant 24 bits of a 32-bit word.
4519 * - If sample_word_size = 24, 24-bit samples are placed in
4520 * 24-bit words. @tablebulletend
4521 */
4522 uint8_t channel_mapping[8];
4523 /*
4524 * Channel mapping array expected at the encoder output.
4525 * Channel[i] mapping describes channel i inside the buffer, where
4526 * 0 @le i < num_channels. All valid used channels must be present at
4527 * the beginning of the array.
4528 * If Native mode is set for the channels, this field is ignored.
4529 * @values See Section @xref{dox:PcmChannelDefs}
4530 */
4531};
4532
4533/* @brief Multichannel PCM encoder configuration structure used
4534 * in the #ASM_PARAM_ID_ENCDEC_ENC_CFG_BLK_V2 command.
4535 */
4536
4537struct asm_multi_channel_pcm_enc_cfg_v2 {
4538 struct apr_hdr hdr;
4539 struct asm_stream_cmd_set_encdec_param encdec;
4540 struct asm_enc_cfg_blk_param_v2 encblk;
4541 uint16_t num_channels;
4542/*< Number of PCM channels.
4543 *
4544 * Supported values: - 0 -- Native mode - 1 -- 8 Native mode
4545 * indicates that encoding must be performed with the number of
4546 * channels at the input.
4547 */
4548
4549 uint16_t bits_per_sample;
4550/*< Number of bits per sample per channel.
4551 * Supported values: 16, 24
4552 */
4553
4554 uint32_t sample_rate;
4555/*< Number of samples per second (in Hertz).
4556 *
4557 * Supported values: 0, 8000 to 48000 A value of 0 indicates the
4558 * native sampling rate. Encoding is performed at the input sampling
4559 * rate.
4560 */
4561
4562 uint16_t is_signed;
4563/*< Specifies whether the samples are signed (1). Currently,
4564 * only signed samples are supported.
4565 */
4566
4567 uint16_t reserved;
4568/*< reserved field for 32 bit alignment. must be set to zero.*/
4569
4570
4571 uint8_t channel_mapping[8];
4572} __packed;
4573
4574#define ASM_MEDIA_FMT_MP3 0x00010BE9
4575#define ASM_MEDIA_FMT_AAC_V2 0x00010DA6
4576
4577/* @xreflabel
4578 * {hdr:AsmMediaFmtDolbyAac} Media format ID for the
4579 * Dolby AAC decoder. This format ID is be used if the client wants
4580 * to use the Dolby AAC decoder to decode MPEG2 and MPEG4 AAC
4581 * contents.
4582 */
4583
4584#define ASM_MEDIA_FMT_DOLBY_AAC 0x00010D86
4585
4586/* Enumeration for the audio data transport stream AAC format. */
4587#define ASM_MEDIA_FMT_AAC_FORMAT_FLAG_ADTS 0
4588
4589/* Enumeration for low overhead audio stream AAC format. */
4590#define ASM_MEDIA_FMT_AAC_FORMAT_FLAG_LOAS 1
4591
4592/* Enumeration for the audio data interchange format
4593 * AAC format.
4594 */
4595#define ASM_MEDIA_FMT_AAC_FORMAT_FLAG_ADIF 2
4596
4597/* Enumeration for the raw AAC format. */
4598#define ASM_MEDIA_FMT_AAC_FORMAT_FLAG_RAW 3
4599
4600/* Enumeration for the AAC LATM format. */
4601#define ASM_MEDIA_FMT_AAC_FORMAT_FLAG_LATM 4
4602
4603#define ASM_MEDIA_FMT_AAC_AOT_LC 2
4604#define ASM_MEDIA_FMT_AAC_AOT_SBR 5
4605#define ASM_MEDIA_FMT_AAC_AOT_PS 29
4606#define ASM_MEDIA_FMT_AAC_AOT_BSAC 22
4607
4608struct asm_aac_fmt_blk_v2 {
4609 struct apr_hdr hdr;
4610 struct asm_data_cmd_media_fmt_update_v2 fmt_blk;
4611
4612 u16 aac_fmt_flag;
4613/* Bitstream format option.
4614 * Supported values:
4615 * - #ASM_MEDIA_FMT_AAC_FORMAT_FLAG_ADTS
4616 * - #ASM_MEDIA_FMT_AAC_FORMAT_FLAG_LOAS
4617 * - #ASM_MEDIA_FMT_AAC_FORMAT_FLAG_ADIF
4618 * - #ASM_MEDIA_FMT_AAC_FORMAT_FLAG_RAW
4619 */
4620
4621 u16 audio_objype;
4622/* Audio Object Type (AOT) present in the AAC stream.
4623 * Supported values:
4624 * - #ASM_MEDIA_FMT_AAC_AOT_LC
4625 * - #ASM_MEDIA_FMT_AAC_AOT_SBR
4626 * - #ASM_MEDIA_FMT_AAC_AOT_BSAC
4627 * - #ASM_MEDIA_FMT_AAC_AOT_PS
4628 * - Otherwise -- Not supported
4629 */
4630
4631 u16 channel_config;
4632/* Number of channels present in the AAC stream.
4633 * Supported values:
4634 * - 1 -- Mono
4635 * - 2 -- Stereo
4636 * - 6 -- 5.1 content
4637 */
4638
4639 u16 total_size_of_PCE_bits;
4640/* greater or equal to zero. * -In case of RAW formats and
4641 * channel config = 0 (PCE), client can send * the bit stream
4642 * containing PCE immediately following this structure * (in-band).
4643 * -This number does not include bits included for 32 bit alignment.
4644 * -If zero, then the PCE info is assumed to be available in the
4645 * audio -bit stream & not in-band.
4646 */
4647
4648 u32 sample_rate;
4649/* Number of samples per second (in Hertz).
4650 *
4651 * Supported values: 8000, 11025, 12000, 16000, 22050, 24000, 32000,
4652 * 44100, 48000
4653 *
4654 * This field must be equal to the sample rate of the AAC-LC
4655 * decoder's output. - For MP4 or 3GP containers, this is indicated
4656 * by the samplingFrequencyIndex field in the AudioSpecificConfig
4657 * element. - For ADTS format, this is indicated by the
4658 * samplingFrequencyIndex in the ADTS fixed header. - For ADIF
4659 * format, this is indicated by the samplingFrequencyIndex in the
4660 * program_config_element present in the ADIF header.
4661 */
4662
4663} __packed;
4664
4665struct asm_aac_enc_cfg_v2 {
4666 struct apr_hdr hdr;
4667 struct asm_stream_cmd_set_encdec_param encdec;
4668 struct asm_enc_cfg_blk_param_v2 encblk;
4669
4670 u32 bit_rate;
4671 /* Encoding rate in bits per second. */
4672 u32 enc_mode;
4673/* Encoding mode.
4674 * Supported values:
4675 * - #ASM_MEDIA_FMT_AAC_AOT_LC
4676 * - #ASM_MEDIA_FMT_AAC_AOT_SBR
4677 * - #ASM_MEDIA_FMT_AAC_AOT_PS
4678 */
4679 u16 aac_fmt_flag;
4680/* AAC format flag.
4681 * Supported values:
4682 * - #ASM_MEDIA_FMT_AAC_FORMAT_FLAG_ADTS
4683 * - #ASM_MEDIA_FMT_AAC_FORMAT_FLAG_RAW
4684 */
4685 u16 channel_cfg;
4686/* Number of channels to encode.
4687 * Supported values:
4688 * - 0 -- Native mode
4689 * - 1 -- Mono
4690 * - 2 -- Stereo
4691 * - Other values are not supported.
4692 * @note1hang The eAAC+ encoder mode supports only stereo.
4693 * Native mode indicates that encoding must be performed with the
4694 * number of channels at the input.
4695 * The number of channels must not change during encoding.
4696 */
4697
4698 u32 sample_rate;
4699/* Number of samples per second.
4700 * Supported values: - 0 -- Native mode - For other values,
4701 * Native mode indicates that encoding must be performed with the
4702 * sampling rate at the input.
4703 * The sampling rate must not change during encoding.
4704 */
4705
4706} __packed;
4707
4708#define ASM_MEDIA_FMT_G711_ALAW_FS 0x00010BF7
4709#define ASM_MEDIA_FMT_G711_MLAW_FS 0x00010C2E
4710
4711struct asm_g711_enc_cfg_v2 {
4712 struct apr_hdr hdr;
4713 struct asm_stream_cmd_set_encdec_param encdec;
4714 struct asm_enc_cfg_blk_param_v2 encblk;
4715
4716 u32 sample_rate;
4717/*
4718 * Number of samples per second.
4719 * Supported values: 8000, 16000 Hz
4720 */
4721
4722} __packed;
4723
4724struct asm_vorbis_fmt_blk_v2 {
4725 struct apr_hdr hdr;
4726 struct asm_data_cmd_media_fmt_update_v2 fmtblk;
4727 u32 bit_stream_fmt;
4728/* Bit stream format.
4729 * Supported values:
4730 * - 0 -- Raw bitstream
4731 * - 1 -- Transcoded bitstream
4732 *
4733 * Transcoded bitstream containing the size of the frame as the first
4734 * word in each frame.
4735 */
4736
4737} __packed;
4738
4739struct asm_flac_fmt_blk_v2 {
4740 struct apr_hdr hdr;
4741 struct asm_data_cmd_media_fmt_update_v2 fmtblk;
4742
4743 u16 is_stream_info_present;
4744/* Specifies whether stream information is present in the FLAC format
4745 * block.
4746 *
4747 * Supported values:
4748 * - 0 -- Stream information is not present in this message
4749 * - 1 -- Stream information is present in this message
4750 *
4751 * When set to 1, the FLAC bitstream was successfully parsed by the
4752 * client, and other fields in the FLAC format block can be read by the
4753 * decoder to get metadata stream information.
4754 */
4755
4756 u16 num_channels;
4757/* Number of channels for decoding.
4758 * Supported values: 1 to 2
4759 */
4760
4761 u16 min_blk_size;
4762/* Minimum block size (in samples) used in the stream. It must be less
4763 * than or equal to max_blk_size.
4764 */
4765
4766 u16 max_blk_size;
4767/* Maximum block size (in samples) used in the stream. If the
4768 * minimum block size equals the maximum block size, a fixed block
4769 * size stream is implied.
4770 */
4771
4772 u16 md5_sum[8];
4773/* MD5 signature array of the unencoded audio data. This allows the
4774 * decoder to determine if an error exists in the audio data, even when
4775 * the error does not result in an invalid bitstream.
4776 */
4777
4778 u32 sample_rate;
4779/* Number of samples per second.
4780 * Supported values: 8000 to 48000 Hz
4781 */
4782
4783 u32 min_frame_size;
4784/* Minimum frame size used in the stream.
4785 * Supported values:
4786 * - > 0 bytes
4787 * - 0 -- The value is unknown
4788 */
4789
4790 u32 max_frame_size;
4791/* Maximum frame size used in the stream.
4792 * Supported values:
4793 * -- > 0 bytes
4794 * -- 0 . The value is unknown
4795 */
4796
4797 u16 sample_size;
4798/* Bits per sample.Supported values: 8, 16 */
4799
4800 u16 reserved;
4801/* Clients must set this field to zero
4802 */
4803
4804} __packed;
4805
4806struct asm_alac_fmt_blk_v2 {
4807 struct apr_hdr hdr;
4808 struct asm_data_cmd_media_fmt_update_v2 fmtblk;
4809
4810 u32 frame_length;
4811 u8 compatible_version;
4812 u8 bit_depth;
4813 u8 pb;
4814 u8 mb;
4815 u8 kb;
4816 u8 num_channels;
4817 u16 max_run;
4818 u32 max_frame_bytes;
4819 u32 avg_bit_rate;
4820 u32 sample_rate;
4821 u32 channel_layout_tag;
4822
4823} __packed;
4824
4825struct asm_g711_dec_fmt_blk_v2 {
4826 struct apr_hdr hdr;
4827 struct asm_data_cmd_media_fmt_update_v2 fmtblk;
4828 u32 sample_rate;
4829} __packed;
4830
4831struct asm_ape_fmt_blk_v2 {
4832 struct apr_hdr hdr;
4833 struct asm_data_cmd_media_fmt_update_v2 fmtblk;
4834
4835 u16 compatible_version;
4836 u16 compression_level;
4837 u32 format_flags;
4838 u32 blocks_per_frame;
4839 u32 final_frame_blocks;
4840 u32 total_frames;
4841 u16 bits_per_sample;
4842 u16 num_channels;
4843 u32 sample_rate;
4844 u32 seek_table_present;
4845
4846} __packed;
4847
4848struct asm_dsd_fmt_blk_v2 {
4849 struct apr_hdr hdr;
4850 struct asm_data_cmd_media_fmt_update_v2 fmtblk;
4851
4852 u16 num_version;
4853 u16 is_bitwise_big_endian;
4854 u16 dsd_channel_block_size;
4855 u16 num_channels;
4856 u8 channel_mapping[8];
4857 u32 dsd_data_rate;
4858
4859} __packed;
4860
4861#define ASM_MEDIA_FMT_AMRNB_FS 0x00010BEB
4862
4863/* Enumeration for 4.75 kbps AMR-NB Encoding mode. */
4864#define ASM_MEDIA_FMT_AMRNB_FS_ENCODE_MODE_MR475 0
4865
4866/* Enumeration for 5.15 kbps AMR-NB Encoding mode. */
4867#define ASM_MEDIA_FMT_AMRNB_FS_ENCODE_MODE_MR515 1
4868
4869/* Enumeration for 5.90 kbps AMR-NB Encoding mode. */
4870#define ASM_MEDIA_FMT_AMRNB_FS_ENCODE_MODE_MMR59 2
4871
4872/* Enumeration for 6.70 kbps AMR-NB Encoding mode. */
4873#define ASM_MEDIA_FMT_AMRNB_FS_ENCODE_MODE_MMR67 3
4874
4875/* Enumeration for 7.40 kbps AMR-NB Encoding mode. */
4876#define ASM_MEDIA_FMT_AMRNB_FS_ENCODE_MODE_MMR74 4
4877
4878/* Enumeration for 7.95 kbps AMR-NB Encoding mode. */
4879#define ASM_MEDIA_FMT_AMRNB_FS_ENCODE_MODE_MMR795 5
4880
4881/* Enumeration for 10.20 kbps AMR-NB Encoding mode. */
4882#define ASM_MEDIA_FMT_AMRNB_FS_ENCODE_MODE_MMR102 6
4883
4884/* Enumeration for 12.20 kbps AMR-NB Encoding mode. */
4885#define ASM_MEDIA_FMT_AMRNB_FS_ENCODE_MODE_MMR122 7
4886
4887/* Enumeration for AMR-NB Discontinuous Transmission mode off. */
4888#define ASM_MEDIA_FMT_AMRNB_FS_DTX_MODE_OFF 0
4889
4890/* Enumeration for AMR-NB DTX mode VAD1. */
4891#define ASM_MEDIA_FMT_AMRNB_FS_DTX_MODE_VAD1 1
4892
4893/* Enumeration for AMR-NB DTX mode VAD2. */
4894#define ASM_MEDIA_FMT_AMRNB_FS_DTX_MODE_VAD2 2
4895
4896/* Enumeration for AMR-NB DTX mode auto. */
4897#define ASM_MEDIA_FMT_AMRNB_FS_DTX_MODE_AUTO 3
4898
4899struct asm_amrnb_enc_cfg {
4900 struct apr_hdr hdr;
4901 struct asm_stream_cmd_set_encdec_param encdec;
4902 struct asm_enc_cfg_blk_param_v2 encblk;
4903
4904 u16 enc_mode;
4905/* AMR-NB encoding rate.
4906 * Supported values:
4907 * Use the ASM_MEDIA_FMT_AMRNB_FS_ENCODE_MODE_*
4908 * macros
4909 */
4910
4911 u16 dtx_mode;
4912/* Specifies whether DTX mode is disabled or enabled.
4913 * Supported values:
4914 * - #ASM_MEDIA_FMT_AMRNB_FS_DTX_MODE_OFF
4915 * - #ASM_MEDIA_FMT_AMRNB_FS_DTX_MODE_VAD1
4916 */
4917} __packed;
4918
4919#define ASM_MEDIA_FMT_AMRWB_FS 0x00010BEC
4920
4921/* Enumeration for 6.6 kbps AMR-WB Encoding mode. */
4922#define ASM_MEDIA_FMT_AMRWB_FS_ENCODE_MODE_MR66 0
4923
4924/* Enumeration for 8.85 kbps AMR-WB Encoding mode. */
4925#define ASM_MEDIA_FMT_AMRWB_FS_ENCODE_MODE_MR885 1
4926
4927/* Enumeration for 12.65 kbps AMR-WB Encoding mode. */
4928#define ASM_MEDIA_FMT_AMRWB_FS_ENCODE_MODE_MR1265 2
4929
4930/* Enumeration for 14.25 kbps AMR-WB Encoding mode. */
4931#define ASM_MEDIA_FMT_AMRWB_FS_ENCODE_MODE_MR1425 3
4932
4933/* Enumeration for 15.85 kbps AMR-WB Encoding mode. */
4934#define ASM_MEDIA_FMT_AMRWB_FS_ENCODE_MODE_MR1585 4
4935
4936/* Enumeration for 18.25 kbps AMR-WB Encoding mode. */
4937#define ASM_MEDIA_FMT_AMRWB_FS_ENCODE_MODE_MR1825 5
4938
4939/* Enumeration for 19.85 kbps AMR-WB Encoding mode. */
4940#define ASM_MEDIA_FMT_AMRWB_FS_ENCODE_MODE_MR1985 6
4941
4942/* Enumeration for 23.05 kbps AMR-WB Encoding mode. */
4943#define ASM_MEDIA_FMT_AMRWB_FS_ENCODE_MODE_MR2305 7
4944
4945/* Enumeration for 23.85 kbps AMR-WB Encoding mode. */
4946#define ASM_MEDIA_FMT_AMRWB_FS_ENCODE_MODE_MR2385 8
4947
4948struct asm_amrwb_enc_cfg {
4949 struct apr_hdr hdr;
4950 struct asm_stream_cmd_set_encdec_param encdec;
4951 struct asm_enc_cfg_blk_param_v2 encblk;
4952
4953 u16 enc_mode;
4954/* AMR-WB encoding rate.
4955 * Suupported values:
4956 * Use the ASM_MEDIA_FMT_AMRWB_FS_ENCODE_MODE_*
4957 * macros
4958 */
4959
4960 u16 dtx_mode;
4961/* Specifies whether DTX mode is disabled or enabled.
4962 * Supported values:
4963 * - #ASM_MEDIA_FMT_AMRNB_FS_DTX_MODE_OFF
4964 * - #ASM_MEDIA_FMT_AMRNB_FS_DTX_MODE_VAD1
4965 */
4966} __packed;
4967
4968#define ASM_MEDIA_FMT_V13K_FS 0x00010BED
4969
4970/* Enumeration for 14.4 kbps V13K Encoding mode. */
4971#define ASM_MEDIA_FMT_V13K_FS_ENCODE_MODE_MR1440 0
4972
4973/* Enumeration for 12.2 kbps V13K Encoding mode. */
4974#define ASM_MEDIA_FMT_V13K_FS_ENCODE_MODE_MR1220 1
4975
4976/* Enumeration for 11.2 kbps V13K Encoding mode. */
4977#define ASM_MEDIA_FMT_V13K_FS_ENCODE_MODE_MR1120 2
4978
4979/* Enumeration for 9.0 kbps V13K Encoding mode. */
4980#define ASM_MEDIA_FMT_V13K_FS_ENCODE_MODE_MR90 3
4981
4982/* Enumeration for 7.2 kbps V13K eEncoding mode. */
4983#define ASM_MEDIA_FMT_V13K_FS_ENCODE_MODE_MR720 4
4984
4985/* Enumeration for 1/8 vocoder rate.*/
4986#define ASM_MEDIA_FMT_VOC_ONE_EIGHTH_RATE 1
4987
4988/* Enumeration for 1/4 vocoder rate. */
4989#define ASM_MEDIA_FMT_VOC_ONE_FOURTH_RATE 2
4990
4991/* Enumeration for 1/2 vocoder rate. */
4992#define ASM_MEDIA_FMT_VOC_HALF_RATE 3
4993
4994/* Enumeration for full vocoder rate. */
4995#define ASM_MEDIA_FMT_VOC_FULL_RATE 4
4996
4997struct asm_v13k_enc_cfg {
4998 struct apr_hdr hdr;
4999 struct asm_stream_cmd_set_encdec_param encdec;
5000 struct asm_enc_cfg_blk_param_v2 encblk;
5001 u16 max_rate;
5002/* Maximum allowed encoder frame rate.
5003 * Supported values:
5004 * - #ASM_MEDIA_FMT_VOC_ONE_EIGHTH_RATE
5005 * - #ASM_MEDIA_FMT_VOC_ONE_FOURTH_RATE
5006 * - #ASM_MEDIA_FMT_VOC_HALF_RATE
5007 * - #ASM_MEDIA_FMT_VOC_FULL_RATE
5008 */
5009
5010 u16 min_rate;
5011/* Minimum 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 reduced_rate_cmd;
5020/* Reduced rate command, used to change
5021 * the average bitrate of the V13K
5022 * vocoder.
5023 * Supported values:
5024 * - #ASM_MEDIA_FMT_V13K_FS_ENCODE_MODE_MR1440 (Default)
5025 * - #ASM_MEDIA_FMT_V13K_FS_ENCODE_MODE_MR1220
5026 * - #ASM_MEDIA_FMT_V13K_FS_ENCODE_MODE_MR1120
5027 * - #ASM_MEDIA_FMT_V13K_FS_ENCODE_MODE_MR90
5028 * - #ASM_MEDIA_FMT_V13K_FS_ENCODE_MODE_MR720
5029 */
5030
5031 u16 rate_mod_cmd;
5032/* Rate modulation command. Default = 0.
5033 *- If bit 0=1, rate control is enabled.
5034 *- If bit 1=1, the maximum number of consecutive full rate
5035 * frames is limited with numbers supplied in
5036 * bits 2 to 10.
5037 *- If bit 1=0, the minimum number of non-full rate frames
5038 * in between two full rate frames is forced to
5039 * the number supplied in bits 2 to 10. In both cases, if necessary,
5040 * half rate is used to substitute full rate. - Bits 15 to 10 are
5041 * reserved and must all be set to zero.
5042 */
5043
5044} __packed;
5045
5046#define ASM_MEDIA_FMT_EVRC_FS 0x00010BEE
5047
5048/* EVRC encoder configuration structure used in the
5049 * #ASM_PARAM_ID_ENCDEC_ENC_CFG_BLK_V2 command.
5050 */
5051struct asm_evrc_enc_cfg {
5052 struct apr_hdr hdr;
5053 struct asm_stream_cmd_set_encdec_param encdec;
5054 struct asm_enc_cfg_blk_param_v2 encblk;
5055 u16 max_rate;
5056/* Maximum allowed encoder frame rate.
5057 * Supported values:
5058 * - #ASM_MEDIA_FMT_VOC_ONE_EIGHTH_RATE
5059 * - #ASM_MEDIA_FMT_VOC_ONE_FOURTH_RATE
5060 * - #ASM_MEDIA_FMT_VOC_HALF_RATE
5061 * - #ASM_MEDIA_FMT_VOC_FULL_RATE
5062 */
5063
5064 u16 min_rate;
5065/* Minimum allowed encoder frame rate.
5066 * Supported values:
5067 * - #ASM_MEDIA_FMT_VOC_ONE_EIGHTH_RATE
5068 * - #ASM_MEDIA_FMT_VOC_ONE_FOURTH_RATE
5069 * - #ASM_MEDIA_FMT_VOC_HALF_RATE
5070 * - #ASM_MEDIA_FMT_VOC_FULL_RATE
5071 */
5072
5073 u16 rate_mod_cmd;
5074/* Rate modulation command. Default: 0.
5075 * - If bit 0=1, rate control is enabled.
5076 * - If bit 1=1, the maximum number of consecutive full rate frames
5077 * is limited with numbers supplied in bits 2 to 10.
5078 *
5079 * - If bit 1=0, the minimum number of non-full rate frames in
5080 * between two full rate frames is forced to the number supplied in
5081 * bits 2 to 10. In both cases, if necessary, half rate is used to
5082 * substitute full rate.
5083 *
5084 * - Bits 15 to 10 are reserved and must all be set to zero.
5085 */
5086
5087 u16 reserved;
5088 /* Reserved. Clients must set this field to zero. */
5089} __packed;
5090
5091#define ASM_MEDIA_FMT_WMA_V10PRO_V2 0x00010DA7
5092
5093struct asm_wmaprov10_fmt_blk_v2 {
5094 struct apr_hdr hdr;
5095 struct asm_data_cmd_media_fmt_update_v2 fmtblk;
5096
5097 u16 fmtag;
5098/* WMA format type.
5099 * Supported values:
5100 * - 0x162 -- WMA 9 Pro
5101 * - 0x163 -- WMA 9 Pro Lossless
5102 * - 0x166 -- WMA 10 Pro
5103 * - 0x167 -- WMA 10 Pro Lossless
5104 */
5105
5106 u16 num_channels;
5107/* Number of channels encoded in the input stream.
5108 * Supported values: 1 to 8
5109 */
5110
5111 u32 sample_rate;
5112/* Number of samples per second (in Hertz).
5113 * Supported values: 11025, 16000, 22050, 32000, 44100, 48000,
5114 * 88200, 96000
5115 */
5116
5117 u32 avg_bytes_per_sec;
5118/* Bitrate expressed as the average bytes per second.
5119 * Supported values: 2000 to 96000
5120 */
5121
5122 u16 blk_align;
5123/* Size of the bitstream packet size in bytes. WMA Pro files
5124 * have a payload of one block per bitstream packet.
5125 * Supported values: @le 13376
5126 */
5127
5128 u16 bits_per_sample;
5129/* Number of bits per sample in the encoded WMA stream.
5130 * Supported values: 16, 24
5131 */
5132
5133 u32 channel_mask;
5134/* Bit-packed double word (32-bits) that indicates the
5135 * recommended speaker positions for each source channel.
5136 */
5137
5138 u16 enc_options;
5139/* Bit-packed word with values that indicate whether certain
5140 * features of the bitstream are used.
5141 * Supported values: - 0x0001 -- ENCOPT3_PURE_LOSSLESS - 0x0006 --
5142 * ENCOPT3_FRM_SIZE_MOD - 0x0038 -- ENCOPT3_SUBFRM_DIV - 0x0040 --
5143 * ENCOPT3_WRITE_FRAMESIZE_IN_HDR - 0x0080 --
5144 * ENCOPT3_GENERATE_DRC_PARAMS - 0x0100 -- ENCOPT3_RTMBITS
5145 */
5146
5147
5148 u16 usAdvancedEncodeOpt;
5149 /* Advanced encoding option. */
5150
5151 u32 advanced_enc_options2;
5152 /* Advanced encoding option 2. */
5153
5154} __packed;
5155
5156#define ASM_MEDIA_FMT_WMA_V9_V2 0x00010DA8
5157struct asm_wmastdv9_fmt_blk_v2 {
5158 struct apr_hdr hdr;
5159 struct asm_data_cmd_media_fmt_update_v2 fmtblk;
5160 u16 fmtag;
5161/* WMA format tag.
5162 * Supported values: 0x161 (WMA 9 standard)
5163 */
5164
5165 u16 num_channels;
5166/* Number of channels in the stream.
5167 * Supported values: 1, 2
5168 */
5169
5170 u32 sample_rate;
5171/* Number of samples per second (in Hertz).
5172 * Supported values: 48000
5173 */
5174
5175 u32 avg_bytes_per_sec;
5176 /* Bitrate expressed as the average bytes per second. */
5177
5178 u16 blk_align;
5179/* Block align. All WMA files with a maximum packet size of
5180 * 13376 are supported.
5181 */
5182
5183
5184 u16 bits_per_sample;
5185/* Number of bits per sample in the output.
5186 * Supported values: 16
5187 */
5188
5189 u32 channel_mask;
5190/* Channel mask.
5191 * Supported values:
5192 * - 3 -- Stereo (front left/front right)
5193 * - 4 -- Mono (center)
5194 */
5195
5196 u16 enc_options;
5197 /* Options used during encoding. */
5198
5199 u16 reserved;
5200
5201} __packed;
5202
5203#define ASM_MEDIA_FMT_WMA_V8 0x00010D91
5204
5205struct asm_wmastdv8_enc_cfg {
5206 struct apr_hdr hdr;
5207 struct asm_stream_cmd_set_encdec_param encdec;
5208 struct asm_enc_cfg_blk_param_v2 encblk;
5209 u32 bit_rate;
5210 /* Encoding rate in bits per second. */
5211
5212 u32 sample_rate;
5213/* Number of samples per second.
5214 *
5215 * Supported values:
5216 * - 0 -- Native mode
5217 * - Other Supported values are 22050, 32000, 44100, and 48000.
5218 *
5219 * Native mode indicates that encoding must be performed with the
5220 * sampling rate at the input.
5221 * The sampling rate must not change during encoding.
5222 */
5223
5224 u16 channel_cfg;
5225/* Number of channels to encode.
5226 * Supported values:
5227 * - 0 -- Native mode
5228 * - 1 -- Mono
5229 * - 2 -- Stereo
5230 * - Other values are not supported.
5231 *
5232 * Native mode indicates that encoding must be performed with the
5233 * number of channels at the input.
5234 * The number of channels must not change during encoding.
5235 */
5236
5237 u16 reserved;
5238 /* Reserved. Clients must set this field to zero.*/
5239 } __packed;
5240
5241#define ASM_MEDIA_FMT_AMR_WB_PLUS_V2 0x00010DA9
5242
5243struct asm_amrwbplus_fmt_blk_v2 {
5244 struct apr_hdr hdr;
5245 struct asm_data_cmd_media_fmt_update_v2 fmtblk;
5246 u32 amr_frame_fmt;
5247/* AMR frame format.
5248 * Supported values:
5249 * - 6 -- Transport Interface Format (TIF)
5250 * - Any other value -- File storage format (FSF)
5251 *
5252 * TIF stream contains 2-byte header for each frame within the
5253 * superframe. FSF stream contains one 2-byte header per superframe.
5254 */
5255
5256} __packed;
5257
5258#define ASM_MEDIA_FMT_AC3 0x00010DEE
5259#define ASM_MEDIA_FMT_EAC3 0x00010DEF
5260#define ASM_MEDIA_FMT_DTS 0x00010D88
5261#define ASM_MEDIA_FMT_MP2 0x00010DE9
5262#define ASM_MEDIA_FMT_FLAC 0x00010C16
5263#define ASM_MEDIA_FMT_ALAC 0x00012F31
5264#define ASM_MEDIA_FMT_VORBIS 0x00010C15
5265#define ASM_MEDIA_FMT_APE 0x00012F32
5266#define ASM_MEDIA_FMT_DSD 0x00012F3E
5267#define ASM_MEDIA_FMT_TRUEHD 0x00013215
5268/* 0x0 is used for fomat ID since ADSP dynamically determines the
5269 * format encapsulated in the IEC61937 (compressed) or IEC60958
5270 * (pcm) packets.
5271 */
5272#define ASM_MEDIA_FMT_IEC 0x00000000
5273
5274/* Media format ID for adaptive transform acoustic coding. This
5275 * ID is used by the #ASM_STREAM_CMD_OPEN_WRITE_COMPRESSED command
5276 * only.
5277 */
5278
5279#define ASM_MEDIA_FMT_ATRAC 0x00010D89
5280
5281/* Media format ID for metadata-enhanced audio transmission.
5282 * This ID is used by the #ASM_STREAM_CMD_OPEN_WRITE_COMPRESSED
5283 * command only.
5284 */
5285
5286#define ASM_MEDIA_FMT_MAT 0x00010D8A
5287
5288/* adsp_media_fmt.h */
5289
5290#define ASM_DATA_CMD_WRITE_V2 0x00010DAB
5291
5292struct asm_data_cmd_write_v2 {
5293 struct apr_hdr hdr;
5294 u32 buf_addr_lsw;
5295/* The 64 bit address msw-lsw should be a valid, mapped address.
5296 * 64 bit address should be a multiple of 32 bytes
5297 */
5298
5299 u32 buf_addr_msw;
5300/* The 64 bit address msw-lsw should be a valid, mapped address.
5301 * 64 bit address should be a multiple of 32 bytes.
5302 * -Address of the buffer containing the data to be decoded.
5303 * The buffer should be aligned to a 32 byte boundary.
5304 * -In the case of 32 bit Shared memory address, msw field must
5305 * -be set to zero.
5306 * -In the case of 36 bit shared memory address, bit 31 to bit 4
5307 * -of msw must be set to zero.
5308 */
5309 u32 mem_map_handle;
5310/* memory map handle returned by DSP through
5311 * ASM_CMD_SHARED_MEM_MAP_REGIONS command
5312 */
5313 u32 buf_size;
5314/* Number of valid bytes available in the buffer for decoding. The
5315 * first byte starts at buf_addr.
5316 */
5317
5318 u32 seq_id;
5319 /* Optional buffer sequence ID. */
5320
5321 u32 timestamp_lsw;
5322/* Lower 32 bits of the 64-bit session time in microseconds of the
5323 * first buffer sample.
5324 */
5325
5326 u32 timestamp_msw;
5327/* Upper 32 bits of the 64-bit session time in microseconds of the
5328 * first buffer sample.
5329 */
5330
5331 u32 flags;
5332/* Bitfield of flags.
5333 * Supported values for bit 31:
5334 * - 1 -- Valid timestamp.
5335 * - 0 -- Invalid timestamp.
5336 * - Use #ASM_BIT_MASKIMESTAMP_VALID_FLAG as the bitmask and
5337 * #ASM_SHIFTIMESTAMP_VALID_FLAG as the shift value to set this bit.
5338 * Supported values for bit 30:
5339 * - 1 -- Last buffer.
5340 * - 0 -- Not the last buffer.
5341 *
5342 * Supported values for bit 29:
5343 * - 1 -- Continue the timestamp from the previous buffer.
5344 * - 0 -- Timestamp of the current buffer is not related
5345 * to the timestamp of the previous buffer.
5346 * - Use #ASM_BIT_MASKS_CONTINUE_FLAG and #ASM_SHIFTS_CONTINUE_FLAG
5347 * to set this bit.
5348 *
5349 * Supported values for bit 4:
5350 * - 1 -- End of the frame.
5351 * - 0 -- Not the end of frame, or this information is not known.
5352 * - Use #ASM_BIT_MASK_EOF_FLAG as the bitmask and #ASM_SHIFT_EOF_FLAG
5353 * as the shift value to set this bit.
5354 *
5355 * All other bits are reserved and must be set to 0.
5356 *
5357 * If bit 31=0 and bit 29=1: The timestamp of the first sample in
5358 * this buffer continues from the timestamp of the last sample in
5359 * the previous buffer. If there is no previous buffer (i.e., this
5360 * is the first buffer sent after opening the stream or after a
5361 * flush operation), or if the previous buffer does not have a valid
5362 * timestamp, the samples in the current buffer also do not have a
5363 * valid timestamp. They are played out as soon as possible.
5364 *
5365 *
5366 * If bit 31=0 and bit 29=0: No timestamp is associated with the
5367 * first sample in this buffer. The samples are played out as soon
5368 * as possible.
5369 *
5370 *
5371 * If bit 31=1 and bit 29 is ignored: The timestamp specified in
5372 * this payload is honored.
5373 *
5374 *
5375 * If bit 30=0: Not the last buffer in the stream. This is useful
5376 * in removing trailing samples.
5377 *
5378 *
5379 * For bit 4: The client can set this flag for every buffer sent in
5380 * which the last byte is the end of a frame. If this flag is set,
5381 * the buffer can contain data from multiple frames, but it should
5382 * always end at a frame boundary. Restrictions allow the aDSP to
5383 * detect an end of frame without requiring additional processing.
5384 */
5385
5386} __packed;
5387
5388#define ASM_DATA_CMD_READ_V2 0x00010DAC
5389
5390struct asm_data_cmd_read_v2 {
5391 struct apr_hdr hdr;
5392 u32 buf_addr_lsw;
5393/* the 64 bit address msw-lsw should be a valid mapped address
5394 * and should be a multiple of 32 bytes
5395 */
5396
5397
5398 u32 buf_addr_msw;
5399/* the 64 bit address msw-lsw should be a valid mapped address
5400 * and should be a multiple of 32 bytes.
5401 * - Address of the buffer where the DSP puts the encoded data,
5402 * potentially, at an offset specified by the uOffset field in
5403 * ASM_DATA_EVENT_READ_DONE structure. The buffer should be aligned
5404 * to a 32 byte boundary.
5405 * - In the case of 32 bit Shared memory address, msw field must
5406 * - be set to zero.
5407 * - In the case of 36 bit shared memory address, bit 31 to bit
5408 * - 4 of msw must be set to zero.
5409 */
5410 u32 mem_map_handle;
5411/* memory map handle returned by DSP through
5412 * ASM_CMD_SHARED_MEM_MAP_REGIONS command.
5413 */
5414
5415 u32 buf_size;
5416/* Number of bytes available for the aDSP to write. The aDSP
5417 * starts writing from buf_addr.
5418 */
5419
5420 u32 seq_id;
5421 /* Optional buffer sequence ID. */
5422} __packed;
5423
5424#define ASM_DATA_CMD_EOS 0x00010BDB
5425#define ASM_DATA_EVENT_RENDERED_EOS 0x00010C1C
5426#define ASM_DATA_EVENT_EOS 0x00010BDD
5427
5428#define ASM_DATA_EVENT_WRITE_DONE_V2 0x00010D99
5429struct asm_data_event_write_done_v2 {
5430 u32 buf_addr_lsw;
5431 /* lsw of the 64 bit address */
5432 u32 buf_addr_msw;
5433 /* msw of the 64 bit address. address given by the client in
5434 * ASM_DATA_CMD_WRITE_V2 command.
5435 */
5436 u32 mem_map_handle;
5437 /* memory map handle in the ASM_DATA_CMD_WRITE_V2 */
5438
5439 u32 status;
5440/* Status message (error code) that indicates whether the
5441 * referenced buffer has been successfully consumed.
5442 * Supported values: Refer to @xhyperref{Q3,[Q3]}
5443 */
5444} __packed;
5445
5446#define ASM_DATA_EVENT_READ_DONE_V2 0x00010D9A
5447
5448/* Definition of the frame metadata flag bitmask.*/
5449#define ASM_BIT_MASK_FRAME_METADATA_FLAG (0x40000000UL)
5450
5451/* Definition of the frame metadata flag shift value. */
5452#define ASM_SHIFT_FRAME_METADATA_FLAG 30
5453
5454struct asm_data_event_read_done_v2 {
5455 u32 status;
5456/* Status message (error code).
5457 * Supported values: Refer to @xhyperref{Q3,[Q3]}
5458 */
5459
5460u32 buf_addr_lsw;
5461/* 64 bit address msw-lsw is a valid, mapped address. 64 bit
5462 * address is a multiple of 32 bytes.
5463 */
5464
5465u32 buf_addr_msw;
5466/* 64 bit address msw-lsw is a valid, mapped address. 64 bit
5467 * address is a multiple of 32 bytes.
5468 *
5469 * -Same address provided by the client in ASM_DATA_CMD_READ_V2
5470 * -In the case of 32 bit Shared memory address, msw field is set to
5471 * zero.
5472 * -In the case of 36 bit shared memory address, bit 31 to bit 4
5473 * -of msw is set to zero.
5474 */
5475
5476u32 mem_map_handle;
5477/* memory map handle in the ASM_DATA_CMD_READ_V2 */
5478
5479u32 enc_framesotal_size;
5480/* Total size of the encoded frames in bytes.
5481 * Supported values: >0
5482 */
5483
5484u32 offset;
5485/* Offset (from buf_addr) to the first byte of the first encoded
5486 * frame. All encoded frames are consecutive, starting from this
5487 * offset.
5488 * Supported values: > 0
5489 */
5490
5491u32 timestamp_lsw;
5492/* Lower 32 bits of the 64-bit session time in microseconds of
5493 * the first sample in the buffer. If Bit 5 of mode_flags flag of
5494 * ASM_STREAM_CMD_OPEN_READ_V2 is 1 then the 64 bit timestamp is
5495 * absolute capture time otherwise it is relative session time. The
5496 * absolute timestamp doesn't reset unless the system is reset.
5497 */
5498
5499
5500u32 timestamp_msw;
5501/* Upper 32 bits of the 64-bit session time in microseconds of
5502 * the first sample in the buffer.
5503 */
5504
5505
5506u32 flags;
5507/* Bitfield of flags. Bit 30 indicates whether frame metadata is
5508 * present. If frame metadata is present, num_frames consecutive
5509 * instances of @xhyperref{hdr:FrameMetaData,Frame metadata} start
5510 * at the buffer address.
5511 * Supported values for bit 31:
5512 * - 1 -- Timestamp is valid.
5513 * - 0 -- Timestamp is invalid.
5514 * - Use #ASM_BIT_MASKIMESTAMP_VALID_FLAG and
5515 * #ASM_SHIFTIMESTAMP_VALID_FLAG to set this bit.
5516 *
5517 * Supported values for bit 30:
5518 * - 1 -- Frame metadata is present.
5519 * - 0 -- Frame metadata is absent.
5520 * - Use #ASM_BIT_MASK_FRAME_METADATA_FLAG and
5521 * #ASM_SHIFT_FRAME_METADATA_FLAG to set this bit.
5522 *
5523 * All other bits are reserved; the aDSP sets them to 0.
5524 */
5525
5526u32 num_frames;
5527/* Number of encoded frames in the buffer. */
5528
5529u32 seq_id;
5530/* Optional buffer sequence ID. */
5531} __packed;
5532
5533struct asm_data_read_buf_metadata_v2 {
5534 u32 offset;
5535/* Offset from buf_addr in #ASM_DATA_EVENT_READ_DONE_PAYLOAD to
5536 * the frame associated with this metadata.
5537 * Supported values: > 0
5538 */
5539
5540u32 frm_size;
5541/* Size of the encoded frame in bytes.
5542 * Supported values: > 0
5543 */
5544
5545u32 num_encoded_pcm_samples;
5546/* Number of encoded PCM samples (per channel) in the frame
5547 * associated with this metadata.
5548 * Supported values: > 0
5549 */
5550
5551u32 timestamp_lsw;
5552/* Lower 32 bits of the 64-bit session time in microseconds of the
5553 * first sample for this frame.
5554 * If Bit 5 of mode_flags flag of ASM_STREAM_CMD_OPEN_READ_V2 is 1
5555 * then the 64 bit timestamp is absolute capture time otherwise it
5556 * is relative session time. The absolute timestamp doesn't reset
5557 * unless the system is reset.
5558 */
5559
5560
5561u32 timestamp_msw;
5562/* Lower 32 bits of the 64-bit session time in microseconds of the
5563 * first sample for this frame.
5564 */
5565
5566u32 flags;
5567/* Frame flags.
5568 * Supported values for bit 31:
5569 * - 1 -- Time stamp is valid
5570 * - 0 -- Time stamp is not valid
5571 * - All other bits are reserved; the aDSP sets them to 0.
5572 */
5573} __packed;
5574
5575/* Notifies the client of a change in the data sampling rate or
5576 * Channel mode. This event is raised by the decoder service. The
5577 * event is enabled through the mode flags of
5578 * #ASM_STREAM_CMD_OPEN_WRITE_V2 or
5579 * #ASM_STREAM_CMD_OPEN_READWRITE_V2. - The decoder detects a change
5580 * in the output sampling frequency or the number/positioning of
5581 * output channels, or if it is the first frame decoded.The new
5582 * sampling frequency or the new channel configuration is
5583 * communicated back to the client asynchronously.
5584 */
5585
5586#define ASM_DATA_EVENT_SR_CM_CHANGE_NOTIFY 0x00010C65
5587
5588/* Payload of the #ASM_DATA_EVENT_SR_CM_CHANGE_NOTIFY event.
5589 * This event is raised when the following conditions are both true:
5590 * - The event is enabled through the mode_flags of
5591 * #ASM_STREAM_CMD_OPEN_WRITE_V2 or
5592 * #ASM_STREAM_CMD_OPEN_READWRITE_V2. - The decoder detects a change
5593 * in either the output sampling frequency or the number/positioning
5594 * of output channels, or if it is the first frame decoded.
5595 * This event is not raised (even if enabled) if the decoder is
5596 * MIDI, because
5597 */
5598
5599
5600struct asm_data_event_sr_cm_change_notify {
5601 u32 sample_rate;
5602/* New sampling rate (in Hertz) after detecting a change in the
5603 * bitstream.
5604 * Supported values: 2000 to 48000
5605 */
5606
5607 u16 num_channels;
5608/* New number of channels after detecting a change in the
5609 * bitstream.
5610 * Supported values: 1 to 8
5611 */
5612
5613
5614 u16 reserved;
5615 /* Reserved for future use. This field must be set to 0.*/
5616
5617 u8 channel_mapping[8];
5618
5619} __packed;
5620
5621/* Notifies the client of a data sampling rate or channel mode
5622 * change. This event is raised by the encoder service.
5623 * This event is raised when :
5624 * - Native mode encoding was requested in the encoder
5625 * configuration (i.e., the channel number was 0), the sample rate
5626 * was 0, or both were 0.
5627 *
5628 * - The input data frame at the encoder is the first one, or the
5629 * sampling rate/channel mode is different from the previous input
5630 * data frame.
5631 *
5632 */
5633#define ASM_DATA_EVENT_ENC_SR_CM_CHANGE_NOTIFY 0x00010BDE
5634
5635struct asm_data_event_enc_sr_cm_change_notify {
5636 u32 sample_rate;
5637/* New sampling rate (in Hertz) after detecting a change in the
5638 * input data.
5639 * Supported values: 2000 to 48000
5640 */
5641
5642
5643 u16 num_channels;
5644/* New number of channels after detecting a change in the input
5645 * data. Supported values: 1 to 8
5646 */
5647
5648
5649 u16 bits_per_sample;
5650/* New bits per sample after detecting a change in the input
5651 * data.
5652 * Supported values: 16, 24
5653 */
5654
5655
5656 u8 channel_mapping[8];
5657
5658} __packed;
5659#define ASM_DATA_CMD_IEC_60958_FRAME_RATE 0x00010D87
5660
5661
5662/* Payload of the #ASM_DATA_CMD_IEC_60958_FRAME_RATE command,
5663 * which is used to indicate the IEC 60958 frame rate of a given
5664 * packetized audio stream.
5665 */
5666
5667struct asm_data_cmd_iec_60958_frame_rate {
5668 u32 frame_rate;
5669/* IEC 60958 frame rate of the incoming IEC 61937 packetized stream.
5670 * Supported values: Any valid frame rate
5671 */
5672} __packed;
5673
5674/* adsp_asm_data_commands.h*/
5675/* Definition of the stream ID bitmask.*/
5676#define ASM_BIT_MASK_STREAM_ID (0x000000FFUL)
5677
5678/* Definition of the stream ID shift value.*/
5679#define ASM_SHIFT_STREAM_ID 0
5680
5681/* Definition of the session ID bitmask.*/
5682#define ASM_BIT_MASK_SESSION_ID (0x0000FF00UL)
5683
5684/* Definition of the session ID shift value.*/
5685#define ASM_SHIFT_SESSION_ID 8
5686
5687/* Definition of the service ID bitmask.*/
5688#define ASM_BIT_MASK_SERVICE_ID (0x00FF0000UL)
5689
5690/* Definition of the service ID shift value.*/
5691#define ASM_SHIFT_SERVICE_ID 16
5692
5693/* Definition of the domain ID bitmask.*/
5694#define ASM_BIT_MASK_DOMAIN_ID (0xFF000000UL)
5695
5696/* Definition of the domain ID shift value.*/
5697#define ASM_SHIFT_DOMAIN_ID 24
5698
5699#define ASM_CMD_SHARED_MEM_MAP_REGIONS 0x00010D92
5700#define ASM_CMDRSP_SHARED_MEM_MAP_REGIONS 0x00010D93
5701#define ASM_CMD_SHARED_MEM_UNMAP_REGIONS 0x00010D94
5702
5703/* adsp_asm_service_commands.h */
5704
5705#define ASM_MAX_SESSION_ID (15)
5706
5707/* Maximum number of sessions.*/
5708#define ASM_MAX_NUM_SESSIONS ASM_MAX_SESSION_ID
5709
5710/* Maximum number of streams per session.*/
5711#define ASM_MAX_STREAMS_PER_SESSION (8)
5712#define ASM_SESSION_CMD_RUN_V2 0x00010DAA
5713#define ASM_SESSION_CMD_RUN_STARTIME_RUN_IMMEDIATE 0
5714#define ASM_SESSION_CMD_RUN_STARTIME_RUN_AT_ABSOLUTEIME 1
5715#define ASM_SESSION_CMD_RUN_STARTIME_RUN_AT_RELATIVEIME 2
5716#define ASM_SESSION_CMD_RUN_STARTIME_RUN_WITH_DELAY 3
5717
5718#define ASM_BIT_MASK_RUN_STARTIME (0x00000003UL)
5719
5720/* Bit shift value used to specify the start time for the
5721 * ASM_SESSION_CMD_RUN_V2 command.
5722 */
5723#define ASM_SHIFT_RUN_STARTIME 0
5724struct asm_session_cmd_run_v2 {
5725 struct apr_hdr hdr;
5726 u32 flags;
5727/* Specifies whether to run immediately or at a specific
5728 * rendering time or with a specified delay. Run with delay is
5729 * useful for delaying in case of ASM loopback opened through
5730 * ASM_STREAM_CMD_OPEN_LOOPBACK_V2. Use #ASM_BIT_MASK_RUN_STARTIME
5731 * and #ASM_SHIFT_RUN_STARTIME to set this 2-bit flag.
5732 *
5733 *
5734 *Bits 0 and 1 can take one of four possible values:
5735 *
5736 *- #ASM_SESSION_CMD_RUN_STARTIME_RUN_IMMEDIATE
5737 *- #ASM_SESSION_CMD_RUN_STARTIME_RUN_AT_ABSOLUTEIME
5738 *- #ASM_SESSION_CMD_RUN_STARTIME_RUN_AT_RELATIVEIME
5739 *- #ASM_SESSION_CMD_RUN_STARTIME_RUN_WITH_DELAY
5740 *
5741 *All other bits are reserved; clients must set them to zero.
5742 */
5743
5744 u32 time_lsw;
5745/* Lower 32 bits of the time in microseconds used to align the
5746 * session origin time. When bits 0-1 of flags is
5747 * ASM_SESSION_CMD_RUN_START_RUN_WITH_DELAY, time lsw is the lsw of
5748 * the delay in us. For ASM_SESSION_CMD_RUN_START_RUN_WITH_DELAY,
5749 * maximum value of the 64 bit delay is 150 ms.
5750 */
5751
5752 u32 time_msw;
5753/* Upper 32 bits of the time in microseconds used to align the
5754 * session origin time. When bits 0-1 of flags is
5755 * ASM_SESSION_CMD_RUN_START_RUN_WITH_DELAY, time msw is the msw of
5756 * the delay in us. For ASM_SESSION_CMD_RUN_START_RUN_WITH_DELAY,
5757 * maximum value of the 64 bit delay is 150 ms.
5758 */
5759
5760} __packed;
5761
5762#define ASM_SESSION_CMD_PAUSE 0x00010BD3
5763#define ASM_SESSION_CMD_SUSPEND 0x00010DEC
5764#define ASM_SESSION_CMD_GET_SESSIONTIME_V3 0x00010D9D
5765#define ASM_SESSION_CMD_REGISTER_FOR_RX_UNDERFLOW_EVENTS 0x00010BD5
5766
5767struct asm_session_cmd_rgstr_rx_underflow {
5768 struct apr_hdr hdr;
5769 u16 enable_flag;
5770/* Specifies whether a client is to receive events when an Rx
5771 * session underflows.
5772 * Supported values:
5773 * - 0 -- Do not send underflow events
5774 * - 1 -- Send underflow events
5775 */
5776 u16 reserved;
5777 /* Reserved. This field must be set to zero.*/
5778} __packed;
5779
5780#define ASM_SESSION_CMD_REGISTER_FORX_OVERFLOW_EVENTS 0x00010BD6
5781
5782struct asm_session_cmd_regx_overflow {
5783 struct apr_hdr hdr;
5784 u16 enable_flag;
5785/* Specifies whether a client is to receive events when a Tx
5786 * session overflows.
5787 * Supported values:
5788 * - 0 -- Do not send overflow events
5789 * - 1 -- Send overflow events
5790 */
5791
5792 u16 reserved;
5793 /* Reserved. This field must be set to zero.*/
5794} __packed;
5795
5796#define ASM_SESSION_EVENT_RX_UNDERFLOW 0x00010C17
5797#define ASM_SESSION_EVENTX_OVERFLOW 0x00010C18
5798#define ASM_SESSION_CMDRSP_GET_SESSIONTIME_V3 0x00010D9E
5799
5800struct asm_session_cmdrsp_get_sessiontime_v3 {
5801 u32 status;
5802 /* Status message (error code).
5803 * Supported values: Refer to @xhyperref{Q3,[Q3]}
5804 */
5805
5806 u32 sessiontime_lsw;
5807 /* Lower 32 bits of the current session time in microseconds.*/
5808
5809 u32 sessiontime_msw;
5810 /* Upper 32 bits of the current session time in microseconds.*/
5811
5812 u32 absolutetime_lsw;
5813/* Lower 32 bits in micro seconds of the absolute time at which
5814 * the * sample corresponding to the above session time gets
5815 * rendered * to hardware. This absolute time may be slightly in the
5816 * future or past.
5817 */
5818
5819
5820 u32 absolutetime_msw;
5821/* Upper 32 bits in micro seconds of the absolute time at which
5822 * the * sample corresponding to the above session time gets
5823 * rendered to * hardware. This absolute time may be slightly in the
5824 * future or past.
5825 */
5826
5827} __packed;
5828
5829#define ASM_SESSION_CMD_ADJUST_SESSION_CLOCK_V2 0x00010D9F
5830
5831struct asm_session_cmd_adjust_session_clock_v2 {
5832 struct apr_hdr hdr;
5833u32 adjustime_lsw;
5834/* Lower 32 bits of the signed 64-bit quantity that specifies the
5835 * adjustment time in microseconds to the session clock.
5836 *
5837 * Positive values indicate advancement of the session clock.
5838 * Negative values indicate delay of the session clock.
5839 */
5840
5841
5842 u32 adjustime_msw;
5843/* Upper 32 bits of the signed 64-bit quantity that specifies
5844 * the adjustment time in microseconds to the session clock.
5845 * Positive values indicate advancement of the session clock.
5846 * Negative values indicate delay of the session clock.
5847 */
5848
5849} __packed;
5850
5851#define ASM_SESSION_CMDRSP_ADJUST_SESSION_CLOCK_V2 0x00010DA0
5852
5853struct asm_session_cmdrsp_adjust_session_clock_v2 {
5854 u32 status;
5855/* Status message (error code).
5856 * Supported values: Refer to @xhyperref{Q3,[Q3]}
5857 * An error means the session clock is not adjusted. In this case,
5858 * the next two fields are irrelevant.
5859 */
5860
5861
5862 u32 actual_adjustime_lsw;
5863/* Lower 32 bits of the signed 64-bit quantity that specifies
5864 * the actual adjustment in microseconds performed by the aDSP.
5865 * A positive value indicates advancement of the session clock. A
5866 * negative value indicates delay of the session clock.
5867 */
5868
5869
5870 u32 actual_adjustime_msw;
5871/* Upper 32 bits of the signed 64-bit quantity that specifies
5872 * the actual adjustment in microseconds performed by the aDSP.
5873 * A positive value indicates advancement of the session clock. A
5874 * negative value indicates delay of the session clock.
5875 */
5876
5877
5878 u32 cmd_latency_lsw;
5879/* Lower 32 bits of the unsigned 64-bit quantity that specifies
5880 * the amount of time in microseconds taken to perform the session
5881 * clock adjustment.
5882 */
5883
5884
5885 u32 cmd_latency_msw;
5886/* Upper 32 bits of the unsigned 64-bit quantity that specifies
5887 * the amount of time in microseconds taken to perform the session
5888 * clock adjustment.
5889 */
5890
5891} __packed;
5892
5893#define ASM_SESSION_CMD_GET_PATH_DELAY_V2 0x00010DAF
5894#define ASM_SESSION_CMDRSP_GET_PATH_DELAY_V2 0x00010DB0
5895
5896struct asm_session_cmdrsp_get_path_delay_v2 {
5897 u32 status;
5898/* Status message (error code). Whether this get delay operation
5899 * is successful or not. Delay value is valid only if status is
5900 * success.
5901 * Supported values: Refer to @xhyperref{Q5,[Q5]}
5902 */
5903
5904 u32 audio_delay_lsw;
5905 /* Upper 32 bits of the aDSP delay in microseconds. */
5906
5907 u32 audio_delay_msw;
5908 /* Lower 32 bits of the aDSP delay in microseconds. */
5909
5910} __packed;
5911
5912/* adsp_asm_session_command.h*/
5913#define ASM_STREAM_CMD_OPEN_WRITE_V3 0x00010DB3
5914
5915#define ASM_LOW_LATENCY_STREAM_SESSION 0x10000000
5916
5917#define ASM_ULTRA_LOW_LATENCY_STREAM_SESSION 0x20000000
5918
5919#define ASM_ULL_POST_PROCESSING_STREAM_SESSION 0x40000000
5920
5921#define ASM_LEGACY_STREAM_SESSION 0
5922
5923
5924struct asm_stream_cmd_open_write_v3 {
5925 struct apr_hdr hdr;
5926 uint32_t mode_flags;
5927/* Mode flags that configure the stream to notify the client
5928 * whenever it detects an SR/CM change at the input to its POPP.
5929 * Supported values for bits 0 to 1:
5930 * - Reserved; clients must set them to zero.
5931 * Supported values for bit 2:
5932 * - 0 -- SR/CM change notification event is disabled.
5933 * - 1 -- SR/CM change notification event is enabled.
5934 * - Use #ASM_BIT_MASK_SR_CM_CHANGE_NOTIFY_FLAG and
5935 * #ASM_SHIFT_SR_CM_CHANGE_NOTIFY_FLAG to set or get this bit.
5936 *
5937 * Supported values for bit 31:
5938 * - 0 -- Stream to be opened in on-Gapless mode.
5939 * - 1 -- Stream to be opened in Gapless mode. In Gapless mode,
5940 * successive streams must be opened with same session ID but
5941 * different stream IDs.
5942 *
5943 * - Use #ASM_BIT_MASK_GAPLESS_MODE_FLAG and
5944 * #ASM_SHIFT_GAPLESS_MODE_FLAG to set or get this bit.
5945 *
5946 *
5947 * @note1hang MIDI and DTMF streams cannot be opened in Gapless mode.
5948 */
5949
5950 uint16_t sink_endpointype;
5951/*< Sink point type.
5952 * Supported values:
5953 * - 0 -- Device matrix
5954 * - Other values are reserved.
5955 *
5956 * The device matrix is the gateway to the hardware ports.
5957 */
5958
5959 uint16_t bits_per_sample;
5960/*< Number of bits per sample processed by ASM modules.
5961 * Supported values: 16 and 24 bits per sample
5962 */
5963
5964 uint32_t postprocopo_id;
5965/*< Specifies the topology (order of processing) of
5966 * postprocessing algorithms. <i>None</i> means no postprocessing.
5967 * Supported values:
5968 * - #ASM_STREAM_POSTPROCOPO_ID_DEFAULT
5969 * - #ASM_STREAM_POSTPROCOPO_ID_MCH_PEAK_VOL
5970 * - #ASM_STREAM_POSTPROCOPO_ID_NONE
5971 *
5972 * This field can also be enabled through SetParams flags.
5973 */
5974
5975 uint32_t dec_fmt_id;
5976/*< Configuration ID of the decoder media format.
5977 *
5978 * Supported values:
5979 * - #ASM_MEDIA_FMT_MULTI_CHANNEL_PCM_V2
5980 * - #ASM_MEDIA_FMT_ADPCM
5981 * - #ASM_MEDIA_FMT_MP3
5982 * - #ASM_MEDIA_FMT_AAC_V2
5983 * - #ASM_MEDIA_FMT_DOLBY_AAC
5984 * - #ASM_MEDIA_FMT_AMRNB_FS
5985 * - #ASM_MEDIA_FMT_AMRWB_FS
5986 * - #ASM_MEDIA_FMT_AMR_WB_PLUS_V2
5987 * - #ASM_MEDIA_FMT_V13K_FS
5988 * - #ASM_MEDIA_FMT_EVRC_FS
5989 * - #ASM_MEDIA_FMT_EVRCB_FS
5990 * - #ASM_MEDIA_FMT_EVRCWB_FS
5991 * - #ASM_MEDIA_FMT_SBC
5992 * - #ASM_MEDIA_FMT_WMA_V10PRO_V2
5993 * - #ASM_MEDIA_FMT_WMA_V9_V2
5994 * - #ASM_MEDIA_FMT_AC3
5995 * - #ASM_MEDIA_FMT_EAC3
5996 * - #ASM_MEDIA_FMT_G711_ALAW_FS
5997 * - #ASM_MEDIA_FMT_G711_MLAW_FS
5998 * - #ASM_MEDIA_FMT_G729A_FS
5999 * - #ASM_MEDIA_FMT_FR_FS
6000 * - #ASM_MEDIA_FMT_VORBIS
6001 * - #ASM_MEDIA_FMT_FLAC
6002 * - #ASM_MEDIA_FMT_ALAC
6003 * - #ASM_MEDIA_FMT_APE
6004 * - #ASM_MEDIA_FMT_EXAMPLE
6005 */
6006} __packed;
6007
6008#define ASM_STREAM_CMD_OPEN_PULL_MODE_WRITE 0x00010DD9
6009
6010/* Bitmask for the stream_perf_mode subfield. */
6011#define ASM_BIT_MASK_STREAM_PERF_FLAG_PULL_MODE_WRITE 0xE0000000UL
6012
6013/* Bitmask for the stream_perf_mode subfield. */
6014#define ASM_SHIFT_STREAM_PERF_FLAG_PULL_MODE_WRITE 29
6015
6016#define ASM_STREAM_CMD_OPEN_PUSH_MODE_READ 0x00010DDA
6017
6018#define ASM_BIT_MASK_STREAM_PERF_FLAG_PUSH_MODE_READ 0xE0000000UL
6019
6020#define ASM_SHIFT_STREAM_PERF_FLAG_PUSH_MODE_READ 29
6021
6022#define ASM_DATA_EVENT_WATERMARK 0x00010DDB
6023
6024struct asm_shared_position_buffer {
6025 volatile uint32_t frame_counter;
6026/* Counter used to handle interprocessor synchronization issues.
6027 * When frame_counter is 0: read_index, wall_clock_us_lsw, and
6028 * wall_clock_us_msw are invalid.
6029 * Supported values: >= 0.
6030 */
6031
6032 volatile uint32_t index;
6033/* Index in bytes from where the aDSP is reading/writing.
6034 * Supported values: 0 to circular buffer size - 1
6035 */
6036
6037 volatile uint32_t wall_clock_us_lsw;
6038/* Lower 32 bits of the 64-bit wall clock time in microseconds when the
6039 * read index was updated.
6040 * Supported values: >= 0
6041 */
6042
6043 volatile uint32_t wall_clock_us_msw;
6044/* Upper 32 bits of the 64 bit wall clock time in microseconds when the
6045 * read index was updated
6046 * Supported values: >= 0
6047 */
6048} __packed;
6049
6050struct asm_shared_watermark_level {
6051 uint32_t watermark_level_bytes;
6052} __packed;
6053
6054struct asm_stream_cmd_open_shared_io {
6055 struct apr_hdr hdr;
6056 uint32_t mode_flags;
6057 uint16_t endpoint_type;
6058 uint16_t topo_bits_per_sample;
6059 uint32_t topo_id;
6060 uint32_t fmt_id;
6061 uint32_t shared_pos_buf_phy_addr_lsw;
6062 uint32_t shared_pos_buf_phy_addr_msw;
6063 uint16_t shared_pos_buf_mem_pool_id;
6064 uint16_t shared_pos_buf_num_regions;
6065 uint32_t shared_pos_buf_property_flag;
6066 uint32_t shared_circ_buf_start_phy_addr_lsw;
6067 uint32_t shared_circ_buf_start_phy_addr_msw;
6068 uint32_t shared_circ_buf_size;
6069 uint16_t shared_circ_buf_mem_pool_id;
6070 uint16_t shared_circ_buf_num_regions;
6071 uint32_t shared_circ_buf_property_flag;
6072 uint32_t num_watermark_levels;
6073 struct asm_multi_channel_pcm_fmt_blk_v3 fmt;
6074 struct avs_shared_map_region_payload map_region_pos_buf;
6075 struct avs_shared_map_region_payload map_region_circ_buf;
6076 struct asm_shared_watermark_level watermark[0];
6077} __packed;
6078
6079#define ASM_STREAM_CMD_OPEN_READ_V3 0x00010DB4
6080
6081/* Definition of the timestamp type flag bitmask */
6082#define ASM_BIT_MASKIMESTAMPYPE_FLAG (0x00000020UL)
6083
6084/* Definition of the timestamp type flag shift value. */
6085#define ASM_SHIFTIMESTAMPYPE_FLAG 5
6086
6087/* Relative timestamp is identified by this value.*/
6088#define ASM_RELATIVEIMESTAMP 0
6089
6090/* Absolute timestamp is identified by this value.*/
6091#define ASM_ABSOLUTEIMESTAMP 1
6092
6093/* Bit value for Low Latency Tx stream subfield */
6094#define ASM_LOW_LATENCY_TX_STREAM_SESSION 1
6095
6096/* Bit shift for the stream_perf_mode subfield. */
6097#define ASM_SHIFT_STREAM_PERF_MODE_FLAG_IN_OPEN_READ 29
6098
6099struct asm_stream_cmd_open_read_v3 {
6100 struct apr_hdr hdr;
6101 u32 mode_flags;
6102/* Mode flags that indicate whether meta information per encoded
6103 * frame is to be provided.
6104 * Supported values for bit 4:
6105 *
6106 * - 0 -- Return data buffer contains all encoded frames only; it
6107 * does not contain frame metadata.
6108 *
6109 * - 1 -- Return data buffer contains an array of metadata and
6110 * encoded frames.
6111 *
6112 * - Use #ASM_BIT_MASK_META_INFO_FLAG as the bitmask and
6113 * #ASM_SHIFT_META_INFO_FLAG as the shift value for this bit.
6114 *
6115 *
6116 * Supported values for bit 5:
6117 *
6118 * - ASM_RELATIVEIMESTAMP -- ASM_DATA_EVENT_READ_DONE_V2 will have
6119 * - relative time-stamp.
6120 * - ASM_ABSOLUTEIMESTAMP -- ASM_DATA_EVENT_READ_DONE_V2 will
6121 * - have absolute time-stamp.
6122 *
6123 * - Use #ASM_BIT_MASKIMESTAMPYPE_FLAG as the bitmask and
6124 * #ASM_SHIFTIMESTAMPYPE_FLAG as the shift value for this bit.
6125 *
6126 * All other bits are reserved; clients must set them to zero.
6127 */
6128
6129 u32 src_endpointype;
6130/* Specifies the endpoint providing the input samples.
6131 * Supported values:
6132 * - 0 -- Device matrix
6133 * - All other values are reserved; clients must set them to zero.
6134 * Otherwise, an error is returned.
6135 * The device matrix is the gateway from the tunneled Tx ports.
6136 */
6137
6138 u32 preprocopo_id;
6139/* Specifies the topology (order of processing) of preprocessing
6140 * algorithms. <i>None</i> means no preprocessing.
6141 * Supported values:
6142 * - #ASM_STREAM_PREPROCOPO_ID_DEFAULT
6143 * - #ASM_STREAM_PREPROCOPO_ID_NONE
6144 *
6145 * This field can also be enabled through SetParams flags.
6146 */
6147
6148 u32 enc_cfg_id;
6149/* Media configuration ID for encoded output.
6150 * Supported values:
6151 * - #ASM_MEDIA_FMT_MULTI_CHANNEL_PCM_V2
6152 * - #ASM_MEDIA_FMT_AAC_V2
6153 * - #ASM_MEDIA_FMT_AMRNB_FS
6154 * - #ASM_MEDIA_FMT_AMRWB_FS
6155 * - #ASM_MEDIA_FMT_V13K_FS
6156 * - #ASM_MEDIA_FMT_EVRC_FS
6157 * - #ASM_MEDIA_FMT_EVRCB_FS
6158 * - #ASM_MEDIA_FMT_EVRCWB_FS
6159 * - #ASM_MEDIA_FMT_SBC
6160 * - #ASM_MEDIA_FMT_G711_ALAW_FS
6161 * - #ASM_MEDIA_FMT_G711_MLAW_FS
6162 * - #ASM_MEDIA_FMT_G729A_FS
6163 * - #ASM_MEDIA_FMT_EXAMPLE
6164 * - #ASM_MEDIA_FMT_WMA_V8
6165 */
6166
6167 u16 bits_per_sample;
6168/* Number of bits per sample processed by ASM modules.
6169 * Supported values: 16 and 24 bits per sample
6170 */
6171
6172 u16 reserved;
6173/* Reserved for future use. This field must be set to zero.*/
6174} __packed;
6175
6176#define ASM_POPP_OUTPUT_SR_NATIVE_RATE 0
6177
6178/* Enumeration for the maximum sampling rate at the POPP output.*/
6179#define ASM_POPP_OUTPUT_SR_MAX_RATE 48000
6180
6181#define ASM_STREAM_CMD_OPEN_READWRITE_V2 0x00010D8D
6182#define ASM_STREAM_CMD_OPEN_READWRITE_V2 0x00010D8D
6183
6184struct asm_stream_cmd_open_readwrite_v2 {
6185 struct apr_hdr hdr;
6186 u32 mode_flags;
6187/* Mode flags.
6188 * Supported values for bit 2:
6189 * - 0 -- SR/CM change notification event is disabled.
6190 * - 1 -- SR/CM change notification event is enabled. Use
6191 * #ASM_BIT_MASK_SR_CM_CHANGE_NOTIFY_FLAG and
6192 * #ASM_SHIFT_SR_CM_CHANGE_NOTIFY_FLAG to set or
6193 * getting this flag.
6194 *
6195 * Supported values for bit 4:
6196 * - 0 -- Return read data buffer contains all encoded frames only; it
6197 * does not contain frame metadata.
6198 * - 1 -- Return read data buffer contains an array of metadata and
6199 * encoded frames.
6200 *
6201 * All other bits are reserved; clients must set them to zero.
6202 */
6203
6204 u32 postprocopo_id;
6205/* Specifies the topology (order of processing) of postprocessing
6206 * algorithms. <i>None</i> means no postprocessing.
6207 *
6208 * Supported values:
6209 * - #ASM_STREAM_POSTPROCOPO_ID_DEFAULT
6210 * - #ASM_STREAM_POSTPROCOPO_ID_MCH_PEAK_VOL
6211 * - #ASM_STREAM_POSTPROCOPO_ID_NONE
6212 */
6213
6214 u32 dec_fmt_id;
6215/* Specifies the media type of the input data. PCM indicates that
6216 * no decoding must be performed, e.g., this is an NT encoder
6217 * session.
6218 * Supported values:
6219 * - #ASM_MEDIA_FMT_MULTI_CHANNEL_PCM_V2
6220 * - #ASM_MEDIA_FMT_ADPCM
6221 * - #ASM_MEDIA_FMT_MP3
6222 * - #ASM_MEDIA_FMT_AAC_V2
6223 * - #ASM_MEDIA_FMT_DOLBY_AAC
6224 * - #ASM_MEDIA_FMT_AMRNB_FS
6225 * - #ASM_MEDIA_FMT_AMRWB_FS
6226 * - #ASM_MEDIA_FMT_V13K_FS
6227 * - #ASM_MEDIA_FMT_EVRC_FS
6228 * - #ASM_MEDIA_FMT_EVRCB_FS
6229 * - #ASM_MEDIA_FMT_EVRCWB_FS
6230 * - #ASM_MEDIA_FMT_SBC
6231 * - #ASM_MEDIA_FMT_WMA_V10PRO_V2
6232 * - #ASM_MEDIA_FMT_WMA_V9_V2
6233 * - #ASM_MEDIA_FMT_AMR_WB_PLUS_V2
6234 * - #ASM_MEDIA_FMT_AC3
6235 * - #ASM_MEDIA_FMT_G711_ALAW_FS
6236 * - #ASM_MEDIA_FMT_G711_MLAW_FS
6237 * - #ASM_MEDIA_FMT_G729A_FS
6238 * - #ASM_MEDIA_FMT_EXAMPLE
6239 */
6240
6241 u32 enc_cfg_id;
6242/* Specifies the media type for the output of the stream. PCM
6243 * indicates that no encoding must be performed, e.g., this is an NT
6244 * decoder session.
6245 * Supported values:
6246 * - #ASM_MEDIA_FMT_MULTI_CHANNEL_PCM_V2
6247 * - #ASM_MEDIA_FMT_AAC_V2
6248 * - #ASM_MEDIA_FMT_AMRNB_FS
6249 * - #ASM_MEDIA_FMT_AMRWB_FS
6250 * - #ASM_MEDIA_FMT_V13K_FS
6251 * - #ASM_MEDIA_FMT_EVRC_FS
6252 * - #ASM_MEDIA_FMT_EVRCB_FS
6253 * - #ASM_MEDIA_FMT_EVRCWB_FS
6254 * - #ASM_MEDIA_FMT_SBC
6255 * - #ASM_MEDIA_FMT_G711_ALAW_FS
6256 * - #ASM_MEDIA_FMT_G711_MLAW_FS
6257 * - #ASM_MEDIA_FMT_G729A_FS
6258 * - #ASM_MEDIA_FMT_EXAMPLE
6259 * - #ASM_MEDIA_FMT_WMA_V8
6260 */
6261
6262 u16 bits_per_sample;
6263/* Number of bits per sample processed by ASM modules.
6264 * Supported values: 16 and 24 bits per sample
6265 */
6266
6267 u16 reserved;
6268/* Reserved for future use. This field must be set to zero.*/
6269
6270} __packed;
6271
6272#define ASM_STREAM_CMD_OPEN_LOOPBACK_V2 0x00010D8E
6273struct asm_stream_cmd_open_loopback_v2 {
6274 struct apr_hdr hdr;
6275 u32 mode_flags;
6276/* Mode flags.
6277 * Bit 0-31: reserved; client should set these bits to 0
6278 */
6279 u16 src_endpointype;
6280 /* Endpoint type. 0 = Tx Matrix */
6281 u16 sink_endpointype;
6282 /* Endpoint type. 0 = Rx Matrix */
6283 u32 postprocopo_id;
6284/* Postprocessor topology ID. Specifies the topology of
6285 * postprocessing algorithms.
6286 */
6287
6288 u16 bits_per_sample;
6289/* The number of bits per sample processed by ASM modules
6290 * Supported values: 16 and 24 bits per sample
6291 */
6292 u16 reserved;
6293/* Reserved for future use. This field must be set to zero. */
6294} __packed;
6295
6296
6297#define ASM_STREAM_CMD_OPEN_TRANSCODE_LOOPBACK 0x00010DBA
6298
6299/* Bitmask for the stream's Performance mode. */
6300#define ASM_BIT_MASK_STREAM_PERF_MODE_FLAG_IN_OPEN_TRANSCODE_LOOPBACK \
6301 (0x70000000UL)
6302
6303/* Bit shift for the stream's Performance mode. */
6304#define ASM_SHIFT_STREAM_PERF_MODE_FLAG_IN_OPEN_TRANSCODE_LOOPBACK 28
6305
6306/* Bitmask for the decoder converter enable flag. */
6307#define ASM_BIT_MASK_DECODER_CONVERTER_FLAG (0x00000078UL)
6308
6309/* Shift value for the decoder converter enable flag. */
6310#define ASM_SHIFT_DECODER_CONVERTER_FLAG 3
6311
6312/* Converter mode is None (Default). */
6313#define ASM_CONVERTER_MODE_NONE 0
6314
6315/* Converter mode is DDP-to-DD. */
6316#define ASM_DDP_DD_CONVERTER_MODE 1
6317
6318/* Identifies a special converter mode where source and sink formats
6319 * are the same but postprocessing must applied. Therefore, Decode
6320 * @rarrow Re-encode is necessary.
6321 */
6322#define ASM_POST_PROCESS_CONVERTER_MODE 2
6323
6324
6325struct asm_stream_cmd_open_transcode_loopback_t {
6326 struct apr_hdr hdr;
6327 u32 mode_flags;
6328/* Mode Flags specifies the performance mode in which this stream
6329 * is to be opened.
6330 * Supported values{for bits 30 to 28}(stream_perf_mode flag)
6331 *
6332 * #ASM_LEGACY_STREAM_SESSION -- This mode ensures backward
6333 * compatibility to the original behavior
6334 * of ASM_STREAM_CMD_OPEN_TRANSCODE_LOOPBACK
6335 *
6336 * #ASM_LOW_LATENCY_STREAM_SESSION -- Opens a loopback session by using
6337 * shortened buffers in low latency POPP
6338 * - Recommendation: Do not enable high latency algorithms. They might
6339 * negate the benefits of opening a low latency stream, and they
6340 * might also suffer quality degradation from unexpected jitter.
6341 * - This Low Latency mode is supported only for PCM In and PCM Out
6342 * loopbacks. An error is returned if Low Latency mode is opened for
6343 * other transcode loopback modes.
6344 * - To configure this subfield, use
6345 * ASM_BIT_MASK_STREAM_PERF_MODE_FLAG_IN_OPEN_TRANSCODE_LOOPBACK and
6346 * ASM_SHIFT_STREAM_PERF_MODE_FLAG_IN_OPEN_TRANSCODE_LOOPBACK.
6347 *
6348 * Supported values{for bits 6 to 3} (decoder-converter compatibility)
6349 * #ASM_CONVERTER_MODE_NONE (0x0) -- Default
6350 * #ASM_DDP_DD_CONVERTER_MODE (0x1)
6351 * #ASM_POST_PROCESS_CONVERTER_MODE (0x2)
6352 * 0x3-0xF -- Reserved for future use
6353 * - Use #ASM_BIT_MASK_DECODER_CONVERTER_FLAG and
6354 * ASM_SHIFT_DECODER_CONVERTER_FLAG to set this bit
6355 * All other bits are reserved; clients must set them to 0.
6356 */
6357
6358 u32 src_format_id;
6359/* Specifies the media format of the input audio stream.
6360 *
6361 * Supported values
6362 * - #ASM_MEDIA_FMT_MULTI_CHANNEL_PCM_V2
6363 * - #ASM_MEDIA_FMT_MULTI_CHANNEL_PCM_V3
6364 * - #ASM_MEDIA_FMT_DTS
6365 * - #ASM_MEDIA_FMT_EAC3_DEC
6366 * - #ASM_MEDIA_FMT_EAC3
6367 * - #ASM_MEDIA_FMT_AC3_DEC
6368 * - #ASM_MEDIA_FMT_AC3
6369 */
6370 u32 sink_format_id;
6371/* Specifies the media format of the output stream.
6372 *
6373 * Supported values
6374 * - #ASM_MEDIA_FMT_MULTI_CHANNEL_PCM_V2
6375 * - #ASM_MEDIA_FMT_MULTI_CHANNEL_PCM_V3
6376 * - #ASM_MEDIA_FMT_DTS (not supported in Low Latency mode)
6377 * - #ASM_MEDIA_FMT_EAC3_DEC (not supported in Low Latency mode)
6378 * - #ASM_MEDIA_FMT_EAC3 (not supported in Low Latency mode)
6379 * - #ASM_MEDIA_FMT_AC3_DEC (not supported in Low Latency mode)
6380 * - #ASM_MEDIA_FMT_AC3 (not supported in Low Latency mode)
6381 */
6382
6383 u32 audproc_topo_id;
6384/* Postprocessing topology ID, which specifies the topology (order of
6385 * processing) of postprocessing algorithms.
6386 *
6387 * Supported values
6388 * - #ASM_STREAM_POSTPROC_TOPO_ID_DEFAULT
6389 * - #ASM_STREAM_POSTPROC_TOPO_ID_PEAKMETER
6390 * - #ASM_STREAM_POSTPROC_TOPO_ID_MCH_PEAK_VOL
6391 * - #ASM_STREAM_POSTPROC_TOPO_ID_NONE
6392 * Topologies can be added through #ASM_CMD_ADD_TOPOLOGIES.
6393 * This field is ignored for the Converter mode, in which no
6394 * postprocessing is performed.
6395 */
6396
6397 u16 src_endpoint_type;
6398/* Specifies the source endpoint that provides the input samples.
6399 *
6400 * Supported values
6401 * - 0 -- Tx device matrix or stream router (gateway to the hardware
6402 * ports)
6403 * - All other values are reserved
6404 * Clients must set this field to 0. Otherwise, an error is returned.
6405 */
6406
6407 u16 sink_endpoint_type;
6408/* Specifies the sink endpoint type.
6409 *
6410 * Supported values
6411 * - 0 -- Rx device matrix or stream router (gateway to the hardware
6412 * ports)
6413 * - All other values are reserved
6414 * Clients must set this field to 0. Otherwise, an error is returned.
6415 */
6416
6417 u16 bits_per_sample;
6418/* Number of bits per sample processed by the ASM modules.
6419 * Supported values 16, 24
6420 */
6421
6422 u16 reserved;
6423/* This field must be set to 0.
6424 */
6425} __packed;
6426
6427
6428#define ASM_STREAM_CMD_CLOSE 0x00010BCD
6429#define ASM_STREAM_CMD_FLUSH 0x00010BCE
6430
6431
6432#define ASM_STREAM_CMD_FLUSH_READBUFS 0x00010C09
6433#define ASM_STREAM_CMD_SET_PP_PARAMS_V2 0x00010DA1
6434
6435struct asm_stream_cmd_set_pp_params_v2 {
6436 u32 data_payload_addr_lsw;
6437/* LSW of parameter data payload address. Supported values: any. */
6438 u32 data_payload_addr_msw;
6439/* MSW of Parameter data payload address. Supported values: any.
6440 * - Must be set to zero for in-band data.
6441 * - In the case of 32 bit Shared memory address, msw field must be
6442 * - set to zero.
6443 * - In the case of 36 bit shared memory address, bit 31 to bit 4 of
6444 * msw
6445 *
6446 * - must be set to zero.
6447 */
6448 u32 mem_map_handle;
6449/* Supported Values: Any.
6450 * memory map handle returned by DSP through
6451 * ASM_CMD_SHARED_MEM_MAP_REGIONS
6452 * command.
6453 * if mmhandle is NULL, the ParamData payloads are within the
6454 * message payload (in-band).
6455 * If mmhandle is non-NULL, the ParamData payloads begin at the
6456 * address specified in the address msw and lsw (out-of-band).
6457 */
6458
6459 u32 data_payload_size;
6460/* Size in bytes of the variable payload accompanying the
6461 * message, or in shared memory. This field is used for parsing the
6462 * parameter payload.
6463 */
6464} __packed;
6465
6466
6467struct asm_stream_param_data_v2 {
6468 u32 module_id;
6469 /* Unique module ID. */
6470
6471 u32 param_id;
6472 /* Unique parameter ID. */
6473
6474 u16 param_size;
6475/* Data size of the param_id/module_id combination. This is
6476 * a multiple of 4 bytes.
6477 */
6478
6479 u16 reserved;
6480/* Reserved for future enhancements. This field must be set to
6481 * zero.
6482 */
6483
6484} __packed;
6485
6486#define ASM_STREAM_CMD_GET_PP_PARAMS_V2 0x00010DA2
6487
6488struct asm_stream_cmd_get_pp_params_v2 {
6489 u32 data_payload_addr_lsw;
6490 /* LSW of the parameter data payload address. */
6491 u32 data_payload_addr_msw;
6492/* MSW of the parameter data payload address.
6493 * - Size of the shared memory, if specified, shall be large enough
6494 * to contain the whole ParamData payload, including Module ID,
6495 * Param ID, Param Size, and Param Values
6496 * - Must be set to zero for in-band data
6497 * - In the case of 32 bit Shared memory address, msw field must be
6498 * set to zero.
6499 * - In the case of 36 bit shared memory address, bit 31 to bit 4 of
6500 * msw must be set to zero.
6501 */
6502
6503 u32 mem_map_handle;
6504/* Supported Values: Any.
6505 * memory map handle returned by DSP through ASM_CMD_SHARED_MEM_MAP_REGIONS
6506 * command.
6507 * if mmhandle is NULL, the ParamData payloads in the ACK are within the
6508 * message payload (in-band).
6509 * If mmhandle is non-NULL, the ParamData payloads in the ACK begin at the
6510 * address specified in the address msw and lsw.
6511 * (out-of-band).
6512 */
6513
6514 u32 module_id;
6515/* Unique module ID. */
6516
6517 u32 param_id;
6518/* Unique parameter ID. */
6519
6520 u16 param_max_size;
6521/* Maximum data size of the module_id/param_id combination. This
6522 * is a multiple of 4 bytes.
6523 */
6524
6525
6526 u16 reserved;
6527/* Reserved for backward compatibility. Clients must set this
6528 * field to zero.
6529 */
6530} __packed;
6531
6532#define ASM_STREAM_CMD_SET_ENCDEC_PARAM 0x00010C10
6533
6534#define ASM_STREAM_CMD_SET_ENCDEC_PARAM_V2 0x00013218
6535
6536struct asm_stream_cmd_set_encdec_param_v2 {
6537 u16 service_id;
6538 /* 0 - ASM_ENCODER_SVC; 1 - ASM_DECODER_SVC */
6539
6540 u16 reserved;
6541
6542 u32 param_id;
6543 /* ID of the parameter. */
6544
6545 u32 param_size;
6546 /*
6547 * Data size of this parameter, in bytes. The size is a multiple
6548 * of 4 bytes.
6549 */
6550} __packed;
6551
6552#define ASM_STREAM_CMD_REGISTER_ENCDEC_EVENTS 0x00013219
6553
6554#define ASM_STREAM_CMD_ENCDEC_EVENTS 0x0001321A
6555
6556#define AVS_PARAM_ID_RTIC_SHARED_MEMORY_ADDR 0x00013237
6557
6558struct avs_rtic_shared_mem_addr {
6559 struct apr_hdr hdr;
6560 struct asm_stream_cmd_set_encdec_param_v2 encdec;
6561 u32 shm_buf_addr_lsw;
6562 /* Lower 32 bit of the RTIC shared memory */
6563
6564 u32 shm_buf_addr_msw;
6565 /* Upper 32 bit of the RTIC shared memory */
6566
6567 u32 buf_size;
6568 /* Size of buffer */
6569
6570 u16 shm_buf_mem_pool_id;
6571 /* ADSP_MEMORY_MAP_SHMEM8_4K_POOL */
6572
6573 u16 shm_buf_num_regions;
6574 /* number of regions to map */
6575
6576 u32 shm_buf_flag;
6577 /* buffer property flag */
6578
6579 struct avs_shared_map_region_payload map_region;
6580 /* memory map region*/
6581} __packed;
6582
6583#define AVS_PARAM_ID_RTIC_EVENT_ACK 0x00013238
6584
6585struct avs_param_rtic_event_ack {
6586 struct apr_hdr hdr;
6587 struct asm_stream_cmd_set_encdec_param_v2 encdec;
6588} __packed;
6589
6590#define ASM_PARAM_ID_ENCDEC_BITRATE 0x00010C13
6591
6592struct asm_bitrate_param {
6593 u32 bitrate;
6594/* Maximum supported bitrate. Only the AAC encoder is supported.*/
6595
6596} __packed;
6597
6598#define ASM_PARAM_ID_ENCDEC_ENC_CFG_BLK_V2 0x00010DA3
6599#define ASM_PARAM_ID_AAC_SBR_PS_FLAG 0x00010C63
6600
6601/* Flag to turn off both SBR and PS processing, if they are
6602 * present in the bitstream.
6603 */
6604
6605#define ASM_AAC_SBR_OFF_PS_OFF (2)
6606
6607/* Flag to turn on SBR but turn off PS processing,if they are
6608 * present in the bitstream.
6609 */
6610
6611#define ASM_AAC_SBR_ON_PS_OFF (1)
6612
6613/* Flag to turn on both SBR and PS processing, if they are
6614 * present in the bitstream (default behavior).
6615 */
6616
6617
6618#define ASM_AAC_SBR_ON_PS_ON (0)
6619
6620/* Structure for an AAC SBR PS processing flag. */
6621
6622/* Payload of the #ASM_PARAM_ID_AAC_SBR_PS_FLAG parameter in the
6623 * #ASM_STREAM_CMD_SET_ENCDEC_PARAM command.
6624 */
6625struct asm_aac_sbr_ps_flag_param {
6626 struct apr_hdr hdr;
6627 struct asm_stream_cmd_set_encdec_param encdec;
6628 struct asm_enc_cfg_blk_param_v2 encblk;
6629
6630 u32 sbr_ps_flag;
6631/* Control parameter to enable or disable SBR/PS processing in
6632 * the AAC bitstream. Use the following macros to set this field:
6633 * - #ASM_AAC_SBR_OFF_PS_OFF -- Turn off both SBR and PS
6634 * processing, if they are present in the bitstream.
6635 * - #ASM_AAC_SBR_ON_PS_OFF -- Turn on SBR processing, but not PS
6636 * processing, if they are present in the bitstream.
6637 * - #ASM_AAC_SBR_ON_PS_ON -- Turn on both SBR and PS processing,
6638 * if they are present in the bitstream (default behavior).
6639 * - All other values are invalid.
6640 * Changes are applied to the next decoded frame.
6641 */
6642} __packed;
6643
6644#define ASM_PARAM_ID_AAC_DUAL_MONO_MAPPING 0x00010C64
6645
6646/* First single channel element in a dual mono bitstream.*/
6647#define ASM_AAC_DUAL_MONO_MAP_SCE_1 (1)
6648
6649/* Second single channel element in a dual mono bitstream.*/
6650#define ASM_AAC_DUAL_MONO_MAP_SCE_2 (2)
6651
6652/* Structure for AAC decoder dual mono channel mapping. */
6653
6654
6655struct asm_aac_dual_mono_mapping_param {
6656 struct apr_hdr hdr;
6657 struct asm_stream_cmd_set_encdec_param encdec;
6658 u16 left_channel_sce;
6659 u16 right_channel_sce;
6660
6661} __packed;
6662
6663#define ASM_STREAM_CMDRSP_GET_PP_PARAMS_V2 0x00010DA4
6664
6665struct asm_stream_cmdrsp_get_pp_params_v2 {
6666 u32 status;
6667} __packed;
6668
6669#define ASM_PARAM_ID_AC3_KARAOKE_MODE 0x00010D73
6670
6671/* Enumeration for both vocals in a karaoke stream.*/
6672#define AC3_KARAOKE_MODE_NO_VOCAL (0)
6673
6674/* Enumeration for only the left vocal in a karaoke stream.*/
6675#define AC3_KARAOKE_MODE_LEFT_VOCAL (1)
6676
6677/* Enumeration for only the right vocal in a karaoke stream.*/
6678#define AC3_KARAOKE_MODE_RIGHT_VOCAL (2)
6679
6680/* Enumeration for both vocal channels in a karaoke stream.*/
6681#define AC3_KARAOKE_MODE_BOTH_VOCAL (3)
6682#define ASM_PARAM_ID_AC3_DRC_MODE 0x00010D74
6683/* Enumeration for the Custom Analog mode.*/
6684#define AC3_DRC_MODE_CUSTOM_ANALOG (0)
6685
6686/* Enumeration for the Custom Digital mode.*/
6687#define AC3_DRC_MODE_CUSTOM_DIGITAL (1)
6688/* Enumeration for the Line Out mode (light compression).*/
6689#define AC3_DRC_MODE_LINE_OUT (2)
6690
6691/* Enumeration for the RF remodulation mode (heavy compression).*/
6692#define AC3_DRC_MODE_RF_REMOD (3)
6693#define ASM_PARAM_ID_AC3_DUAL_MONO_MODE 0x00010D75
6694
6695/* Enumeration for playing dual mono in stereo mode.*/
6696#define AC3_DUAL_MONO_MODE_STEREO (0)
6697
6698/* Enumeration for playing left mono.*/
6699#define AC3_DUAL_MONO_MODE_LEFT_MONO (1)
6700
6701/* Enumeration for playing right mono.*/
6702#define AC3_DUAL_MONO_MODE_RIGHT_MONO (2)
6703
6704/* Enumeration for mixing both dual mono channels and playing them.*/
6705#define AC3_DUAL_MONO_MODE_MIXED_MONO (3)
6706#define ASM_PARAM_ID_AC3_STEREO_DOWNMIX_MODE 0x00010D76
6707
6708/* Enumeration for using the Downmix mode indicated in the bitstream. */
6709
6710#define AC3_STEREO_DOWNMIX_MODE_AUTO_DETECT (0)
6711
6712/* Enumeration for Surround Compatible mode (preserves the
6713 * surround information).
6714 */
6715
6716#define AC3_STEREO_DOWNMIX_MODE_LT_RT (1)
6717/* Enumeration for Mono Compatible mode (if the output is to be
6718 * further downmixed to mono).
6719 */
6720
6721#define AC3_STEREO_DOWNMIX_MODE_LO_RO (2)
6722
6723/* ID of the AC3 PCM scale factor parameter in the
6724 * #ASM_STREAM_CMD_SET_ENCDEC_PARAM command.
6725 */
6726#define ASM_PARAM_ID_AC3_PCM_SCALEFACTOR 0x00010D78
6727
6728/* ID of the AC3 DRC boost scale factor parameter in the
6729 * #ASM_STREAM_CMD_SET_ENCDEC_PARAM command.
6730 */
6731#define ASM_PARAM_ID_AC3_DRC_BOOST_SCALEFACTOR 0x00010D79
6732
6733/* ID of the AC3 DRC cut scale factor parameter in the
6734 * #ASM_STREAM_CMD_SET_ENCDEC_PARAM command.
6735 */
6736#define ASM_PARAM_ID_AC3_DRC_CUT_SCALEFACTOR 0x00010D7A
6737
6738/* Structure for AC3 Generic Parameter. */
6739
6740/* Payload of the AC3 parameters in the
6741 * #ASM_STREAM_CMD_SET_ENCDEC_PARAM command.
6742 */
6743struct asm_ac3_generic_param {
6744 struct apr_hdr hdr;
6745 struct asm_stream_cmd_set_encdec_param encdec;
6746 struct asm_enc_cfg_blk_param_v2 encblk;
6747 u32 generic_parameter;
6748/* AC3 generic parameter. Select from one of the following
6749 * possible values.
6750 *
6751 * For #ASM_PARAM_ID_AC3_KARAOKE_MODE, supported values are:
6752 * - AC3_KARAOKE_MODE_NO_VOCAL
6753 * - AC3_KARAOKE_MODE_LEFT_VOCAL
6754 * - AC3_KARAOKE_MODE_RIGHT_VOCAL
6755 * - AC3_KARAOKE_MODE_BOTH_VOCAL
6756 *
6757 * For #ASM_PARAM_ID_AC3_DRC_MODE, supported values are:
6758 * - AC3_DRC_MODE_CUSTOM_ANALOG
6759 * - AC3_DRC_MODE_CUSTOM_DIGITAL
6760 * - AC3_DRC_MODE_LINE_OUT
6761 * - AC3_DRC_MODE_RF_REMOD
6762 *
6763 * For #ASM_PARAM_ID_AC3_DUAL_MONO_MODE, supported values are:
6764 * - AC3_DUAL_MONO_MODE_STEREO
6765 * - AC3_DUAL_MONO_MODE_LEFT_MONO
6766 * - AC3_DUAL_MONO_MODE_RIGHT_MONO
6767 * - AC3_DUAL_MONO_MODE_MIXED_MONO
6768 *
6769 * For #ASM_PARAM_ID_AC3_STEREO_DOWNMIX_MODE, supported values are:
6770 * - AC3_STEREO_DOWNMIX_MODE_AUTO_DETECT
6771 * - AC3_STEREO_DOWNMIX_MODE_LT_RT
6772 * - AC3_STEREO_DOWNMIX_MODE_LO_RO
6773 *
6774 * For #ASM_PARAM_ID_AC3_PCM_SCALEFACTOR, supported values are
6775 * 0 to 1 in Q31 format.
6776 *
6777 * For #ASM_PARAM_ID_AC3_DRC_BOOST_SCALEFACTOR, supported values are
6778 * 0 to 1 in Q31 format.
6779 *
6780 * For #ASM_PARAM_ID_AC3_DRC_CUT_SCALEFACTOR, supported values are
6781 * 0 to 1 in Q31 format.
6782 */
6783} __packed;
6784
6785/* Enumeration for Raw mode (no downmixing), which specifies
6786 * that all channels in the bitstream are to be played out as is
6787 * without any downmixing. (Default)
6788 */
6789
6790#define WMAPRO_CHANNEL_MASK_RAW (-1)
6791
6792/* Enumeration for setting the channel mask to 0. The 7.1 mode
6793 * (Home Theater) is assigned.
6794 */
6795
6796
6797#define WMAPRO_CHANNEL_MASK_ZERO 0x0000
6798
6799/* Speaker layout mask for one channel (Home Theater, mono).
6800 * - Speaker front center
6801 */
6802#define WMAPRO_CHANNEL_MASK_1_C 0x0004
6803
6804/* Speaker layout mask for two channels (Home Theater, stereo).
6805 * - Speaker front left
6806 * - Speaker front right
6807 */
6808#define WMAPRO_CHANNEL_MASK_2_L_R 0x0003
6809
6810/* Speaker layout mask for three channels (Home Theater).
6811 * - Speaker front left
6812 * - Speaker front right
6813 * - Speaker front center
6814 */
6815#define WMAPRO_CHANNEL_MASK_3_L_C_R 0x0007
6816
6817/* Speaker layout mask for two channels (stereo).
6818 * - Speaker back left
6819 * - Speaker back right
6820 */
6821#define WMAPRO_CHANNEL_MASK_2_Bl_Br 0x0030
6822
6823/* Speaker layout mask for four channels.
6824 * - Speaker front left
6825 * - Speaker front right
6826 * - Speaker back left
6827 * - Speaker back right
6828 */
6829#define WMAPRO_CHANNEL_MASK_4_L_R_Bl_Br 0x0033
6830
6831/* Speaker layout mask for four channels (Home Theater).
6832 * - Speaker front left
6833 * - Speaker front right
6834 * - Speaker front center
6835 * - Speaker back center
6836 */
6837#define WMAPRO_CHANNEL_MASK_4_L_R_C_Bc_HT 0x0107
6838/* Speaker layout mask for five channels.
6839 * - Speaker front left
6840 * - Speaker front right
6841 * - Speaker front center
6842 * - Speaker back left
6843 * - Speaker back right
6844 */
6845#define WMAPRO_CHANNEL_MASK_5_L_C_R_Bl_Br 0x0037
6846
6847/* Speaker layout mask for five channels (5 mode, Home Theater).
6848 * - Speaker front left
6849 * - Speaker front right
6850 * - Speaker front center
6851 * - Speaker side left
6852 * - Speaker side right
6853 */
6854#define WMAPRO_CHANNEL_MASK_5_L_C_R_Sl_Sr_HT 0x0607
6855/* Speaker layout mask for six channels (5.1 mode).
6856 * - Speaker front left
6857 * - Speaker front right
6858 * - Speaker front center
6859 * - Speaker low frequency
6860 * - Speaker back left
6861 * - Speaker back right
6862 */
6863#define WMAPRO_CHANNEL_MASK_5DOT1_L_C_R_Bl_Br_SLF 0x003F
6864/* Speaker layout mask for six channels (5.1 mode, Home Theater).
6865 * - Speaker front left
6866 * - Speaker front right
6867 * - Speaker front center
6868 * - Speaker low frequency
6869 * - Speaker side left
6870 * - Speaker side right
6871 */
6872#define WMAPRO_CHANNEL_MASK_5DOT1_L_C_R_Sl_Sr_SLF_HT 0x060F
6873/* Speaker layout mask for six channels (5.1 mode, no LFE).
6874 * - Speaker front left
6875 * - Speaker front right
6876 * - Speaker front center
6877 * - Speaker back left
6878 * - Speaker back right
6879 * - Speaker back center
6880 */
6881#define WMAPRO_CHANNEL_MASK_5DOT1_L_C_R_Bl_Br_Bc 0x0137
6882/* Speaker layout mask for six channels (5.1 mode, Home Theater,
6883 * no LFE).
6884 * - Speaker front left
6885 * - Speaker front right
6886 * - Speaker front center
6887 * - Speaker back center
6888 * - Speaker side left
6889 * - Speaker side right
6890 */
6891#define WMAPRO_CHANNEL_MASK_5DOT1_L_C_R_Sl_Sr_Bc_HT 0x0707
6892
6893/* Speaker layout mask for seven channels (6.1 mode).
6894 * - Speaker front left
6895 * - Speaker front right
6896 * - Speaker front center
6897 * - Speaker low frequency
6898 * - Speaker back left
6899 * - Speaker back right
6900 * - Speaker back center
6901 */
6902#define WMAPRO_CHANNEL_MASK_6DOT1_L_C_R_Bl_Br_Bc_SLF 0x013F
6903
6904/* Speaker layout mask for seven channels (6.1 mode, Home
6905 * Theater).
6906 * - Speaker front left
6907 * - Speaker front right
6908 * - Speaker front center
6909 * - Speaker low frequency
6910 * - Speaker back center
6911 * - Speaker side left
6912 * - Speaker side right
6913 */
6914#define WMAPRO_CHANNEL_MASK_6DOT1_L_C_R_Sl_Sr_Bc_SLF_HT 0x070F
6915
6916/* Speaker layout mask for seven channels (6.1 mode, no LFE).
6917 * - Speaker front left
6918 * - Speaker front right
6919 * - Speaker front center
6920 * - Speaker back left
6921 * - Speaker back right
6922 * - Speaker front left of center
6923 * - Speaker front right of center
6924 */
6925#define WMAPRO_CHANNEL_MASK_6DOT1_L_C_R_Bl_Br_SFLOC_SFROC 0x00F7
6926
6927/* Speaker layout mask for seven channels (6.1 mode, Home
6928 * Theater, no LFE).
6929 * - Speaker front left
6930 * - Speaker front right
6931 * - Speaker front center
6932 * - Speaker side left
6933 * - Speaker side right
6934 * - Speaker front left of center
6935 * - Speaker front right of center
6936 */
6937#define WMAPRO_CHANNEL_MASK_6DOT1_L_C_R_Sl_Sr_SFLOC_SFROC_HT 0x0637
6938
6939/* Speaker layout mask for eight channels (7.1 mode).
6940 * - Speaker front left
6941 * - Speaker front right
6942 * - Speaker front center
6943 * - Speaker back left
6944 * - Speaker back right
6945 * - Speaker low frequency
6946 * - Speaker front left of center
6947 * - Speaker front right of center
6948 */
6949#define WMAPRO_CHANNEL_MASK_7DOT1_L_C_R_Bl_Br_SLF_SFLOC_SFROC \
6950 0x00FF
6951
6952/* Speaker layout mask for eight channels (7.1 mode, Home Theater).
6953 * - Speaker front left
6954 * - Speaker front right
6955 * - Speaker front center
6956 * - Speaker side left
6957 * - Speaker side right
6958 * - Speaker low frequency
6959 * - Speaker front left of center
6960 * - Speaker front right of center
6961 *
6962 */
6963#define WMAPRO_CHANNEL_MASK_7DOT1_L_C_R_Sl_Sr_SLF_SFLOC_SFROC_HT \
6964 0x063F
6965
6966#define ASM_PARAM_ID_DEC_OUTPUT_CHAN_MAP 0x00010D82
6967
6968/* Maximum number of decoder output channels. */
6969#define MAX_CHAN_MAP_CHANNELS 16
6970
6971/* Structure for decoder output channel mapping. */
6972
6973/* Payload of the #ASM_PARAM_ID_DEC_OUTPUT_CHAN_MAP parameter in the
6974 * #ASM_STREAM_CMD_SET_ENCDEC_PARAM command.
6975 */
6976struct asm_dec_out_chan_map_param {
6977 struct apr_hdr hdr;
6978 struct asm_stream_cmd_set_encdec_param encdec;
6979 u32 num_channels;
6980/* Number of decoder output channels.
6981 * Supported values: 0 to #MAX_CHAN_MAP_CHANNELS
6982 *
6983 * A value of 0 indicates native channel mapping, which is valid
6984 * only for NT mode. This means the output of the decoder is to be
6985 * preserved as is.
6986 */
6987 u8 channel_mapping[MAX_CHAN_MAP_CHANNELS];
6988} __packed;
6989
6990#define ASM_STREAM_CMD_OPEN_WRITE_COMPRESSED 0x00010D84
6991
6992/* Bitmask for the IEC 61937 enable flag.*/
6993#define ASM_BIT_MASK_IEC_61937_STREAM_FLAG (0x00000001UL)
6994
6995/* Shift value for the IEC 61937 enable flag.*/
6996#define ASM_SHIFT_IEC_61937_STREAM_FLAG 0
6997
6998/* Bitmask for the IEC 60958 enable flag.*/
6999#define ASM_BIT_MASK_IEC_60958_STREAM_FLAG (0x00000002UL)
7000
7001/* Shift value for the IEC 60958 enable flag.*/
7002#define ASM_SHIFT_IEC_60958_STREAM_FLAG 1
7003
7004/* Payload format for open write compressed command */
7005
7006/* Payload format for the #ASM_STREAM_CMD_OPEN_WRITE_COMPRESSED
7007 * command, which opens a stream for a given session ID and stream ID
7008 * to be rendered in the compressed format.
7009 */
7010
7011struct asm_stream_cmd_open_write_compressed {
7012 struct apr_hdr hdr;
7013 u32 flags;
7014/* Mode flags that configure the stream for a specific format.
7015 * Supported values:
7016 * - Bit 0 -- IEC 61937 compatibility
7017 * - 0 -- Stream is not in IEC 61937 format
7018 * - 1 -- Stream is in IEC 61937 format
7019 * - Bit 1 -- IEC 60958 compatibility
7020 * - 0 -- Stream is not in IEC 60958 format
7021 * - 1 -- Stream is in IEC 60958 format
7022 * - Bits 2 to 31 -- 0 (Reserved)
7023 *
7024 * For the same stream, bit 0 cannot be set to 0 and bit 1 cannot
7025 * be set to 1. A compressed stream connot have IEC 60958
7026 * packetization applied without IEC 61937 packetization.
7027 * @note1hang Currently, IEC 60958 packetized input streams are not
7028 * supported.
7029 */
7030
7031
7032 u32 fmt_id;
7033/* Specifies the media type of the HDMI stream to be opened.
7034 * Supported values:
7035 * - #ASM_MEDIA_FMT_AC3
7036 * - #ASM_MEDIA_FMT_EAC3
7037 * - #ASM_MEDIA_FMT_DTS
7038 * - #ASM_MEDIA_FMT_ATRAC
7039 * - #ASM_MEDIA_FMT_MAT
7040 *
7041 * @note1hang This field must be set to a valid media type even if
7042 * IEC 61937 packetization is not performed by the aDSP.
7043 */
7044
7045} __packed;
7046
7047
7048/* Indicates the number of samples per channel to be removed from the
7049 * beginning of the stream.
7050 */
7051#define ASM_DATA_CMD_REMOVE_INITIAL_SILENCE 0x00010D67
7052
7053/* Indicates the number of samples per channel to be removed from
7054 * the end of the stream.
7055 */
7056#define ASM_DATA_CMD_REMOVE_TRAILING_SILENCE 0x00010D68
7057
7058struct asm_data_cmd_remove_silence {
7059 struct apr_hdr hdr;
7060 u32 num_samples_to_remove;
7061 /* < Number of samples per channel to be removed.
7062 * @values 0 to (2@sscr{32}-1)
7063 */
7064} __packed;
7065
7066#define ASM_STREAM_CMD_OPEN_READ_COMPRESSED 0x00010D95
7067
7068struct asm_stream_cmd_open_read_compressed {
7069 struct apr_hdr hdr;
7070 u32 mode_flags;
7071/* Mode flags that indicate whether meta information per encoded
7072 * frame is to be provided.
7073 * Supported values for bit 4:
7074 * - 0 -- Return data buffer contains all encoded frames only; it does
7075 * not contain frame metadata.
7076 * - 1 -- Return data buffer contains an array of metadata and encoded
7077 * frames.
7078 * - Use #ASM_BIT_MASK_META_INFO_FLAG to set the bitmask and
7079 * #ASM_SHIFT_META_INFO_FLAG to set the shift value for this bit.
7080 * All other bits are reserved; clients must set them to zero.
7081 */
7082
7083 u32 frames_per_buf;
7084/* Indicates the number of frames that need to be returned per
7085 * read buffer
7086 * Supported values: should be greater than 0
7087 */
7088
7089} __packed;
7090
7091/* adsp_asm_stream_commands.h*/
7092
7093
7094/* adsp_asm_api.h (no changes)*/
7095#define ASM_STREAM_POSTPROCOPO_ID_DEFAULT \
7096 0x00010BE4
7097#define ASM_STREAM_POSTPROCOPO_ID_PEAKMETER \
7098 0x00010D83
7099#define ASM_STREAM_POSTPROCOPO_ID_NONE \
7100 0x00010C68
7101#define ASM_STREAM_POSTPROCOPO_ID_MCH_PEAK_VOL \
7102 0x00010D8B
7103#define ASM_STREAM_PREPROCOPO_ID_DEFAULT \
7104 ASM_STREAM_POSTPROCOPO_ID_DEFAULT
7105#define ASM_STREAM_PREPROCOPO_ID_NONE \
7106 ASM_STREAM_POSTPROCOPO_ID_NONE
7107#define ADM_CMD_COPP_OPENOPOLOGY_ID_NONE_AUDIO_COPP \
7108 0x00010312
7109#define ADM_CMD_COPP_OPENOPOLOGY_ID_SPEAKER_MONO_AUDIO_COPP \
7110 0x00010313
7111#define ADM_CMD_COPP_OPENOPOLOGY_ID_SPEAKER_STEREO_AUDIO_COPP \
7112 0x00010314
7113#define ADM_CMD_COPP_OPENOPOLOGY_ID_SPEAKER_STEREO_IIR_AUDIO_COPP\
7114 0x00010704
7115#define ADM_CMD_COPP_OPENOPOLOGY_ID_SPEAKER_MONO_AUDIO_COPP_MBDRCV2\
7116 0x0001070D
7117#define ADM_CMD_COPP_OPENOPOLOGY_ID_SPEAKER_STEREO_AUDIO_COPP_MBDRCV2\
7118 0x0001070E
7119#define ADM_CMD_COPP_OPENOPOLOGY_ID_SPEAKER_STEREO_IIR_AUDIO_COPP_MBDRCV2\
7120 0x0001070F
7121#define ADM_CMD_COPP_OPENOPOLOGY_ID_SPEAKER_STEREO_AUDIO_COPP_MBDRC_V3 \
7122 0x11000000
7123#define ADM_CMD_COPP_OPENOPOLOGY_ID_SPEAKER_MCH_PEAK_VOL \
7124 0x0001031B
7125#define ADM_CMD_COPP_OPENOPOLOGY_ID_MIC_MONO_AUDIO_COPP 0x00010315
7126#define ADM_CMD_COPP_OPENOPOLOGY_ID_MIC_STEREO_AUDIO_COPP 0x00010316
7127#define AUDPROC_COPPOPOLOGY_ID_MCHAN_IIR_AUDIO 0x00010715
7128#define ADM_CMD_COPP_OPENOPOLOGY_ID_DEFAULT_AUDIO_COPP 0x00010BE3
7129#define ADM_CMD_COPP_OPENOPOLOGY_ID_PEAKMETER_AUDIO_COPP 0x00010317
7130#define AUDPROC_MODULE_ID_AIG 0x00010716
7131#define AUDPROC_PARAM_ID_AIG_ENABLE 0x00010717
7132#define AUDPROC_PARAM_ID_AIG_CONFIG 0x00010718
7133
7134struct Audio_AigParam {
7135 uint16_t mode;
7136/*< Mode word for enabling AIG/SIG mode .
7137 * Byte offset: 0
7138 */
7139 int16_t staticGainL16Q12;
7140/*< Static input gain when aigMode is set to 1.
7141 * Byte offset: 2
7142 */
7143 int16_t initialGainDBL16Q7;
7144/*<Initial value that the adaptive gain update starts from dB
7145 * Q7 Byte offset: 4
7146 */
7147 int16_t idealRMSDBL16Q7;
7148/*<Average RMS level that AIG attempts to achieve Q8.7
7149 * Byte offset: 6
7150 */
7151 int32_t noiseGateL32;
7152/*Threshold below which signal is considered as noise and AIG
7153 * Byte offset: 8
7154 */
7155 int32_t minGainL32Q15;
7156/*Minimum gain that can be provided by AIG Q16.15
7157 * Byte offset: 12
7158 */
7159 int32_t maxGainL32Q15;
7160/*Maximum gain that can be provided by AIG Q16.15
7161 * Byte offset: 16
7162 */
7163 uint32_t gainAtRtUL32Q31;
7164/*Attack/release time for AIG update Q1.31
7165 * Byte offset: 20
7166 */
7167 uint32_t longGainAtRtUL32Q31;
7168/*Long attack/release time while updating gain for
7169 * noise/silence Q1.31 Byte offset: 24
7170 */
7171
7172 uint32_t rmsTavUL32Q32;
7173/* RMS smoothing time constant used for long-term RMS estimate
7174 * Q0.32 Byte offset: 28
7175 */
7176
7177 uint32_t gainUpdateStartTimMsUL32Q0;
7178/* The waiting time before which AIG starts to apply adaptive
7179 * gain update Q32.0 Byte offset: 32
7180 */
7181
7182} __packed;
7183
7184
7185#define ADM_MODULE_ID_EANS 0x00010C4A
7186#define ADM_PARAM_ID_EANS_ENABLE 0x00010C4B
7187#define ADM_PARAM_ID_EANS_PARAMS 0x00010C4C
7188
7189struct adm_eans_enable {
7190
7191 uint32_t enable_flag;
7192/*< Specifies whether EANS is disabled (0) or enabled
7193 * (nonzero).
7194 * This is supported only for sampling rates of 8, 12, 16, 24, 32,
7195 * and 48 kHz. It is not supported for sampling rates of 11.025,
7196 * 22.05, or 44.1 kHz.
7197 */
7198
7199} __packed;
7200
7201
7202struct adm_eans_params {
7203 int16_t eans_mode;
7204/*< Mode word for enabling/disabling submodules.
7205 * Byte offset: 0
7206 */
7207
7208 int16_t eans_input_gain;
7209/*< Q2.13 input gain to the EANS module.
7210 * Byte offset: 2
7211 */
7212
7213 int16_t eans_output_gain;
7214/*< Q2.13 output gain to the EANS module.
7215 * Byte offset: 4
7216 */
7217
7218 int16_t eansarget_ns;
7219/*< Target noise suppression level in dB.
7220 * Byte offset: 6
7221 */
7222
7223 int16_t eans_s_alpha;
7224/*< Q3.12 over-subtraction factor for stationary noise
7225 * suppression.
7226 * Byte offset: 8
7227 */
7228
7229 int16_t eans_n_alpha;
7230/* < Q3.12 over-subtraction factor for nonstationary noise
7231 * suppression.
7232 * Byte offset: 10
7233 */
7234
7235 int16_t eans_n_alphamax;
7236/*< Q3.12 maximum over-subtraction factor for nonstationary
7237 * noise suppression.
7238 * Byte offset: 12
7239 */
7240 int16_t eans_e_alpha;
7241/*< Q15 scaling factor for excess noise suppression.
7242 * Byte offset: 14
7243 */
7244
7245 int16_t eans_ns_snrmax;
7246/*< Upper boundary in dB for SNR estimation.
7247 * Byte offset: 16
7248 */
7249
7250 int16_t eans_sns_block;
7251/*< Quarter block size for stationary noise suppression.
7252 * Byte offset: 18
7253 */
7254
7255 int16_t eans_ns_i;
7256/*< Initialization block size for noise suppression.
7257 * Byte offset: 20
7258 */
7259 int16_t eans_np_scale;
7260/*< Power scale factor for nonstationary noise update.
7261 * Byte offset: 22
7262 */
7263
7264 int16_t eans_n_lambda;
7265/*< Smoothing factor for higher level nonstationary noise
7266 * update.
7267 * Byte offset: 24
7268 */
7269
7270 int16_t eans_n_lambdaf;
7271/*< Medium averaging factor for noise update.
7272 * Byte offset: 26
7273 */
7274
7275 int16_t eans_gs_bias;
7276/*< Bias factor in dB for gain calculation.
7277 * Byte offset: 28
7278 */
7279
7280 int16_t eans_gs_max;
7281/*< SNR lower boundary in dB for aggressive gain calculation.
7282 * Byte offset: 30
7283 */
7284
7285 int16_t eans_s_alpha_hb;
7286/*< Q3.12 over-subtraction factor for high-band stationary
7287 * noise suppression.
7288 * Byte offset: 32
7289 */
7290
7291 int16_t eans_n_alphamax_hb;
7292/*< Q3.12 maximum over-subtraction factor for high-band
7293 * nonstationary noise suppression.
7294 * Byte offset: 34
7295 */
7296
7297 int16_t eans_e_alpha_hb;
7298/*< Q15 scaling factor for high-band excess noise suppression.
7299 * Byte offset: 36
7300 */
7301
7302 int16_t eans_n_lambda0;
7303/*< Smoothing factor for nonstationary noise update during
7304 * speech activity.
7305 * Byte offset: 38
7306 */
7307
7308 int16_t thresh;
7309/*< Threshold for generating a binary VAD decision.
7310 * Byte offset: 40
7311 */
7312
7313 int16_t pwr_scale;
7314/*< Indirect lower boundary of the noise level estimate.
7315 * Byte offset: 42
7316 */
7317
7318 int16_t hangover_max;
7319/*< Avoids mid-speech clipping and reliably detects weak speech
7320 * bursts at the end of speech activity.
7321 * Byte offset: 44
7322 */
7323
7324 int16_t alpha_snr;
7325/*< Controls responsiveness of the VAD.
7326 * Byte offset: 46
7327 */
7328
7329 int16_t snr_diff_max;
7330/*< Maximum SNR difference. Decreasing this parameter value may
7331 * help in making correct decisions during abrupt changes; however,
7332 * decreasing too much may increase false alarms during long
7333 * pauses/silences.
7334 * Byte offset: 48
7335 */
7336
7337 int16_t snr_diff_min;
7338/*< Minimum SNR difference. Decreasing this parameter value may
7339 * help in making correct decisions during abrupt changes; however,
7340 * decreasing too much may increase false alarms during long
7341 * pauses/silences.
7342 * Byte offset: 50
7343 */
7344
7345 int16_t init_length;
7346/*< Defines the number of frames for which a noise level
7347 * estimate is set to a fixed value.
7348 * Byte offset: 52
7349 */
7350
7351 int16_t max_val;
7352/*< Defines the upper limit of the noise level.
7353 * Byte offset: 54
7354 */
7355
7356 int16_t init_bound;
7357/*< Defines the initial bounding value for the noise level
7358 * estimate. This is used during the initial segment defined by the
7359 * init_length parameter.
7360 * Byte offset: 56
7361 */
7362
7363 int16_t reset_bound;
7364/*< Reset boundary for noise tracking.
7365 * Byte offset: 58
7366 */
7367
7368 int16_t avar_scale;
7369/*< Defines the bias factor in noise estimation.
7370 * Byte offset: 60
7371 */
7372
7373 int16_t sub_nc;
7374/*< Defines the window length for noise estimation.
7375 * Byte offset: 62
7376 */
7377
7378 int16_t spow_min;
7379/*< Defines the minimum signal power required to update the
7380 * boundaries for the noise floor estimate.
7381 * Byte offset: 64
7382 */
7383
7384 int16_t eans_gs_fast;
7385/*< Fast smoothing factor for postprocessor gain.
7386 * Byte offset: 66
7387 */
7388
7389 int16_t eans_gs_med;
7390/*< Medium smoothing factor for postprocessor gain.
7391 * Byte offset: 68
7392 */
7393
7394 int16_t eans_gs_slow;
7395/*< Slow smoothing factor for postprocessor gain.
7396 * Byte offset: 70
7397 */
7398
7399 int16_t eans_swb_salpha;
7400/*< Q3.12 super wideband aggressiveness factor for stationary
7401 * noise suppression.
7402 * Byte offset: 72
7403 */
7404
7405 int16_t eans_swb_nalpha;
7406/*< Q3.12 super wideband aggressiveness factor for
7407 * nonstationary noise suppression.
7408 * Byte offset: 74
7409 */
7410} __packed;
7411#define ADM_MODULE_IDX_MIC_GAIN_CTRL 0x00010C35
7412
7413/* @addtogroup audio_pp_param_ids
7414 * ID of the Tx mic gain control parameter used by the
7415 * #ADM_MODULE_IDX_MIC_GAIN_CTRL module.
7416 * @messagepayload
7417 * @structure{admx_mic_gain}
7418 * @tablespace
7419 * @inputtable{Audio_Postproc_ADM_PARAM_IDX_MIC_GAIN.tex}
7420 */
7421#define ADM_PARAM_IDX_MIC_GAIN 0x00010C36
7422
7423/* Structure for a Tx mic gain parameter for the mic gain
7424 * control module.
7425 */
7426
7427
7428/* @brief Payload of the #ADM_PARAM_IDX_MIC_GAIN parameter in the
7429 * Tx Mic Gain Control module.
7430 */
7431struct admx_mic_gain {
7432 uint16_t tx_mic_gain;
7433 /*< Linear gain in Q13 format. */
7434
7435 uint16_t reserved;
7436 /*< Clients must set this field to zero. */
7437} __packed;
7438
7439struct adm_set_mic_gain_params {
7440 struct adm_cmd_set_pp_params_v5 params;
7441 struct adm_param_data_v5 data;
7442 struct admx_mic_gain mic_gain_data;
7443} __packed;
7444
7445/* end_addtogroup audio_pp_param_ids */
7446
7447/* @ingroup audio_pp_module_ids
7448 * ID of the Rx Codec Gain Control module.
7449 *
7450 * This module supports the following parameter ID:
7451 * - #ADM_PARAM_ID_RX_CODEC_GAIN
7452 */
7453#define ADM_MODULE_ID_RX_CODEC_GAIN_CTRL 0x00010C37
7454
7455/* @addtogroup audio_pp_param_ids
7456 * ID of the Rx codec gain control parameter used by the
7457 * #ADM_MODULE_ID_RX_CODEC_GAIN_CTRL module.
7458 *
7459 * @messagepayload
7460 * @structure{adm_rx_codec_gain}
7461 * @tablespace
7462 * @inputtable{Audio_Postproc_ADM_PARAM_ID_RX_CODEC_GAIN.tex}
7463 */
7464#define ADM_PARAM_ID_RX_CODEC_GAIN 0x00010C38
7465
7466/* Structure for the Rx common codec gain control module. */
7467
7468
7469/* @brief Payload of the #ADM_PARAM_ID_RX_CODEC_GAIN parameter
7470 * in the Rx Codec Gain Control module.
7471 */
7472
7473
7474struct adm_rx_codec_gain {
7475 uint16_t rx_codec_gain;
7476 /* Linear gain in Q13 format. */
7477
7478 uint16_t reserved;
7479 /* Clients must set this field to zero.*/
7480} __packed;
7481
7482/* end_addtogroup audio_pp_param_ids */
7483
7484/* @ingroup audio_pp_module_ids
7485 * ID of the HPF Tuning Filter module on the Tx path.
7486 * This module supports the following parameter IDs:
7487 * - #ADM_PARAM_ID_HPF_IIRX_FILTER_ENABLE_CONFIG
7488 * - #ADM_PARAM_ID_HPF_IIRX_FILTER_PRE_GAIN
7489 * - #ADM_PARAM_ID_HPF_IIRX_FILTER_CONFIG_PARAMS
7490 */
7491#define ADM_MODULE_ID_HPF_IIRX_FILTER 0x00010C3D
7492
7493/* @addtogroup audio_pp_param_ids */
7494/* ID of the Tx HPF IIR filter enable parameter used by the
7495 * #ADM_MODULE_ID_HPF_IIRX_FILTER module.
7496 * @parspace Message payload
7497 * @structure{adm_hpfx_iir_filter_enable_cfg}
7498 * @tablespace
7499 * @inputtable{Audio_Postproc_ADM_PARAM_ID_HPF_IIRX_FILTER_ENABLE_CONFIG.tex}
7500 */
7501#define ADM_PARAM_ID_HPF_IIRX_FILTER_ENABLE_CONFIG 0x00010C3E
7502
7503/* ID of the Tx HPF IIR filter pregain parameter used by the
7504 * #ADM_MODULE_ID_HPF_IIRX_FILTER module.
7505 * @parspace Message payload
7506 * @structure{adm_hpfx_iir_filter_pre_gain}
7507 * @tablespace
7508 * @inputtable{Audio_Postproc_ADM_PARAM_ID_HPF_IIRX_FILTER_PRE_GAIN.tex}
7509 */
7510#define ADM_PARAM_ID_HPF_IIRX_FILTER_PRE_GAIN 0x00010C3F
7511
7512/* ID of the Tx HPF IIR filter configuration parameters used by the
7513 * #ADM_MODULE_ID_HPF_IIRX_FILTER module.
7514 * @parspace Message payload
7515 * @structure{adm_hpfx_iir_filter_cfg_params}
7516 * @tablespace
7517 * @inputtable{Audio_Postproc_ADM_PARAM_ID_HPF_IIRX_FILTER_CONFIG_PA
7518 * RAMS.tex}
7519 */
7520#define ADM_PARAM_ID_HPF_IIRX_FILTER_CONFIG_PARAMS 0x00010C40
7521
7522/* Structure for enabling a configuration parameter for
7523 * the HPF IIR tuning filter module on the Tx path.
7524 */
7525
7526/* @brief Payload of the #ADM_PARAM_ID_HPF_IIRX_FILTER_ENABLE_CONFIG
7527 * parameter in the Tx path HPF Tuning Filter module.
7528 */
7529struct adm_hpfx_iir_filter_enable_cfg {
7530 uint32_t enable_flag;
7531/* Specifies whether the HPF tuning filter is disabled (0) or
7532 * enabled (nonzero).
7533 */
7534} __packed;
7535
7536
7537/* Structure for the pregain parameter for the HPF
7538 * IIR tuning filter module on the Tx path.
7539 */
7540
7541
7542/* @brief Payload of the #ADM_PARAM_ID_HPF_IIRX_FILTER_PRE_GAIN parameter
7543 * in the Tx path HPF Tuning Filter module.
7544 */
7545struct adm_hpfx_iir_filter_pre_gain {
7546 uint16_t pre_gain;
7547 /* Linear gain in Q13 format. */
7548
7549 uint16_t reserved;
7550 /* Clients must set this field to zero.*/
7551} __packed;
7552
7553
7554/* Structure for the configuration parameter for the
7555 * HPF IIR tuning filter module on the Tx path.
7556 */
7557
7558
7559/* @brief Payload of the #ADM_PARAM_ID_HPF_IIRX_FILTER_CONFIG_PARAMS
7560 * parameters in the Tx path HPF Tuning Filter module. \n
7561 * \n
7562 * This structure is followed by tuning filter coefficients as follows: \n
7563 * - Sequence of int32_t FilterCoeffs.
7564 * Each band has five coefficients, each in int32_t format in the order of
7565 * b0, b1, b2, a1, a2.
7566 * - Sequence of int16_t NumShiftFactor.
7567 * One int16_t per band. The numerator shift factor is related to the Q
7568 * factor of the filter coefficients.
7569 * - Sequence of uint16_t PanSetting.
7570 * One uint16_t for each band to indicate application of the filter to
7571 * left (0), right (1), or both (2) channels.
7572 */
7573struct adm_hpfx_iir_filter_cfg_params {
7574 uint16_t num_biquad_stages;
7575/*< Number of bands.
7576 * Supported values: 0 to 20
7577 */
7578
7579 uint16_t reserved;
7580 /*< Clients must set this field to zero.*/
7581} __packed;
7582
7583/* end_addtogroup audio_pp_module_ids */
7584
7585/* @addtogroup audio_pp_module_ids */
7586/* ID of the Tx path IIR Tuning Filter module.
7587 * This module supports the following parameter IDs:
7588 * - #ADM_PARAM_IDX_IIR_FILTER_ENABLE_CONFIG
7589 */
7590#define ADM_MODULE_IDX_IIR_FILTER 0x00010C41
7591
7592/* ID of the Rx path IIR Tuning Filter module for the left channel.
7593 * The parameter IDs of the IIR tuning filter module
7594 * (#ASM_MODULE_ID_IIRUNING_FILTER) are used for the left IIR Rx tuning
7595 * filter.
7596 *
7597 * Pan parameters are not required for this per-channel IIR filter; the pan
7598 * parameters are ignored by this module.
7599 */
7600#define ADM_MODULE_ID_LEFT_IIRUNING_FILTER 0x00010705
7601
7602/* ID of the the Rx path IIR Tuning Filter module for the right
7603 * channel.
7604 * The parameter IDs of the IIR tuning filter module
7605 * (#ASM_MODULE_ID_IIRUNING_FILTER) are used for the right IIR Rx
7606 * tuning filter.
7607 *
7608 * Pan parameters are not required for this per-channel IIR filter;
7609 * the pan parameters are ignored by this module.
7610 */
7611#define ADM_MODULE_ID_RIGHT_IIRUNING_FILTER 0x00010706
7612
7613/* end_addtogroup audio_pp_module_ids */
7614
7615/* @addtogroup audio_pp_param_ids */
7616
7617/* ID of the Tx IIR filter enable parameter used by the
7618 * #ADM_MODULE_IDX_IIR_FILTER module.
7619 * @parspace Message payload
7620 * @structure{admx_iir_filter_enable_cfg}
7621 * @tablespace
7622 * @inputtable{Audio_Postproc_ADM_PARAM_IDX_IIR_FILTER_ENABLE_CONFIG.tex}
7623 */
7624#define ADM_PARAM_IDX_IIR_FILTER_ENABLE_CONFIG 0x00010C42
7625
7626/* ID of the Tx IIR filter pregain parameter used by the
7627 * #ADM_MODULE_IDX_IIR_FILTER module.
7628 * @parspace Message payload
7629 * @structure{admx_iir_filter_pre_gain}
7630 * @tablespace
7631 * @inputtable{Audio_Postproc_ADM_PARAM_IDX_IIR_FILTER_PRE_GAIN.tex}
7632 */
7633#define ADM_PARAM_IDX_IIR_FILTER_PRE_GAIN 0x00010C43
7634
7635/* ID of the Tx IIR filter configuration parameters used by the
7636 * #ADM_MODULE_IDX_IIR_FILTER module.
7637 * @parspace Message payload
7638 * @structure{admx_iir_filter_cfg_params}
7639 * @tablespace
7640 * @inputtable{Audio_Postproc_ADM_PARAM_IDX_IIR_FILTER_CONFIG_PARAMS.tex}
7641 */
7642#define ADM_PARAM_IDX_IIR_FILTER_CONFIG_PARAMS 0x00010C44
7643
7644/* Structure for enabling the configuration parameter for the
7645 * IIR filter module on the Tx path.
7646 */
7647
7648/* @brief Payload of the #ADM_PARAM_IDX_IIR_FILTER_ENABLE_CONFIG
7649 * parameter in the Tx Path IIR Tuning Filter module.
7650 */
7651
7652struct admx_iir_filter_enable_cfg {
7653 uint32_t enable_flag;
7654/*< Specifies whether the IIR tuning filter is disabled (0) or
7655 * enabled (nonzero).
7656 */
7657
7658} __packed;
7659
7660
7661/* Structure for the pregain parameter for the
7662 * IIR filter module on the Tx path.
7663 */
7664
7665
7666/* @brief Payload of the #ADM_PARAM_IDX_IIR_FILTER_PRE_GAIN
7667 * parameter in the Tx Path IIR Tuning Filter module.
7668 */
7669
7670struct admx_iir_filter_pre_gain {
7671 uint16_t pre_gain;
7672 /*< Linear gain in Q13 format. */
7673
7674 uint16_t reserved;
7675 /*< Clients must set this field to zero.*/
7676} __packed;
7677
7678
7679/* Structure for the configuration parameter for the
7680 * IIR filter module on the Tx path.
7681 */
7682
7683
7684/* @brief Payload of the #ADM_PARAM_IDX_IIR_FILTER_CONFIG_PARAMS
7685 * parameter in the Tx Path IIR Tuning Filter module. \n
7686 * \n
7687 * This structure is followed by the HPF IIR filter coefficients on
7688 * the Tx path as follows: \n
7689 * - Sequence of int32_t ulFilterCoeffs. Each band has five
7690 * coefficients, each in int32_t format in the order of b0, b1, b2,
7691 * a1, a2.
7692 * - Sequence of int16_t sNumShiftFactor. One int16_t per band. The
7693 * numerator shift factor is related to the Q factor of the filter
7694 * coefficients.
7695 * - Sequence of uint16_t usPanSetting. One uint16_t for each band
7696 * to indicate if the filter is applied to left (0), right (1), or
7697 * both (2) channels.
7698 */
7699struct admx_iir_filter_cfg_params {
7700 uint16_t num_biquad_stages;
7701/*< Number of bands.
7702 * Supported values: 0 to 20
7703 */
7704
7705 uint16_t reserved;
7706 /*< Clients must set this field to zero.*/
7707} __packed;
7708
7709/* end_addtogroup audio_pp_module_ids */
7710
7711/* @ingroup audio_pp_module_ids
7712 * ID of the QEnsemble module.
7713 * This module supports the following parameter IDs:
7714 * - #ADM_PARAM_ID_QENSEMBLE_ENABLE
7715 * - #ADM_PARAM_ID_QENSEMBLE_BACKGAIN
7716 * - #ADM_PARAM_ID_QENSEMBLE_SET_NEW_ANGLE
7717 */
7718#define ADM_MODULE_ID_QENSEMBLE 0x00010C59
7719
7720/* @addtogroup audio_pp_param_ids */
7721/* ID of the QEnsemble enable parameter used by the
7722 * #ADM_MODULE_ID_QENSEMBLE module.
7723 * @messagepayload
7724 * @structure{adm_qensemble_enable}
7725 * @tablespace
7726 * @inputtable{Audio_Postproc_ADM_PARAM_ID_QENSEMBLE_ENABLE.tex}
7727 */
7728#define ADM_PARAM_ID_QENSEMBLE_ENABLE 0x00010C60
7729
7730/* ID of the QEnsemble back gain parameter used by the
7731 * #ADM_MODULE_ID_QENSEMBLE module.
7732 * @messagepayload
7733 * @structure{adm_qensemble_param_backgain}
7734 * @tablespace
7735 * @inputtable{Audio_Postproc_ADM_PARAM_ID_QENSEMBLE_BACKGAIN.tex}
7736 */
7737#define ADM_PARAM_ID_QENSEMBLE_BACKGAIN 0x00010C61
7738
7739/* ID of the QEnsemble new angle parameter used by the
7740 * #ADM_MODULE_ID_QENSEMBLE module.
7741 * @messagepayload
7742 * @structure{adm_qensemble_param_set_new_angle}
7743 * @tablespace
7744 * @inputtable{Audio_Postproc_ADM_PARAM_ID_QENSEMBLE_SET_NEW_ANGLE.tex}
7745 */
7746#define ADM_PARAM_ID_QENSEMBLE_SET_NEW_ANGLE 0x00010C62
7747
7748/* Structure for enabling the configuration parameter for the
7749 * QEnsemble module.
7750 */
7751
7752
7753/* @brief Payload of the #ADM_PARAM_ID_QENSEMBLE_ENABLE
7754 * parameter used by the QEnsemble module.
7755 */
7756struct adm_qensemble_enable {
7757 uint32_t enable_flag;
7758/*< Specifies whether the QEnsemble module is disabled (0) or enabled
7759 * (nonzero).
7760 */
7761} __packed;
7762
7763
7764/* Structure for the background gain for the QEnsemble module. */
7765
7766
7767/* @brief Payload of the #ADM_PARAM_ID_QENSEMBLE_BACKGAIN
7768 * parameter used by
7769 * the QEnsemble module.
7770 */
7771struct adm_qensemble_param_backgain {
7772 int16_t back_gain;
7773/*< Linear gain in Q15 format.
7774 * Supported values: 0 to 32767
7775 */
7776
7777 uint16_t reserved;
7778 /*< Clients must set this field to zero.*/
7779} __packed;
7780/* Structure for setting a new angle for the QEnsemble module. */
7781
7782
7783/* @brief Payload of the #ADM_PARAM_ID_QENSEMBLE_SET_NEW_ANGLE
7784 * parameter used
7785 * by the QEnsemble module.
7786 */
7787struct adm_qensemble_param_set_new_angle {
7788 int16_t new_angle;
7789/*< New angle in degrees.
7790 * Supported values: 0 to 359
7791 */
7792
7793 int16_t time_ms;
7794/*< Transition time in milliseconds to set the new angle.
7795 * Supported values: 0 to 32767
7796 */
7797} __packed;
7798
7799
7800#define ADM_CMD_GET_PP_TOPO_MODULE_LIST 0x00010349
7801#define ADM_CMDRSP_GET_PP_TOPO_MODULE_LIST 0x00010350
7802#define AUDPROC_PARAM_ID_ENABLE 0x00010904
7803 /*
7804 * Payload of the ADM_CMD_GET_PP_TOPO_MODULE_LIST command.
7805 */
7806struct adm_cmd_get_pp_topo_module_list_t {
7807 struct apr_hdr hdr;
7808 /* Lower 32 bits of the 64-bit parameter data payload address. */
7809 uint32_t data_payload_addr_lsw;
7810 /*
7811 * Upper 32 bits of the 64-bit parameter data payload address.
7812 *
7813 *
7814 * The size of the shared memory, if specified, must be large enough to
7815 * contain the entire parameter data payload, including the module ID,
7816 * parameter ID, parameter size, and parameter values.
7817 */
7818 uint32_t data_payload_addr_msw;
7819 /*
7820 * Unique identifier for an address.
7821 *
7822 * This memory map handle is returned by the aDSP through the
7823 * #ADM_CMD_SHARED_MEM_MAP_REGIONS command.
7824 *
7825 * @values
7826 * - Non-NULL -- On acknowledgment, the parameter data payloads begin at
7827 * the address specified (out-of-band)
7828 * - NULL -- The acknowledgment's payload contains the parameter data
7829 * (in-band) @tablebulletend
7830 */
7831 uint32_t mem_map_handle;
7832 /*
7833 * Maximum data size of the list of modules. This
7834 * field is a multiple of 4 bytes.
7835 */
7836 uint16_t param_max_size;
7837 /* This field must be set to zero. */
7838 uint16_t reserved;
7839} __packed;
7840
7841/*
7842 * Payload of the ADM_CMDRSP_GET_PP_TOPO_MODULE_LIST message, which returns
7843 * module ids in response to an ADM_CMD_GET_PP_TOPO_MODULE_LIST command.
7844 * Immediately following this structure is the acknowledgment <b>module id
7845 * data variable payload</b> containing the pre/postprocessing module id
7846 * values. For an in-band scenario, the variable payload depends on the size
7847 * of the parameter.
7848 */
7849struct adm_cmd_rsp_get_pp_topo_module_list_t {
7850 /* Status message (error code). */
7851 uint32_t status;
7852} __packed;
7853
7854struct audproc_topology_module_id_info_t {
7855 uint32_t num_modules;
7856} __packed;
7857
7858/* end_addtogroup audio_pp_module_ids */
7859
7860/* @ingroup audio_pp_module_ids
7861 * ID of the Volume Control module pre/postprocessing block.
7862 * This module supports the following parameter IDs:
7863 * - #ASM_PARAM_ID_VOL_CTRL_MASTER_GAIN
7864 * - #ASM_PARAM_ID_MULTICHANNEL_GAIN
7865 * - #ASM_PARAM_ID_VOL_CTRL_MUTE_CONFIG
7866 * - #ASM_PARAM_ID_SOFT_VOL_STEPPING_PARAMETERS
7867 * - #ASM_PARAM_ID_SOFT_PAUSE_PARAMETERS
7868 * - #ASM_PARAM_ID_MULTICHANNEL_GAIN
7869 * - #ASM_PARAM_ID_MULTICHANNEL_MUTE
7870 */
7871#define ASM_MODULE_ID_VOL_CTRL 0x00010BFE
7872#define ASM_MODULE_ID_VOL_CTRL2 0x00010910
7873#define AUDPROC_MODULE_ID_VOL_CTRL ASM_MODULE_ID_VOL_CTRL
7874
7875/* @addtogroup audio_pp_param_ids */
7876/* ID of the master gain parameter used by the #ASM_MODULE_ID_VOL_CTRL
7877 * module.
7878 * @messagepayload
7879 * @structure{asm_volume_ctrl_master_gain}
7880 * @tablespace
7881 * @inputtable{Audio_Postproc_ASM_PARAM_ID_VOL_CTRL_MASTER_GAIN.tex}
7882 */
7883#define ASM_PARAM_ID_VOL_CTRL_MASTER_GAIN 0x00010BFF
7884#define AUDPROC_PARAM_ID_VOL_CTRL_MASTER_GAIN ASM_PARAM_ID_VOL_CTRL_MASTER_GAIN
7885
7886/* ID of the left/right channel gain parameter used by the
7887 * #ASM_MODULE_ID_VOL_CTRL module.
7888 * @messagepayload
7889 * @structure{asm_volume_ctrl_lr_chan_gain}
7890 * @tablespace
7891 * @inputtable{Audio_Postproc_ASM_PARAM_ID_MULTICHANNEL_GAIN.tex}
7892 */
7893#define ASM_PARAM_ID_VOL_CTRL_LR_CHANNEL_GAIN 0x00010C00
7894
7895/* ID of the mute configuration parameter used by the
7896 * #ASM_MODULE_ID_VOL_CTRL module.
7897 * @messagepayload
7898 * @structure{asm_volume_ctrl_mute_config}
7899 * @tablespace
7900 * @inputtable{Audio_Postproc_ASM_PARAM_ID_VOL_CTRL_MUTE_CONFIG.tex}
7901 */
7902#define ASM_PARAM_ID_VOL_CTRL_MUTE_CONFIG 0x00010C01
7903
7904/* ID of the soft stepping volume parameters used by the
7905 * #ASM_MODULE_ID_VOL_CTRL module.
7906 * @messagepayload
7907 * @structure{asm_soft_step_volume_params}
7908 * @tablespace
7909 * @inputtable{Audio_Postproc_ASM_PARAM_ID_SOFT_VOL_STEPPING_PARAMET
7910 * ERS.tex}
7911 */
7912#define ASM_PARAM_ID_SOFT_VOL_STEPPING_PARAMETERS 0x00010C29
7913#define AUDPROC_PARAM_ID_SOFT_VOL_STEPPING_PARAMETERS\
7914 ASM_PARAM_ID_SOFT_VOL_STEPPING_PARAMETERS
7915
7916/* ID of the soft pause parameters used by the #ASM_MODULE_ID_VOL_CTRL
7917 * module.
7918 */
7919#define ASM_PARAM_ID_SOFT_PAUSE_PARAMETERS 0x00010D6A
7920
7921/* ID of the multiple-channel volume control parameters used by the
7922 * #ASM_MODULE_ID_VOL_CTRL module.
7923 */
7924#define ASM_PARAM_ID_MULTICHANNEL_GAIN 0x00010713
7925
7926/* ID of the multiple-channel mute configuration parameters used by the
7927 * #ASM_MODULE_ID_VOL_CTRL module.
7928 */
7929
7930#define ASM_PARAM_ID_MULTICHANNEL_MUTE 0x00010714
7931
7932/* Structure for the master gain parameter for a volume control
7933 * module.
7934 */
7935
7936
7937/* @brief Payload of the #ASM_PARAM_ID_VOL_CTRL_MASTER_GAIN
7938 * parameter used by the Volume Control module.
7939 */
7940
7941
7942
7943struct asm_volume_ctrl_master_gain {
7944 struct apr_hdr hdr;
7945 struct asm_stream_cmd_set_pp_params_v2 param;
7946 struct asm_stream_param_data_v2 data;
7947 uint16_t master_gain;
7948 /* Linear gain in Q13 format. */
7949
7950 uint16_t reserved;
7951 /* Clients must set this field to zero. */
7952} __packed;
7953
7954
7955struct asm_volume_ctrl_lr_chan_gain {
7956 struct apr_hdr hdr;
7957 struct asm_stream_cmd_set_pp_params_v2 param;
7958 struct asm_stream_param_data_v2 data;
7959
7960 uint16_t l_chan_gain;
7961 /*< Linear gain in Q13 format for the left channel. */
7962
7963 uint16_t r_chan_gain;
7964 /*< Linear gain in Q13 format for the right channel.*/
7965} __packed;
7966
7967
7968/* Structure for the mute configuration parameter for a
7969 * volume control module.
7970 */
7971
7972
7973/* @brief Payload of the #ASM_PARAM_ID_VOL_CTRL_MUTE_CONFIG
7974 * parameter used by the Volume Control module.
7975 */
7976
7977
7978struct asm_volume_ctrl_mute_config {
7979 struct apr_hdr hdr;
7980 struct asm_stream_cmd_set_pp_params_v2 param;
7981 struct asm_stream_param_data_v2 data;
7982 uint32_t mute_flag;
7983/*< Specifies whether mute is disabled (0) or enabled (nonzero).*/
7984
7985} __packed;
7986
7987/*
7988 * Supported parameters for a soft stepping linear ramping curve.
7989 */
7990#define ASM_PARAM_SVC_RAMPINGCURVE_LINEAR 0
7991
7992/*
7993 * Exponential ramping curve.
7994 */
7995#define ASM_PARAM_SVC_RAMPINGCURVE_EXP 1
7996
7997/*
7998 * Logarithmic ramping curve.
7999 */
8000#define ASM_PARAM_SVC_RAMPINGCURVE_LOG 2
8001
8002/* Structure for holding soft stepping volume parameters. */
8003
8004
8005/* Payload of the #ASM_PARAM_ID_SOFT_VOL_STEPPING_PARAMETERS
8006 * parameters used by the Volume Control module.
8007 */
8008struct asm_soft_step_volume_params {
8009 struct apr_hdr hdr;
8010 struct asm_stream_cmd_set_pp_params_v2 param;
8011 struct asm_stream_param_data_v2 data;
8012 uint32_t period;
8013/*< Period in milliseconds.
8014 * Supported values: 0 to 15000
8015 */
8016
8017 uint32_t step;
8018/*< Step in microseconds.
8019 * Supported values: 0 to 15000000
8020 */
8021
8022 uint32_t ramping_curve;
8023/*< Ramping curve type.
8024 * Supported values:
8025 * - #ASM_PARAM_SVC_RAMPINGCURVE_LINEAR
8026 * - #ASM_PARAM_SVC_RAMPINGCURVE_EXP
8027 * - #ASM_PARAM_SVC_RAMPINGCURVE_LOG
8028 */
8029} __packed;
8030
8031
8032/* Structure for holding soft pause parameters. */
8033
8034
8035/* Payload of the #ASM_PARAM_ID_SOFT_PAUSE_PARAMETERS
8036 * parameters used by the Volume Control module.
8037 */
8038
8039
8040struct asm_soft_pause_params {
8041 struct apr_hdr hdr;
8042 struct asm_stream_cmd_set_pp_params_v2 param;
8043 struct asm_stream_param_data_v2 data;
8044 uint32_t enable_flag;
8045/*< Specifies whether soft pause is disabled (0) or enabled
8046 * (nonzero).
8047 */
8048
8049
8050
8051 uint32_t period;
8052/*< Period in milliseconds.
8053 * Supported values: 0 to 15000
8054 */
8055
8056 uint32_t step;
8057/*< Step in microseconds.
8058 * Supported values: 0 to 15000000
8059 */
8060
8061 uint32_t ramping_curve;
8062/*< Ramping curve.
8063 * Supported values:
8064 * - #ASM_PARAM_SVC_RAMPINGCURVE_LINEAR
8065 * - #ASM_PARAM_SVC_RAMPINGCURVE_EXP
8066 * - #ASM_PARAM_SVC_RAMPINGCURVE_LOG
8067 */
8068} __packed;
8069
8070
8071/* Maximum number of channels.*/
8072#define VOLUME_CONTROL_MAX_CHANNELS 8
8073
8074/* Structure for holding one channel type - gain pair. */
8075
8076
8077/* Payload of the #ASM_PARAM_ID_MULTICHANNEL_GAIN channel
8078 * type/gain pairs used by the Volume Control module. \n \n This
8079 * structure immediately follows the
8080 * asm_volume_ctrl_multichannel_gain structure.
8081 */
8082
8083
8084struct asm_volume_ctrl_channeltype_gain_pair {
8085 uint8_t channeltype;
8086 /*
8087 * Channel type for which the gain setting is to be applied.
8088 * Supported values:
8089 * - #PCM_CHANNEL_L
8090 * - #PCM_CHANNEL_R
8091 * - #PCM_CHANNEL_C
8092 * - #PCM_CHANNEL_LS
8093 * - #PCM_CHANNEL_RS
8094 * - #PCM_CHANNEL_LFE
8095 * - #PCM_CHANNEL_CS
8096 * - #PCM_CHANNEL_LB
8097 * - #PCM_CHANNEL_RB
8098 * - #PCM_CHANNELS
8099 * - #PCM_CHANNEL_CVH
8100 * - #PCM_CHANNEL_MS
8101 * - #PCM_CHANNEL_FLC
8102 * - #PCM_CHANNEL_FRC
8103 * - #PCM_CHANNEL_RLC
8104 * - #PCM_CHANNEL_RRC
8105 */
8106
8107 uint8_t reserved1;
8108 /* Clients must set this field to zero. */
8109
8110 uint8_t reserved2;
8111 /* Clients must set this field to zero. */
8112
8113 uint8_t reserved3;
8114 /* Clients must set this field to zero. */
8115
8116 uint32_t gain;
8117 /*
8118 * Gain value for this channel in Q28 format.
8119 * Supported values: Any
8120 */
8121} __packed;
8122
8123
8124/* Structure for the multichannel gain command */
8125
8126
8127/* Payload of the #ASM_PARAM_ID_MULTICHANNEL_GAIN
8128 * parameters used by the Volume Control module.
8129 */
8130
8131
8132struct asm_volume_ctrl_multichannel_gain {
8133 struct apr_hdr hdr;
8134 struct asm_stream_cmd_set_pp_params_v2 param;
8135 struct asm_stream_param_data_v2 data;
8136 uint32_t num_channels;
8137 /*
8138 * Number of channels for which gain values are provided. Any
8139 * channels present in the data for which gain is not provided are
8140 * set to unity gain.
8141 * Supported values: 1 to 8
8142 */
8143
8144 struct asm_volume_ctrl_channeltype_gain_pair
8145 gain_data[VOLUME_CONTROL_MAX_CHANNELS];
8146 /* Array of channel type/gain pairs.*/
8147} __packed;
8148
8149
8150/* Structure for holding one channel type - mute pair. */
8151
8152
8153/* Payload of the #ASM_PARAM_ID_MULTICHANNEL_MUTE channel
8154 * type/mute setting pairs used by the Volume Control module. \n \n
8155 * This structure immediately follows the
8156 * asm_volume_ctrl_multichannel_mute structure.
8157 */
8158
8159
8160struct asm_volume_ctrl_channelype_mute_pair {
8161 struct apr_hdr hdr;
8162 struct asm_stream_cmd_set_pp_params_v2 param;
8163 struct asm_stream_param_data_v2 data;
8164 uint8_t channelype;
8165/*< Channel type for which the mute setting is to be applied.
8166 * Supported values:
8167 * - #PCM_CHANNEL_L
8168 * - #PCM_CHANNEL_R
8169 * - #PCM_CHANNEL_C
8170 * - #PCM_CHANNEL_LS
8171 * - #PCM_CHANNEL_RS
8172 * - #PCM_CHANNEL_LFE
8173 * - #PCM_CHANNEL_CS
8174 * - #PCM_CHANNEL_LB
8175 * - #PCM_CHANNEL_RB
8176 * - #PCM_CHANNELS
8177 * - #PCM_CHANNEL_CVH
8178 * - #PCM_CHANNEL_MS
8179 * - #PCM_CHANNEL_FLC
8180 * - #PCM_CHANNEL_FRC
8181 * - #PCM_CHANNEL_RLC
8182 * - #PCM_CHANNEL_RRC
8183 */
8184
8185 uint8_t reserved1;
8186 /*< Clients must set this field to zero. */
8187
8188 uint8_t reserved2;
8189 /*< Clients must set this field to zero. */
8190
8191 uint8_t reserved3;
8192 /*< Clients must set this field to zero. */
8193
8194 uint32_t mute;
8195/*< Mute setting for this channel.
8196 * Supported values:
8197 * - 0 = Unmute
8198 * - Nonzero = Mute
8199 */
8200} __packed;
8201
8202
8203/* Structure for the multichannel mute command */
8204
8205
8206/* @brief Payload of the #ASM_PARAM_ID_MULTICHANNEL_MUTE
8207 * parameters used by the Volume Control module.
8208 */
8209
8210
8211struct asm_volume_ctrl_multichannel_mute {
8212 struct apr_hdr hdr;
8213 struct asm_stream_cmd_set_pp_params_v2 param;
8214 struct asm_stream_param_data_v2 data;
8215 uint32_t num_channels;
8216/*< Number of channels for which mute configuration is
8217 * provided. Any channels present in the data for which mute
8218 * configuration is not provided are set to unmute.
8219 * Supported values: 1 to 8
8220 */
8221
8222struct asm_volume_ctrl_channelype_mute_pair
8223 mute_data[VOLUME_CONTROL_MAX_CHANNELS];
8224 /*< Array of channel type/mute setting pairs.*/
8225} __packed;
8226/* end_addtogroup audio_pp_param_ids */
8227
8228/* audio_pp_module_ids
8229 * ID of the IIR Tuning Filter module.
8230 * This module supports the following parameter IDs:
8231 * - #ASM_PARAM_ID_IIRUNING_FILTER_ENABLE_CONFIG
8232 * - #ASM_PARAM_ID_IIRUNING_FILTER_PRE_GAIN
8233 * - #ASM_PARAM_ID_IIRUNING_FILTER_CONFIG_PARAMS
8234 */
8235#define ASM_MODULE_ID_IIRUNING_FILTER 0x00010C02
8236
8237/* @addtogroup audio_pp_param_ids */
8238/* ID of the IIR tuning filter enable parameter used by the
8239 * #ASM_MODULE_ID_IIRUNING_FILTER module.
8240 * @messagepayload
8241 * @structure{asm_iiruning_filter_enable}
8242 * @tablespace
8243 * @inputtable{Audio_Postproc_ASM_PARAM_ID_IIRUNING_FILTER_ENABLE_CO
8244 * NFIG.tex}
8245 */
8246#define ASM_PARAM_ID_IIRUNING_FILTER_ENABLE_CONFIG 0x00010C03
8247
8248/* ID of the IIR tuning filter pregain parameter used by the
8249 * #ASM_MODULE_ID_IIRUNING_FILTER module.
8250 */
8251#define ASM_PARAM_ID_IIRUNING_FILTER_PRE_GAIN 0x00010C04
8252
8253/* ID of the IIR tuning filter configuration parameters used by the
8254 * #ASM_MODULE_ID_IIRUNING_FILTER module.
8255 */
8256#define ASM_PARAM_ID_IIRUNING_FILTER_CONFIG_PARAMS 0x00010C05
8257
8258/* Structure for an enable configuration parameter for an
8259 * IIR tuning filter module.
8260 */
8261
8262
8263/* @brief Payload of the #ASM_PARAM_ID_IIRUNING_FILTER_ENABLE_CONFIG
8264 * parameter used by the IIR Tuning Filter module.
8265 */
8266struct asm_iiruning_filter_enable {
8267 uint32_t enable_flag;
8268/*< Specifies whether the IIR tuning filter is disabled (0) or
8269 * enabled (1).
8270 */
8271} __packed;
8272
8273/* Structure for the pregain parameter for an IIR tuning filter module. */
8274
8275
8276/* Payload of the #ASM_PARAM_ID_IIRUNING_FILTER_PRE_GAIN
8277 * parameters used by the IIR Tuning Filter module.
8278 */
8279struct asm_iiruning_filter_pregain {
8280 uint16_t pregain;
8281 /*< Linear gain in Q13 format. */
8282
8283 uint16_t reserved;
8284 /*< Clients must set this field to zero.*/
8285} __packed;
8286
8287/* Structure for the configuration parameter for an IIR tuning filter
8288 * module.
8289 */
8290
8291
8292/* @brief Payload of the #ASM_PARAM_ID_IIRUNING_FILTER_CONFIG_PARAMS
8293 * parameters used by the IIR Tuning Filter module. \n
8294 * \n
8295 * This structure is followed by the IIR filter coefficients: \n
8296 * - Sequence of int32_t FilterCoeffs \n
8297 * Five coefficients for each band. Each coefficient is in int32_t format, in
8298 * the order of b0, b1, b2, a1, a2.
8299 * - Sequence of int16_t NumShiftFactor \n
8300 * One int16_t per band. The numerator shift factor is related to the Q
8301 * factor of the filter coefficients.
8302 * - Sequence of uint16_t PanSetting \n
8303 * One uint16_t per band, indicating if the filter is applied to left (0),
8304 * right (1), or both (2) channels.
8305 */
8306struct asm_iir_filter_config_params {
8307 uint16_t num_biquad_stages;
8308/*< Number of bands.
8309 * Supported values: 0 to 20
8310 */
8311
8312 uint16_t reserved;
8313 /*< Clients must set this field to zero.*/
8314} __packed;
8315
8316/* audio_pp_module_ids
8317 * ID of the Multiband Dynamic Range Control (MBDRC) module on the Tx/Rx
8318 * paths.
8319 * This module supports the following parameter IDs:
8320 * - #ASM_PARAM_ID_MBDRC_ENABLE
8321 * - #ASM_PARAM_ID_MBDRC_CONFIG_PARAMS
8322 */
8323#define ASM_MODULE_ID_MBDRC 0x00010C06
8324
8325/* audio_pp_param_ids */
8326/* ID of the MBDRC enable parameter used by the #ASM_MODULE_ID_MBDRC module.
8327 * @messagepayload
8328 * @structure{asm_mbdrc_enable}
8329 * @tablespace
8330 * @inputtable{Audio_Postproc_ASM_PARAM_ID_MBDRC_ENABLE.tex}
8331 */
8332#define ASM_PARAM_ID_MBDRC_ENABLE 0x00010C07
8333
8334/* ID of the MBDRC configuration parameters used by the
8335 * #ASM_MODULE_ID_MBDRC module.
8336 * @messagepayload
8337 * @structure{asm_mbdrc_config_params}
8338 * @tablespace
8339 * @inputtable{Audio_Postproc_ASM_PARAM_ID_MBDRC_CONFIG_PARAMS.tex}
8340 *
8341 * @parspace Sub-band DRC configuration parameters
8342 * @structure{asm_subband_drc_config_params}
8343 * @tablespace
8344 * @inputtable{Audio_Postproc_ASM_PARAM_ID_MBDRC_CONFIG_PARAMS_subband_DRC.tex}
8345 *
8346 * @keep{6}
8347 * To obtain legacy ADRC from MBDRC, use the calibration tool to:
8348 *
8349 * - Enable MBDRC (EnableFlag = TRUE)
8350 * - Set number of bands to 1 (uiNumBands = 1)
8351 * - Enable the first MBDRC band (DrcMode[0] = DRC_ENABLED = 1)
8352 * - Clear the first band mute flag (MuteFlag[0] = 0)
8353 * - Set the first band makeup gain to unity (compMakeUpGain[0] = 0x2000)
8354 * - Use the legacy ADRC parameters to calibrate the rest of the MBDRC
8355 * parameters.
8356 */
8357#define ASM_PARAM_ID_MBDRC_CONFIG_PARAMS 0x00010C08
8358
8359/* end_addtogroup audio_pp_param_ids */
8360
8361/* audio_pp_module_ids
8362 * ID of the MMBDRC module version 2 pre/postprocessing block.
8363 * This module differs from the original MBDRC (#ASM_MODULE_ID_MBDRC) in
8364 * the length of the filters used in each sub-band.
8365 * This module supports the following parameter ID:
8366 * - #ASM_PARAM_ID_MBDRC_CONFIG_PARAMS_IMPROVED_FILTBANK_V2
8367 */
8368#define ASM_MODULE_ID_MBDRCV2 0x0001070B
8369
8370/* @addtogroup audio_pp_param_ids */
8371/* ID of the configuration parameters used by the
8372 * #ASM_MODULE_ID_MBDRCV2 module for the improved filter structure
8373 * of the MBDRC v2 pre/postprocessing block.
8374 * The update to this configuration structure from the original
8375 * MBDRC is the number of filter coefficients in the filter
8376 * structure. The sequence for is as follows:
8377 * - 1 band = 0 FIR coefficient + 1 mute flag + uint16_t padding
8378 * - 2 bands = 141 FIR coefficients + 2 mute flags + uint16_t padding
8379 * - 3 bands = 141+81 FIR coefficients + 3 mute flags + uint16_t padding
8380 * - 4 bands = 141+81+61 FIR coefficients + 4 mute flags + uint16_t
8381 * padding
8382 * - 5 bands = 141+81+61+61 FIR coefficients + 5 mute flags +
8383 * uint16_t padding
8384 * This block uses the same parameter structure as
8385 * #ASM_PARAM_ID_MBDRC_CONFIG_PARAMS.
8386 */
8387#define ASM_PARAM_ID_MBDRC_CONFIG_PARAMS_IMPROVED_FILTBANK_V2 \
8388 0x0001070C
8389
8390#define ASM_MODULE_ID_MBDRCV3 0x0001090B
8391/*
8392 * ID of the MMBDRC module version 3 pre/postprocessing block.
8393 * This module differs from MBDRCv2 (#ASM_MODULE_ID_MBDRCV2) in
8394 * that it supports both 16- and 24-bit data.
8395 * This module supports the following parameter ID:
8396 * - #ASM_PARAM_ID_MBDRC_ENABLE
8397 * - #ASM_PARAM_ID_MBDRC_CONFIG_PARAMS
8398 * - #ASM_PARAM_ID_MBDRC_CONFIG_PARAMS_V3
8399 * - #ASM_PARAM_ID_MBDRC_FILTER_XOVER_FREQS
8400 */
8401
8402/* Structure for the enable parameter for an MBDRC module. */
8403
8404
8405/* Payload of the #ASM_PARAM_ID_MBDRC_ENABLE parameter used by the
8406 * MBDRC module.
8407 */
8408struct asm_mbdrc_enable {
8409 uint32_t enable_flag;
8410/*< Specifies whether MBDRC is disabled (0) or enabled (nonzero).*/
8411} __packed;
8412
8413/* Structure for the configuration parameters for an MBDRC module. */
8414
8415
8416/* Payload of the #ASM_PARAM_ID_MBDRC_CONFIG_PARAMS
8417 * parameters used by the MBDRC module. \n \n Following this
8418 * structure is the payload for sub-band DRC configuration
8419 * parameters (asm_subband_drc_config_params). This sub-band
8420 * structure must be repeated for each band.
8421 */
8422
8423
8424struct asm_mbdrc_config_params {
8425 uint16_t num_bands;
8426/*< Number of bands.
8427 * Supported values: 1 to 5
8428 */
8429
8430 int16_t limiterhreshold;
8431/*< Threshold in decibels for the limiter output.
8432 * Supported values: -72 to 18 \n
8433 * Recommended value: 3994 (-0.22 db in Q3.12 format)
8434 */
8435
8436 int16_t limiter_makeup_gain;
8437/*< Makeup gain in decibels for the limiter output.
8438 * Supported values: -42 to 42 \n
8439 * Recommended value: 256 (0 dB in Q7.8 format)
8440 */
8441
8442 int16_t limiter_gc;
8443/*< Limiter gain recovery coefficient.
8444 * Supported values: 0.5 to 0.99 \n
8445 * Recommended value: 32440 (0.99 in Q15 format)
8446 */
8447
8448 int16_t limiter_delay;
8449/*< Limiter delay in samples.
8450 * Supported values: 0 to 10 \n
8451 * Recommended value: 262 (0.008 samples in Q15 format)
8452 */
8453
8454 int16_t limiter_max_wait;
8455/*< Maximum limiter waiting time in samples.
8456 * Supported values: 0 to 10 \n
8457 * Recommended value: 262 (0.008 samples in Q15 format)
8458 */
8459} __packed;
8460
8461/* DRC configuration structure for each sub-band of an MBDRC module. */
8462
8463
8464/* Payload of the #ASM_PARAM_ID_MBDRC_CONFIG_PARAMS DRC
8465 * configuration parameters for each sub-band in the MBDRC module.
8466 * After this DRC structure is configured for valid bands, the next
8467 * MBDRC setparams expects the sequence of sub-band MBDRC filter
8468 * coefficients (the length depends on the number of bands) plus the
8469 * mute flag for that band plus uint16_t padding.
8470 *
8471 * @keep{10}
8472 * The filter coefficient and mute flag are of type int16_t:
8473 * - FIR coefficient = int16_t firFilter
8474 * - Mute flag = int16_t fMuteFlag
8475 *
8476 * The sequence is as follows:
8477 * - 1 band = 0 FIR coefficient + 1 mute flag + uint16_t padding
8478 * - 2 bands = 97 FIR coefficients + 2 mute flags + uint16_t padding
8479 * - 3 bands = 97+33 FIR coefficients + 3 mute flags + uint16_t padding
8480 * - 4 bands = 97+33+33 FIR coefficients + 4 mute flags + uint16_t padding
8481 * - 5 bands = 97+33+33+33 FIR coefficients + 5 mute flags + uint16_t padding
8482 *
8483 * For improved filterbank, the sequence is as follows:
8484 * - 1 band = 0 FIR coefficient + 1 mute flag + uint16_t padding
8485 * - 2 bands = 141 FIR coefficients + 2 mute flags + uint16_t padding
8486 * - 3 bands = 141+81 FIR coefficients + 3 mute flags + uint16_t padding
8487 * - 4 bands = 141+81+61 FIR coefficients + 4 mute flags + uint16_t padding
8488 * - 5 bands = 141+81+61+61 FIR coefficients + 5 mute flags + uint16_t padding
8489 */
8490struct asm_subband_drc_config_params {
8491 int16_t drc_stereo_linked_flag;
8492/*< Specifies whether all stereo channels have the same applied
8493 * dynamics (1) or if they process their dynamics independently (0).
8494 * Supported values:
8495 * - 0 -- Not linked
8496 * - 1 -- Linked
8497 */
8498
8499 int16_t drc_mode;
8500/*< Specifies whether DRC mode is bypassed for sub-bands.
8501 * Supported values:
8502 * - 0 -- Disabled
8503 * - 1 -- Enabled
8504 */
8505
8506 int16_t drc_down_sample_level;
8507/*< DRC down sample level.
8508 * Supported values: @ge 1
8509 */
8510
8511 int16_t drc_delay;
8512/*< DRC delay in samples.
8513 * Supported values: 0 to 1200
8514 */
8515
8516 uint16_t drc_rmsime_avg_const;
8517/*< RMS signal energy time-averaging constant.
8518 * Supported values: 0 to 2^16-1
8519 */
8520
8521 uint16_t drc_makeup_gain;
8522/*< DRC makeup gain in decibels.
8523 * Supported values: 258 to 64917
8524 */
8525 /* Down expander settings */
8526 int16_t down_expdrhreshold;
8527/*< Down expander threshold.
8528 * Supported Q7 format values: 1320 to up_cmpsrhreshold
8529 */
8530
8531 int16_t down_expdr_slope;
8532/*< Down expander slope.
8533 * Supported Q8 format values: -32768 to 0.
8534 */
8535
8536 uint32_t down_expdr_attack;
8537/*< Down expander attack constant.
8538 * Supported Q31 format values: 196844 to 2^31.
8539 */
8540
8541 uint32_t down_expdr_release;
8542/*< Down expander release constant.
8543 * Supported Q31 format values: 19685 to 2^31
8544 */
8545
8546 uint16_t down_expdr_hysteresis;
8547/*< Down expander hysteresis constant.
8548 * Supported Q14 format values: 1 to 32690
8549 */
8550
8551 uint16_t reserved;
8552 /*< Clients must set this field to zero. */
8553
8554 int32_t down_expdr_min_gain_db;
8555/*< Down expander minimum gain.
8556 * Supported Q23 format values: -805306368 to 0.
8557 */
8558
8559 /* Up compressor settings */
8560
8561 int16_t up_cmpsrhreshold;
8562/*< Up compressor threshold.
8563 * Supported Q7 format values: down_expdrhreshold to
8564 * down_cmpsrhreshold.
8565 */
8566
8567 uint16_t up_cmpsr_slope;
8568/*< Up compressor slope.
8569 * Supported Q16 format values: 0 to 64881.
8570 */
8571
8572 uint32_t up_cmpsr_attack;
8573/*< Up compressor attack constant.
8574 * Supported Q31 format values: 196844 to 2^31.
8575 */
8576
8577 uint32_t up_cmpsr_release;
8578/*< Up compressor release constant.
8579 * Supported Q31 format values: 19685 to 2^31.
8580 */
8581
8582 uint16_t up_cmpsr_hysteresis;
8583/*< Up compressor hysteresis constant.
8584 * Supported Q14 format values: 1 to 32690.
8585 */
8586
8587 /* Down compressor settings */
8588
8589 int16_t down_cmpsrhreshold;
8590/*< Down compressor threshold.
8591 * Supported Q7 format values: up_cmpsrhreshold to 11560.
8592 */
8593
8594 uint16_t down_cmpsr_slope;
8595/*< Down compressor slope.
8596 * Supported Q16 format values: 0 to 64881.
8597 */
8598
8599 uint16_t reserved1;
8600/*< Clients must set this field to zero. */
8601
8602 uint32_t down_cmpsr_attack;
8603/*< Down compressor attack constant.
8604 * Supported Q31 format values: 196844 to 2^31.
8605 */
8606
8607 uint32_t down_cmpsr_release;
8608/*< Down compressor release constant.
8609 * Supported Q31 format values: 19685 to 2^31.
8610 */
8611
8612 uint16_t down_cmpsr_hysteresis;
8613/*< Down compressor hysteresis constant.
8614 * Supported Q14 values: 1 to 32690.
8615 */
8616
8617 uint16_t reserved2;
8618/*< Clients must set this field to zero.*/
8619} __packed;
8620
8621#define ASM_MODULE_ID_EQUALIZER 0x00010C27
8622#define ASM_PARAM_ID_EQUALIZER_PARAMETERS 0x00010C28
8623
8624#define ASM_MAX_EQ_BANDS 12
8625
8626struct asm_eq_per_band_params {
8627 uint32_t band_idx;
8628/*< Band index.
8629 * Supported values: 0 to 11
8630 */
8631
8632 uint32_t filterype;
8633/*< Type of filter.
8634 * Supported values:
8635 * - #ASM_PARAM_EQYPE_NONE
8636 * - #ASM_PARAM_EQ_BASS_BOOST
8637 * - #ASM_PARAM_EQ_BASS_CUT
8638 * - #ASM_PARAM_EQREBLE_BOOST
8639 * - #ASM_PARAM_EQREBLE_CUT
8640 * - #ASM_PARAM_EQ_BAND_BOOST
8641 * - #ASM_PARAM_EQ_BAND_CUT
8642 */
8643
8644 uint32_t center_freq_hz;
8645 /*< Filter band center frequency in Hertz. */
8646
8647 int32_t filter_gain;
8648/*< Filter band initial gain.
8649 * Supported values: +12 to -12 dB in 1 dB increments
8650 */
8651
8652 int32_t q_factor;
8653/*< Filter band quality factor expressed as a Q8 number, i.e., a
8654 * fixed-point number with q factor of 8. For example, 3000/(2^8).
8655 */
8656} __packed;
8657
8658struct asm_eq_params {
8659 struct apr_hdr hdr;
8660 struct asm_stream_cmd_set_pp_params_v2 param;
8661 struct asm_stream_param_data_v2 data;
8662 uint32_t enable_flag;
8663/*< Specifies whether the equalizer module is disabled (0) or enabled
8664 * (nonzero).
8665 */
8666
8667 uint32_t num_bands;
8668/*< Number of bands.
8669 * Supported values: 1 to 12
8670 */
8671 struct asm_eq_per_band_params eq_bands[ASM_MAX_EQ_BANDS];
8672
8673} __packed;
8674
8675/* No equalizer effect.*/
8676#define ASM_PARAM_EQYPE_NONE 0
8677
8678/* Bass boost equalizer effect.*/
8679#define ASM_PARAM_EQ_BASS_BOOST 1
8680
8681/*Bass cut equalizer effect.*/
8682#define ASM_PARAM_EQ_BASS_CUT 2
8683
8684/* Treble boost equalizer effect */
8685#define ASM_PARAM_EQREBLE_BOOST 3
8686
8687/* Treble cut equalizer effect.*/
8688#define ASM_PARAM_EQREBLE_CUT 4
8689
8690/* Band boost equalizer effect.*/
8691#define ASM_PARAM_EQ_BAND_BOOST 5
8692
8693/* Band cut equalizer effect.*/
8694#define ASM_PARAM_EQ_BAND_CUT 6
8695
8696/* Get & set params */
8697#define VSS_ICOMMON_CMD_SET_PARAM_V2 0x0001133D
8698#define VSS_ICOMMON_CMD_GET_PARAM_V2 0x0001133E
8699#define VSS_ICOMMON_RSP_GET_PARAM 0x00011008
8700
Laxminath Kasam38070be2017-08-17 18:21:59 +05308701#define VSS_MAX_AVCS_NUM_SERVICES 25
8702
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05308703/* ID of the Bass Boost module.
8704 * This module supports the following parameter IDs:
8705 * - #AUDPROC_PARAM_ID_BASS_BOOST_ENABLE
8706 * - #AUDPROC_PARAM_ID_BASS_BOOST_MODE
8707 * - #AUDPROC_PARAM_ID_BASS_BOOST_STRENGTH
8708 */
8709#define AUDPROC_MODULE_ID_BASS_BOOST 0x000108A1
8710/* ID of the Bass Boost enable parameter used by
8711 * AUDPROC_MODULE_ID_BASS_BOOST.
8712 */
8713#define AUDPROC_PARAM_ID_BASS_BOOST_ENABLE 0x000108A2
8714/* ID of the Bass Boost mode parameter used by
8715 * AUDPROC_MODULE_ID_BASS_BOOST.
8716 */
8717#define AUDPROC_PARAM_ID_BASS_BOOST_MODE 0x000108A3
8718/* ID of the Bass Boost strength parameter used by
8719 * AUDPROC_MODULE_ID_BASS_BOOST.
8720 */
8721#define AUDPROC_PARAM_ID_BASS_BOOST_STRENGTH 0x000108A4
8722
8723/* ID of the PBE module.
8724 * This module supports the following parameter IDs:
8725 * - #AUDPROC_PARAM_ID_PBE_ENABLE
8726 * - #AUDPROC_PARAM_ID_PBE_PARAM_CONFIG
8727 */
8728#define AUDPROC_MODULE_ID_PBE 0x00010C2A
8729/* ID of the Bass Boost enable parameter used by
8730 * AUDPROC_MODULE_ID_BASS_BOOST.
8731 */
8732#define AUDPROC_PARAM_ID_PBE_ENABLE 0x00010C2B
8733/* ID of the Bass Boost mode parameter used by
8734 * AUDPROC_MODULE_ID_BASS_BOOST.
8735 */
8736#define AUDPROC_PARAM_ID_PBE_PARAM_CONFIG 0x00010C49
8737
8738/* ID of the Virtualizer module. This module supports the
8739 * following parameter IDs:
8740 * - #AUDPROC_PARAM_ID_VIRTUALIZER_ENABLE
8741 * - #AUDPROC_PARAM_ID_VIRTUALIZER_STRENGTH
8742 * - #AUDPROC_PARAM_ID_VIRTUALIZER_OUT_TYPE
8743 * - #AUDPROC_PARAM_ID_VIRTUALIZER_GAIN_ADJUST
8744 */
8745#define AUDPROC_MODULE_ID_VIRTUALIZER 0x000108A5
8746/* ID of the Virtualizer enable parameter used by
8747 * AUDPROC_MODULE_ID_VIRTUALIZER.
8748 */
8749#define AUDPROC_PARAM_ID_VIRTUALIZER_ENABLE 0x000108A6
8750/* ID of the Virtualizer strength parameter used by
8751 * AUDPROC_MODULE_ID_VIRTUALIZER.
8752 */
8753#define AUDPROC_PARAM_ID_VIRTUALIZER_STRENGTH 0x000108A7
8754/* ID of the Virtualizer out type parameter used by
8755 * AUDPROC_MODULE_ID_VIRTUALIZER.
8756 */
8757#define AUDPROC_PARAM_ID_VIRTUALIZER_OUT_TYPE 0x000108A8
8758/* ID of the Virtualizer out type parameter used by
8759 * AUDPROC_MODULE_ID_VIRTUALIZER.
8760 */
8761#define AUDPROC_PARAM_ID_VIRTUALIZER_GAIN_ADJUST 0x000108A9
8762
8763/* ID of the Reverb module. This module supports the following
8764 * parameter IDs:
8765 * - #AUDPROC_PARAM_ID_REVERB_ENABLE
8766 * - #AUDPROC_PARAM_ID_REVERB_MODE
8767 * - #AUDPROC_PARAM_ID_REVERB_PRESET
8768 * - #AUDPROC_PARAM_ID_REVERB_WET_MIX
8769 * - #AUDPROC_PARAM_ID_REVERB_GAIN_ADJUST
8770 * - #AUDPROC_PARAM_ID_REVERB_ROOM_LEVEL
8771 * - #AUDPROC_PARAM_ID_REVERB_ROOM_HF_LEVEL
8772 * - #AUDPROC_PARAM_ID_REVERB_DECAY_TIME
8773 * - #AUDPROC_PARAM_ID_REVERB_DECAY_HF_RATIO
8774 * - #AUDPROC_PARAM_ID_REVERB_REFLECTIONS_LEVEL
8775 * - #AUDPROC_PARAM_ID_REVERB_REFLECTIONS_DELAY
8776 * - #AUDPROC_PARAM_ID_REVERB_LEVEL
8777 * - #AUDPROC_PARAM_ID_REVERB_DELAY
8778 * - #AUDPROC_PARAM_ID_REVERB_DIFFUSION
8779 * - #AUDPROC_PARAM_ID_REVERB_DENSITY
8780 */
8781#define AUDPROC_MODULE_ID_REVERB 0x000108AA
8782/* ID of the Reverb enable parameter used by
8783 * AUDPROC_MODULE_ID_REVERB.
8784 */
8785#define AUDPROC_PARAM_ID_REVERB_ENABLE 0x000108AB
8786/* ID of the Reverb mode parameter used by
8787 * AUDPROC_MODULE_ID_REVERB.
8788 */
8789#define AUDPROC_PARAM_ID_REVERB_MODE 0x000108AC
8790/* ID of the Reverb preset parameter used by
8791 * AUDPROC_MODULE_ID_REVERB.
8792 */
8793#define AUDPROC_PARAM_ID_REVERB_PRESET 0x000108AD
8794/* ID of the Reverb wet mix parameter used by
8795 * AUDPROC_MODULE_ID_REVERB.
8796 */
8797#define AUDPROC_PARAM_ID_REVERB_WET_MIX 0x000108AE
8798/* ID of the Reverb gain adjust parameter used by
8799 * AUDPROC_MODULE_ID_REVERB.
8800 */
8801#define AUDPROC_PARAM_ID_REVERB_GAIN_ADJUST 0x000108AF
8802/* ID of the Reverb room level parameter used by
8803 * AUDPROC_MODULE_ID_REVERB.
8804 */
8805#define AUDPROC_PARAM_ID_REVERB_ROOM_LEVEL 0x000108B0
8806/* ID of the Reverb room hf level parameter used by
8807 * AUDPROC_MODULE_ID_REVERB.
8808 */
8809#define AUDPROC_PARAM_ID_REVERB_ROOM_HF_LEVEL 0x000108B1
8810/* ID of the Reverb decay time parameter used by
8811 * AUDPROC_MODULE_ID_REVERB.
8812 */
8813#define AUDPROC_PARAM_ID_REVERB_DECAY_TIME 0x000108B2
8814/* ID of the Reverb decay hf ratio parameter used by
8815 * AUDPROC_MODULE_ID_REVERB.
8816 */
8817#define AUDPROC_PARAM_ID_REVERB_DECAY_HF_RATIO 0x000108B3
8818/* ID of the Reverb reflections level parameter used by
8819 * AUDPROC_MODULE_ID_REVERB.
8820 */
8821#define AUDPROC_PARAM_ID_REVERB_REFLECTIONS_LEVEL 0x000108B4
8822/* ID of the Reverb reflections delay parameter used by
8823 * AUDPROC_MODULE_ID_REVERB.
8824 */
8825#define AUDPROC_PARAM_ID_REVERB_REFLECTIONS_DELAY 0x000108B5
8826/* ID of the Reverb level parameter used by
8827 * AUDPROC_MODULE_ID_REVERB.
8828 */
8829#define AUDPROC_PARAM_ID_REVERB_LEVEL 0x000108B6
8830/* ID of the Reverb delay parameter used by
8831 * AUDPROC_MODULE_ID_REVERB.
8832 */
8833#define AUDPROC_PARAM_ID_REVERB_DELAY 0x000108B7
8834/* ID of the Reverb diffusion parameter used by
8835 * AUDPROC_MODULE_ID_REVERB.
8836 */
8837#define AUDPROC_PARAM_ID_REVERB_DIFFUSION 0x000108B8
8838/* ID of the Reverb density parameter used by
8839 * AUDPROC_MODULE_ID_REVERB.
8840 */
8841#define AUDPROC_PARAM_ID_REVERB_DENSITY 0x000108B9
8842
8843/* ID of the Popless Equalizer module. This module supports the
8844 * following parameter IDs:
8845 * - #AUDPROC_PARAM_ID_EQ_ENABLE
8846 * - #AUDPROC_PARAM_ID_EQ_CONFIG
8847 * - #AUDPROC_PARAM_ID_EQ_NUM_BANDS
8848 * - #AUDPROC_PARAM_ID_EQ_BAND_LEVELS
8849 * - #AUDPROC_PARAM_ID_EQ_BAND_LEVEL_RANGE
8850 * - #AUDPROC_PARAM_ID_EQ_BAND_FREQS
8851 * - #AUDPROC_PARAM_ID_EQ_SINGLE_BAND_FREQ_RANGE
8852 * - #AUDPROC_PARAM_ID_EQ_SINGLE_BAND_FREQ
8853 * - #AUDPROC_PARAM_ID_EQ_BAND_INDEX
8854 * - #AUDPROC_PARAM_ID_EQ_PRESET_ID
8855 * - #AUDPROC_PARAM_ID_EQ_NUM_PRESETS
8856 * - #AUDPROC_PARAM_ID_EQ_GET_PRESET_NAME
8857 */
8858#define AUDPROC_MODULE_ID_POPLESS_EQUALIZER 0x000108BA
8859/* ID of the Popless Equalizer enable parameter used by
8860 * AUDPROC_MODULE_ID_POPLESS_EQUALIZER.
8861 */
8862#define AUDPROC_PARAM_ID_EQ_ENABLE 0x000108BB
8863/* ID of the Popless Equalizer config parameter used by
8864 * AUDPROC_MODULE_ID_POPLESS_EQUALIZER.
8865 */
8866#define AUDPROC_PARAM_ID_EQ_CONFIG 0x000108BC
8867/* ID of the Popless Equalizer number of bands parameter used
8868 * by AUDPROC_MODULE_ID_POPLESS_EQUALIZER. This param ID is
8869 * used for get param only.
8870 */
8871#define AUDPROC_PARAM_ID_EQ_NUM_BANDS 0x000108BD
8872/* ID of the Popless Equalizer band levels parameter used by
8873 * AUDPROC_MODULE_ID_POPLESS_EQUALIZER. This param ID is
8874 * used for get param only.
8875 */
8876#define AUDPROC_PARAM_ID_EQ_BAND_LEVELS 0x000108BE
8877/* ID of the Popless Equalizer band level range parameter used
8878 * by AUDPROC_MODULE_ID_POPLESS_EQUALIZER. This param ID is
8879 * used for get param only.
8880 */
8881#define AUDPROC_PARAM_ID_EQ_BAND_LEVEL_RANGE 0x000108BF
8882/* ID of the Popless Equalizer band frequencies parameter used
8883 * by AUDPROC_MODULE_ID_POPLESS_EQUALIZER. This param ID is
8884 * used for get param only.
8885 */
8886#define AUDPROC_PARAM_ID_EQ_BAND_FREQS 0x000108C0
8887/* ID of the Popless Equalizer single band frequency range
8888 * parameter used by AUDPROC_MODULE_ID_POPLESS_EQUALIZER.
8889 * This param ID is used for get param only.
8890 */
8891#define AUDPROC_PARAM_ID_EQ_SINGLE_BAND_FREQ_RANGE 0x000108C1
8892/* ID of the Popless Equalizer single band frequency parameter
8893 * used by AUDPROC_MODULE_ID_POPLESS_EQUALIZER. This param ID
8894 * is used for set param only.
8895 */
8896#define AUDPROC_PARAM_ID_EQ_SINGLE_BAND_FREQ 0x000108C2
8897/* ID of the Popless Equalizer band index parameter used by
8898 * AUDPROC_MODULE_ID_POPLESS_EQUALIZER.
8899 */
8900#define AUDPROC_PARAM_ID_EQ_BAND_INDEX 0x000108C3
8901/* ID of the Popless Equalizer preset id parameter used by
8902 * AUDPROC_MODULE_ID_POPLESS_EQUALIZER. This param ID is used
8903 * for get param only.
8904 */
8905#define AUDPROC_PARAM_ID_EQ_PRESET_ID 0x000108C4
8906/* ID of the Popless Equalizer number of presets parameter used
8907 * by AUDPROC_MODULE_ID_POPLESS_EQUALIZER. This param ID is used
8908 * for get param only.
8909 */
8910#define AUDPROC_PARAM_ID_EQ_NUM_PRESETS 0x000108C5
8911/* ID of the Popless Equalizer preset name parameter used by
8912 * AUDPROC_MODULE_ID_POPLESS_EQUALIZER. This param ID is used
8913 * for get param only.
8914 */
8915#define AUDPROC_PARAM_ID_EQ_PRESET_NAME 0x000108C6
8916
8917/* Set Q6 topologies */
8918#define ASM_CMD_ADD_TOPOLOGIES 0x00010DBE
8919#define ADM_CMD_ADD_TOPOLOGIES 0x00010335
8920#define AFE_CMD_ADD_TOPOLOGIES 0x000100f8
8921/* structure used for both ioctls */
8922struct cmd_set_topologies {
8923 struct apr_hdr hdr;
8924 u32 payload_addr_lsw;
8925 /* LSW of parameter data payload address.*/
8926 u32 payload_addr_msw;
8927 /* MSW of parameter data payload address.*/
8928 u32 mem_map_handle;
8929 /* Memory map handle returned by mem map command */
8930 u32 payload_size;
8931 /* Size in bytes of the variable payload in shared memory */
8932} __packed;
8933
8934/* This module represents the Rx processing of Feedback speaker protection.
8935 * It contains the excursion control, thermal protection,
8936 * analog clip manager features in it.
8937 * This module id will support following param ids.
8938 * - AFE_PARAM_ID_FBSP_MODE_RX_CFG
8939 */
8940
8941#define AFE_MODULE_FB_SPKR_PROT_RX 0x0001021C
8942#define AFE_MODULE_FB_SPKR_PROT_V2_RX 0x0001025F
Xiaojun Sang12120ab2017-09-28 18:21:21 +08008943#define AFE_PARAM_ID_SP_RX_LIMITER_TH 0x000102B1
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05308944#define AFE_PARAM_ID_FBSP_MODE_RX_CFG 0x0001021D
8945#define AFE_PARAM_ID_FBSP_PTONE_RAMP_CFG 0x00010260
8946
8947struct asm_fbsp_mode_rx_cfg {
8948 uint32_t minor_version;
8949 uint32_t mode;
8950} __packed;
8951
8952/* This module represents the VI processing of feedback speaker protection.
8953 * It will receive Vsens and Isens from codec and generates necessary
8954 * parameters needed by Rx processing.
8955 * This module id will support following param ids.
8956 * - AFE_PARAM_ID_SPKR_CALIB_VI_PROC_CFG
8957 * - AFE_PARAM_ID_CALIB_RES_CFG
8958 * - AFE_PARAM_ID_FEEDBACK_PATH_CFG
8959 */
8960
8961#define AFE_MODULE_FB_SPKR_PROT_VI_PROC 0x00010226
8962#define AFE_MODULE_FB_SPKR_PROT_VI_PROC_V2 0x0001026A
8963
8964#define AFE_PARAM_ID_SPKR_CALIB_VI_PROC_CFG 0x0001022A
8965#define AFE_PARAM_ID_SPKR_CALIB_VI_PROC_CFG_V2 0x0001026B
8966
8967struct asm_spkr_calib_vi_proc_cfg {
8968 uint32_t minor_version;
8969 uint32_t operation_mode;
8970 uint32_t r0_t0_selection_flag[SP_V2_NUM_MAX_SPKR];
8971 int32_t r0_cali_q24[SP_V2_NUM_MAX_SPKR];
8972 int16_t t0_cali_q6[SP_V2_NUM_MAX_SPKR];
8973 uint32_t quick_calib_flag;
8974} __packed;
8975
8976#define AFE_PARAM_ID_CALIB_RES_CFG 0x0001022B
8977#define AFE_PARAM_ID_CALIB_RES_CFG_V2 0x0001026E
8978
8979struct asm_calib_res_cfg {
8980 uint32_t minor_version;
8981 int32_t r0_cali_q24[SP_V2_NUM_MAX_SPKR];
8982 uint32_t th_vi_ca_state;
8983} __packed;
8984
8985#define AFE_PARAM_ID_FEEDBACK_PATH_CFG 0x0001022C
8986#define AFE_MODULE_FEEDBACK 0x00010257
8987
8988struct asm_feedback_path_cfg {
8989 uint32_t minor_version;
8990 int32_t dst_portid;
8991 int32_t num_channels;
8992 int32_t chan_info[4];
8993} __packed;
8994
8995#define AFE_PARAM_ID_MODE_VI_PROC_CFG 0x00010227
8996
8997struct asm_mode_vi_proc_cfg {
8998 uint32_t minor_version;
8999 uint32_t cal_mode;
9000} __packed;
9001
9002#define AFE_MODULE_SPEAKER_PROTECTION_V2_TH_VI 0x0001026A
9003#define AFE_PARAM_ID_SP_V2_TH_VI_MODE_CFG 0x0001026B
9004#define AFE_PARAM_ID_SP_V2_TH_VI_FTM_CFG 0x0001029F
9005#define AFE_PARAM_ID_SP_V2_TH_VI_FTM_PARAMS 0x000102A0
9006
9007struct afe_sp_th_vi_mode_cfg {
9008 uint32_t minor_version;
9009 uint32_t operation_mode;
9010 /*
9011 * Operation mode of thermal VI module.
9012 * 0 -- Normal Running mode
9013 * 1 -- Calibration mode
9014 * 2 -- FTM mode
9015 */
9016 uint32_t r0t0_selection_flag[SP_V2_NUM_MAX_SPKR];
9017 /*
9018 * Specifies which set of R0, T0 values the algorithm will use.
9019 * This field is valid only in Normal mode (operation_mode = 0).
9020 * 0 -- Use calibrated R0, T0 value
9021 * 1 -- Use safe R0, T0 value
9022 */
9023 int32_t r0_cali_q24[SP_V2_NUM_MAX_SPKR];
9024 /*
9025 * Calibration point resistance per device. This field is valid
9026 * only in Normal mode (operation_mode = 0).
9027 * values 33554432 to 1073741824 Ohms (in Q24 format)
9028 */
9029 int16_t t0_cali_q6[SP_V2_NUM_MAX_SPKR];
9030 /*
9031 * Calibration point temperature per device. This field is valid
9032 * in both Normal mode and Calibration mode.
9033 * values -1920 to 5120 degrees C (in Q6 format)
9034 */
9035 uint32_t quick_calib_flag;
9036 /*
9037 * Indicates whether calibration is to be done in quick mode or not.
9038 * This field is valid only in Calibration mode (operation_mode = 1).
9039 * 0 -- Disabled
9040 * 1 -- Enabled
9041 */
9042} __packed;
9043
9044struct afe_sp_th_vi_ftm_cfg {
9045 uint32_t minor_version;
9046 uint32_t wait_time_ms[SP_V2_NUM_MAX_SPKR];
9047 /*
9048 * Wait time to heat up speaker before collecting statistics
9049 * for ftm mode in ms.
9050 * values 0 to 4294967295 ms
9051 */
9052 uint32_t ftm_time_ms[SP_V2_NUM_MAX_SPKR];
9053 /*
9054 * duration for which FTM statistics are collected in ms.
9055 * values 0 to 2000 ms
9056 */
9057} __packed;
9058
9059struct afe_sp_th_vi_ftm_params {
9060 uint32_t minor_version;
9061 int32_t dc_res_q24[SP_V2_NUM_MAX_SPKR];
9062 /*
9063 * DC resistance value in q24 format
9064 * values 0 to 2147483647 Ohms (in Q24 format)
9065 */
9066 int32_t temp_q22[SP_V2_NUM_MAX_SPKR];
9067 /*
9068 * temperature value in q22 format
9069 * values -125829120 to 2147483647 degC (in Q22 format)
9070 */
9071 uint32_t status[SP_V2_NUM_MAX_SPKR];
9072 /*
9073 * FTM packet status
9074 * 0 - Incorrect operation mode.This status is returned
9075 * when GET_PARAM is called in non FTM Mode
9076 * 1 - Inactive mode -- Port is not yet started.
9077 * 2 - Wait state. wait_time_ms has not yet elapsed
9078 * 3 - In progress state. ftm_time_ms has not yet elapsed.
9079 * 4 - Success.
9080 * 5 - Failed.
9081 */
9082} __packed;
9083
9084struct afe_sp_th_vi_get_param {
9085 struct apr_hdr hdr;
9086 struct afe_port_cmd_get_param_v2 get_param;
9087 struct afe_port_param_data_v2 pdata;
9088 struct afe_sp_th_vi_ftm_params param;
9089} __packed;
9090
9091struct afe_sp_th_vi_get_param_resp {
9092 uint32_t status;
9093 struct afe_port_param_data_v2 pdata;
9094 struct afe_sp_th_vi_ftm_params param;
9095} __packed;
9096
9097
9098#define AFE_MODULE_SPEAKER_PROTECTION_V2_EX_VI 0x0001026F
9099#define AFE_PARAM_ID_SP_V2_EX_VI_MODE_CFG 0x000102A1
9100#define AFE_PARAM_ID_SP_V2_EX_VI_FTM_CFG 0x000102A2
9101#define AFE_PARAM_ID_SP_V2_EX_VI_FTM_PARAMS 0x000102A3
9102
9103struct afe_sp_ex_vi_mode_cfg {
9104 uint32_t minor_version;
9105 uint32_t operation_mode;
9106 /*
9107 * Operation mode of Excursion VI module.
9108 * 0 - Normal Running mode
9109 * 2 - FTM mode
9110 */
9111} __packed;
9112
9113struct afe_sp_ex_vi_ftm_cfg {
9114 uint32_t minor_version;
9115 uint32_t wait_time_ms[SP_V2_NUM_MAX_SPKR];
9116 /*
9117 * Wait time to heat up speaker before collecting statistics
9118 * for ftm mode in ms.
9119 * values 0 to 4294967295 ms
9120 */
9121 uint32_t ftm_time_ms[SP_V2_NUM_MAX_SPKR];
9122 /*
9123 * duration for which FTM statistics are collected in ms.
9124 * values 0 to 2000 ms
9125 */
9126} __packed;
9127
9128struct afe_sp_ex_vi_ftm_params {
9129 uint32_t minor_version;
9130 int32_t freq_q20[SP_V2_NUM_MAX_SPKR];
9131 /*
9132 * Resonance frequency in q20 format
9133 * values 0 to 2147483647 Hz (in Q20 format)
9134 */
9135 int32_t resis_q24[SP_V2_NUM_MAX_SPKR];
9136 /*
9137 * Mechanical resistance in q24 format
9138 * values 0 to 2147483647 Ohms (in Q24 format)
9139 */
9140 int32_t qmct_q24[SP_V2_NUM_MAX_SPKR];
9141 /*
9142 * Mechanical Qfactor in q24 format
9143 * values 0 to 2147483647 (in Q24 format)
9144 */
9145 uint32_t status[SP_V2_NUM_MAX_SPKR];
9146 /*
9147 * FTM packet status
9148 * 0 - Incorrect operation mode.This status is returned
9149 * when GET_PARAM is called in non FTM Mode.
9150 * 1 - Inactive mode -- Port is not yet started.
9151 * 2 - Wait state. wait_time_ms has not yet elapsed
9152 * 3 - In progress state. ftm_time_ms has not yet elapsed.
9153 * 4 - Success.
9154 * 5 - Failed.
9155 */
9156} __packed;
9157
9158struct afe_sp_ex_vi_get_param {
9159 struct apr_hdr hdr;
9160 struct afe_port_cmd_get_param_v2 get_param;
9161 struct afe_port_param_data_v2 pdata;
9162 struct afe_sp_ex_vi_ftm_params param;
9163} __packed;
9164
9165struct afe_sp_ex_vi_get_param_resp {
9166 uint32_t status;
9167 struct afe_port_param_data_v2 pdata;
9168 struct afe_sp_ex_vi_ftm_params param;
9169} __packed;
9170
Xiaojun Sang12120ab2017-09-28 18:21:21 +08009171struct afe_sp_rx_limiter_th_param {
9172 uint32_t minor_version;
9173 uint32_t lim_thr_per_calib_q27[SP_V2_NUM_MAX_SPKR];
9174} __packed;
9175
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05309176union afe_spkr_prot_config {
9177 struct asm_fbsp_mode_rx_cfg mode_rx_cfg;
9178 struct asm_spkr_calib_vi_proc_cfg vi_proc_cfg;
9179 struct asm_feedback_path_cfg feedback_path_cfg;
9180 struct asm_mode_vi_proc_cfg mode_vi_proc_cfg;
9181 struct afe_sp_th_vi_mode_cfg th_vi_mode_cfg;
9182 struct afe_sp_th_vi_ftm_cfg th_vi_ftm_cfg;
9183 struct afe_sp_ex_vi_mode_cfg ex_vi_mode_cfg;
9184 struct afe_sp_ex_vi_ftm_cfg ex_vi_ftm_cfg;
Xiaojun Sang12120ab2017-09-28 18:21:21 +08009185 struct afe_sp_rx_limiter_th_param limiter_th_cfg;
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05309186} __packed;
9187
9188struct afe_spkr_prot_config_command {
9189 struct apr_hdr hdr;
9190 struct afe_port_cmd_set_param_v2 param;
9191 struct afe_port_param_data_v2 pdata;
9192 union afe_spkr_prot_config prot_config;
9193} __packed;
9194
9195struct afe_spkr_prot_get_vi_calib {
9196 struct apr_hdr hdr;
9197 struct afe_port_cmd_get_param_v2 get_param;
9198 struct afe_port_param_data_v2 pdata;
9199 struct asm_calib_res_cfg res_cfg;
9200} __packed;
9201
9202struct afe_spkr_prot_calib_get_resp {
9203 uint32_t status;
9204 struct afe_port_param_data_v2 pdata;
9205 struct asm_calib_res_cfg res_cfg;
9206} __packed;
9207
9208
9209/* SRS TRUMEDIA start */
9210/* topology */
9211#define SRS_TRUMEDIA_TOPOLOGY_ID 0x00010D90
9212/* module */
9213#define SRS_TRUMEDIA_MODULE_ID 0x10005010
9214/* parameters */
9215#define SRS_TRUMEDIA_PARAMS 0x10005011
9216#define SRS_TRUMEDIA_PARAMS_WOWHD 0x10005012
9217#define SRS_TRUMEDIA_PARAMS_CSHP 0x10005013
9218#define SRS_TRUMEDIA_PARAMS_HPF 0x10005014
9219#define SRS_TRUMEDIA_PARAMS_AEQ 0x10005015
9220#define SRS_TRUMEDIA_PARAMS_HL 0x10005016
9221#define SRS_TRUMEDIA_PARAMS_GEQ 0x10005017
9222
9223#define SRS_ID_GLOBAL 0x00000001
9224#define SRS_ID_WOWHD 0x00000002
9225#define SRS_ID_CSHP 0x00000003
9226#define SRS_ID_HPF 0x00000004
9227#define SRS_ID_AEQ 0x00000005
9228#define SRS_ID_HL 0x00000006
9229#define SRS_ID_GEQ 0x00000007
9230
9231#define SRS_CMD_UPLOAD 0x7FFF0000
9232#define SRS_PARAM_OFFSET_MASK 0x3FFF0000
9233#define SRS_PARAM_VALUE_MASK 0x0000FFFF
9234
9235struct srs_trumedia_params_GLOBAL {
9236 uint8_t v1;
9237 uint8_t v2;
9238 uint8_t v3;
9239 uint8_t v4;
9240 uint8_t v5;
9241 uint8_t v6;
9242 uint8_t v7;
9243 uint8_t v8;
9244 uint16_t v9;
9245} __packed;
9246
9247struct srs_trumedia_params_WOWHD {
9248 uint32_t v1;
9249 uint16_t v2;
9250 uint16_t v3;
9251 uint16_t v4;
9252 uint16_t v5;
9253 uint16_t v6;
9254 uint16_t v7;
9255 uint16_t v8;
9256 uint16_t v____A1;
9257 uint32_t v9;
9258 uint16_t v10;
9259 uint16_t v11;
9260 uint32_t v12[16];
9261 uint32_t v13[16];
9262 uint32_t v14[16];
9263 uint32_t v15[16];
9264 uint32_t v16;
9265 uint16_t v17;
9266 uint16_t v18;
9267} __packed;
9268
9269struct srs_trumedia_params_CSHP {
9270 uint32_t v1;
9271 uint16_t v2;
9272 uint16_t v3;
9273 uint16_t v4;
9274 uint16_t v5;
9275 uint16_t v6;
9276 uint16_t v____A1;
9277 uint32_t v7;
9278 uint16_t v8;
9279 uint16_t v9;
9280 uint32_t v10[16];
9281} __packed;
9282
9283struct srs_trumedia_params_HPF {
9284 uint32_t v1;
9285 uint32_t v2[26];
9286} __packed;
9287
9288struct srs_trumedia_params_AEQ {
9289 uint32_t v1;
9290 uint16_t v2;
9291 uint16_t v3;
9292 uint16_t v4;
9293 uint16_t v____A1;
9294 uint32_t v5[74];
9295 uint32_t v6[74];
9296 uint16_t v7[2048];
9297} __packed;
9298
9299struct srs_trumedia_params_HL {
9300 uint16_t v1;
9301 uint16_t v2;
9302 uint16_t v3;
9303 uint16_t v____A1;
9304 int32_t v4;
9305 uint32_t v5;
9306 uint16_t v6;
9307 uint16_t v____A2;
9308 uint32_t v7;
9309} __packed;
9310
9311struct srs_trumedia_params_GEQ {
9312 int16_t v1[10];
9313} __packed;
9314struct srs_trumedia_params {
9315 struct srs_trumedia_params_GLOBAL global;
9316 struct srs_trumedia_params_WOWHD wowhd;
9317 struct srs_trumedia_params_CSHP cshp;
9318 struct srs_trumedia_params_HPF hpf;
9319 struct srs_trumedia_params_AEQ aeq;
9320 struct srs_trumedia_params_HL hl;
9321 struct srs_trumedia_params_GEQ geq;
9322} __packed;
9323/* SRS TruMedia end */
9324
9325#define AUDPROC_PARAM_ID_ENABLE 0x00010904
9326#define ASM_STREAM_POSTPROC_TOPO_ID_SA_PLUS 0x1000FFFF
9327/* DTS Eagle */
9328#define AUDPROC_MODULE_ID_DTS_HPX_PREMIX 0x0001077C
9329#define AUDPROC_MODULE_ID_DTS_HPX_POSTMIX 0x0001077B
9330#define ASM_STREAM_POSTPROC_TOPO_ID_DTS_HPX 0x00010DED
9331#define ASM_STREAM_POSTPROC_TOPO_ID_HPX_PLUS 0x10015000
9332#define ASM_STREAM_POSTPROC_TOPO_ID_HPX_MASTER 0x10015001
9333struct asm_dts_eagle_param {
9334 struct apr_hdr hdr;
9335 struct asm_stream_cmd_set_pp_params_v2 param;
9336 struct asm_stream_param_data_v2 data;
9337} __packed;
9338
9339struct asm_dts_eagle_param_get {
9340 struct apr_hdr hdr;
9341 struct asm_stream_cmd_get_pp_params_v2 param;
9342} __packed;
9343
9344/* Opcode to set BT address and license for aptx decoder */
9345#define APTX_DECODER_BT_ADDRESS 0x00013201
9346#define APTX_CLASSIC_DEC_LICENSE_ID 0x00013202
9347
9348struct aptx_dec_bt_addr_cfg {
9349 uint32_t lap;
9350 uint32_t uap;
9351 uint32_t nap;
9352} __packed;
9353
9354struct aptx_dec_bt_dev_addr {
9355 struct apr_hdr hdr;
9356 struct asm_stream_cmd_set_encdec_param encdec;
9357 struct aptx_dec_bt_addr_cfg bt_addr_cfg;
9358} __packed;
9359
9360struct asm_aptx_dec_fmt_blk_v2 {
9361 struct apr_hdr hdr;
9362 struct asm_data_cmd_media_fmt_update_v2 fmtblk;
9363 u32 sample_rate;
9364/* Number of samples per second.
9365 * Supported values: 44100 and 48000 Hz
9366 */
9367} __packed;
9368
Laxminath Kasam38070be2017-08-17 18:21:59 +05309369/* Q6Core Specific */
9370#define AVCS_CMD_GET_FWK_VERSION (0x0001292C)
9371#define AVCS_CMDRSP_GET_FWK_VERSION (0x0001292D)
9372
9373#define AVCS_SERVICE_ID_ALL (0xFFFFFFFF)
9374#define APRV2_IDS_SERVICE_ID_ADSP_CVP_V (0xB)
9375
9376struct avcs_get_fwk_version {
9377 /*
9378 * Indicates the major version of the AVS build.
9379 * This value is incremented on chipset family boundaries.
9380 */
9381 uint32_t build_major_version;
9382
9383 /*
9384 * Minor version of the AVS build.
9385 * This value represents the mainline to which the AVS build belongs.
9386 */
9387 uint32_t build_minor_version;
9388
9389 /* Indicates the AVS branch version to which the image belongs. */
9390 uint32_t build_branch_version;
9391
9392 /* Indicates the AVS sub-branch or customer product line information. */
9393 uint32_t build_subbranch_version;
9394
9395 /* Number of supported AVS services in the current build. */
9396 uint32_t num_services;
9397};
9398
9399struct avs_svc_api_info {
9400 /*
9401 * APRV2 service IDs for the individual static services.
9402 *
9403 * @values
9404 * - APRV2_IDS_SERVICE_ID_ADSP_CORE_V
9405 * - APRV2_IDS_SERVICE_ID_ADSP_AFE_V
9406 * - APRV2_IDS_SERVICE_ID_ADSP_ASM_V
9407 * - APRV2_IDS_SERVICE_ID_ADSP_ADM_V
9408 * - APRV2_IDS_SERVICE_ID_ADSP_MVM_V
9409 * - APRV2_IDS_SERVICE_ID_ADSP_CVS_V
9410 * - APRV2_IDS_SERVICE_ID_ADSP_CVP_V
9411 * - APRV2_IDS_SERVICE_ID_ADSP_LSM_V
9412 */
9413 uint32_t service_id;
9414
9415 /*
9416 * Indicates the API version of the service.
9417 *
9418 * Each new API update that warrants a change on the HLOS side triggers
9419 * an increment in the version.
9420 */
9421 uint32_t api_version;
9422
9423 /*
9424 * Indicates the API increments on a sub-branch (not on the mainline).
9425 *
9426 * API branch version numbers can increment independently on different
9427 * sub-branches.
9428 */
9429 uint32_t api_branch_version;
9430};
9431
9432struct avcs_fwk_ver_info {
9433 struct avcs_get_fwk_version avcs_fwk_version;
Siena Richard2d0102d2017-09-05 11:15:45 -07009434 struct avs_svc_api_info services[0];
Laxminath Kasam38070be2017-08-17 18:21:59 +05309435} __packed;
9436
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05309437/* LSM Specific */
9438#define VW_FEAT_DIM (39)
9439
9440#define APRV2_IDS_SERVICE_ID_ADSP_LSM_V (0xD)
9441#define APRV2_IDS_DOMAIN_ID_ADSP_V (0x4)
9442#define APRV2_IDS_DOMAIN_ID_APPS_V (0x5)
9443
9444#define LSM_SESSION_CMD_SHARED_MEM_MAP_REGIONS (0x00012A7F)
9445#define LSM_SESSION_CMDRSP_SHARED_MEM_MAP_REGIONS (0x00012A80)
9446#define LSM_SESSION_CMD_SHARED_MEM_UNMAP_REGIONS (0x00012A81)
9447#define LSM_SESSION_CMD_OPEN_TX (0x00012A82)
9448#define LSM_SESSION_CMD_CLOSE_TX (0x00012A88)
9449#define LSM_SESSION_CMD_SET_PARAMS (0x00012A83)
9450#define LSM_SESSION_CMD_SET_PARAMS_V2 (0x00012A8F)
9451#define LSM_SESSION_CMD_REGISTER_SOUND_MODEL (0x00012A84)
9452#define LSM_SESSION_CMD_DEREGISTER_SOUND_MODEL (0x00012A85)
9453#define LSM_SESSION_CMD_START (0x00012A86)
9454#define LSM_SESSION_CMD_STOP (0x00012A87)
9455#define LSM_SESSION_CMD_EOB (0x00012A89)
9456#define LSM_SESSION_CMD_READ (0x00012A8A)
9457#define LSM_SESSION_CMD_OPEN_TX_V2 (0x00012A8B)
9458#define LSM_CMD_ADD_TOPOLOGIES (0x00012A8C)
9459
9460#define LSM_SESSION_EVENT_DETECTION_STATUS (0x00012B00)
9461#define LSM_SESSION_EVENT_DETECTION_STATUS_V2 (0x00012B01)
9462#define LSM_DATA_EVENT_READ_DONE (0x00012B02)
9463#define LSM_DATA_EVENT_STATUS (0x00012B03)
9464#define LSM_SESSION_EVENT_DETECTION_STATUS_V3 (0x00012B04)
9465
9466#define LSM_MODULE_ID_VOICE_WAKEUP (0x00012C00)
9467#define LSM_PARAM_ID_ENDPOINT_DETECT_THRESHOLD (0x00012C01)
9468#define LSM_PARAM_ID_OPERATION_MODE (0x00012C02)
9469#define LSM_PARAM_ID_GAIN (0x00012C03)
9470#define LSM_PARAM_ID_CONNECT_TO_PORT (0x00012C04)
9471#define LSM_PARAM_ID_FEATURE_COMPENSATION_DATA (0x00012C07)
9472#define LSM_PARAM_ID_MIN_CONFIDENCE_LEVELS (0x00012C07)
9473#define LSM_MODULE_ID_LAB (0x00012C08)
9474#define LSM_PARAM_ID_LAB_ENABLE (0x00012C09)
9475#define LSM_PARAM_ID_LAB_CONFIG (0x00012C0A)
9476#define LSM_MODULE_ID_FRAMEWORK (0x00012C0E)
9477#define LSM_PARAM_ID_SWMAD_CFG (0x00012C18)
9478#define LSM_PARAM_ID_SWMAD_MODEL (0x00012C19)
9479#define LSM_PARAM_ID_SWMAD_ENABLE (0x00012C1A)
9480#define LSM_PARAM_ID_POLLING_ENABLE (0x00012C1B)
9481#define LSM_PARAM_ID_MEDIA_FMT (0x00012C1E)
9482#define LSM_PARAM_ID_FWK_MODE_CONFIG (0x00012C27)
9483
9484/* HW MAD specific */
9485#define AFE_MODULE_HW_MAD (0x00010230)
9486#define AFE_PARAM_ID_HW_MAD_CFG (0x00010231)
9487#define AFE_PARAM_ID_HW_MAD_CTRL (0x00010232)
9488#define AFE_PARAM_ID_SLIMBUS_SLAVE_PORT_CFG (0x00010233)
9489
9490/* SW MAD specific */
9491#define AFE_MODULE_SW_MAD (0x0001022D)
9492#define AFE_PARAM_ID_SW_MAD_CFG (0x0001022E)
9493#define AFE_PARAM_ID_SVM_MODEL (0x0001022F)
9494
9495/* Commands/Params to pass the codec/slimbus data to DSP */
9496#define AFE_SVC_CMD_SET_PARAM (0x000100f3)
9497#define AFE_MODULE_CDC_DEV_CFG (0x00010234)
9498#define AFE_PARAM_ID_CDC_SLIMBUS_SLAVE_CFG (0x00010235)
9499#define AFE_PARAM_ID_CDC_REG_CFG (0x00010236)
9500#define AFE_PARAM_ID_CDC_REG_CFG_INIT (0x00010237)
9501#define AFE_PARAM_ID_CDC_REG_PAGE_CFG (0x00010296)
9502
9503#define AFE_MAX_CDC_REGISTERS_TO_CONFIG (20)
9504
9505/* AANC Port Config Specific */
9506#define AFE_PARAM_ID_AANC_PORT_CONFIG (0x00010215)
9507#define AFE_API_VERSION_AANC_PORT_CONFIG (0x1)
9508#define AANC_TX_MIC_UNUSED (0)
9509#define AANC_TX_VOICE_MIC (1)
9510#define AANC_TX_ERROR_MIC (2)
9511#define AANC_TX_NOISE_MIC (3)
9512#define AFE_PORT_MAX_CHANNEL_CNT (8)
9513#define AFE_MODULE_AANC (0x00010214)
9514#define AFE_PARAM_ID_CDC_AANC_VERSION (0x0001023A)
9515#define AFE_API_VERSION_CDC_AANC_VERSION (0x1)
9516#define AANC_HW_BLOCK_VERSION_1 (1)
9517#define AANC_HW_BLOCK_VERSION_2 (2)
9518
9519/*Clip bank selection*/
9520#define AFE_API_VERSION_CLIP_BANK_SEL_CFG 0x1
9521#define AFE_CLIP_MAX_BANKS 4
9522#define AFE_PARAM_ID_CLIP_BANK_SEL_CFG 0x00010242
9523
9524struct afe_param_aanc_port_cfg {
9525 /* Minor version used for tracking the version of the module's
9526 * source port configuration.
9527 */
9528 uint32_t aanc_port_cfg_minor_version;
9529
9530 /* Sampling rate of the source Tx port. 8k - 192k*/
9531 uint32_t tx_port_sample_rate;
9532
9533 /* Channel mapping for the Tx port signal carrying Noise (X),
9534 * Error (E), and Voice (V) signals.
9535 */
9536 uint8_t tx_port_channel_map[AFE_PORT_MAX_CHANNEL_CNT];
9537
9538 /* Number of channels on the source Tx port. */
9539 uint16_t tx_port_num_channels;
9540
9541 /* Port ID of the Rx path reference signal. */
9542 uint16_t rx_path_ref_port_id;
9543
9544 /* Sampling rate of the reference port. 8k - 192k*/
9545 uint32_t ref_port_sample_rate;
9546} __packed;
9547
9548struct afe_param_id_cdc_aanc_version {
9549 /* Minor version used for tracking the version of the module's
9550 * hw version
9551 */
9552 uint32_t cdc_aanc_minor_version;
9553
9554 /* HW version. */
9555 uint32_t aanc_hw_version;
9556} __packed;
9557
9558struct afe_param_id_clip_bank_sel {
9559 /* Minor version used for tracking the version of the module's
9560 * hw version
9561 */
9562 uint32_t minor_version;
9563
9564 /* Number of banks to be read */
9565 uint32_t num_banks;
9566
9567 uint32_t bank_map[AFE_CLIP_MAX_BANKS];
9568} __packed;
9569
9570/* ERROR CODES */
9571/* Success. The operation completed with no errors. */
9572#define ADSP_EOK 0x00000000
9573/* General failure. */
9574#define ADSP_EFAILED 0x00000001
9575/* Bad operation parameter. */
9576#define ADSP_EBADPARAM 0x00000002
9577/* Unsupported routine or operation. */
9578#define ADSP_EUNSUPPORTED 0x00000003
9579/* Unsupported version. */
9580#define ADSP_EVERSION 0x00000004
9581/* Unexpected problem encountered. */
9582#define ADSP_EUNEXPECTED 0x00000005
9583/* Unhandled problem occurred. */
9584#define ADSP_EPANIC 0x00000006
9585/* Unable to allocate resource. */
9586#define ADSP_ENORESOURCE 0x00000007
9587/* Invalid handle. */
9588#define ADSP_EHANDLE 0x00000008
9589/* Operation is already processed. */
9590#define ADSP_EALREADY 0x00000009
9591/* Operation is not ready to be processed. */
9592#define ADSP_ENOTREADY 0x0000000A
9593/* Operation is pending completion. */
9594#define ADSP_EPENDING 0x0000000B
9595/* Operation could not be accepted or processed. */
9596#define ADSP_EBUSY 0x0000000C
9597/* Operation aborted due to an error. */
9598#define ADSP_EABORTED 0x0000000D
9599/* Operation preempted by a higher priority. */
9600#define ADSP_EPREEMPTED 0x0000000E
9601/* Operation requests intervention to complete. */
9602#define ADSP_ECONTINUE 0x0000000F
9603/* Operation requests immediate intervention to complete. */
9604#define ADSP_EIMMEDIATE 0x00000010
9605/* Operation is not implemented. */
9606#define ADSP_ENOTIMPL 0x00000011
9607/* Operation needs more data or resources. */
9608#define ADSP_ENEEDMORE 0x00000012
9609/* Operation does not have memory. */
9610#define ADSP_ENOMEMORY 0x00000014
9611/* Item does not exist. */
9612#define ADSP_ENOTEXIST 0x00000015
9613/* Max count for adsp error code sent to HLOS*/
9614#define ADSP_ERR_MAX (ADSP_ENOTEXIST + 1)
9615/* Operation is finished. */
9616#define ADSP_ETERMINATED 0x00011174
9617
9618/*bharath, adsp_error_codes.h */
9619
9620/* LPASS clock for I2S Interface */
9621
9622/* Supported OSR clock values */
9623#define Q6AFE_LPASS_OSR_CLK_12_P288_MHZ 0xBB8000
9624#define Q6AFE_LPASS_OSR_CLK_11_P2896_MHZ 0xAC4400
9625#define Q6AFE_LPASS_OSR_CLK_9_P600_MHZ 0x927C00
9626#define Q6AFE_LPASS_OSR_CLK_8_P192_MHZ 0x7D0000
9627#define Q6AFE_LPASS_OSR_CLK_6_P144_MHZ 0x5DC000
9628#define Q6AFE_LPASS_OSR_CLK_4_P096_MHZ 0x3E8000
9629#define Q6AFE_LPASS_OSR_CLK_3_P072_MHZ 0x2EE000
9630#define Q6AFE_LPASS_OSR_CLK_2_P048_MHZ 0x1F4000
9631#define Q6AFE_LPASS_OSR_CLK_1_P536_MHZ 0x177000
9632#define Q6AFE_LPASS_OSR_CLK_1_P024_MHZ 0xFA000
9633#define Q6AFE_LPASS_OSR_CLK_768_kHZ 0xBB800
9634#define Q6AFE_LPASS_OSR_CLK_512_kHZ 0x7D000
9635#define Q6AFE_LPASS_OSR_CLK_DISABLE 0x0
9636
9637/* Supported Bit clock values */
9638#define Q6AFE_LPASS_IBIT_CLK_12_P288_MHZ 0xBB8000
9639#define Q6AFE_LPASS_IBIT_CLK_11_P2896_MHZ 0xAC4400
9640#define Q6AFE_LPASS_IBIT_CLK_8_P192_MHZ 0x7D0000
9641#define Q6AFE_LPASS_IBIT_CLK_6_P144_MHZ 0x5DC000
9642#define Q6AFE_LPASS_IBIT_CLK_4_P096_MHZ 0x3E8000
9643#define Q6AFE_LPASS_IBIT_CLK_3_P072_MHZ 0x2EE000
9644#define Q6AFE_LPASS_IBIT_CLK_2_P8224_MHZ 0x2b1100
9645#define Q6AFE_LPASS_IBIT_CLK_2_P048_MHZ 0x1F4000
9646#define Q6AFE_LPASS_IBIT_CLK_1_P536_MHZ 0x177000
9647#define Q6AFE_LPASS_IBIT_CLK_1_P4112_MHZ 0x158880
9648#define Q6AFE_LPASS_IBIT_CLK_1_P024_MHZ 0xFA000
9649#define Q6AFE_LPASS_IBIT_CLK_768_KHZ 0xBB800
9650#define Q6AFE_LPASS_IBIT_CLK_512_KHZ 0x7D000
9651#define Q6AFE_LPASS_IBIT_CLK_256_KHZ 0x3E800
9652#define Q6AFE_LPASS_IBIT_CLK_DISABLE 0x0
9653
9654/* Supported LPASS CLK sources */
9655#define Q6AFE_LPASS_CLK_SRC_EXTERNAL 0
9656#define Q6AFE_LPASS_CLK_SRC_INTERNAL 1
9657
9658/* Supported LPASS CLK root*/
9659#define Q6AFE_LPASS_CLK_ROOT_DEFAULT 0
9660
9661enum afe_lpass_clk_mode {
9662 Q6AFE_LPASS_MODE_BOTH_INVALID,
9663 Q6AFE_LPASS_MODE_CLK1_VALID,
9664 Q6AFE_LPASS_MODE_CLK2_VALID,
9665 Q6AFE_LPASS_MODE_BOTH_VALID,
9666} __packed;
9667
9668/* Clock ID Enumeration Define. */
9669/* Clock ID for Primary I2S IBIT */
9670#define Q6AFE_LPASS_CLK_ID_PRI_MI2S_IBIT 0x100
9671/* Clock ID for Primary I2S EBIT */
9672#define Q6AFE_LPASS_CLK_ID_PRI_MI2S_EBIT 0x101
9673/* Clock ID for Secondary I2S IBIT */
9674#define Q6AFE_LPASS_CLK_ID_SEC_MI2S_IBIT 0x102
9675/* Clock ID for Secondary I2S EBIT */
9676#define Q6AFE_LPASS_CLK_ID_SEC_MI2S_EBIT 0x103
9677/* Clock ID for Tertiary I2S IBIT */
9678#define Q6AFE_LPASS_CLK_ID_TER_MI2S_IBIT 0x104
9679/* Clock ID for Tertiary I2S EBIT */
9680#define Q6AFE_LPASS_CLK_ID_TER_MI2S_EBIT 0x105
9681/* Clock ID for Quartnery I2S IBIT */
9682#define Q6AFE_LPASS_CLK_ID_QUAD_MI2S_IBIT 0x106
9683/* Clock ID for Quartnery I2S EBIT */
9684#define Q6AFE_LPASS_CLK_ID_QUAD_MI2S_EBIT 0x107
9685/* Clock ID for Speaker I2S IBIT */
9686#define Q6AFE_LPASS_CLK_ID_SPEAKER_I2S_IBIT 0x108
9687/* Clock ID for Speaker I2S EBIT */
9688#define Q6AFE_LPASS_CLK_ID_SPEAKER_I2S_EBIT 0x109
9689/* Clock ID for Speaker I2S OSR */
9690#define Q6AFE_LPASS_CLK_ID_SPEAKER_I2S_OSR 0x10A
9691
9692/* Clock ID for QUINARY I2S IBIT */
9693#define Q6AFE_LPASS_CLK_ID_QUI_MI2S_IBIT 0x10B
9694/* Clock ID for QUINARY I2S EBIT */
9695#define Q6AFE_LPASS_CLK_ID_QUI_MI2S_EBIT 0x10C
9696/* Clock ID for SENARY I2S IBIT */
9697#define Q6AFE_LPASS_CLK_ID_SEN_MI2S_IBIT 0x10D
9698/* Clock ID for SENARY I2S EBIT */
9699#define Q6AFE_LPASS_CLK_ID_SEN_MI2S_EBIT 0x10E
9700/* Clock ID for INT0 I2S IBIT */
9701#define Q6AFE_LPASS_CLK_ID_INT0_MI2S_IBIT 0x10F
9702/* Clock ID for INT1 I2S IBIT */
9703#define Q6AFE_LPASS_CLK_ID_INT1_MI2S_IBIT 0x110
9704/* Clock ID for INT2 I2S IBIT */
9705#define Q6AFE_LPASS_CLK_ID_INT2_MI2S_IBIT 0x111
9706/* Clock ID for INT3 I2S IBIT */
9707#define Q6AFE_LPASS_CLK_ID_INT3_MI2S_IBIT 0x112
9708/* Clock ID for INT4 I2S IBIT */
9709#define Q6AFE_LPASS_CLK_ID_INT4_MI2S_IBIT 0x113
9710/* Clock ID for INT5 I2S IBIT */
9711#define Q6AFE_LPASS_CLK_ID_INT5_MI2S_IBIT 0x114
9712/* Clock ID for INT6 I2S IBIT */
9713#define Q6AFE_LPASS_CLK_ID_INT6_MI2S_IBIT 0x115
9714
Rohit Kumara5077932017-09-10 22:05:05 +05309715/* Clock ID for QUINARY MI2S OSR CLK */
9716#define Q6AFE_LPASS_CLK_ID_QUI_MI2S_OSR 0x116
9717
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05309718/* Clock ID for Primary PCM IBIT */
9719#define Q6AFE_LPASS_CLK_ID_PRI_PCM_IBIT 0x200
9720/* Clock ID for Primary PCM EBIT */
9721#define Q6AFE_LPASS_CLK_ID_PRI_PCM_EBIT 0x201
9722/* Clock ID for Secondary PCM IBIT */
9723#define Q6AFE_LPASS_CLK_ID_SEC_PCM_IBIT 0x202
9724/* Clock ID for Secondary PCM EBIT */
9725#define Q6AFE_LPASS_CLK_ID_SEC_PCM_EBIT 0x203
9726/* Clock ID for Tertiary PCM IBIT */
9727#define Q6AFE_LPASS_CLK_ID_TER_PCM_IBIT 0x204
9728/* Clock ID for Tertiary PCM EBIT */
9729#define Q6AFE_LPASS_CLK_ID_TER_PCM_EBIT 0x205
9730/* Clock ID for Quartery PCM IBIT */
9731#define Q6AFE_LPASS_CLK_ID_QUAD_PCM_IBIT 0x206
9732/* Clock ID for Quartery PCM EBIT */
9733#define Q6AFE_LPASS_CLK_ID_QUAD_PCM_EBIT 0x207
Rohit Kumara5077932017-09-10 22:05:05 +05309734/* Clock ID for Quinary PCM IBIT */
9735#define Q6AFE_LPASS_CLK_ID_QUIN_PCM_IBIT 0x208
9736/* Clock ID for Quinary PCM EBIT */
9737#define Q6AFE_LPASS_CLK_ID_QUIN_PCM_EBIT 0x209
9738/* Clock ID for QUINARY PCM OSR */
9739#define Q6AFE_LPASS_CLK_ID_QUI_PCM_OSR 0x20A
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05309740
9741/** Clock ID for Primary TDM IBIT */
9742#define Q6AFE_LPASS_CLK_ID_PRI_TDM_IBIT 0x200
9743/** Clock ID for Primary TDM EBIT */
9744#define Q6AFE_LPASS_CLK_ID_PRI_TDM_EBIT 0x201
9745/** Clock ID for Secondary TDM IBIT */
9746#define Q6AFE_LPASS_CLK_ID_SEC_TDM_IBIT 0x202
9747/** Clock ID for Secondary TDM EBIT */
9748#define Q6AFE_LPASS_CLK_ID_SEC_TDM_EBIT 0x203
9749/** Clock ID for Tertiary TDM IBIT */
9750#define Q6AFE_LPASS_CLK_ID_TER_TDM_IBIT 0x204
9751/** Clock ID for Tertiary TDM EBIT */
9752#define Q6AFE_LPASS_CLK_ID_TER_TDM_EBIT 0x205
9753/** Clock ID for Quartery TDM IBIT */
9754#define Q6AFE_LPASS_CLK_ID_QUAD_TDM_IBIT 0x206
9755/** Clock ID for Quartery TDM EBIT */
9756#define Q6AFE_LPASS_CLK_ID_QUAD_TDM_EBIT 0x207
Rohit Kumara5077932017-09-10 22:05:05 +05309757/** Clock ID for Quinary TDM IBIT */
9758#define Q6AFE_LPASS_CLK_ID_QUIN_TDM_IBIT 0x208
9759/** Clock ID for Quinary TDM EBIT */
9760#define Q6AFE_LPASS_CLK_ID_QUIN_TDM_EBIT 0x209
9761/** Clock ID for Quinary TDM OSR */
9762#define Q6AFE_LPASS_CLK_ID_QUIN_TDM_OSR 0x20A
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05309763
9764/* Clock ID for MCLK1 */
9765#define Q6AFE_LPASS_CLK_ID_MCLK_1 0x300
9766/* Clock ID for MCLK2 */
9767#define Q6AFE_LPASS_CLK_ID_MCLK_2 0x301
9768/* Clock ID for MCLK3 */
9769#define Q6AFE_LPASS_CLK_ID_MCLK_3 0x302
9770/* Clock ID for MCLK4 */
9771#define Q6AFE_LPASS_CLK_ID_MCLK_4 0x304
9772/* Clock ID for Internal Digital Codec Core */
9773#define Q6AFE_LPASS_CLK_ID_INTERNAL_DIGITAL_CODEC_CORE 0x303
9774/* Clock ID for INT MCLK0 */
9775#define Q6AFE_LPASS_CLK_ID_INT_MCLK_0 0x305
9776/* Clock ID for INT MCLK1 */
9777#define Q6AFE_LPASS_CLK_ID_INT_MCLK_1 0x306
9778/*
9779 * Clock ID for soundwire NPL.
9780 * This is the clock to be used to enable NPL clock for internal Soundwire.
9781 */
9782#define AFE_CLOCK_SET_CLOCK_ID_SWR_NPL_CLK 0x307
9783
9784/* Clock ID for AHB HDMI input */
9785#define Q6AFE_LPASS_CLK_ID_AHB_HDMI_INPUT 0x400
9786
9787/* Clock ID for SPDIF core */
9788#define Q6AFE_LPASS_CLK_ID_SPDIF_CORE 0x500
9789
9790
9791/* Clock attribute for invalid use (reserved for internal usage) */
9792#define Q6AFE_LPASS_CLK_ATTRIBUTE_INVALID 0x0
9793/* Clock attribute for no couple case */
9794#define Q6AFE_LPASS_CLK_ATTRIBUTE_COUPLE_NO 0x1
9795/* Clock attribute for dividend couple case */
9796#define Q6AFE_LPASS_CLK_ATTRIBUTE_COUPLE_DIVIDEND 0x2
9797/* Clock attribute for divisor couple case */
9798#define Q6AFE_LPASS_CLK_ATTRIBUTE_COUPLE_DIVISOR 0x3
9799/* Clock attribute for invert and no couple case */
9800#define Q6AFE_LPASS_CLK_ATTRIBUTE_INVERT_COUPLE_NO 0x4
9801/* Clock set API version */
9802#define Q6AFE_LPASS_CLK_CONFIG_API_VERSION 0x1
9803
9804struct afe_clk_set {
9805 /*
9806 * Minor version used for tracking clock set.
9807 * @values #AFE_API_VERSION_CLOCK_SET
9808 */
9809 uint32_t clk_set_minor_version;
9810
9811 /*
9812 * Clock ID
9813 * @values
9814 * - 0x100 to 0x10A - MSM8996
9815 * - 0x200 to 0x207 - MSM8996
9816 * - 0x300 to 0x302 - MSM8996 @tablebulletend
9817 */
9818 uint32_t clk_id;
9819
9820 /*
9821 * Clock frequency (in Hertz) to be set.
9822 * @values
9823 * - >= 0 for clock frequency to set @tablebulletend
9824 */
9825 uint32_t clk_freq_in_hz;
9826
9827 /* Use to specific divider for two clocks if needed.
9828 * Set to Q6AFE_LPASS_CLK_ATTRIBUTE_COUPLE_NO for no divider
9829 * relation clocks
9830 * @values
9831 * - #Q6AFE_LPASS_CLK_ATTRIBUTE_COUPLE_NO
9832 * - #Q6AFE_LPASS_CLK_ATTRIBUTE_COUPLE_DIVIDEND
9833 * - #Q6AFE_LPASS_CLK_ATTRIBUTE_COUPLE_DIVISOR @tablebulletend
9834 */
9835 uint16_t clk_attri;
9836
9837 /*
9838 * Specifies the root clock source.
9839 * Currently, only Q6AFE_LPASS_CLK_ROOT_DEFAULT is valid
9840 * @values
9841 * - 0 @tablebulletend
9842 */
9843 uint16_t clk_root;
9844
9845 /*
9846 * for enable and disable clock.
9847 * "clk_freq_in_hz", "clk_attri", and "clk_root"
9848 * are ignored in disable clock case.
9849 * @values 
9850 * - 0 -- Disabled
9851 * - 1 -- Enabled @tablebulletend
9852 */
9853 uint32_t enable;
9854};
9855
9856struct afe_clk_cfg {
9857/* Minor version used for tracking the version of the I2S
9858 * configuration interface.
9859 * Supported values: #AFE_API_VERSION_I2S_CONFIG
9860 */
9861 u32 i2s_cfg_minor_version;
9862
9863/* clk value 1 in MHz. */
9864 u32 clk_val1;
9865
9866/* clk value 2 in MHz. */
9867 u32 clk_val2;
9868
9869/* clk_src
9870 * #Q6AFE_LPASS_CLK_SRC_EXTERNAL
9871 * #Q6AFE_LPASS_CLK_SRC_INTERNAL
9872 */
9873
9874 u16 clk_src;
9875
9876/* clk_root -0 for default */
9877 u16 clk_root;
9878
9879/* clk_set_mode
9880 * #Q6AFE_LPASS_MODE_BOTH_INVALID
9881 * #Q6AFE_LPASS_MODE_CLK1_VALID
9882 * #Q6AFE_LPASS_MODE_CLK2_VALID
9883 * #Q6AFE_LPASS_MODE_BOTH_VALID
9884 */
9885 u16 clk_set_mode;
9886
9887/* This param id is used to configure I2S clk */
9888 u16 reserved;
9889} __packed;
9890
9891/* This param id is used to configure I2S clk */
9892#define AFE_PARAM_ID_LPAIF_CLK_CONFIG 0x00010238
9893#define AFE_MODULE_CLOCK_SET 0x0001028F
9894#define AFE_PARAM_ID_CLOCK_SET 0x00010290
9895
9896struct afe_lpass_clk_config_command {
9897 struct apr_hdr hdr;
9898 struct afe_port_cmd_set_param_v2 param;
9899 struct afe_port_param_data_v2 pdata;
9900 struct afe_clk_cfg clk_cfg;
9901} __packed;
9902
9903enum afe_lpass_digital_clk_src {
9904 Q6AFE_LPASS_DIGITAL_ROOT_INVALID,
9905 Q6AFE_LPASS_DIGITAL_ROOT_PRI_MI2S_OSR,
9906 Q6AFE_LPASS_DIGITAL_ROOT_SEC_MI2S_OSR,
9907 Q6AFE_LPASS_DIGITAL_ROOT_TER_MI2S_OSR,
9908 Q6AFE_LPASS_DIGITAL_ROOT_QUAD_MI2S_OSR,
9909 Q6AFE_LPASS_DIGITAL_ROOT_CDC_ROOT_CLK,
9910} __packed;
9911
9912/* This param id is used to configure internal clk */
9913#define AFE_PARAM_ID_INTERNAL_DIGIATL_CDC_CLK_CONFIG 0x00010239
9914
9915struct afe_digital_clk_cfg {
9916/* Minor version used for tracking the version of the I2S
9917 * configuration interface.
9918 * Supported values: #AFE_API_VERSION_I2S_CONFIG
9919 */
9920 u32 i2s_cfg_minor_version;
9921
9922/* clk value in MHz. */
9923 u32 clk_val;
9924
9925/* INVALID
9926 * PRI_MI2S_OSR
9927 * SEC_MI2S_OSR
9928 * TER_MI2S_OSR
9929 * QUAD_MI2S_OSR
9930 * DIGT_CDC_ROOT
9931 */
9932 u16 clk_root;
9933
9934/* This field must be set to zero. */
9935 u16 reserved;
9936} __packed;
9937
9938
9939struct afe_lpass_digital_clk_config_command {
9940 struct apr_hdr hdr;
9941 struct afe_port_cmd_set_param_v2 param;
9942 struct afe_port_param_data_v2 pdata;
9943 struct afe_digital_clk_cfg clk_cfg;
9944} __packed;
9945
9946/*
9947 * Opcode for AFE to start DTMF.
9948 */
9949#define AFE_PORTS_CMD_DTMF_CTL 0x00010102
9950
9951/** DTMF payload.*/
9952struct afe_dtmf_generation_command {
9953 struct apr_hdr hdr;
9954
9955 /*
9956 * Duration of the DTMF tone in ms.
9957 * -1 -> continuous,
9958 * 0 -> disable
9959 */
9960 int64_t duration_in_ms;
9961
9962 /*
9963 * The DTMF high tone frequency.
9964 */
9965 uint16_t high_freq;
9966
9967 /*
9968 * The DTMF low tone frequency.
9969 */
9970 uint16_t low_freq;
9971
9972 /*
9973 * The DTMF volume setting
9974 */
9975 uint16_t gain;
9976
9977 /*
9978 * The number of ports to enable/disable on.
9979 */
9980 uint16_t num_ports;
9981
9982 /*
9983 * The Destination ports - array .
9984 * For DTMF on multiple ports, portIds needs to
9985 * be populated numPorts times.
9986 */
9987 uint16_t port_ids;
9988
9989 /*
9990 * variable for 32 bit alignment of APR packet.
9991 */
9992 uint16_t reserved;
9993} __packed;
9994
9995enum afe_config_type {
9996 AFE_SLIMBUS_SLAVE_PORT_CONFIG,
9997 AFE_SLIMBUS_SLAVE_CONFIG,
9998 AFE_CDC_REGISTERS_CONFIG,
9999 AFE_AANC_VERSION,
10000 AFE_CDC_CLIP_REGISTERS_CONFIG,
10001 AFE_CLIP_BANK_SEL,
10002 AFE_CDC_REGISTER_PAGE_CONFIG,
10003 AFE_MAX_CONFIG_TYPES,
10004};
10005
10006struct afe_param_slimbus_slave_port_cfg {
10007 uint32_t minor_version;
10008 uint16_t slimbus_dev_id;
10009 uint16_t slave_dev_pgd_la;
10010 uint16_t slave_dev_intfdev_la;
10011 uint16_t bit_width;
10012 uint16_t data_format;
10013 uint16_t num_channels;
10014 uint16_t slave_port_mapping[AFE_PORT_MAX_AUDIO_CHAN_CNT];
10015} __packed;
10016
10017struct afe_param_cdc_slimbus_slave_cfg {
10018 uint32_t minor_version;
10019 uint32_t device_enum_addr_lsw;
10020 uint32_t device_enum_addr_msw;
10021 uint16_t tx_slave_port_offset;
10022 uint16_t rx_slave_port_offset;
10023} __packed;
10024
10025struct afe_param_cdc_reg_cfg {
10026 uint32_t minor_version;
10027 uint32_t reg_logical_addr;
10028 uint32_t reg_field_type;
10029 uint32_t reg_field_bit_mask;
10030 uint16_t reg_bit_width;
10031 uint16_t reg_offset_scale;
10032} __packed;
10033
10034#define AFE_API_VERSION_CDC_REG_PAGE_CFG 1
10035
10036enum {
10037 AFE_CDC_REG_PAGE_ASSIGN_PROC_ID_0 = 0,
10038 AFE_CDC_REG_PAGE_ASSIGN_PROC_ID_1,
10039 AFE_CDC_REG_PAGE_ASSIGN_PROC_ID_2,
10040 AFE_CDC_REG_PAGE_ASSIGN_PROC_ID_3,
10041};
10042
10043struct afe_param_cdc_reg_page_cfg {
10044 uint32_t minor_version;
10045 uint32_t enable;
10046 uint32_t proc_id;
10047} __packed;
10048
10049struct afe_param_cdc_reg_cfg_data {
10050 uint32_t num_registers;
10051 struct afe_param_cdc_reg_cfg *reg_data;
10052} __packed;
10053
10054struct afe_svc_cmd_set_param {
10055 uint32_t payload_size;
10056 uint32_t payload_address_lsw;
10057 uint32_t payload_address_msw;
10058 uint32_t mem_map_handle;
10059} __packed;
10060
10061struct afe_svc_param_data {
10062 uint32_t module_id;
10063 uint32_t param_id;
10064 uint16_t param_size;
10065 uint16_t reserved;
10066} __packed;
10067
10068struct afe_param_hw_mad_ctrl {
10069 uint32_t minor_version;
10070 uint16_t mad_type;
10071 uint16_t mad_enable;
10072} __packed;
10073
10074struct afe_cmd_hw_mad_ctrl {
10075 struct apr_hdr hdr;
10076 struct afe_port_cmd_set_param_v2 param;
10077 struct afe_port_param_data_v2 pdata;
10078 struct afe_param_hw_mad_ctrl payload;
10079} __packed;
10080
10081struct afe_cmd_hw_mad_slimbus_slave_port_cfg {
10082 struct apr_hdr hdr;
10083 struct afe_port_cmd_set_param_v2 param;
10084 struct afe_port_param_data_v2 pdata;
10085 struct afe_param_slimbus_slave_port_cfg sb_port_cfg;
10086} __packed;
10087
10088struct afe_cmd_sw_mad_enable {
10089 struct apr_hdr hdr;
10090 struct afe_port_cmd_set_param_v2 param;
10091 struct afe_port_param_data_v2 pdata;
10092} __packed;
10093
10094struct afe_param_cdc_reg_cfg_payload {
10095 struct afe_svc_param_data common;
10096 struct afe_param_cdc_reg_cfg reg_cfg;
10097} __packed;
10098
10099struct afe_lpass_clk_config_command_v2 {
10100 struct apr_hdr hdr;
10101 struct afe_svc_cmd_set_param param;
10102 struct afe_svc_param_data pdata;
10103 struct afe_clk_set clk_cfg;
10104} __packed;
10105
10106/*
10107 * reg_data's size can be up to AFE_MAX_CDC_REGISTERS_TO_CONFIG
10108 */
10109struct afe_svc_cmd_cdc_reg_cfg {
10110 struct apr_hdr hdr;
10111 struct afe_svc_cmd_set_param param;
10112 struct afe_param_cdc_reg_cfg_payload reg_data[0];
10113} __packed;
10114
10115struct afe_svc_cmd_init_cdc_reg_cfg {
10116 struct apr_hdr hdr;
10117 struct afe_svc_cmd_set_param param;
10118 struct afe_port_param_data_v2 init;
10119} __packed;
10120
10121struct afe_svc_cmd_sb_slave_cfg {
10122 struct apr_hdr hdr;
10123 struct afe_svc_cmd_set_param param;
10124 struct afe_port_param_data_v2 pdata;
10125 struct afe_param_cdc_slimbus_slave_cfg sb_slave_cfg;
10126} __packed;
10127
10128struct afe_svc_cmd_cdc_reg_page_cfg {
10129 struct apr_hdr hdr;
10130 struct afe_svc_cmd_set_param param;
10131 struct afe_port_param_data_v2 pdata;
10132 struct afe_param_cdc_reg_page_cfg cdc_reg_page_cfg;
10133} __packed;
10134
10135struct afe_svc_cmd_cdc_aanc_version {
10136 struct apr_hdr hdr;
10137 struct afe_svc_cmd_set_param param;
10138 struct afe_port_param_data_v2 pdata;
10139 struct afe_param_id_cdc_aanc_version version;
10140} __packed;
10141
10142struct afe_port_cmd_set_aanc_param {
10143 struct apr_hdr hdr;
10144 struct afe_port_cmd_set_param_v2 param;
10145 struct afe_port_param_data_v2 pdata;
10146 union {
10147 struct afe_param_aanc_port_cfg aanc_port_cfg;
10148 struct afe_mod_enable_param mod_enable;
10149 } __packed data;
10150} __packed;
10151
10152struct afe_port_cmd_set_aanc_acdb_table {
10153 struct apr_hdr hdr;
10154 struct afe_port_cmd_set_param_v2 param;
10155} __packed;
10156
10157/* Dolby DAP topology */
10158#define DOLBY_ADM_COPP_TOPOLOGY_ID 0x0001033B
10159#define DS2_ADM_COPP_TOPOLOGY_ID 0x1301033B
10160
10161/* RMS value from DSP */
10162#define RMS_MODULEID_APPI_PASSTHRU 0x10009011
10163#define RMS_PARAM_FIRST_SAMPLE 0x10009012
10164#define RMS_PAYLOAD_LEN 4
10165
10166/* Customized mixing in matix mixer */
10167#define MTMX_MODULE_ID_DEFAULT_CHMIXER 0x00010341
10168#define DEFAULT_CHMIXER_PARAM_ID_COEFF 0x00010342
10169#define CUSTOM_STEREO_PAYLOAD_SIZE 9
10170#define CUSTOM_STEREO_CMD_PARAM_SIZE 24
10171#define CUSTOM_STEREO_NUM_OUT_CH 0x0002
10172#define CUSTOM_STEREO_NUM_IN_CH 0x0002
10173#define CUSTOM_STEREO_INDEX_PARAM 0x0002
10174#define Q14_GAIN_ZERO_POINT_FIVE 0x2000
10175#define Q14_GAIN_UNITY 0x4000
10176
10177struct afe_svc_cmd_set_clip_bank_selection {
10178 struct apr_hdr hdr;
10179 struct afe_svc_cmd_set_param param;
10180 struct afe_port_param_data_v2 pdata;
10181 struct afe_param_id_clip_bank_sel bank_sel;
10182} __packed;
10183
10184/* Ultrasound supported formats */
10185#define US_POINT_EPOS_FORMAT_V2 0x0001272D
10186#define US_RAW_FORMAT_V2 0x0001272C
10187#define US_PROX_FORMAT_V4 0x0001273B
10188#define US_RAW_SYNC_FORMAT 0x0001272F
10189#define US_GES_SYNC_FORMAT 0x00012730
10190
10191#define AFE_MODULE_GROUP_DEVICE 0x00010254
10192#define AFE_PARAM_ID_GROUP_DEVICE_CFG 0x00010255
10193#define AFE_PARAM_ID_GROUP_DEVICE_ENABLE 0x00010256
10194#define AFE_GROUP_DEVICE_ID_SECONDARY_MI2S_RX 0x1102
10195
10196/* Payload of the #AFE_PARAM_ID_GROUP_DEVICE_CFG
10197 * parameter, which configures max of 8 AFE ports
10198 * into a group.
10199 * The fixed size of this structure is sixteen bytes.
10200 */
10201struct afe_group_device_group_cfg {
10202 u32 minor_version;
10203 u16 group_id;
10204 u16 num_channels;
10205 u16 port_id[8];
10206} __packed;
10207
10208#define AFE_GROUP_DEVICE_ID_PRIMARY_TDM_RX \
10209 (AFE_PORT_ID_PRIMARY_TDM_RX + 0x100)
10210#define AFE_GROUP_DEVICE_ID_PRIMARY_TDM_TX \
10211 (AFE_PORT_ID_PRIMARY_TDM_TX + 0x100)
10212#define AFE_GROUP_DEVICE_ID_SECONDARY_TDM_RX \
10213 (AFE_PORT_ID_SECONDARY_TDM_RX + 0x100)
10214#define AFE_GROUP_DEVICE_ID_SECONDARY_TDM_TX \
10215 (AFE_PORT_ID_SECONDARY_TDM_TX + 0x100)
10216#define AFE_GROUP_DEVICE_ID_TERTIARY_TDM_RX \
10217 (AFE_PORT_ID_TERTIARY_TDM_RX + 0x100)
10218#define AFE_GROUP_DEVICE_ID_TERTIARY_TDM_TX \
10219 (AFE_PORT_ID_TERTIARY_TDM_TX + 0x100)
10220#define AFE_GROUP_DEVICE_ID_QUATERNARY_TDM_RX \
10221 (AFE_PORT_ID_QUATERNARY_TDM_RX + 0x100)
10222#define AFE_GROUP_DEVICE_ID_QUATERNARY_TDM_TX \
10223 (AFE_PORT_ID_QUATERNARY_TDM_TX + 0x100)
Rohit Kumara5077932017-09-10 22:05:05 +053010224#define AFE_GROUP_DEVICE_ID_QUINARY_TDM_RX \
10225 (AFE_PORT_ID_QUINARY_TDM_RX + 0x100)
10226#define AFE_GROUP_DEVICE_ID_QUINARY_TDM_TX \
10227 (AFE_PORT_ID_QUINARY_TDM_TX + 0x100)
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +053010228
10229/* ID of the parameter used by #AFE_MODULE_GROUP_DEVICE to configure the
10230 * group device. #AFE_SVC_CMD_SET_PARAM can use this parameter ID.
10231 *
10232 * Requirements:
10233 * - Configure the group before the member ports in the group are
10234 * configured and started.
10235 * - Enable the group only after it is configured.
10236 * - Stop all member ports in the group before disabling the group.
10237 */
10238#define AFE_PARAM_ID_GROUP_DEVICE_TDM_CONFIG 0x0001029E
10239
10240/* Version information used to handle future additions to
10241 * AFE_PARAM_ID_GROUP_DEVICE_TDM_CONFIG processing (for backward compatibility).
10242 */
10243#define AFE_API_VERSION_GROUP_DEVICE_TDM_CONFIG 0x1
10244
10245/* Number of AFE ports in group device */
10246#define AFE_GROUP_DEVICE_NUM_PORTS 8
10247
10248/* Payload of the AFE_PARAM_ID_GROUP_DEVICE_TDM_CONFIG parameter ID
10249 * used by AFE_MODULE_GROUP_DEVICE.
10250 */
10251struct afe_param_id_group_device_tdm_cfg {
10252 u32 group_device_cfg_minor_version;
10253 /* Minor version used to track group device configuration.
10254 * @values #AFE_API_VERSION_GROUP_DEVICE_TDM_CONFIG
10255 */
10256
10257 u16 group_id;
10258 /* ID for the group device.
10259 * @values
10260 * - #AFE_GROUP_DEVICE_ID_PRIMARY_TDM_RX
10261 * - #AFE_GROUP_DEVICE_ID_PRIMARY_TDM_TX
10262 * - #AFE_GROUP_DEVICE_ID_SECONDARY_TDM_RX
10263 * - #AFE_GROUP_DEVICE_ID_SECONDARY_TDM_TX
10264 * - #AFE_GROUP_DEVICE_ID_TERTIARY_TDM_RX
10265 * - #AFE_GROUP_DEVICE_ID_TERTIARY_TDM_TX
10266 * - #AFE_GROUP_DEVICE_ID_QUATERNARY_TDM_RX
10267 * - #AFE_GROUP_DEVICE_ID_QUATERNARY_TDM_TX
10268 */
10269
10270 u16 reserved;
10271 /* 0 */
10272
10273 u16 port_id[AFE_GROUP_DEVICE_NUM_PORTS];
10274 /* Array of member port IDs of this group.
10275 * @values
10276 * - #AFE_PORT_ID_PRIMARY_TDM_RX
10277 * - #AFE_PORT_ID_PRIMARY_TDM_RX_1
10278 * - #AFE_PORT_ID_PRIMARY_TDM_RX_2
10279 * - #AFE_PORT_ID_PRIMARY_TDM_RX_3
10280 * - #AFE_PORT_ID_PRIMARY_TDM_RX_4
10281 * - #AFE_PORT_ID_PRIMARY_TDM_RX_5
10282 * - #AFE_PORT_ID_PRIMARY_TDM_RX_6
10283 * - #AFE_PORT_ID_PRIMARY_TDM_RX_7
10284
10285 * - #AFE_PORT_ID_PRIMARY_TDM_TX
10286 * - #AFE_PORT_ID_PRIMARY_TDM_TX_1
10287 * - #AFE_PORT_ID_PRIMARY_TDM_TX_2
10288 * - #AFE_PORT_ID_PRIMARY_TDM_TX_3
10289 * - #AFE_PORT_ID_PRIMARY_TDM_TX_4
10290 * - #AFE_PORT_ID_PRIMARY_TDM_TX_5
10291 * - #AFE_PORT_ID_PRIMARY_TDM_TX_6
10292 * - #AFE_PORT_ID_PRIMARY_TDM_TX_7
10293
10294 * - #AFE_PORT_ID_SECONDARY_TDM_RX
10295 * - #AFE_PORT_ID_SECONDARY_TDM_RX_1
10296 * - #AFE_PORT_ID_SECONDARY_TDM_RX_2
10297 * - #AFE_PORT_ID_SECONDARY_TDM_RX_3
10298 * - #AFE_PORT_ID_SECONDARY_TDM_RX_4
10299 * - #AFE_PORT_ID_SECONDARY_TDM_RX_5
10300 * - #AFE_PORT_ID_SECONDARY_TDM_RX_6
10301 * - #AFE_PORT_ID_SECONDARY_TDM_RX_7
10302
10303 * - #AFE_PORT_ID_SECONDARY_TDM_TX
10304 * - #AFE_PORT_ID_SECONDARY_TDM_TX_1
10305 * - #AFE_PORT_ID_SECONDARY_TDM_TX_2
10306 * - #AFE_PORT_ID_SECONDARY_TDM_TX_3
10307 * - #AFE_PORT_ID_SECONDARY_TDM_TX_4
10308 * - #AFE_PORT_ID_SECONDARY_TDM_TX_5
10309 * - #AFE_PORT_ID_SECONDARY_TDM_TX_6
10310 * - #AFE_PORT_ID_SECONDARY_TDM_TX_7
10311
10312 * - #AFE_PORT_ID_TERTIARY_TDM_RX
10313 * - #AFE_PORT_ID_TERTIARY_TDM_RX_1
10314 * - #AFE_PORT_ID_TERTIARY_TDM_RX_2
10315 * - #AFE_PORT_ID_TERTIARY_TDM_RX_3
10316 * - #AFE_PORT_ID_TERTIARY_TDM_RX_4
10317 * - #AFE_PORT_ID_TERTIARY_TDM_RX_5
10318 * - #AFE_PORT_ID_TERTIARY_TDM_RX_6
10319 * - #AFE_PORT_ID_TERTIARY_TDM_RX_7
10320
10321 * - #AFE_PORT_ID_TERTIARY_TDM_TX
10322 * - #AFE_PORT_ID_TERTIARY_TDM_TX_1
10323 * - #AFE_PORT_ID_TERTIARY_TDM_TX_2
10324 * - #AFE_PORT_ID_TERTIARY_TDM_TX_3
10325 * - #AFE_PORT_ID_TERTIARY_TDM_TX_4
10326 * - #AFE_PORT_ID_TERTIARY_TDM_TX_5
10327 * - #AFE_PORT_ID_TERTIARY_TDM_TX_6
10328 * - #AFE_PORT_ID_TERTIARY_TDM_TX_7
10329
10330 * - #AFE_PORT_ID_QUATERNARY_TDM_RX
10331 * - #AFE_PORT_ID_QUATERNARY_TDM_RX_1
10332 * - #AFE_PORT_ID_QUATERNARY_TDM_RX_2
10333 * - #AFE_PORT_ID_QUATERNARY_TDM_RX_3
10334 * - #AFE_PORT_ID_QUATERNARY_TDM_RX_4
10335 * - #AFE_PORT_ID_QUATERNARY_TDM_RX_5
10336 * - #AFE_PORT_ID_QUATERNARY_TDM_RX_6
10337 * - #AFE_PORT_ID_QUATERNARY_TDM_RX_7
10338
10339 * - #AFE_PORT_ID_QUATERNARY_TDM_TX
10340 * - #AFE_PORT_ID_QUATERNARY_TDM_TX_1
10341 * - #AFE_PORT_ID_QUATERNARY_TDM_TX_2
10342 * - #AFE_PORT_ID_QUATERNARY_TDM_TX_3
10343 * - #AFE_PORT_ID_QUATERNARY_TDM_TX_4
10344 * - #AFE_PORT_ID_QUATERNARY_TDM_TX_5
10345 * - #AFE_PORT_ID_QUATERNARY_TDM_TX_6
10346 * - #AFE_PORT_ID_QUATERNARY_TDM_TX_7
10347 * @tablebulletend
10348 */
10349
10350 u32 num_channels;
10351 /* Number of enabled slots for TDM frame.
10352 * @values 1 to 8
10353 */
10354
10355 u32 sample_rate;
10356 /* Sampling rate of the port.
10357 * @values
10358 * - #AFE_PORT_SAMPLE_RATE_8K
10359 * - #AFE_PORT_SAMPLE_RATE_16K
10360 * - #AFE_PORT_SAMPLE_RATE_24K
10361 * - #AFE_PORT_SAMPLE_RATE_32K
10362 * - #AFE_PORT_SAMPLE_RATE_48K @tablebulletend
10363 */
10364
10365 u32 bit_width;
10366 /* Bit width of the sample.
10367 * @values 16, 24, (32)
10368 */
10369
10370 u16 nslots_per_frame;
10371 /* Number of slots per frame. Typical : 1, 2, 4, 8, 16, 32.
10372 * @values 1 - 32
10373 */
10374
10375 u16 slot_width;
10376 /* Slot width of the slot in a TDM frame. (slot_width >= bit_width)
10377 * have to be satisfied.
10378 * @values 16, 24, 32
10379 */
10380
10381 u32 slot_mask;
10382 /* Position of active slots. When that bit is set, that paricular
10383 * slot is active.
10384 * Number of active slots can be inferred by number of bits set in
10385 * the mask. Only 8 individual bits can be enabled.
10386 * Bits 0..31 corresponding to slot 0..31
10387 * @values 1 to 2^32 -1
10388 */
10389} __packed;
10390
10391/* Payload of the #AFE_PARAM_ID_GROUP_DEVICE_ENABLE
10392 * parameter, which enables or
10393 * disables any module.
10394 * The fixed size of this structure is four bytes.
10395 */
10396
10397struct afe_group_device_enable {
10398 u16 group_id;
10399 /* valid value is AFE_GROUP_DEVICE_ID_SECONDARY_MI2S_RX */
10400 u16 enable;
10401 /* Enables (1) or disables (0) the module. */
10402} __packed;
10403
10404union afe_port_group_config {
10405 struct afe_group_device_group_cfg group_cfg;
10406 struct afe_group_device_enable group_enable;
10407 struct afe_param_id_group_device_tdm_cfg tdm_cfg;
10408} __packed;
10409
10410struct afe_port_group_create {
10411 struct apr_hdr hdr;
10412 struct afe_svc_cmd_set_param param;
10413 struct afe_port_param_data_v2 pdata;
10414 union afe_port_group_config data;
10415} __packed;
10416
10417/* ID of the parameter used by #AFE_MODULE_AUDIO_DEV_INTERFACE to specify
10418 * the timing statistics of the corresponding device interface.
10419 * Client can periodically query for the device time statistics to help adjust
10420 * the PLL based on the drift value. The get param command must be sent to
10421 * AFE port ID corresponding to device interface
10422
10423 * This parameter ID supports following get param commands:
10424 * #AFE_PORT_CMD_GET_PARAM_V2 and
10425 * #AFE_PORT_CMD_GET_PARAM_V3.
10426 */
10427#define AFE_PARAM_ID_DEV_TIMING_STATS 0x000102AD
10428
10429/* Version information used to handle future additions to AFE device
10430 * interface timing statistics (for backward compatibility).
10431 */
10432#define AFE_API_VERSION_DEV_TIMING_STATS 0x1
10433
10434/* Enumeration for specifying a sink(Rx) device */
10435#define AFE_SINK_DEVICE 0x0
10436
10437/* Enumeration for specifying a source(Tx) device */
10438#define AFE_SOURCE_DEVICE 0x1
10439
10440/* Enumeration for specifying the drift reference is of type AV Timer */
10441#define AFE_REF_TIMER_TYPE_AVTIMER 0x0
10442
10443/* Message payload structure for the
10444 * AFE_PARAM_ID_DEV_TIMING_STATS parameter.
10445 */
10446struct afe_param_id_dev_timing_stats {
10447 /* Minor version used to track the version of device interface timing
10448 * statistics. Currently, the supported version is 1.
10449 * @values #AFE_API_VERSION_DEV_TIMING_STATS
10450 */
10451 u32 minor_version;
10452
10453 /* Indicates the device interface direction as either
10454 * source (Tx) or sink (Rx).
10455 * @values
10456 * #AFE_SINK_DEVICE
10457 * #AFE_SOURCE_DEVICE
10458 */
10459 u16 device_direction;
10460
10461 /* Reference timer for drift accumulation and time stamp information.
10462 * @values
10463 * #AFE_REF_TIMER_TYPE_AVTIMER @tablebulletend
10464 */
10465 u16 reference_timer;
10466
10467 /*
10468 * Flag to indicate if resync is required on the client side for
10469 * drift correction. Flag is set to TRUE for the first get_param
10470 * response after device interface starts. This flag value can be
10471 * used by client to identify if device interface restart has
10472 * happened and if any re-sync is required at their end for drift
10473 * correction.
10474 * @values
10475 * 0: FALSE (Resync not required)
10476 * 1: TRUE (Resync required) @tablebulletend
10477 */
10478 u32 resync_flag;
10479
10480 /* Accumulated drift value in microseconds. This value is updated
10481 * every 100th ms.
10482 * Positive drift value indicates AV timer is running faster than device
10483 * Negative drift value indicates AV timer is running slower than device
10484 * @values Any valid int32 number
10485 */
10486 s32 acc_drift_value;
10487
10488 /* Lower 32 bits of the 64-bit absolute timestamp of reference
10489 * timer in microseconds.
10490
10491 * This timestamp corresponds to the time when the drift values
10492 * are accumlated for every 100th ms.
10493 * @values Any valid uint32 number
10494 */
10495 u32 ref_timer_abs_ts_lsw;
10496
10497 /* Upper 32 bits of the 64-bit absolute timestamp of reference
10498 * timer in microseconds.
10499 * This timestamp corresponds to the time when the drift values
10500 * are accumlated for every 100th ms.
10501 * @values Any valid uint32 number
10502 */
10503 u32 ref_timer_abs_ts_msw;
10504} __packed;
10505
10506struct afe_av_dev_drift_get_param {
10507 struct apr_hdr hdr;
10508 struct afe_port_cmd_get_param_v2 get_param;
10509 struct afe_port_param_data_v2 pdata;
10510 struct afe_param_id_dev_timing_stats timing_stats;
10511} __packed;
10512
10513struct afe_av_dev_drift_get_param_resp {
10514 uint32_t status;
10515 struct afe_port_param_data_v2 pdata;
10516 struct afe_param_id_dev_timing_stats timing_stats;
10517} __packed;
10518
10519/* Command for Matrix or Stream Router */
10520#define ASM_SESSION_CMD_SET_MTMX_STRTR_PARAMS_V2 0x00010DCE
10521/* Module for AVSYNC */
10522#define ASM_SESSION_MTMX_STRTR_MODULE_ID_AVSYNC 0x00010DC6
10523
10524/* Parameter used by #ASM_SESSION_MTMX_STRTR_MODULE_ID_AVSYNC to specify the
10525 * render window start value. This parameter is supported only for a Set
10526 * command (not a Get command) in the Rx direction
10527 * (#ASM_SESSION_CMD_SET_MTMX_STRTR_PARAMS_V2).
10528 * Render window start is a value (session time minus timestamp, or ST-TS)
10529 * below which frames are held, and after which frames are immediately
10530 * rendered.
10531 */
10532#define ASM_SESSION_MTMX_STRTR_PARAM_RENDER_WINDOW_START_V2 0x00010DD1
10533
10534/* Parameter used by #ASM_SESSION_MTMX_STRTR_MODULE_ID_AVSYNC to specify the
10535 * render window end value. This parameter is supported only for a Set
10536 * command (not a Get command) in the Rx direction
10537 * (#ASM_SESSION_CMD_SET_MTMX_STRTR_PARAMS_V2). Render window end is a value
10538 * (session time minus timestamp) above which frames are dropped, and below
10539 * which frames are immediately rendered.
10540 */
10541#define ASM_SESSION_MTMX_STRTR_PARAM_RENDER_WINDOW_END_V2 0x00010DD2
10542
10543/* Generic payload of the window parameters in the
10544 * #ASM_SESSION_MTMX_STRTR_MODULE_ID_AVSYNC module.
10545 * This payload is supported only for a Set command
10546 * (not a Get command) on the Rx path.
10547 */
10548struct asm_session_mtmx_strtr_param_window_v2_t {
10549 u32 window_lsw;
10550 /* Lower 32 bits of the render window start value. */
10551
10552 u32 window_msw;
10553 /* Upper 32 bits of the render window start value.
10554 *
10555 * The 64-bit number formed by window_lsw and window_msw specifies a
10556 * signed 64-bit window value in microseconds. The sign extension is
10557 * necessary. This value is used by the following parameter IDs:
10558 * #ASM_SESSION_MTMX_STRTR_PARAM_RENDER_WINDOW_START_V2
10559 * #ASM_SESSION_MTMX_STRTR_PARAM_RENDER_WINDOW_END_V2
10560 * #ASM_SESSION_MTMX_STRTR_PARAM_STAT_WINDOW_START_V2
10561 * #ASM_SESSION_MTMX_STRTR_PARAM_STAT_WINDOW_END_V2
10562 * The value depends on which parameter ID is used.
10563 * The aDSP honors the windows at a granularity of 1 ms.
10564 */
10565};
10566
10567struct asm_session_cmd_set_mtmx_strstr_params_v2 {
10568 uint32_t data_payload_addr_lsw;
10569 /* Lower 32 bits of the 64-bit data payload address. */
10570
10571 uint32_t data_payload_addr_msw;
10572 /* Upper 32 bits of the 64-bit data payload address.
10573 * If the address is not sent (NULL), the message is in the payload.
10574 * If the address is sent (non-NULL), the parameter data payloads
10575 * begin at the specified address.
10576 */
10577
10578 uint32_t mem_map_handle;
10579 /* Unique identifier for an address. This memory map handle is returned
10580 * by the aDSP through the #ASM_CMD_SHARED_MEM_MAP_REGIONS command.
10581 * values
10582 * - NULL -- Parameter data payloads are within the message payload
10583 * (in-band).
10584 * - Non-NULL -- Parameter data payloads begin at the address specified
10585 * in the data_payload_addr_lsw and data_payload_addr_msw fields
10586 * (out-of-band).
10587 */
10588
10589 uint32_t data_payload_size;
10590 /* Actual size of the variable payload accompanying the message, or in
10591 * shared memory. This field is used for parsing the parameter payload.
10592 * values > 0 bytes
10593 */
10594
10595 uint32_t direction;
10596 /* Direction of the entity (matrix mixer or stream router) on which
10597 * the parameter is to be set.
10598 * values
10599 * - 0 -- Rx (for Rx stream router or Rx matrix mixer)
10600 * - 1 -- Tx (for Tx stream router or Tx matrix mixer)
10601 */
10602};
10603
10604/* Parameter used by #ASM_SESSION_MTMX_STRTR_MODULE_ID_AVSYNC which allows the
10605 * audio client choose the rendering decision that the audio DSP should use.
10606 */
10607#define ASM_SESSION_MTMX_STRTR_PARAM_RENDER_MODE_CMD 0x00012F0D
10608
10609/* Indicates that rendering decision will be based on default rate
10610 * (session clock based rendering, device driven).
10611 * 1. The default session clock based rendering is inherently driven
10612 * by the timing of the device.
10613 * 2. After the initial decision is made (first buffer after a run
10614 * command), subsequent data rendering decisions are made with
10615 * respect to the rate at which the device is rendering, thus deriving
10616 * its timing from the device.
10617 * 3. While this decision making is simple, it has some inherent limitations
10618 * (mentioned in the next section).
10619 * 4. If this API is not set, the session clock based rendering will be assumed
10620 * and this will ensure that the DSP is backward compatible.
10621 */
10622#define ASM_SESSION_MTMX_STRTR_PARAM_RENDER_DEFAULT 0
10623
10624/* Indicates that rendering decision will be based on local clock rate.
10625 * 1. In the DSP loopback/client loopback use cases (frame based
10626 * inputs), the incoming data into audio DSP is time-stamped at the
10627 * local clock rate (STC).
10628 * 2. This TS rate may match the incoming data rate or maybe different
10629 * from the incoming data rate.
10630 * 3. Regardless, the data will be time-stamped with local STC and
10631 * therefore, the client is recommended to set this mode for these
10632 * use cases. This method is inherently more robust to sequencing
10633 * (AFE Start/Stop) and device switches, among other benefits.
10634 * 4. This API will inform the DSP to compare every incoming buffer TS
10635 * against local STC.
10636 * 5. DSP will continue to honor render windows APIs, as before.
10637 */
10638#define ASM_SESSION_MTMX_STRTR_PARAM_RENDER_LOCAL_STC 1
10639
10640/* Structure for rendering decision parameter */
10641struct asm_session_mtmx_strtr_param_render_mode_t {
10642 /* Specifies the type of rendering decision the audio DSP should use.
10643 *
10644 * @values
10645 * - #ASM_SESSION_MTMX_STRTR_PARAM_RENDER_DEFAULT
10646 * - #ASM_SESSION_MTMX_STRTR_PARAM_RENDER_LOCAL_STC
10647 */
10648 u32 flags;
10649} __packed;
10650
10651/* Parameter used by #ASM_SESSION_MTMX_STRTR_MODULE_ID_AVSYNC which allows the
10652 * audio client to specify the clock recovery mechanism that the audio DSP
10653 * should use.
10654 */
10655
10656#define ASM_SESSION_MTMX_STRTR_PARAM_CLK_REC_CMD 0x00012F0E
10657
10658/* Indicates that default clock recovery will be used (no clock recovery).
10659 * If the client wishes that no clock recovery be done, the client can
10660 * choose this. This means that no attempt will made by the DSP to try and
10661 * match the rates of the input and output audio.
10662 */
10663#define ASM_SESSION_MTMX_STRTR_PARAM_CLK_REC_NONE 0
10664
10665/* Indicates that independent clock recovery needs to be used.
10666 * 1. In the DSP loopback/client loopback use cases (frame based inputs),
10667 * the client should choose the independent clock recovery option.
10668 * 2. This basically de-couples the audio and video from knowing each others
10669 * clock sources and lets the audio DSP independently rate match the input
10670 * and output rates.
10671 * 3. After drift detection, the drift correction is achieved by either pulling
10672 * the PLLs (if applicable) or by stream to device rate matching
10673 * (for PCM use cases) by comparing drift with respect to STC.
10674 * 4. For passthrough use cases, since the PLL pulling is the only option,
10675 * a best effort will be made.
10676 * If PLL pulling is not possible / available, the rendering will be
10677 * done without rate matching.
10678 */
10679#define ASM_SESSION_MTMX_STRTR_PARAM_CLK_REC_AUTO 1
10680
10681/* Payload of the #ASM_SESSION_MTMX_STRTR_PARAM_CLK_REC parameter.
10682 */
10683struct asm_session_mtmx_strtr_param_clk_rec_t {
10684 /* Specifies the type of clock recovery that the audio DSP should
10685 * use for rate matching.
10686 */
10687
10688 /* @values
10689 * #ASM_SESSION_MTMX_STRTR_PARAM_CLK_REC_DEFAULT
10690 * #ASM_SESSION_MTMX_STRTR_PARAM_CLK_REC_INDEPENDENT
10691 */
10692 u32 flags;
10693} __packed;
10694
10695
10696/* Parameter used by #ASM_SESSION_MTMX_STRTR_MODULE_ID_AVSYNC to
10697 * realize smoother adjustment of audio session clock for a specified session.
10698 * The desired audio session clock adjustment(in micro seconds) is specified
10699 * using the command #ASM_SESSION_CMD_ADJUST_SESSION_CLOCK_V2.
10700 * Delaying/Advancing the session clock would be implemented by inserting
10701 * interpolated/dropping audio samples in the playback path respectively.
10702 * Also, this parameter has to be configured before the Audio Session is put
10703 * to RUN state to avoid cold start latency/glitches in the playback.
10704 */
10705
10706#define ASM_SESSION_MTMX_PARAM_ADJUST_SESSION_TIME_CTL 0x00013217
10707
10708struct asm_session_mtmx_param_adjust_session_time_ctl_t {
10709 /* Specifies whether the module is enabled or not
10710 * @values
10711 * 0 -- disabled
10712 * 1 -- enabled
10713 */
10714 u32 enable;
10715};
10716
10717union asm_session_mtmx_strtr_param_config {
10718 struct asm_session_mtmx_strtr_param_window_v2_t window_param;
10719 struct asm_session_mtmx_strtr_param_render_mode_t render_param;
10720 struct asm_session_mtmx_strtr_param_clk_rec_t clk_rec_param;
10721 struct asm_session_mtmx_param_adjust_session_time_ctl_t adj_time_param;
10722} __packed;
10723
10724struct asm_mtmx_strtr_params {
10725 struct apr_hdr hdr;
10726 struct asm_session_cmd_set_mtmx_strstr_params_v2 param;
10727 struct asm_stream_param_data_v2 data;
10728 union asm_session_mtmx_strtr_param_config config;
10729} __packed;
10730
10731#define ASM_SESSION_CMD_GET_MTMX_STRTR_PARAMS_V2 0x00010DCF
10732#define ASM_SESSION_CMDRSP_GET_MTMX_STRTR_PARAMS_V2 0x00010DD0
10733
10734#define ASM_SESSION_MTMX_STRTR_PARAM_SESSION_TIME_V3 0x00012F0B
10735#define ASM_SESSION_MTMX_STRTR_PARAM_STIME_TSTMP_FLG_BMASK (0x80000000UL)
10736
10737struct asm_session_cmd_get_mtmx_strstr_params_v2 {
10738 uint32_t data_payload_addr_lsw;
10739 /* Lower 32 bits of the 64-bit data payload address. */
10740
10741 uint32_t data_payload_addr_msw;
10742 /*
10743 * Upper 32 bits of the 64-bit data payload address.
10744 * If the address is not sent (NULL), the message is in the payload.
10745 * If the address is sent (non-NULL), the parameter data payloads
10746 * begin at the specified address.
10747 */
10748
10749 uint32_t mem_map_handle;
10750 /*
10751 * Unique identifier for an address. This memory map handle is returned
10752 * by the aDSP through the #ASM_CMD_SHARED_MEM_MAP_REGIONS command.
10753 * values
10754 * - NULL -- Parameter data payloads are within the message payload
10755 * (in-band).
10756 * - Non-NULL -- Parameter data payloads begin at the address specified
10757 * in the data_payload_addr_lsw and data_payload_addr_msw fields
10758 * (out-of-band).
10759 */
10760 uint32_t direction;
10761 /*
10762 * Direction of the entity (matrix mixer or stream router) on which
10763 * the parameter is to be set.
10764 * values
10765 * - 0 -- Rx (for Rx stream router or Rx matrix mixer)
10766 * - 1 -- Tx (for Tx stream router or Tx matrix mixer)
10767 */
10768 uint32_t module_id;
10769 /* Unique module ID. */
10770
10771 uint32_t param_id;
10772 /* Unique parameter ID. */
10773
10774 uint32_t param_max_size;
10775};
10776
10777struct asm_session_mtmx_strtr_param_session_time_v3_t {
10778 uint32_t session_time_lsw;
10779 /* Lower 32 bits of the current session time in microseconds */
10780
10781 uint32_t session_time_msw;
10782 /*
10783 * Upper 32 bits of the current session time in microseconds.
10784 * The 64-bit number formed by session_time_lsw and session_time_msw
10785 * is treated as signed.
10786 */
10787
10788 uint32_t absolute_time_lsw;
10789 /*
10790 * Lower 32 bits of the 64-bit absolute time in microseconds.
10791 * This is the time when the sample corresponding to the
10792 * session_time_lsw is rendered to the hardware. This absolute
10793 * time can be slightly in the future or past.
10794 */
10795
10796 uint32_t absolute_time_msw;
10797 /*
10798 * Upper 32 bits of the 64-bit absolute time in microseconds.
10799 * This is the time when the sample corresponding to the
10800 * session_time_msw is rendered to hardware. This absolute
10801 * time can be slightly in the future or past. The 64-bit number
10802 * formed by absolute_time_lsw and absolute_time_msw is treated as
10803 * unsigned.
10804 */
10805
10806 uint32_t time_stamp_lsw;
10807 /* Lower 32 bits of the last processed timestamp in microseconds */
10808
10809 uint32_t time_stamp_msw;
10810 /*
10811 * Upper 32 bits of the last processed timestamp in microseconds.
10812 * The 64-bit number formed by time_stamp_lsw and time_stamp_lsw
10813 * is treated as unsigned.
10814 */
10815
10816 uint32_t flags;
10817 /*
10818 * Keeps track of any additional flags needed.
10819 * @values{for bit 31}
10820 * - 0 -- Uninitialized/invalid
10821 * - 1 -- Valid
10822 * All other bits are reserved; clients must set them to zero.
10823 */
10824};
10825
10826union asm_session_mtmx_strtr_data_type {
10827 struct asm_session_mtmx_strtr_param_session_time_v3_t session_time;
10828};
10829
10830struct asm_mtmx_strtr_get_params {
10831 struct apr_hdr hdr;
10832 struct asm_session_cmd_get_mtmx_strstr_params_v2 param_info;
10833} __packed;
10834
10835struct asm_mtmx_strtr_get_params_cmdrsp {
10836 uint32_t err_code;
10837 struct asm_stream_param_data_v2 param_info;
10838 union asm_session_mtmx_strtr_data_type param_data;
10839} __packed;
10840
10841#define AUDPROC_MODULE_ID_RESAMPLER 0x00010719
10842
10843enum {
10844 LEGACY_PCM = 0,
10845 COMPRESSED_PASSTHROUGH,
10846 COMPRESSED_PASSTHROUGH_CONVERT,
10847 COMPRESSED_PASSTHROUGH_DSD,
10848 LISTEN,
10849 COMPRESSED_PASSTHROUGH_GEN,
10850 COMPRESSED_PASSTHROUGH_IEC61937
10851};
10852
10853#define AUDPROC_MODULE_ID_COMPRESSED_MUTE 0x00010770
10854#define AUDPROC_PARAM_ID_COMPRESSED_MUTE 0x00010771
10855
10856struct adm_set_compressed_device_mute {
10857 struct adm_cmd_set_pp_params_v5 command;
10858 struct adm_param_data_v5 params;
10859 u32 mute_on;
10860} __packed;
10861
10862#define AUDPROC_MODULE_ID_COMPRESSED_LATENCY 0x0001076E
10863#define AUDPROC_PARAM_ID_COMPRESSED_LATENCY 0x0001076F
10864
10865struct adm_set_compressed_device_latency {
10866 struct adm_cmd_set_pp_params_v5 command;
10867 struct adm_param_data_v5 params;
10868 u32 latency;
10869} __packed;
10870
10871#define VOICEPROC_MODULE_ID_GENERIC_TX 0x00010EF6
10872#define VOICEPROC_PARAM_ID_FLUENCE_SOUNDFOCUS 0x00010E37
10873#define VOICEPROC_PARAM_ID_FLUENCE_SOURCETRACKING 0x00010E38
10874#define MAX_SECTORS 8
10875#define MAX_NOISE_SOURCE_INDICATORS 3
10876#define MAX_POLAR_ACTIVITY_INDICATORS 360
10877
10878struct sound_focus_param {
10879 uint16_t start_angle[MAX_SECTORS];
10880 uint8_t enable[MAX_SECTORS];
10881 uint16_t gain_step;
10882} __packed;
10883
10884struct source_tracking_param {
10885 uint8_t vad[MAX_SECTORS];
10886 uint16_t doa_speech;
10887 uint16_t doa_noise[MAX_NOISE_SOURCE_INDICATORS];
10888 uint8_t polar_activity[MAX_POLAR_ACTIVITY_INDICATORS];
10889} __packed;
10890
10891struct adm_param_fluence_soundfocus_t {
10892 uint16_t start_angles[MAX_SECTORS];
10893 uint8_t enables[MAX_SECTORS];
10894 uint16_t gain_step;
10895 uint16_t reserved;
10896} __packed;
10897
10898struct adm_set_fluence_soundfocus_param {
10899 struct adm_cmd_set_pp_params_v5 params;
10900 struct adm_param_data_v5 data;
10901 struct adm_param_fluence_soundfocus_t soundfocus_data;
10902} __packed;
10903
10904struct adm_param_fluence_sourcetracking_t {
10905 uint8_t vad[MAX_SECTORS];
10906 uint16_t doa_speech;
10907 uint16_t doa_noise[MAX_NOISE_SOURCE_INDICATORS];
10908 uint8_t polar_activity[MAX_POLAR_ACTIVITY_INDICATORS];
10909} __packed;
10910
10911#define AUDPROC_MODULE_ID_AUDIOSPHERE 0x00010916
10912#define AUDPROC_PARAM_ID_AUDIOSPHERE_ENABLE 0x00010917
10913#define AUDPROC_PARAM_ID_AUDIOSPHERE_STRENGTH 0x00010918
10914#define AUDPROC_PARAM_ID_AUDIOSPHERE_CONFIG_MODE 0x00010919
10915
10916#define AUDPROC_PARAM_ID_AUDIOSPHERE_COEFFS_STEREO_INPUT 0x0001091A
10917#define AUDPROC_PARAM_ID_AUDIOSPHERE_COEFFS_MULTICHANNEL_INPUT 0x0001091B
10918#define AUDPROC_PARAM_ID_AUDIOSPHERE_DESIGN_STEREO_INPUT 0x0001091C
10919#define AUDPROC_PARAM_ID_AUDIOSPHERE_DESIGN_MULTICHANNEL_INPUT 0x0001091D
10920
10921#define AUDPROC_PARAM_ID_AUDIOSPHERE_OPERATING_INPUT_MEDIA_INFO 0x0001091E
10922
10923#define AUDPROC_MODULE_ID_VOICE_TX_SECNS 0x10027059
10924#define AUDPROC_PARAM_IDX_SEC_PRIMARY_MIC_CH 0x10014444
10925
10926struct admx_sec_primary_mic_ch {
10927 uint16_t version;
10928 uint16_t reserved;
10929 uint16_t sec_primary_mic_ch;
10930 uint16_t reserved1;
10931} __packed;
10932
10933
10934struct adm_set_sec_primary_ch_params {
10935 struct adm_cmd_set_pp_params_v5 params;
10936 struct adm_param_data_v5 data;
10937 struct admx_sec_primary_mic_ch sec_primary_mic_ch_data;
10938} __packed;
10939#endif /*_APR_AUDIO_V2_H_ */