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