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