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