blob: 695fea9ad21da1838c3d0302d1f51faecd352311 [file] [log] [blame]
Bharath Ramachandramurthy2e3168f2012-05-03 16:29:09 -07001/* Copyright (c) 2012, Code Aurora Forum. All rights reserved.
2*
3* This program is free software; you can redistribute it and/or modify
4* it under the terms of the GNU General Public License version 2 and
5* only version 2 as published by the Free Software Foundation.
6*
7* This program is distributed in the hope that it will be useful,
8* but WITHOUT ANY WARRANTY; without even the implied warranty of
9* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10* GNU General Public License for more details.
11*/
12
13
14#ifndef _APR_AUDIO_V2_H_
15#define _APR_AUDIO_V2_H_
16
17#include <mach/qdsp6v2/apr.h>
18
19#define ADSP_ADM_VERSION 0x00070000
20
21#define ADM_CMD_SHARED_MEM_MAP_REGIONS 0x00010322
22#define ADM_CMDRSP_SHARED_MEM_MAP_REGIONS 0x00010323
23#define ADM_CMD_SHARED_MEM_UNMAP_REGIONS 0x00010324
24
25#define ADM_CMD_MATRIX_MAP_ROUTINGS_V5 0x00010325
26
27/* Enumeration for an audio Rx matrix ID.*/
28#define ADM_MATRIX_ID_AUDIO_RX 0
29
30#define ADM_MATRIX_ID_AUDIO_TX 1
31
32/* Enumeration for an audio Tx matrix ID.*/
33#define ADM_MATRIX_ID_AUDIOX 1
34
35#define ADM_MAX_COPPS 5
36
37
38/* Session map node structure.
39* Immediately following this structure are num_copps
40* entries of COPP IDs. The COPP IDs are 16 bits, so
41* there might be a padding 16-bit field if num_copps
42* is odd.
43*/
44struct adm_session_map_node_v5 {
45 u16 session_id;
46/* Handle of the ASM session to be routed. Supported values: 1
47* to 8.
48*/
49
50
51 u16 num_copps;
52 /* Number of COPPs to which this session is to be routed.
53 Supported values: 0 < num_copps <= ADM_MAX_COPPS.
54 */
55} __packed;
56
57/* Payload of the #ADM_CMD_MATRIX_MAP_ROUTINGS_V5 command.
58* Immediately following this structure are num_sessions of the session map
59* node payload (adm_session_map_node_v5).
60*/
61
62struct adm_cmd_matrix_map_routings_v5 {
63 struct apr_hdr hdr;
64
65 u32 matrix_id;
66/* Specifies whether the matrix ID is Audio Rx (0) or Audio Tx
67* (1). Use the ADM_MATRIX_ID_AUDIO_RX or ADM_MATRIX_ID_AUDIOX
68* macros to set this field.
69*/
70 u32 num_sessions;
71 /* Number of sessions being updated by this command (optional).*/
72} __packed;
73
74/* This command allows a client to open a COPP/Voice Proc. TX module
75* and sets up the device session: Matrix -> COPP -> AFE on the RX
76* and AFE -> COPP -> Matrix on the TX. This enables PCM data to
77* be transferred to/from the endpoint (AFEPortID).
78*
79* @return
80* #ADM_CMDRSP_DEVICE_OPEN_V5 with the resulting status and
81* COPP ID.
82*/
83#define ADM_CMD_DEVICE_OPEN_V5 0x00010326
84
85/* Indicates that endpoint_id_2 is to be ignored.*/
86#define ADM_CMD_COPP_OPEN_END_POINT_ID_2_IGNORE 0xFFFF
87
88#define ADM_CMD_COPP_OPEN_MODE_OF_OPERATION_RX_PATH_COPP 1
89
90#define ADM_CMD_COPP_OPEN_MODE_OF_OPERATIONX_PATH_LIVE_COPP 2
91
92#define ADM_CMD_COPP_OPEN_MODE_OF_OPERATIONX_PATH_NON_LIVE_COPP 3
93
94/* Indicates that an audio COPP is to send/receive a mono PCM
95 * stream to/from
96 * END_POINT_ID_1.
97 */
98#define ADM_CMD_COPP_OPEN_CHANNEL_CONFIG_MONO 1
99
100/* Indicates that an audio COPP is to send/receive a
101 * stereo PCM stream to/from END_POINT_ID_1.
102 */
103#define ADM_CMD_COPP_OPEN_CHANNEL_CONFIG_STEREO 2
104
105/* Sample rate is 8000 Hz.*/
106#define ADM_CMD_COPP_OPEN_SAMPLE_RATE_8K 8000
107
108/* Sample rate is 16000 Hz.*/
109#define ADM_CMD_COPP_OPEN_SAMPLE_RATE_16K 16000
110
111/* Sample rate is 48000 Hz.*/
112#define ADM_CMD_COPP_OPEN_SAMPLE_RATE_48K 48000
113
114/* Definition for a COPP live input flag bitmask.*/
115#define ADM_BIT_MASK_COPP_LIVE_INPUT_FLAG (0x0001U)
116
117/* Definition for a COPP live shift value bitmask.*/
118#define ADM_SHIFT_COPP_LIVE_INPUT_FLAG 0
119
120/* Definition for the COPP ID bitmask.*/
121#define ADM_BIT_MASK_COPP_ID (0x0000FFFFUL)
122
123/* Definition for the COPP ID shift value.*/
124#define ADM_SHIFT_COPP_ID 0
125
126/* Definition for the service ID bitmask.*/
127#define ADM_BIT_MASK_SERVICE_ID (0x00FF0000UL)
128
129/* Definition for the service ID shift value.*/
130#define ADM_SHIFT_SERVICE_ID 16
131
132/* Definition for the domain ID bitmask.*/
133#define ADM_BIT_MASK_DOMAIN_ID (0xFF000000UL)
134
135/* Definition for the domain ID shift value.*/
136#define ADM_SHIFT_DOMAIN_ID 24
137
138/* ADM device open command payload of the
139 #ADM_CMD_DEVICE_OPEN_V5 command.
140*/
141struct adm_cmd_device_open_v5 {
142 struct apr_hdr hdr;
143 u16 flags;
144/* Reserved for future use. Clients must set this field
145 * to zero.
146 */
147
148 u16 mode_of_operation;
149/* Specifies whether the COPP must be opened on the Tx or Rx
150 * path. Use the ADM_CMD_COPP_OPEN_MODE_OF_OPERATION_* macros for
151 * supported values and interpretation.
152 * Supported values:
153 * - 0x1 -- Rx path COPP
154 * - 0x2 -- Tx path live COPP
155 * - 0x3 -- Tx path nonlive COPP
156 * Live connections cause sample discarding in the Tx device
157 * matrix if the destination output ports do not pull them
158 * fast enough. Nonlive connections queue the samples
159 * indefinitely.
160 */
161
162 u16 endpoint_id_1;
163/* Logical and physical endpoint ID of the audio path.
164 * If the ID is a voice processor Tx block, it receives near
165 * samples. Supported values: Any pseudoport, AFE Rx port,
166 * or AFE Tx port For a list of valid IDs, refer to
167 * @xhyperref{Q4,[Q4]}.
168 * Q4 = Hexagon Multimedia: AFE Interface Specification
169 */
170
171 u16 endpoint_id_2;
172/* Logical and physical endpoint ID 2 for a voice processor
173 * Tx block.
174 * This is not applicable to audio COPP.
175 * Supported values:
176 * - AFE Rx port
177 * - 0xFFFF -- Endpoint 2 is unavailable and the voice
178 * processor Tx
179 * block ignores this endpoint
180 * When the voice processor Tx block is created on the audio
181 * record path,
182 * it can receive far-end samples from an AFE Rx port if the
183 * voice call
184 * is active. The ID of the AFE port is provided in this
185 * field.
186 * For a list of valid IDs, refer @xhyperref{Q4,[Q4]}.
187 */
188
189 u32 topology_id;
190 /* Audio COPP topology ID; 32-bit GUID. */
191
192 u16 dev_num_channel;
193/* Number of channels the audio COPP sends to/receives from
194 * the endpoint.
195 * Supported values: 1 to 8.
196 * The value is ignored for the voice processor Tx block,
197 * where channel
198 * configuration is derived from the topology ID.
199 */
200
201 u16 bit_width;
202/* Bit width (in bits) that the audio COPP sends to/receives
203 * from the
204 * endpoint. The value is ignored for the voice processing
205 * Tx block,
206 * where the PCM width is 16 bits.
207 */
208
209 u32 sample_rate;
210/* Sampling rate at which the audio COPP/voice processor
211 * Tx block
212 * interfaces with the endpoint.
213 * Supported values for voice processor Tx: 8000, 16000,
214 * 48000 Hz
215 * Supported values for audio COPP: >0 and <=192 kHz
216 */
217
218 u8 dev_channel_mapping[8];
219/* Array of channel mapping of buffers that the audio COPP
220 * sends to the endpoint. Channel[i] mapping describes channel
221 * I inside the buffer, where 0 < i < dev_num_channel.
222 * This value is relevent only for an audio Rx COPP.
223 * For the voice processor block and Tx audio block, this field
224 * is set to zero and is ignored.
225 */
226} __packed;
227
228/*
229 * This command allows the client to close a COPP and disconnect
230 * the device session.
231 */
232#define ADM_CMD_DEVICE_CLOSE_V5 0x00010327
233
234/* Sets one or more parameters to a COPP.
235*/
236#define ADM_CMD_SET_PP_PARAMS_V5 0x00010328
237
238/* Payload of the #ADM_CMD_SET_PP_PARAMS_V5 command.
239 * If the data_payload_addr_lsw and data_payload_addr_msw element
240 * are NULL, a series of adm_param_datastructures immediately
241 * follows, whose total size is data_payload_size bytes.
242 */
243struct adm_cmd_set_pp_params_v5 {
244 struct apr_hdr hdr;
245 u32 data_payload_addr_lsw;
246 /* LSW of parameter data payload address.*/
247 u32 data_payload_addr_msw;
248 /* MSW of parameter data payload address.*/
249
250 u32 mem_map_handle;
251/* Memory map handle returned by ADM_CMD_SHARED_MEM_MAP_REGIONS
252 * command */
253/* If mem_map_handle is zero implies the message is in
254 * the payload */
255
256 u32 data_payload_size;
257/* Size in bytes of the variable payload accompanying this
258 * message or
259 * in shared memory. This is used for parsing the parameter
260 * payload.
261 */
262} __packed;
263
264/* Payload format for COPP parameter data.
265 * Immediately following this structure are param_size bytes
266 * of parameter
267 * data.
268 */
269struct adm_param_data_v5 {
270 u32 module_id;
271 /* Unique ID of the module. */
272 u32 param_id;
273 /* Unique ID of the parameter. */
274 u16 param_size;
275 /* Data size of the param_id/module_id combination.
276 This value is a
277 multiple of 4 bytes. */
278 u16 reserved;
279 /* Reserved for future enhancements.
280 * This field must be set to zero.
281 */
282} __packed;
283
284/* Returns the status and COPP ID to an #ADM_CMD_DEVICE_OPEN_V5 command.
285 */
286#define ADM_CMDRSP_DEVICE_OPEN_V5 0x00010329
287
288/* Payload of the #ADM_CMDRSP_DEVICE_OPEN_V5 message,
289 * which returns the
290 * status and COPP ID to an #ADM_CMD_DEVICE_OPEN_V5 command.
291 */
292struct adm_cmd_rsp_device_open_v5 {
293 u32 status;
294 /* Status message (error code).*/
295
296 u16 copp_id;
297 /* COPP ID: Supported values: 0 <= copp_id < ADM_MAX_COPPS*/
298
299 u16 reserved;
300 /* Reserved. This field must be set to zero.*/
301} __packed;
302
303/* This command allows a query of one COPP parameter.
304*/
305#define ADM_CMD_GET_PP_PARAMS_V5 0x0001032A
306
307/* Payload an #ADM_CMD_GET_PP_PARAMS_V5 command.
308*/
309struct adm_cmd_get_pp_params_v5 {
310 u32 data_payload_addr_lsw;
311 /* LSW of parameter data payload address.*/
312
313 u32 data_payload_addr_msw;
314 /* MSW of parameter data payload address.*/
315
316 /* If the mem_map_handle is non zero,
317 * on ACK, the ParamData payloads begin at
318 * the address specified (out-of-band).
319 */
320
321 u32 mem_map_handle;
322 /* Memory map handle returned
323 * by ADM_CMD_SHARED_MEM_MAP_REGIONS command.
324 * If the mem_map_handle is 0, it implies that
325 * the ACK's payload will contain the ParamData (in-band).
326 */
327
328 u32 module_id;
329 /* Unique ID of the module. */
330
331 u32 param_id;
332 /* Unique ID of the parameter. */
333
334 u16 param_max_size;
335 /* Maximum data size of the parameter
336 *ID/module ID combination. This
337 * field is a multiple of 4 bytes.
338 */
339 u16 reserved;
340 /* Reserved for future enhancements.
341 * This field must be set to zero.
342 */
343} __packed;
344
345/* Returns parameter values
346 * in response to an #ADM_CMD_GET_PP_PARAMS_V5 command.
347 */
348#define ADM_CMDRSP_GET_PP_PARAMS_V5 0x0001032B
349
350/* Payload of the #ADM_CMDRSP_GET_PP_PARAMS_V5 message,
351 * which returns parameter values in response
352 * to an #ADM_CMD_GET_PP_PARAMS_V5 command.
353 * Immediately following this
354 * structure is the adm_param_data_v5
355 * structure containing the pre/postprocessing
356 * parameter data. For an in-band
357 * scenario, the variable payload depends
358 * on the size of the parameter.
359*/
360struct adm_cmd_rsp_get_pp_params_v5 {
361 u32 status;
362 /* Status message (error code).*/
363} __packed;
364
365/* Allows a client to control the gains on various session-to-COPP paths.
366 */
367#define ADM_CMD_MATRIX_RAMP_GAINS_V5 0x0001032C
368
369/* Indicates that the target gain in the
370 * current adm_session_copp_gain_v5
371 * structure is to be applied to all
372 * the session-to-COPP paths that exist for
373 * the specified session.
374 */
375#define ADM_CMD_MATRIX_RAMP_GAINS_COPP_ID_ALL_CONNECTED_COPPS 0xFFFF
376
377/* Indicates that the target gain is
378 * to be immediately applied to the
379 * specified session-to-COPP path,
380 * without a ramping fashion.
381 */
382#define ADM_CMD_MATRIX_RAMP_GAINS_RAMP_DURATION_IMMEDIATE 0x0000
383
384/* Enumeration for a linear ramping curve.*/
385#define ADM_CMD_MATRIX_RAMP_GAINS_RAMP_CURVE_LINEAR 0x0000
386
387/* Payload of the #ADM_CMD_MATRIX_RAMP_GAINS_V5 command.
388 * Immediately following this structure are num_gains of the
389 * adm_session_copp_gain_v5structure.
390 */
391struct adm_cmd_matrix_ramp_gains_v5 {
392 u32 matrix_id;
393/* Specifies whether the matrix ID is Audio Rx (0) or Audio Tx (1).
394 * Use the ADM_MATRIX_ID_AUDIO_RX or ADM_MATRIX_ID_AUDIOX
395 * macros to set this field.
396*/
397
398 u16 num_gains;
399 /* Number of gains being applied. */
400
401 u16 reserved_for_align;
402 /* Reserved. This field must be set to zero.*/
403} __packed;
404
405/* Session-to-COPP path gain structure, used by the
406 * #ADM_CMD_MATRIX_RAMP_GAINS_V5 command.
407 * This structure specifies the target
408 * gain (per channel) that must be applied
409 * to a particular session-to-COPP path in
410 * the audio matrix. The structure can
411 * also be used to apply the gain globally
412 * to all session-to-COPP paths that
413 * exist for the given session.
414 * The aDSP uses device channel mapping to
415 * determine which channel gains to
416 * use from this command. For example,
417 * if the device is configured as stereo,
418 * the aDSP uses only target_gain_ch_1 and
419 * target_gain_ch_2, and it ignores
420 * the others.
421 */
422struct adm_session_copp_gain_v5 {
423 u16 session_id;
424/* Handle of the ASM session.
425 * Supported values: 1 to 8.
426 */
427
428 u16 copp_id;
429/* Handle of the COPP. Gain will be applied on the Session ID
430 * COPP ID path.
431 */
432
433 u16 ramp_duration;
434/* Duration (in milliseconds) of the ramp over
435 * which target gains are
436 * to be applied. Use
437 * #ADM_CMD_MATRIX_RAMP_GAINS_RAMP_DURATION_IMMEDIATE
438 * to indicate that gain must be applied immediately.
439 */
440
441 u16 step_duration;
442/* Duration (in milliseconds) of each step in the ramp.
443 * This parameter is ignored if ramp_duration is equal to
444 * #ADM_CMD_MATRIX_RAMP_GAINS_RAMP_DURATION_IMMEDIATE.
445 * Supported value: 1
446 */
447
448 u16 ramp_curve;
449/* Type of ramping curve.
450 * Supported value: #ADM_CMD_MATRIX_RAMP_GAINS_RAMP_CURVE_LINEAR
451 */
452
453 u16 reserved_for_align;
454 /* Reserved. This field must be set to zero. */
455
456 u16 target_gain_ch_1;
457 /* Target linear gain for channel 1 in Q13 format; */
458
459 u16 target_gain_ch_2;
460 /* Target linear gain for channel 2 in Q13 format; */
461
462 u16 target_gain_ch_3;
463 /* Target linear gain for channel 3 in Q13 format; */
464
465 u16 target_gain_ch_4;
466 /* Target linear gain for channel 4 in Q13 format; */
467
468 u16 target_gain_ch_5;
469 /* Target linear gain for channel 5 in Q13 format; */
470
471 u16 target_gain_ch_6;
472 /* Target linear gain for channel 6 in Q13 format; */
473
474 u16 target_gain_ch_7;
475 /* Target linear gain for channel 7 in Q13 format; */
476
477 u16 target_gain_ch_8;
478 /* Target linear gain for channel 8 in Q13 format; */
479} __packed;
480
481/* Allows to set mute/unmute on various session-to-COPP paths.
482 * For every session-to-COPP path (stream-device interconnection),
483 * mute/unmute can be set individually on the output channels.
484 */
485#define ADM_CMD_MATRIX_MUTE_V5 0x0001032D
486
487/* Indicates that mute/unmute in the
488 * current adm_session_copp_mute_v5structure
489 * is to be applied to all the session-to-COPP
490 * paths that exist for the specified session.
491 */
492#define ADM_CMD_MATRIX_MUTE_COPP_ID_ALL_CONNECTED_COPPS 0xFFFF
493
494/* Payload of the #ADM_CMD_MATRIX_MUTE_V5 command*/
495struct adm_cmd_matrix_mute_v5 {
496 u32 matrix_id;
497/* Specifies whether the matrix ID is Audio Rx (0) or Audio Tx (1).
498 * Use the ADM_MATRIX_ID_AUDIO_RX or ADM_MATRIX_ID_AUDIOX
499 * macros to set this field.
500 */
501
502 u16 session_id;
503/* Handle of the ASM session.
504 * Supported values: 1 to 8.
505 */
506
507 u16 copp_id;
508/* Handle of the COPP.
509 * Use ADM_CMD_MATRIX_MUTE_COPP_ID_ALL_CONNECTED_COPPS
510 * to indicate that mute/unmute must be applied to
511 * all the COPPs connected to session_id.
512 * Supported values:
513 * - 0xFFFF -- Apply mute/unmute to all connected COPPs
514 * - Other values -- Valid COPP ID
515 */
516
517 u8 mute_flag_ch_1;
518 /* Mute flag for channel 1 is set to unmute (0) or mute (1). */
519
520 u8 mute_flag_ch_2;
521 /* Mute flag for channel 2 is set to unmute (0) or mute (1). */
522
523 u8 mute_flag_ch_3;
524 /* Mute flag for channel 3 is set to unmute (0) or mute (1). */
525
526 u8 mute_flag_ch_4;
527 /* Mute flag for channel 4 is set to unmute (0) or mute (1). */
528
529 u8 mute_flag_ch_5;
530 /* Mute flag for channel 5 is set to unmute (0) or mute (1). */
531
532 u8 mute_flag_ch_6;
533 /* Mute flag for channel 6 is set to unmute (0) or mute (1). */
534
535 u8 mute_flag_ch_7;
536 /* Mute flag for channel 7 is set to unmute (0) or mute (1). */
537
538 u8 mute_flag_ch_8;
539 /* Mute flag for channel 8 is set to unmute (0) or mute (1). */
540
541 u16 ramp_duration;
542/* Period (in milliseconds) over which the soft mute/unmute will be
543 * applied.
544 * Supported values: 0 (Default) to 0xFFFF
545 * The default of 0 means mute/unmute will be applied immediately.
546 */
547
548 u16 reserved_for_align;
549 /* Clients must set this field to zero.*/
550} __packed;
551
552/* Allows a client to connect the desired stream to
553 * the desired AFE port through the stream router
554 *
555 * This command allows the client to connect specified session to
556 * specified AFE port. This is used for compressed streams only
557 * opened using the #ASM_STREAM_CMD_OPEN_WRITE_COMPRESSED or
558 * #ASM_STREAM_CMD_OPEN_READ_COMPRESSED command.
559 *
560 * @prerequisites
561 * Session ID and AFE Port ID must be valid.
562 * #ASM_STREAM_CMD_OPEN_WRITE_COMPRESSED or
563 * #ASM_STREAM_CMD_OPEN_READ_COMPRESSED
564 * must have been called on this session.
565 */
566
567#define ADM_CMD_CONNECT_AFE_PORT_V5 0x0001032E
568#define ADM_CMD_DISCONNECT_AFE_PORT_V5 0x0001032F
569/* Enumeration for the Rx stream router ID.*/
570#define ADM_STRTR_ID_RX 0
571/* Enumeration for the Tx stream router ID.*/
572#define ADM_STRTR_IDX 1
573
574/* Payload of the #ADM_CMD_CONNECT_AFE_PORT_V5 command.*/
575struct adm_cmd_connect_afe_port_v5 {
576 u8 mode;
577/* ID of the stream router (RX/TX). Use the
578 * ADM_STRTR_ID_RX or ADM_STRTR_IDX macros
579 * to set this field.
580 */
581
582 u8 session_id;
583 /* Session ID of the stream to connect */
584
585 u16 afe_port_id;
586 /* Port ID of the AFE port to connect to.*/
587 u32 num_channels;
588/* Number of device channels
589 * Supported values: 2(Audio Sample Packet),
590 * 8 (HBR Audio Stream Sample Packet)
591 */
592
593 u32 sampling_rate;
594/* Device sampling rate
595* Supported values: Any
596*/
597} __packed;
598
599
600/* adsp_adm_api.h */
601
602
603/* Port ID. Update afe_get_port_index
604 * when a new port is added here. */
605#define PRIMARY_I2S_RX 0 /* index = 0 */
606#define PRIMARY_I2S_TX 1 /* index = 1 */
607#define PCM_RX 2 /* index = 2 */
608#define PCM_TX 3 /* index = 3 */
609#define SECONDARY_I2S_RX 4 /* index = 4 */
610#define SECONDARY_I2S_TX 5 /* index = 5 */
611#define MI2S_RX 6 /* index = 6 */
612#define MI2S_TX 7 /* index = 7 */
613#define HDMI_RX 8 /* index = 8 */
614#define RSVD_2 9 /* index = 9 */
615#define RSVD_3 10 /* index = 10 */
616#define DIGI_MIC_TX 11 /* index = 11 */
617#define VOICE_RECORD_RX 0x8003 /* index = 12 */
618#define VOICE_RECORD_TX 0x8004 /* index = 13 */
619#define VOICE_PLAYBACK_TX 0x8005 /* index = 14 */
620
621/* Slimbus Multi channel port id pool */
622#define SLIMBUS_0_RX 0x4000 /* index = 15 */
623#define SLIMBUS_0_TX 0x4001 /* index = 16 */
624#define SLIMBUS_1_RX 0x4002 /* index = 17 */
625#define SLIMBUS_1_TX 0x4003 /* index = 18 */
626#define SLIMBUS_2_RX 0x4004
627#define SLIMBUS_2_TX 0x4005
628#define SLIMBUS_3_RX 0x4006
629#define SLIMBUS_3_TX 0x4007
630#define SLIMBUS_4_RX 0x4008
631#define SLIMBUS_4_TX 0x4009 /* index = 24 */
632#define INT_BT_SCO_RX 0x3000 /* index = 25 */
633#define INT_BT_SCO_TX 0x3001 /* index = 26 */
634#define INT_BT_A2DP_RX 0x3002 /* index = 27 */
635#define INT_FM_RX 0x3004 /* index = 28 */
636#define INT_FM_TX 0x3005 /* index = 29 */
637#define RT_PROXY_PORT_001_RX 0x2000 /* index = 30 */
638#define RT_PROXY_PORT_001_TX 0x2001 /* index = 31 */
639
640#define AFE_PORT_INVALID 0xFFFF
641#define SLIMBUS_INVALID AFE_PORT_INVALID
642
643#define AFE_PORT_CMD_START 0x000100ca
644
645#define AFE_EVENT_RTPORT_START 0
646#define AFE_EVENT_RTPORT_STOP 1
647#define AFE_EVENT_RTPORT_LOW_WM 2
648#define AFE_EVENT_RTPORT_HI_WM 3
649
650#define ADSP_AFE_VERSION 0x00200000
651
652/* Size of the range of port IDs for the audio interface. */
653#define AFE_PORT_ID_AUDIO_IF_PORT_RANGE_SIZE 0xF
654
655/* Size of the range of port IDs for internal BT-FM ports. */
656#define AFE_PORT_ID_INTERNAL_BT_FM_RANGE_SIZE 0x6
657
658/* Size of the range of port IDs for SLIMbus<sup>&reg;
659 * </sup> multichannel
660 * ports.
661 */
662#define AFE_PORT_ID_SLIMBUS_RANGE_SIZE 0xA
663
664/* Size of the range of port IDs for real-time proxy ports. */
665#define AFE_PORT_ID_RT_PROXY_PORT_RANGE_SIZE 0x2
666
667/* Size of the range of port IDs for pseudoports. */
668#define AFE_PORT_ID_PSEUDOPORT_RANGE_SIZE 0x5
669
670/* Start of the range of port IDs for the audio interface. */
671#define AFE_PORT_ID_AUDIO_IF_PORT_RANGE_START 0x1000
672
673/* End of the range of port IDs for the audio interface. */
674#define AFE_PORT_ID_AUDIO_IF_PORT_RANGE_END \
675 (AFE_PORT_ID_AUDIO_IF_PORT_RANGE_START +\
676 AFE_PORT_ID_AUDIO_IF_PORT_RANGE_SIZE - 1)
677
678/* Start of the range of port IDs for real-time proxy ports. */
679#define AFE_PORT_ID_RT_PROXY_PORT_RANGE_START 0x2000
680
681/* End of the range of port IDs for real-time proxy ports. */
682#define AFE_PORT_ID_RT_PROXY_PORT_RANGE_END \
683 (AFE_PORT_ID_RT_PROXY_PORT_RANGE_START +\
684 AFE_PORT_ID_RT_PROXY_PORT_RANGE_SIZE-1)
685
686/* Start of the range of port IDs for internal BT-FM devices. */
687#define AFE_PORT_ID_INTERNAL_BT_FM_RANGE_START 0x3000
688
689/* End of the range of port IDs for internal BT-FM devices. */
690#define AFE_PORT_ID_INTERNAL_BT_FM_RANGE_END \
691 (AFE_PORT_ID_INTERNAL_BT_FM_RANGE_START +\
692 AFE_PORT_ID_INTERNAL_BT_FM_RANGE_SIZE-1)
693
694/* Start of the range of port IDs for SLIMbus devices. */
695#define AFE_PORT_ID_SLIMBUS_RANGE_START 0x4000
696
697/* End of the range of port IDs for SLIMbus devices. */
698#define AFE_PORT_ID_SLIMBUS_RANGE_END \
699 (AFE_PORT_ID_SLIMBUS_RANGE_START +\
700 AFE_PORT_ID_SLIMBUS_RANGE_SIZE-1)
701
702/* Start of the range of port IDs for pseudoports. */
703#define AFE_PORT_ID_PSEUDOPORT_RANGE_START 0x8001
704
705/* End of the range of port IDs for pseudoports. */
706#define AFE_PORT_ID_PSEUDOPORT_RANGE_END \
707 (AFE_PORT_ID_PSEUDOPORT_RANGE_START +\
708 AFE_PORT_ID_PSEUDOPORT_RANGE_SIZE-1)
709
710#define AFE_PORT_ID_PRIMARY_MI2S_RX 0x1000
711#define AFE_PORT_ID_PRIMARY_MI2S_TX 0x1001
712#define AFE_PORT_ID_SECONDARY_MI2S_RX 0x1002
713#define AFE_PORT_ID_SECONDARY_MI2S_TX 0x1003
714#define AFE_PORT_IDERTIARY_MI2S_RX 0x1004
715#define AFE_PORT_IDERTIARY_MI2S_TX 0x1005
716#define AFE_PORT_ID_QUATERNARY_MI2S_RX 0x1006
717#define AFE_PORT_ID_QUATERNARY_MI2S_TX 0x1007
718#define AUDIO_PORT_ID_I2S_RX 0x1008
719#define AFE_PORT_ID_DIGITAL_MIC_TX 0x1009
720#define AFE_PORT_ID_PRIMARY_PCM_RX 0x100A
721#define AFE_PORT_ID_PRIMARY_PCM_TX 0x100B
722#define AFE_PORT_ID_SECONDARY_PCM_RX 0x100C
723#define AFE_PORT_ID_SECONDARY_PCM_TX 0x100D
724#define AFE_PORT_ID_MULTICHAN_HDMI_RX 0x100E
725#define AFE_PORT_ID_RT_PROXY_PORT_001_RX 0x2000
726#define AFE_PORT_ID_RT_PROXY_PORT_001_TX 0x2001
727#define AFE_PORT_ID_INTERNAL_BT_SCO_RX 0x3000
728#define AFE_PORT_ID_INTERNAL_BT_SCO_TX 0x3001
729#define AFE_PORT_ID_INTERNAL_BT_A2DP_RX 0x3002
730#define AFE_PORT_ID_INTERNAL_FM_RX 0x3004
731#define AFE_PORT_ID_INTERNAL_FM_TX 0x3005
732/* SLIMbus Rx port on channel 0. */
733#define AFE_PORT_ID_SLIMBUS_MULTI_CHAN_0_RX 0x4000
734/* SLIMbus Tx port on channel 0. */
735#define AFE_PORT_ID_SLIMBUS_MULTI_CHAN_0_TX 0x4001
736/* SLIMbus Rx port on channel 1. */
737#define AFE_PORT_ID_SLIMBUS_MULTI_CHAN_1_RX 0x4002
738/* SLIMbus Tx port on channel 1. */
739#define AFE_PORT_ID_SLIMBUS_MULTI_CHAN_1_TX 0x4003
740/* SLIMbus Rx port on channel 2. */
741#define AFE_PORT_ID_SLIMBUS_MULTI_CHAN_2_RX 0x4004
742/* SLIMbus Tx port on channel 2. */
743#define AFE_PORT_ID_SLIMBUS_MULTI_CHAN_2_TX 0x4005
744/* SLIMbus Rx port on channel 3. */
745#define AFE_PORT_ID_SLIMBUS_MULTI_CHAN_3_RX 0x4006
746/* SLIMbus Tx port on channel 3. */
747#define AFE_PORT_ID_SLIMBUS_MULTI_CHAN_3_TX 0x4007
748/* SLIMbus Rx port on channel 4. */
749#define AFE_PORT_ID_SLIMBUS_MULTI_CHAN_4_RX 0x4008
750/* SLIMbus Tx port on channel 4. */
751#define AFE_PORT_ID_SLIMBUS_MULTI_CHAN_4_TX 0x4009
752/* SLIMbus Rx port on channel 0. */
753#define AFE_PORT_ID_SLIMBUS_MULTI_CHAN_0_RX 0x4000
754/* SLIMbus Tx port on channel 0. */
755#define AFE_PORT_ID_SLIMBUS_MULTI_CHAN_0_TX 0x4001
756/* SLIMbus Rx port on channel 1. */
757#define AFE_PORT_ID_SLIMBUS_MULTI_CHAN_1_RX 0x4002
758/* SLIMbus Tx port on channel 1. */
759#define AFE_PORT_ID_SLIMBUS_MULTI_CHAN_1_TX 0x4003
760/* SLIMbus Rx port on channel 2. */
761#define AFE_PORT_ID_SLIMBUS_MULTI_CHAN_2_RX 0x4004
762/* SLIMbus Tx port on channel 2. */
763#define AFE_PORT_ID_SLIMBUS_MULTI_CHAN_2_TX 0x4005
764/* SLIMbus Rx port on channel 3. */
765#define AFE_PORT_ID_SLIMBUS_MULTI_CHAN_3_RX 0x4006
766/* SLIMbus Tx port on channel 3. */
767#define AFE_PORT_ID_SLIMBUS_MULTI_CHAN_3_TX 0x4007
768/* SLIMbus Rx port on channel 4. */
769#define AFE_PORT_ID_SLIMBUS_MULTI_CHAN_4_RX 0x4008
770/* SLIMbus Tx port on channel 4. */
771#define AFE_PORT_ID_SLIMBUS_MULTI_CHAN_4_TX 0x4009
772/* Generic pseudoport 1. */
773#define AFE_PORT_ID_PSEUDOPORT_01 0x8001
774/* Generic pseudoport 2. */
775#define AFE_PORT_ID_PSEUDOPORT_02 0x8002
776
777/* @xreflabel{hdr:AfePortIdPrimaryAuxPcmTx}
778 Primary Aux PCM Tx port ID.
779*/
780#define AFE_PORT_ID_PRIMARY_PCM_TX 0x100B
781/* Pseudoport that corresponds to the voice Rx path.
782 * For recording, the voice Rx path samples are written to this
783 * port and consumed by the audio path.
784 */
785
786#define AFE_PORT_ID_VOICE_RECORD_RX 0x8003
787
788/* Pseudoport that corresponds to the voice Tx path.
789 * For recording, the voice Tx path samples are written to this
790 * port and consumed by the audio path.
791 */
792
793#define AFE_PORT_ID_VOICE_RECORD_TX 0x8004
794/* Pseudoport that corresponds to in-call voice delivery samples.
795 * During in-call audio delivery, the audio path delivers samples
796 * to this port from where the voice path delivers them on the
797 * Rx path.
798 */
799#define AFE_PORT_ID_VOICE_PLAYBACK_TX 0x8005
800#define AFE_PORT_ID_INVALID 0xFFFF
801
802#define AAC_ENC_MODE_AAC_LC 0x02
803#define AAC_ENC_MODE_AAC_P 0x05
804#define AAC_ENC_MODE_EAAC_P 0x1D
805
806#define AFE_PSEUDOPORT_CMD_START 0x000100cf
807struct afe_pseudoport_start_command {
808 struct apr_hdr hdr;
809 u16 port_id; /* Pseudo Port 1 = 0x8000 */
810 /* Pseudo Port 2 = 0x8001 */
811 /* Pseudo Port 3 = 0x8002 */
812 u16 timing; /* FTRT = 0 , AVTimer = 1, */
813} __packed;
814
815#define AFE_PSEUDOPORT_CMD_STOP 0x000100d0
816struct afe_pseudoport_stop_command {
817 struct apr_hdr hdr;
818 u16 port_id; /* Pseudo Port 1 = 0x8000 */
819 /* Pseudo Port 2 = 0x8001 */
820 /* Pseudo Port 3 = 0x8002 */
821 u16 reserved;
822} __packed;
823
824
825#define AFE_MODULE_SIDETONE_IIR_FILTER 0x00010202
826#define AFE_PARAM_ID_ENABLE 0x00010203
827
828/* Payload of the #AFE_PARAM_ID_ENABLE
829 * parameter, which enables or
830 * disables any module.
831 * The fixed size of this structure is four bytes.
832 */
833
834struct afe_mod_enable_param {
835 u16 enable;
836 /* Enables (1) or disables (0) the module. */
837
838 u16 reserved;
839 /* This field must be set to zero.
840 */
841} __packed;
842
843/* ID of the configuration parameter used by the
844 * #AFE_MODULE_SIDETONE_IIR_FILTER module.
845 */
846#define AFE_PARAM_ID_SIDETONE_IIR_FILTER_CONFIG 0x00010204
847
848struct afe_sidetone_iir_filter_config_params {
849 u16 num_biquad_stages;
850/* Number of stages.
851 * Supported values: Minimum of 5 and maximum of 10
852 */
853
854 u16 pregain;
855/* Pregain for the compensating filter response.
856 * Supported values: Any number in Q13 format
857 */
858} __packed;
859
860#define AFE_MODULE_LOOPBACK 0x00010205
861#define AFE_PARAM_ID_LOOPBACK_GAIN_PER_PATH 0x00010206
862
863/* Payload of the #AFE_PARAM_ID_LOOPBACK_GAIN_PER_PATH parameter,
864 * which gets/sets loopback gain of a port to an Rx port.
865 * The Tx port ID of the loopback is part of the set_param command.
866 */
867
868/* Payload of the #AFE_PORT_CMD_SET_PARAM_V2 command's
869 * configuration/calibration settings for the AFE port.
870 */
871struct afe_port_cmd_set_param_v2 {
872 u16 port_id;
873/* Port interface and direction (Rx or Tx) to start.
874 */
875
876 u16 payload_size;
877/* Actual size of the payload in bytes.
878 * This is used for parsing the parameter payload.
879 * Supported values: > 0
880 */
881
882u32 payload_address_lsw;
883/* LSW of 64 bit Payload address.
884 * Address should be 32-byte,
885 * 4kbyte aligned and must be contiguous memory.
886 */
887
888u32 payload_address_msw;
889/* MSW of 64 bit Payload address.
890 * In case of 32-bit shared memory address,
891 * this field must be set to zero.
892 * In case of 36-bit shared memory address,
893 * bit-4 to bit-31 must be set to zero.
894 * Address should be 32-byte, 4kbyte aligned
895 * and must be contiguous memory.
896 */
897
898u32 mem_map_handle;
899/* Memory map handle returned by
900 * AFE_SERVICE_CMD_SHARED_MEM_MAP_REGIONS commands.
901 * Supported Values:
902 * - NULL -- Message. The parameter data is in-band.
903 * - Non-NULL -- The parameter data is Out-band.Pointer to
904 * the physical address
905 * in shared memory of the payload data.
906 * An optional field is available if parameter
907 * data is in-band:
908 * afe_param_data_v2 param_data[...].
909 * For detailed payload content, see the
910 * afe_port_param_data_v2 structure.
911 */
912} __packed;
913
914#define AFE_PORT_CMD_SET_PARAM_V2 0x000100EF
915
916struct afe_port_param_data_v2 {
917 u32 module_id;
918/* ID of the module to be configured.
919 * Supported values: Valid module ID
920 */
921
922u32 param_id;
923/* ID of the parameter corresponding to the supported parameters
924 * for the module ID.
925 * Supported values: Valid parameter ID
926 */
927
928u16 param_size;
929/* Actual size of the data for the
930 * module_id/param_id pair. The size is a
931 * multiple of four bytes.
932 * Supported values: > 0
933 */
934
935u16 reserved;
936/* This field must be set to zero.
937 */
938} __packed;
939
940struct afe_loopback_gain_per_path_param {
941 struct apr_hdr hdr;
942 struct afe_port_cmd_set_param_v2 param;
943 struct afe_port_param_data_v2 pdata;
944 u16 rx_port_id;
945/* Rx port of the loopback. */
946
947u16 gain;
948/* Loopback gain per path of the port.
949 * Supported values: Any number in Q13 format
950 */
951} __packed;
952
953/* Parameter ID used to configure and enable/disable the
954 * loopback path. The difference with respect to the existing
955 * API, AFE_PORT_CMD_LOOPBACK, is that it allows Rx port to be
956 * configured as source port in loopback path. Port-id in
957 * AFE_PORT_CMD_SET_PARAM cmd is the source port whcih can be
958 * Tx or Rx port. In addition, we can configure the type of
959 * routing mode to handle different use cases.
960 */
961#define AFE_PARAM_ID_LOOPBACK_CONFIG 0x0001020B
962#define AFE_API_VERSION_LOOPBACK_CONFIG 0x1
963
964enum afe_loopback_routing_mode {
965 LB_MODE_DEFAULT = 1,
966 /* Regular loopback from source to destination port */
967 LB_MODE_SIDETONE,
968 /* Sidetone feed from Tx source to Rx destination port */
969 LB_MODE_EC_REF_VOICE_AUDIO,
970 /* Echo canceller reference, voice + audio + DTMF */
971 LB_MODE_EC_REF_VOICE
972 /* Echo canceller reference, voice alone */
973} __packed;
974
975/* Payload of the #AFE_PARAM_ID_LOOPBACK_CONFIG ,
976 * which enables/disables one AFE loopback.
977 */
978struct afe_loopback_cfg_v1 {
979 struct apr_hdr hdr;
980 struct afe_port_cmd_set_param_v2 param;
981 struct afe_port_param_data_v2 pdata;
982 u32 loopback_cfg_minor_version;
983/* Minor version used for tracking the version of the RMC module
984 * configuration interface.
985 * Supported values: #AFE_API_VERSION_LOOPBACK_CONFIG
986 */
987 u16 dst_port_id;
988 /* Destination Port Id. */
989 u16 routing_mode;
990/* Specifies data path type from src to dest port.
991 * Supported values:
992 * #LB_MODE_DEFAULT
993 * #LB_MODE_SIDETONE
994 * #LB_MODE_EC_REF_VOICE_AUDIO
995 * #LB_MODE_EC_REF_VOICE_A
996 * #LB_MODE_EC_REF_VOICE
997 */
998
999 u16 enable;
1000/* Specifies whether to enable (1) or
1001 * disable (0) an AFE loopback.
1002 */
1003 u16 reserved;
1004/* Reserved for 32-bit alignment. This field must be set to 0.
1005 */
1006
1007} __packed;
1008
1009#define AFE_MODULE_SPEAKER_PROTECTION 0x00010209
1010#define AFE_PARAM_ID_SPKR_PROT_CONFIG 0x0001020a
1011#define AFE_API_VERSION_SPKR_PROT_CONFIG 0x1
1012#define AFE_SPKR_PROT_EXCURSIONF_LEN 512
1013struct afe_spkr_prot_cfg_param_v1 {
1014 u32 spkr_prot_minor_version;
1015/*
1016 * Minor version used for tracking the version of the
1017 * speaker protection module configuration interface.
1018 * Supported values: #AFE_API_VERSION_SPKR_PROT_CONFIG
1019 */
1020
1021int16_t win_size;
1022/* Analysis and synthesis window size (nWinSize).
1023 * Supported values: 1024, 512, 256 samples
1024 */
1025
1026int16_t margin;
1027/* Allowable margin for excursion prediction,
1028 * in L16Q15 format. This is a
1029 * control parameter to allow
1030 * for overestimation of peak excursion.
1031 */
1032
1033int16_t spkr_exc_limit;
1034/* Speaker excursion limit, in L16Q15 format.*/
1035
1036int16_t spkr_resonance_freq;
1037/* Resonance frequency of the speaker; used
1038 * to define a frequency range
1039 * for signal modification.
1040 *
1041 * Supported values: 0 to 2000 Hz */
1042
1043int16_t limhresh;
1044/* Threshold of the hard limiter; used to
1045 * prevent overshooting beyond a
1046 * signal level that was set by the limiter
1047 * prior to speaker protection.
1048 * Supported values: 0 to 32767
1049 */
1050
1051int16_t hpf_cut_off_freq;
1052/* High pass filter cutoff frequency.
1053 * Supported values: 100, 200, 300 Hz
1054 */
1055
1056int16_t hpf_enable;
1057/* Specifies whether the high pass filter
1058 * is enabled (0) or disabled (1).
1059 */
1060
1061int16_t reserved;
1062/* This field must be set to zero. */
1063
1064int32_t amp_gain;
1065/* Amplifier gain in L32Q15 format.
1066 * This is the RMS voltage at the
1067 * loudspeaker when a 0dBFS tone
1068 * is played in the digital domain.
1069 */
1070
1071int16_t excursionf[AFE_SPKR_PROT_EXCURSIONF_LEN];
1072/* Array of the excursion transfer function.
1073 * The peak excursion of the
1074 * loudspeaker diaphragm is
1075 * measured in millimeters for 1 Vrms Sine
1076 * tone at all FFT bin frequencies.
1077 * Supported values: Q15 format
1078 */
1079} __packed;
1080
1081
1082#define AFE_SERVICE_CMD_REGISTER_RT_PORT_DRIVER 0x000100E0
1083
1084/* Payload of the #AFE_SERVICE_CMD_REGISTER_RT_PORT_DRIVER
1085 * command, which registers a real-time port driver
1086 * with the AFE service.
1087 */
1088struct afe_service_cmd_register_rt_port_driver {
1089 struct apr_hdr hdr;
1090 u16 port_id;
1091/* Port ID with which the real-time driver exchanges data
1092 * (registers for events).
1093 * Supported values: #AFE_PORT_ID_RT_PROXY_PORT_RANGE_START to
1094 * #AFE_PORT_ID_RT_PROXY_PORT_RANGE_END
1095 */
1096
1097 u16 reserved;
1098 /* This field must be set to zero. */
1099} __packed;
1100
1101#define AFE_SERVICE_CMD_UNREGISTER_RT_PORT_DRIVER 0x000100E1
1102
1103/* Payload of the #AFE_SERVICE_CMD_UNREGISTER_RT_PORT_DRIVER
1104 * command, which unregisters a real-time port driver from
1105 * the AFE service.
1106 */
1107struct afe_service_cmd_unregister_rt_port_driver {
1108 struct apr_hdr hdr;
1109 u16 port_id;
1110/* Port ID from which the real-time
1111 * driver unregisters for events.
1112 * Supported values: #AFE_PORT_ID_RT_PROXY_PORT_RANGE_START to
1113 * #AFE_PORT_ID_RT_PROXY_PORT_RANGE_END
1114 */
1115
1116 u16 reserved;
1117 /* This field must be set to zero. */
1118} __packed;
1119
1120#define AFE_EVENT_RT_PROXY_PORT_STATUS 0x00010105
1121#define AFE_EVENTYPE_RT_PROXY_PORT_START 0
1122#define AFE_EVENTYPE_RT_PROXY_PORT_STOP 1
1123#define AFE_EVENTYPE_RT_PROXY_PORT_LOW_WATER_MARK 2
1124#define AFE_EVENTYPE_RT_PROXY_PORT_HIGH_WATER_MARK 3
1125#define AFE_EVENTYPE_RT_PROXY_PORT_INVALID 0xFFFF
1126
1127/* Payload of the #AFE_EVENT_RT_PROXY_PORT_STATUS
1128 * message, which sends an event from the AFE service
1129 * to a registered client.
1130 */
1131struct afe_event_rt_proxy_port_status {
1132 u16 port_id;
1133/* Port ID to which the event is sent.
1134 * Supported values: #AFE_PORT_ID_RT_PROXY_PORT_RANGE_START to
1135 * #AFE_PORT_ID_RT_PROXY_PORT_RANGE_END
1136 */
1137
1138 u16 eventype;
1139/* Type of event.
1140 * Supported values:
1141 * - #AFE_EVENTYPE_RT_PROXY_PORT_START
1142 * - #AFE_EVENTYPE_RT_PROXY_PORT_STOP
1143 * - #AFE_EVENTYPE_RT_PROXY_PORT_LOW_WATER_MARK
1144 * - #AFE_EVENTYPE_RT_PROXY_PORT_HIGH_WATER_MARK
1145 */
1146} __packed;
1147
1148#define AFE_PORT_DATA_CMD_RT_PROXY_PORT_WRITE_V2 0x000100ED
1149
1150struct afe_port_data_cmd_rt_proxy_port_write_v2 {
1151 struct apr_hdr hdr;
1152 u16 port_id;
1153/* Tx (mic) proxy port ID with which the real-time
1154 * driver exchanges data.
1155 * Supported values: #AFE_PORT_ID_RT_PROXY_PORT_RANGE_START to
1156 * #AFE_PORT_ID_RT_PROXY_PORT_RANGE_END
1157 */
1158
1159 u16 reserved;
1160 /* This field must be set to zero. */
1161
1162 u32 buffer_address_lsw;
1163/* LSW Address of the buffer containing the
1164 * data from the real-time source
1165 * device on a client.
1166 */
1167
1168 u32 buffer_address_msw;
1169/* MSW Address of the buffer containing the
1170 * data from the real-time source
1171 * device on a client.
1172 */
1173
1174 u32 mem_map_handle;
1175/* A memory map handle encapsulating shared memory
1176 * attributes is returned if
1177 * AFE_SERVICE_CMD_SHARED_MEM_MAP_REGIONS
1178 * command is successful.
1179 * Supported Values:
1180 * - Any 32 bit value
1181 */
1182
1183 u32 available_bytes;
1184/* Number of valid bytes available
1185 * in the buffer (including all
1186 * channels: number of bytes per
1187 * channel = availableBytesumChannels).
1188 * Supported values: > 0
1189 *
1190 * This field must be equal to the frame
1191 * size specified in the #AFE_PORT_AUDIO_IF_CONFIG
1192 * command that was sent to configure this
1193 * port.
1194 */
1195} __packed;
1196
1197#define AFE_PORT_DATA_CMD_RT_PROXY_PORT_READ_V2 0x000100EE
1198
1199/* Payload of the
1200 * #AFE_PORT_DATA_CMD_RT_PROXY_PORT_READ_V2 command, which
1201 * delivers an empty buffer to the AFE service. On
1202 * acknowledgment, data is filled in the buffer.
1203 */
1204struct afe_port_data_cmd_rt_proxy_port_read_v2 {
1205 struct apr_hdr hdr;
1206 u16 port_id;
1207/* Rx proxy port ID with which the real-time
1208 * driver exchanges data.
1209 * Supported values: #AFE_PORT_ID_RT_PROXY_PORT_RANGE_START to
1210 * #AFE_PORT_ID_RT_PROXY_PORT_RANGE_END
1211 * (This must be an Rx (speaker) port.)
1212 */
1213
1214 u16 reserved;
1215 /* This field must be set to zero. */
1216
1217 u32 buffer_address_lsw;
1218/* LSW Address of the buffer containing the data sent from the AFE
1219 * service to a real-time sink device on the client.
1220 */
1221
1222
1223 u32 buffer_address_msw;
1224/* MSW Address of the buffer containing the data sent from the AFE
1225 * service to a real-time sink device on the client.
1226 */
1227
1228 u32 mem_map_handle;
1229/* A memory map handle encapsulating shared memory attributes is
1230 * returned if AFE_SERVICE_CMD_SHARED_MEM_MAP_REGIONS command is
1231 * successful.
1232 * Supported Values:
1233 * - Any 32 bit value
1234 */
1235
1236 u32 available_bytes;
1237/* Number of valid bytes available in the buffer (including all
1238 * channels).
1239 * Supported values: > 0
1240 * This field must be equal to the frame size specified in the
1241 * #AFE_PORT_AUDIO_IF_CONFIG command that was sent to configure
1242 * this port.
1243 */
1244} __packed;
1245
1246/* This module ID is related to device configuring like I2S,PCM,
1247 * HDMI, SLIMBus etc. This module supports follwing parameter ids.
1248 * - #AFE_PARAM_ID_I2S_CONFIG
1249 * - #AFE_PARAM_ID_PCM_CONFIG
1250 * - #AFE_PARAM_ID_DIGI_MIC_CONFIG
1251 * - #AFE_PARAM_ID_HDMI_CONFIG
1252 * - #AFE_PARAM_ID_INTERNAL_BT_FM_CONFIG
1253 * - #AFE_PARAM_ID_SLIMBUS_CONFIG
1254 * - #AFE_PARAM_ID_RT_PROXY_CONFIG
1255 */
1256
1257#define AFE_MODULE_AUDIO_DEV_INTERFACE 0x0001020C
1258#define AFE_PORT_SAMPLE_RATE_8K 8000
1259#define AFE_PORT_SAMPLE_RATE_16K 16000
1260#define AFE_PORT_SAMPLE_RATE_48K 48000
1261#define AFE_PORT_SAMPLE_RATE_96K 96000
1262#define AFE_PORT_SAMPLE_RATE_192K 192000
1263#define AFE_LINEAR_PCM_DATA 0x0
1264#define AFE_NON_LINEAR_DATA 0x1
1265#define AFE_LINEAR_PCM_DATA_PACKED_60958 0x2
1266#define AFE_NON_LINEAR_DATA_PACKED_60958 0x3
1267
1268/* This param id is used to configure I2S interface */
1269#define AFE_PARAM_ID_I2S_CONFIG 0x0001020D
1270#define AFE_API_VERSION_I2S_CONFIG 0x1
1271/* Enumeration for setting the I2S configuration
1272 * channel_mode parameter to
1273 * serial data wire number 1-3 (SD3).
1274 */
1275#define AFE_PORT_I2S_SD0 0x1
1276#define AFE_PORT_I2S_SD1 0x2
1277#define AFE_PORT_I2S_SD2 0x3
1278#define AFE_PORT_I2S_SD3 0x4
1279#define AFE_PORT_I2S_QUAD01 0x5
1280#define AFE_PORT_I2S_QUAD23 0x6
1281#define AFE_PORT_I2S_6CHS 0x7
1282#define AFE_PORT_I2S_8CHS 0x8
1283#define AFE_PORT_I2S_MONO 0x0
1284#define AFE_PORT_I2S_STEREO 0x1
1285#define AFE_PORT_CONFIG_I2S_WS_SRC_EXTERNAL 0x0
1286#define AFE_PORT_CONFIG_I2S_WS_SRC_INTERNAL 0x1
1287
1288/* Payload of the #AFE_PARAM_ID_I2S_CONFIG
1289 * command's (I2S configuration
1290 * parameter).
1291 */
1292struct afe_param_id_i2s_cfg {
1293 u32 i2s_cfg_minor_version;
1294/* Minor version used for tracking the version of the I2S
1295 * configuration interface.
1296 * Supported values: #AFE_API_VERSION_I2S_CONFIG
1297 */
1298
1299 u16 bit_width;
1300/* Bit width of the sample.
1301 * Supported values: 16, 24
1302 */
1303
1304 u16 channel_mode;
1305/* I2S lines and multichannel operation.
1306 * Supported values:
1307 * - #AFE_PORT_I2S_SD0
1308 * - #AFE_PORT_I2S_SD1
1309 * - #AFE_PORT_I2S_SD2
1310 * - #AFE_PORT_I2S_SD3
1311 * - #AFE_PORT_I2S_QUAD01
1312 * - #AFE_PORT_I2S_QUAD23
1313 * - #AFE_PORT_I2S_6CHS
1314 * - #AFE_PORT_I2S_8CHS
1315 */
1316
1317 u16 mono_stereo;
1318/* Specifies mono or stereo. This applies only when
1319 * a single I2S line is used.
1320 * Supported values:
1321 * - #AFE_PORT_I2S_MONO
1322 * - #AFE_PORT_I2S_STEREO
1323 */
1324
1325 u16 ws_src;
1326/* Word select source: internal or external.
1327 * Supported values:
1328 * - #AFE_PORT_CONFIG_I2S_WS_SRC_EXTERNAL
1329 * - #AFE_PORT_CONFIG_I2S_WS_SRC_INTERNAL
1330 */
1331
1332 u32 sample_rate;
1333/* Sampling rate of the port.
1334 * Supported values:
1335 * - #AFE_PORT_SAMPLE_RATE_8K
1336 * - #AFE_PORT_SAMPLE_RATE_16K
1337 * - #AFE_PORT_SAMPLE_RATE_48K
1338 * - #AFE_PORT_SAMPLE_RATE_96K
1339 * - #AFE_PORT_SAMPLE_RATE_192K
1340 */
1341
1342 u16 data_format;
1343/* data format
1344 * Supported values:
1345 * - #LINEAR_PCM_DATA
1346 * - #NON_LINEAR_DATA
1347 * - #LINEAR_PCM_DATA_PACKED_IN_60958
1348 * - #NON_LINEAR_DATA_PACKED_IN_60958
1349 */
1350 u16 reserved;
1351 /* This field must be set to zero. */
1352} __packed;
1353
1354/*
1355 * This param id is used to configure PCM interface
1356 */
1357#define AFE_PARAM_ID_PCM_CONFIG 0x0001020E
1358#define AFE_API_VERSION_PCM_CONFIG 0x1
1359/* Enumeration for the auxiliary PCM synchronization signal
1360 * provided by an external source.
1361 */
1362
1363#define AFE_PORT_PCM_SYNC_SRC_EXTERNAL 0x0
1364/* Enumeration for the auxiliary PCM synchronization signal
1365 * provided by an internal source.
1366 */
1367#define AFE_PORT_PCM_SYNC_SRC_INTERNAL 0x1
1368/* Enumeration for the PCM configuration aux_mode parameter,
1369 * which configures the auxiliary PCM interface to use
1370 * short synchronization.
1371 */
1372#define AFE_PORT_PCM_AUX_MODE_PCM 0x0
1373/*
1374 * Enumeration for the PCM configuration aux_mode parameter,
1375 * which configures the auxiliary PCM interface to use long
1376 * synchronization.
1377 */
1378#define AFE_PORT_PCM_AUX_MODE_AUX 0x1
1379/*
1380 * Enumeration for setting the PCM configuration frame to 8.
1381 */
1382#define AFE_PORT_PCM_BITS_PER_FRAME_8 0x0
1383/*
1384 * Enumeration for setting the PCM configuration frame to 16.
1385 */
1386#define AFE_PORT_PCM_BITS_PER_FRAME_16 0x1
1387
1388/* Enumeration for setting the PCM configuration frame to 32.*/
1389#define AFE_PORT_PCM_BITS_PER_FRAME_32 0x2
1390
1391/* Enumeration for setting the PCM configuration frame to 64.*/
1392#define AFE_PORT_PCM_BITS_PER_FRAME_64 0x3
1393
1394/* Enumeration for setting the PCM configuration frame to 128.*/
1395#define AFE_PORT_PCM_BITS_PER_FRAME_128 0x4
1396
1397/* Enumeration for setting the PCM configuration frame to 256.*/
1398#define AFE_PORT_PCM_BITS_PER_FRAME_256 0x5
1399
1400/* Enumeration for setting the PCM configuration
1401 * quantype parameter to A-law with no padding.
1402 */
1403#define AFE_PORT_PCM_ALAW_NOPADDING 0x0
1404
1405/* Enumeration for setting the PCM configuration quantype
1406 * parameter to mu-law with no padding.
1407 */
1408#define AFE_PORT_PCM_MULAW_NOPADDING 0x1
1409/* Enumeration for setting the PCM configuration quantype
1410 * parameter to linear with no padding.
1411 */
1412#define AFE_PORT_PCM_LINEAR_NOPADDING 0x2
1413/* Enumeration for setting the PCM configuration quantype
1414 * parameter to A-law with padding.
1415 */
1416#define AFE_PORT_PCM_ALAW_PADDING 0x3
1417/* Enumeration for setting the PCM configuration quantype
1418 * parameter to mu-law with padding.
1419 */
1420#define AFE_PORT_PCM_MULAW_PADDING 0x4
1421/* Enumeration for setting the PCM configuration quantype
1422 * parameter to linear with padding.
1423 */
1424#define AFE_PORT_PCM_LINEAR_PADDING 0x5
1425/* Enumeration for disabling the PCM configuration
1426 * ctrl_data_out_enable parameter.
1427 * The PCM block is the only master.
1428 */
1429#define AFE_PORT_PCM_CTRL_DATA_OE_DISABLE 0x0
1430/*
1431 * Enumeration for enabling the PCM configuration
1432 * ctrl_data_out_enable parameter. The PCM block shares
1433 * the signal with other masters.
1434 */
1435#define AFE_PORT_PCM_CTRL_DATA_OE_ENABLE 0x1
1436
1437/* Payload of the #AFE_PARAM_ID_PCM_CONFIG command's
1438 * (PCM configuration parameter).
1439 */
1440
1441struct afe_param_id_pcm_cfg {
1442 u32 pcm_cfg_minor_version;
1443/* Minor version used for tracking the version of the AUX PCM
1444 * configuration interface.
1445 * Supported values: #AFE_API_VERSION_PCM_CONFIG
1446 */
1447
1448 u16 aux_mode;
1449/* PCM synchronization setting.
1450 * Supported values:
1451 * - #AFE_PORT_PCM_AUX_MODE_PCM
1452 * - #AFE_PORT_PCM_AUX_MODE_AUX
1453 */
1454
1455 u16 sync_src;
1456/* Synchronization source.
1457 * Supported values:
1458 * - #AFE_PORT_PCM_SYNC_SRC_EXTERNAL
1459 * - #AFE_PORT_PCM_SYNC_SRC_INTERNAL
1460 */
1461
1462 u16 frame_setting;
1463/* Number of bits per frame.
1464 * Supported values:
1465 * - #AFE_PORT_PCM_BITS_PER_FRAME_8
1466 * - #AFE_PORT_PCM_BITS_PER_FRAME_16
1467 * - #AFE_PORT_PCM_BITS_PER_FRAME_32
1468 * - #AFE_PORT_PCM_BITS_PER_FRAME_64
1469 * - #AFE_PORT_PCM_BITS_PER_FRAME_128
1470 * - #AFE_PORT_PCM_BITS_PER_FRAME_256
1471 */
1472
1473 u16 quantype;
1474/* PCM quantization type.
1475 * Supported values:
1476 * - #AFE_PORT_PCM_ALAW_NOPADDING
1477 * - #AFE_PORT_PCM_MULAW_NOPADDING
1478 * - #AFE_PORT_PCM_LINEAR_NOPADDING
1479 * - #AFE_PORT_PCM_ALAW_PADDING
1480 * - #AFE_PORT_PCM_MULAW_PADDING
1481 * - #AFE_PORT_PCM_LINEAR_PADDING
1482 */
1483
1484 u16 ctrl_data_out_enable;
1485/* Specifies whether the PCM block shares the data-out
1486 * signal to the drive with other masters.
1487 * Supported values:
1488 * - #AFE_PORT_PCM_CTRL_DATA_OE_DISABLE
1489 * - #AFE_PORT_PCM_CTRL_DATA_OE_ENABLE
1490 */
1491 u16 reserved;
1492 /* This field must be set to zero. */
1493
1494 u32 sample_rate;
1495/* Sampling rate of the port.
1496 * Supported values:
1497 * - #AFE_PORT_SAMPLE_RATE_8K
1498 * - #AFE_PORT_SAMPLE_RATE_16K
1499 */
1500
1501 u16 bit_width;
1502/* Bit width of the sample.
1503 * Supported values: 16
1504 */
1505
1506 u16 num_channels;
1507/* Number of channels.
1508 * Supported values: 1 to 4
1509 */
1510
1511 u16 slot_number_mapping[4];
1512/* Specifies the slot number for the each channel in
1513 * multi channel scenario.
1514 * Supported values: 1 to 32
1515 */
1516} __packed;
1517
1518/*
1519 * This param id is used to configure DIGI MIC interface
1520 */
1521#define AFE_PARAM_ID_DIGI_MIC_CONFIG 0x0001020F
1522/* This version information is used to handle the new
1523 * additions to the config interface in future in backward
1524 * compatible manner.
1525 */
1526#define AFE_API_VERSION_DIGI_MIC_CONFIG 0x1
1527
1528/* Enumeration for setting the digital mic configuration
1529 * channel_mode parameter to left 0.
1530 */
1531
1532#define AFE_PORT_DIGI_MIC_MODE_LEFT0 0x1
1533
1534/*Enumeration for setting the digital mic configuration
1535 * channel_mode parameter to right 0.
1536 */
1537
1538
1539#define AFE_PORT_DIGI_MIC_MODE_RIGHT0 0x2
1540
1541/* Enumeration for setting the digital mic configuration
1542 * channel_mode parameter to left 1.
1543 */
1544
1545#define AFE_PORT_DIGI_MIC_MODE_LEFT1 0x3
1546
1547/* Enumeration for setting the digital mic configuration
1548 * channel_mode parameter to right 1.
1549 */
1550
1551#define AFE_PORT_DIGI_MIC_MODE_RIGHT1 0x4
1552
1553/* Enumeration for setting the digital mic configuration
1554 * channel_mode parameter to stereo 0.
1555 */
1556#define AFE_PORT_DIGI_MIC_MODE_STEREO0 0x5
1557
1558/* Enumeration for setting the digital mic configuration
1559 * channel_mode parameter to stereo 1.
1560 */
1561
1562
1563#define AFE_PORT_DIGI_MIC_MODE_STEREO1 0x6
1564
1565/* Enumeration for setting the digital mic configuration
1566 * channel_mode parameter to quad.
1567 */
1568
1569#define AFE_PORT_DIGI_MIC_MODE_QUAD 0x7
1570
1571/* Payload of the #AFE_PARAM_ID_DIGI_MIC_CONFIG command's
1572 * (DIGI MIC configuration
1573 * parameter).
1574 */
1575struct afe_param_id_digi_mic_cfg {
1576 u32 digi_mic_cfg_minor_version;
1577/* Minor version used for tracking the version of the DIGI Mic
1578 * configuration interface.
1579 * Supported values: #AFE_API_VERSION_DIGI_MIC_CONFIG
1580 */
1581
1582 u16 bit_width;
1583/* Bit width of the sample.
1584 * Supported values: 16
1585 */
1586
1587 u16 channel_mode;
1588/* Digital mic and multichannel operation.
1589 * Supported values:
1590 * - #AFE_PORT_DIGI_MIC_MODE_LEFT0
1591 * - #AFE_PORT_DIGI_MIC_MODE_RIGHT0
1592 * - #AFE_PORT_DIGI_MIC_MODE_LEFT1
1593 * - #AFE_PORT_DIGI_MIC_MODE_RIGHT1
1594 * - #AFE_PORT_DIGI_MIC_MODE_STEREO0
1595 * - #AFE_PORT_DIGI_MIC_MODE_STEREO1
1596 * - #AFE_PORT_DIGI_MIC_MODE_QUAD
1597 */
1598
1599 u32 sample_rate;
1600/* Sampling rate of the port.
1601 * Supported values:
1602 * - #AFE_PORT_SAMPLE_RATE_8K
1603 * - #AFE_PORT_SAMPLE_RATE_16K
1604 * - #AFE_PORT_SAMPLE_RATE_48K
1605 */
1606} __packed;
1607
1608/*
1609* This param id is used to configure HDMI interface
1610*/
1611#define AFE_PARAM_ID_HDMI_CONFIG 0x00010210
1612
1613/* This version information is used to handle the new
1614* additions to the config interface in future in backward
1615* compatible manner.
1616*/
1617#define AFE_API_VERSION_HDMI_CONFIG 0x1
1618
1619/* Payload of the #AFE_PARAM_ID_HDMI_CONFIG command,
1620 * which configures a multichannel HDMI audio interface.
1621 */
1622struct afe_param_id_hdmi_multi_chan_audio_cfg {
1623 u32 hdmi_cfg_minor_version;
1624/* Minor version used for tracking the version of the HDMI
1625 * configuration interface.
1626 * Supported values: #AFE_API_VERSION_HDMI_CONFIG
1627 */
1628
1629u16 dataype;
1630/* data type
1631 * Supported values:
1632 * - #LINEAR_PCM_DATA
1633 * - #NON_LINEAR_DATA
1634 * - #LINEAR_PCM_DATA_PACKED_IN_60958
1635 * - #NON_LINEAR_DATA_PACKED_IN_60958
1636 */
1637
1638u16 channel_allocation;
1639/* HDMI channel allocation information for programming an HDMI
1640 * frame. The default is 0 (Stereo).
1641 *
1642 * This information is defined in the HDMI standard, CEA 861-D
1643 * (refer to @xhyperref{S1,[S1]}). The number of channels is also
1644 * inferred from this parameter.
1645*/
1646
1647
1648u32 sample_rate;
1649/* Sampling rate of the port.
1650 * Supported values:
1651 * - #AFE_PORT_SAMPLE_RATE_8K
1652 * - #AFE_PORT_SAMPLE_RATE_16K
1653 * - #AFE_PORT_SAMPLE_RATE_48K
1654 * - #AFE_PORT_SAMPLE_RATE_96K
1655 * - 22050, 44100, 176400 for compressed streams
1656 */
1657
1658 u16 bit_width;
1659/* Bit width of the sample.
1660 * Supported values: 16, 24
1661 */
1662 u16 reserved;
1663 /* This field must be set to zero. */
1664} __packed;
1665
1666/*
1667* This param id is used to configure BT or FM(RIVA) interface
1668*/
1669#define AFE_PARAM_ID_INTERNAL_BT_FM_CONFIG 0x00010211
1670
1671/* This version information is used to handle the new
1672* additions to the config interface in future in backward
1673* compatible manner.
1674*/
1675#define AFE_API_VERSION_INTERNAL_BT_FM_CONFIG 0x1
1676
1677/* Payload of the #AFE_PARAM_ID_INTERNAL_BT_FM_CONFIG
1678 * command's BT voice/BT audio/FM configuration parameter.
1679 */
1680struct afe_param_id_internal_bt_fm_cfg {
1681 u32 bt_fm_cfg_minor_version;
1682/* Minor version used for tracking the version of the BT and FM
1683 * configuration interface.
1684 * Supported values: #AFE_API_VERSION_INTERNAL_BT_FM_CONFIG
1685 */
1686
1687 u16 num_channels;
1688/* Number of channels.
1689 * Supported values: 1 to 2
1690 */
1691
1692 u16 bit_width;
1693/* Bit width of the sample.
1694 * Supported values: 16
1695 */
1696
1697 u32 sample_rate;
1698/* Sampling rate of the port.
1699 * Supported values:
1700 * - #AFE_PORT_SAMPLE_RATE_8K (only for BTSCO)
1701 * - #AFE_PORT_SAMPLE_RATE_16K (only for BTSCO)
1702 * - #AFE_PORT_SAMPLE_RATE_48K (FM and A2DP)
1703 */
1704} __packed;
1705
1706/* This param id is used to configure SLIMBUS interface using
1707 * shared channel approach.
1708 */
1709
1710
1711#define AFE_PARAM_ID_SLIMBUS_CONFIG 0x00010212
1712
1713/* This version information is used to handle the new
1714* additions to the config interface in future in backward
1715* compatible manner.
1716*/
1717#define AFE_API_VERSION_SLIMBUS_CONFIG 0x1
1718
1719/* Enumeration for setting SLIMbus device ID 1.
1720*/
1721#define AFE_SLIMBUS_DEVICE_1 0x0
1722
1723/* Enumeration for setting SLIMbus device ID 2.
1724*/
1725#define AFE_SLIMBUS_DEVICE_2 0x1
1726
1727/* Enumeration for setting the SLIMbus data formats.
1728*/
1729#define AFE_SB_DATA_FORMAT_NOT_INDICATED 0x0
1730
1731/* Enumeration for setting the maximum number of streams per
1732 * device.
1733 */
1734
1735#define AFE_PORT_MAX_AUDIO_CHAN_CNT 0x8
1736
1737/* Payload of the #AFE_PORT_CMD_SLIMBUS_CONFIG command's SLIMbus
1738 * port configuration parameter.
1739 */
1740
1741struct afe_param_id_slimbus_cfg {
1742 u32 sb_cfg_minor_version;
1743/* Minor version used for tracking the version of the SLIMBUS
1744 * configuration interface.
1745 * Supported values: #AFE_API_VERSION_SLIMBUS_CONFIG
1746 */
1747
1748 u16 slimbus_dev_id;
1749/* SLIMbus hardware device ID, which is required to handle
1750 * multiple SLIMbus hardware blocks.
1751 * Supported values: - #AFE_SLIMBUS_DEVICE_1 - #AFE_SLIMBUS_DEVICE_2
1752 */
1753
1754
1755 u16 bit_width;
1756/* Bit width of the sample.
1757 * Supported values: 16, 24
1758 */
1759
1760 u16 data_format;
1761/* Data format supported by the SLIMbus hardware. The default is
1762 * 0 (#AFE_SB_DATA_FORMAT_NOT_INDICATED), which indicates the
1763 * hardware does not perform any format conversions before the data
1764 * transfer.
1765 */
1766
1767
1768 u16 num_channels;
1769/* Number of channels.
1770 * Supported values: 1 to #AFE_PORT_MAX_AUDIO_CHAN_CNT
1771 */
1772
1773 u8 shared_ch_mapping[AFE_PORT_MAX_AUDIO_CHAN_CNT];
1774/* Mapping of shared channel IDs (128 to 255) to which the
1775 * master port is to be connected.
1776 * Shared_channel_mapping[i] represents the shared channel assigned
1777 * for audio channel i in multichannel audio data.
1778 */
1779
1780 u32 sample_rate;
1781/* Sampling rate of the port.
1782 * Supported values:
1783 * - #AFE_PORT_SAMPLE_RATE_8K
1784 * - #AFE_PORT_SAMPLE_RATE_16K
1785 * - #AFE_PORT_SAMPLE_RATE_48K
1786 * - #AFE_PORT_SAMPLE_RATE_96K
1787 * - #AFE_PORT_SAMPLE_RATE_192K
1788 */
1789} __packed;
1790
1791/*
1792* This param id is used to configure Real Time Proxy interface.
1793*/
1794#define AFE_PARAM_ID_RT_PROXY_CONFIG 0x00010213
1795
1796/* This version information is used to handle the new
1797* additions to the config interface in future in backward
1798* compatible manner.
1799*/
1800#define AFE_API_VERSION_RT_PROXY_CONFIG 0x1
1801
1802/* Payload of the #AFE_PARAM_ID_RT_PROXY_CONFIG
1803 * command (real-time proxy port configuration parameter).
1804 */
1805struct afe_param_id_rt_proxy_port_cfg {
1806 u32 rt_proxy_cfg_minor_version;
1807/* Minor version used for tracking the version of rt-proxy
1808 * config interface.
1809 */
1810
1811 u16 bit_width;
1812/* Bit width of the sample.
1813 * Supported values: 16
1814 */
1815
1816 u16 interleaved;
1817/* Specifies whether the data exchanged between the AFE
1818 * interface and real-time port is interleaved.
1819 * Supported values: - 0 -- Non-interleaved (samples from each
1820 * channel are contiguous in the buffer) - 1 -- Interleaved
1821 * (corresponding samples from each input channel are interleaved
1822 * within the buffer)
1823 */
1824
1825
1826 u16 frame_size;
1827 /* Size of the frames that are used for PCM exchanges with this
1828 * port.
1829 * Supported values: > 0, in bytes
1830 * For example, 5 ms buffers of 16 bits and 16 kHz stereo samples
1831 * is 5 ms * 16 samples/ms * 2 bytes/sample * 2 channels = 320
1832 * bytes.
1833 */
1834 u16 jitter_allowance;
1835/* Configures the amount of jitter that the port will allow.
1836 * Supported values: > 0
1837 * For example, if +/-10 ms of jitter is anticipated in the timing
1838 * of sending frames to the port, and the configuration is 16 kHz
1839 * mono with 16-bit samples, this field is 10 ms * 16 samples/ms * 2
1840 * bytes/sample = 320.
1841 */
1842
1843 u16 low_water_mark;
1844/* Low watermark in bytes (including all channels).
1845 * Supported values:
1846 * - 0 -- Do not send any low watermark events
1847 * - > 0 -- Low watermark for triggering an event
1848 * If the number of bytes in an internal circular buffer is lower
1849 * than this low_water_mark parameter, a LOW_WATER_MARK event is
1850 * sent to applications (via the #AFE_EVENT_RT_PROXY_PORT_STATUS
1851 * event).
1852 * Use of watermark events is optional for debugging purposes.
1853 */
1854
1855 u16 high_water_mark;
1856/* High watermark in bytes (including all channels).
1857 * Supported values:
1858 * - 0 -- Do not send any high watermark events
1859 * - > 0 -- High watermark for triggering an event
1860 * If the number of bytes in an internal circular buffer exceeds
1861 * TOTAL_CIRC_BUF_SIZE minus high_water_mark, a high watermark event
1862 * is sent to applications (via the #AFE_EVENT_RT_PROXY_PORT_STATUS
1863 * event).
1864 * The use of watermark events is optional and for debugging
1865 * purposes.
1866 */
1867
1868
1869 u32 sample_rate;
1870/* Sampling rate of the port.
1871 * Supported values:
1872 * - #AFE_PORT_SAMPLE_RATE_8K
1873 * - #AFE_PORT_SAMPLE_RATE_16K
1874 * - #AFE_PORT_SAMPLE_RATE_48K
1875 */
1876
1877 u16 num_channels;
1878/* Number of channels.
1879 * Supported values: 1 to #AFE_PORT_MAX_AUDIO_CHAN_CNT
1880 */
1881
1882 u16 reserved;
1883 /* For 32 bit alignment. */
1884} __packed;
1885
1886union afe_port_config {
1887 struct afe_param_id_pcm_cfg pcm;
1888 struct afe_param_id_i2s_cfg i2s;
1889 struct afe_param_id_hdmi_multi_chan_audio_cfg hdmi_multi_ch;
1890 struct afe_param_id_slimbus_cfg slim_sch;
1891 struct afe_param_id_rt_proxy_port_cfg rtproxy;
1892} __packed;
1893
1894struct afe_audioif_config_command {
1895 struct apr_hdr hdr;
1896 struct afe_port_cmd_set_param_v2 param;
1897 struct afe_port_param_data_v2 pdata;
1898 union afe_port_config port;
1899} __packed;
1900
1901#define AFE_PORT_CMD_DEVICE_START 0x000100E5
1902
1903/* Payload of the #AFE_PORT_CMD_DEVICE_START.*/
1904struct afe_port_cmd_device_start {
1905 struct apr_hdr hdr;
1906 u16 port_id;
1907/* Port interface and direction (Rx or Tx) to start. An even
1908 * number represents the Rx direction, and an odd number represents
1909 * the Tx direction.
1910 */
1911
1912
1913 u16 reserved;
1914/* Reserved for 32-bit alignment. This field must be set to 0.*/
1915
1916} __packed;
1917
1918#define AFE_PORT_CMD_DEVICE_STOP 0x000100E6
1919
1920/* Payload of the #AFE_PORT_CMD_DEVICE_STOP.
1921*/
1922struct afe_port_cmd_device_stop {
1923 struct apr_hdr hdr;
1924 u16 port_id;
1925/* Port interface and direction (Rx or Tx) to start. An even
1926 * number represents the Rx direction, and an odd number represents
1927 * the Tx direction.
1928 */
1929
1930 u16 reserved;
1931/* Reserved for 32-bit alignment. This field must be set to 0.*/
1932} __packed;
1933
1934#define AFE_SERVICE_CMD_SHARED_MEM_MAP_REGIONS 0x000100EA
1935
1936/* Memory map regions command payload used by the
1937 * #AFE_SERVICE_CMD_SHARED_MEM_MAP_REGIONS .
1938 * This structure allows clients to map multiple shared memory
1939 * regions in a single command. Following this structure are
1940 * num_regions of afe_service_shared_map_region_payload.
1941 */
1942struct afe_service_cmd_shared_mem_map_regions {
1943 struct apr_hdr hdr;
1944u16 mem_pool_id;
1945/* Type of memory on which this memory region is mapped.
1946 * Supported values:
1947 * - #ADSP_MEMORY_MAP_EBI_POOL
1948 * - #ADSP_MEMORY_MAP_SMI_POOL
1949 * - #ADSP_MEMORY_MAP_SHMEM8_4K_POOL
1950 * - Other values are reserved
1951 *
1952 * The memory pool ID implicitly defines the characteristics of the
1953 * memory. Characteristics may include alignment type, permissions,
1954 * etc.
1955 *
1956 * ADSP_MEMORY_MAP_EBI_POOL is External Buffer Interface type memory
1957 * ADSP_MEMORY_MAP_SMI_POOL is Shared Memory Interface type memory
1958 * ADSP_MEMORY_MAP_SHMEM8_4K_POOL is shared memory, byte
1959 * addressable, and 4 KB aligned.
1960 */
1961
1962
1963 u16 num_regions;
1964/* Number of regions to map.
1965 * Supported values:
1966 * - Any value greater than zero
1967 */
1968
1969 u32 property_flag;
1970/* Configures one common property for all the regions in the
1971 * payload.
1972 *
1973 * Supported values: - 0x00000000 to 0x00000001
1974 *
1975 * b0 - bit 0 indicates physical or virtual mapping 0 Shared memory
1976 * address provided in afe_service_shared_map_region_payloadis a
1977 * physical address. The shared memory needs to be mapped( hardware
1978 * TLB entry) and a software entry needs to be added for internal
1979 * book keeping.
1980 *
1981 * 1 Shared memory address provided in
1982 * afe_service_shared_map_region_payloadis a virtual address. The
1983 * shared memory must not be mapped (since hardware TLB entry is
1984 * already available) but a software entry needs to be added for
1985 * internal book keeping. This can be useful if two services with in
1986 * ADSP is communicating via APR. They can now directly communicate
1987 * via the Virtual address instead of Physical address. The virtual
1988 * regions must be contiguous. num_regions must be 1 in this case.
1989 *
1990 * b31-b1 - reserved bits. must be set to zero
1991 */
1992
1993
1994} __packed;
1995/* Map region payload used by the
1996 * afe_service_shared_map_region_payloadstructure.
1997 */
1998struct afe_service_shared_map_region_payload {
1999 u32 shm_addr_lsw;
2000/* least significant word of starting address in the memory
2001 * region to map. It must be contiguous memory, and it must be 4 KB
2002 * aligned.
2003 * Supported values: - Any 32 bit value
2004 */
2005
2006
2007 u32 shm_addr_msw;
2008/* most significant word of startng address in the memory region
2009 * to map. For 32 bit shared memory address, this field must be set
2010 * to zero. For 36 bit shared memory address, bit31 to bit 4 must be
2011 * set to zero
2012 *
2013 * Supported values: - For 32 bit shared memory address, this field
2014 * must be set to zero. - For 36 bit shared memory address, bit31 to
2015 * bit 4 must be set to zero - For 64 bit shared memory address, any
2016 * 32 bit value
2017 */
2018
2019
2020 u32 mem_size_bytes;
2021/* Number of bytes in the region. The aDSP will always map the
2022 * regions as virtual contiguous memory, but the memory size must be
2023 * in multiples of 4 KB to avoid gaps in the virtually contiguous
2024 * mapped memory.
2025 *
2026 * Supported values: - multiples of 4KB
2027 */
2028
2029} __packed;
2030
2031#define AFE_SERVICE_CMDRSP_SHARED_MEM_MAP_REGIONS 0x000100EB
2032struct afe_service_cmdrsp_shared_mem_map_regions {
2033 u32 mem_map_handle;
2034/* A memory map handle encapsulating shared memory attributes is
2035 * returned iff AFE_SERVICE_CMD_SHARED_MEM_MAP_REGIONS command is
2036 * successful. In the case of failure , a generic APR error response
2037 * is returned to the client.
2038 *
2039 * Supported Values: - Any 32 bit value
2040 */
2041
2042} __packed;
2043#define AFE_SERVICE_CMD_SHARED_MEM_UNMAP_REGIONS 0x000100EC
2044/* Memory unmap regions command payload used by the
2045 * #AFE_SERVICE_CMD_SHARED_MEM_UNMAP_REGIONS
2046 *
2047 * This structure allows clients to unmap multiple shared memory
2048 * regions in a single command.
2049 */
2050
2051
2052struct afe_service_cmd_shared_mem_unmap_regions {
2053 struct apr_hdr hdr;
2054u32 mem_map_handle;
2055/* memory map handle returned by
2056 * AFE_SERVICE_CMD_SHARED_MEM_MAP_REGIONS commands
2057 *
2058 * Supported Values:
2059 * - Any 32 bit value
2060 */
2061} __packed;
2062
2063#define AFE_PORT_CMD_GET_PARAM_V2 0x000100F0
2064
2065/* Payload of the #AFE_PORT_CMD_GET_PARAM_V2 command,
2066 * which queries for one post/preprocessing parameter of a
2067 * stream.
2068 */
2069struct afe_port_cmd_get_param_v2 {
2070
2071 struct apr_hdr hdr;
2072u16 port_id;
2073/* Port interface and direction (Rx or Tx) to start. */
2074
2075 u16 payload_size;
2076/* Maximum data size of the parameter ID/module ID combination.
2077 * This is a multiple of four bytes
2078 * Supported values: > 0
2079 */
2080
2081 u32 payload_address_lsw;
2082/* LSW of 64 bit Payload address. Address should be 32-byte,
2083 * 4kbyte aligned and must be contig memory.
2084 */
2085
2086
2087 u32 payload_address_msw;
2088/* MSW of 64 bit Payload address. In case of 32-bit shared
2089 * memory address, this field must be set to zero. In case of 36-bit
2090 * shared memory address, bit-4 to bit-31 must be set to zero.
2091 * Address should be 32-byte, 4kbyte aligned and must be contiguous
2092 * memory.
2093 */
2094
2095 u32 mem_map_handle;
2096/* Memory map handle returned by
2097 * AFE_SERVICE_CMD_SHARED_MEM_MAP_REGIONS commands.
2098 * Supported Values: - NULL -- Message. The parameter data is
2099 * in-band. - Non-NULL -- The parameter data is Out-band.Pointer to
2100 * - the physical address in shared memory of the payload data.
2101 * For detailed payload content, see the afe_port_param_data_v2
2102 * structure
2103 */
2104
2105
2106 u32 module_id;
2107/* ID of the module to be queried.
2108 * Supported values: Valid module ID
2109 */
2110
2111 u32 param_id;
2112/* ID of the parameter to be queried.
2113 * Supported values: Valid parameter ID
2114 */
2115} __packed;
2116
2117#define AFE_PORT_CMDRSP_GET_PARAM_V2 0x00010106
2118
2119/* Payload of the #AFE_PORT_CMDRSP_GET_PARAM_V2 message, which
2120 * responds to an #AFE_PORT_CMD_GET_PARAM_V2 command.
2121 *
2122 * Immediately following this structure is the parameters structure
2123 * (afe_port_param_data) containing the response(acknowledgment)
2124 * parameter payload. This payload is included for an in-band
2125 * scenario. For an address/shared memory-based set parameter, this
2126 * payload is not needed.
2127 */
2128
2129
2130struct afe_port_cmdrsp_get_param_v2 {
2131 u32 status;
2132} __packed;
2133
2134/* adsp_afe_service_commands.h */
2135
2136#define ADSP_MEMORY_MAP_EBI_POOL 0
2137
2138#define ADSP_MEMORY_MAP_SMI_POOL 1
2139#define ADSP_MEMORY_MAP_IMEM_POOL 2
2140#define ADSP_MEMORY_MAP_SHMEM8_4K_POOL 3
2141/*
2142* Definition of virtual memory flag
2143*/
2144#define ADSP_MEMORY_MAP_VIRTUAL_MEMORY 1
2145
2146/*
2147* Definition of physical memory flag
2148*/
2149#define ADSP_MEMORY_MAP_PHYSICAL_MEMORY 0
2150
2151
2152#define DEFAULT_COPP_TOPOLOGY 0x00010be3
2153#define DEFAULT_POPP_TOPOLOGY 0x00010be4
2154#define VPM_TX_SM_ECNS_COPP_TOPOLOGY 0x00010F71
2155#define VPM_TX_DM_FLUENCE_COPP_TOPOLOGY 0x00010F72
2156#define VPM_TX_QMIC_FLUENCE_COPP_TOPOLOGY 0x00010F75
2157
2158/* Memory map regions command payload used by the
2159 * #ASM_CMD_SHARED_MEM_MAP_REGIONS ,#ADM_CMD_SHARED_MEM_MAP_REGIONS
2160 * commands.
2161 *
2162 * This structure allows clients to map multiple shared memory
2163 * regions in a single command. Following this structure are
2164 * num_regions of avs_shared_map_region_payload.
2165 */
2166
2167
2168struct avs_cmd_shared_mem_map_regions {
2169 struct apr_hdr hdr;
2170 u16 mem_pool_id;
2171/* Type of memory on which this memory region is mapped.
2172 *
2173 * Supported values: - #ADSP_MEMORY_MAP_EBI_POOL -
2174 * #ADSP_MEMORY_MAP_SMI_POOL - #ADSP_MEMORY_MAP_IMEM_POOL
2175 * (unsupported) - #ADSP_MEMORY_MAP_SHMEM8_4K_POOL - Other values
2176 * are reserved
2177 *
2178 * The memory ID implicitly defines the characteristics of the
2179 * memory. Characteristics may include alignment type, permissions,
2180 * etc.
2181 *
2182 * SHMEM8_4K is shared memory, byte addressable, and 4 KB aligned.
2183 */
2184
2185
2186 u16 num_regions;
2187 /* Number of regions to map.*/
2188
2189 u32 property_flag;
2190/* Configures one common property for all the regions in the
2191 * payload. No two regions in the same memory map regions cmd can
2192 * have differnt property. Supported values: - 0x00000000 to
2193 * 0x00000001
2194 *
2195 * b0 - bit 0 indicates physical or virtual mapping 0 shared memory
2196 * address provided in avs_shared_map_regions_payload is physical
2197 * address. The shared memory needs to be mapped( hardware TLB
2198 * entry)
2199 *
2200 * and a software entry needs to be added for internal book keeping.
2201 *
2202 * 1 Shared memory address provided in MayPayload[usRegions] is
2203 * virtual address. The shared memory must not be mapped (since
2204 * hardware TLB entry is already available) but a software entry
2205 * needs to be added for internal book keeping. This can be useful
2206 * if two services with in ADSP is communicating via APR. They can
2207 * now directly communicate via the Virtual address instead of
2208 * Physical address. The virtual regions must be contiguous.
2209 *
2210 * b31-b1 - reserved bits. must be set to zero
2211 */
2212
2213} __packed;
2214
2215struct avs_shared_map_region_payload {
2216 u32 shm_addr_lsw;
2217/* least significant word of shared memory address of the memory
2218 * region to map. It must be contiguous memory, and it must be 4 KB
2219 * aligned.
2220 */
2221
2222 u32 shm_addr_msw;
2223/* most significant word of shared memory address of the memory
2224 * region to map. For 32 bit shared memory address, this field must
2225 * tbe set to zero. For 36 bit shared memory address, bit31 to bit 4
2226 * must be set to zero
2227 */
2228
2229 u32 mem_size_bytes;
2230/* Number of bytes in the region.
2231 *
2232 * The aDSP will always map the regions as virtual contiguous
2233 * memory, but the memory size must be in multiples of 4 KB to avoid
2234 * gaps in the virtually contiguous mapped memory.
2235 */
2236
2237} __packed;
2238
2239struct avs_cmd_shared_mem_unmap_regions {
2240 struct apr_hdr hdr;
2241 u32 mem_map_handle;
2242/* memory map handle returned by ASM_CMD_SHARED_MEM_MAP_REGIONS
2243 * , ADM_CMD_SHARED_MEM_MAP_REGIONS, commands
2244 */
2245
2246} __packed;
2247
2248/* Memory map command response payload used by the
2249 * #ASM_CMDRSP_SHARED_MEM_MAP_REGIONS
2250 * ,#ADM_CMDRSP_SHARED_MEM_MAP_REGIONS
2251 */
2252
2253
2254struct avs_cmdrsp_shared_mem_map_regions {
2255 u32 mem_map_handle;
2256/* A memory map handle encapsulating shared memory attributes is
2257 * returned
2258 */
2259
2260} __packed;
2261
2262/*adsp_audio_memmap_api.h*/
2263
2264/* ASM related data structures */
2265struct asm_wma_cfg {
2266 u16 format_tag;
2267 u16 ch_cfg;
2268 u32 sample_rate;
2269 u32 avg_bytes_per_sec;
2270 u16 block_align;
2271 u16 valid_bits_per_sample;
2272 u32 ch_mask;
2273 u16 encode_opt;
2274 u16 adv_encode_opt;
2275 u32 adv_encode_opt2;
2276 u32 drc_peak_ref;
2277 u32 drc_peak_target;
2278 u32 drc_ave_ref;
2279 u32 drc_ave_target;
2280} __packed;
2281
2282struct asm_wmapro_cfg {
2283 u16 format_tag;
2284 u16 ch_cfg;
2285 u32 sample_rate;
2286 u32 avg_bytes_per_sec;
2287 u16 block_align;
2288 u16 valid_bits_per_sample;
2289 u32 ch_mask;
2290 u16 encode_opt;
2291 u16 adv_encode_opt;
2292 u32 adv_encode_opt2;
2293 u32 drc_peak_ref;
2294 u32 drc_peak_target;
2295 u32 drc_ave_ref;
2296 u32 drc_ave_target;
2297} __packed;
2298
2299struct asm_aac_cfg {
2300 u16 format;
2301 u16 aot;
2302 u16 ep_config;
2303 u16 section_data_resilience;
2304 u16 scalefactor_data_resilience;
2305 u16 spectral_data_resilience;
2306 u16 ch_cfg;
2307 u16 reserved;
2308 u32 sample_rate;
2309} __packed;
2310
2311struct asm_softpause_params {
2312 u32 enable;
2313 u32 period;
2314 u32 step;
2315 u32 rampingcurve;
2316} __packed;
2317
2318struct asm_softvolume_params {
2319 u32 period;
2320 u32 step;
2321 u32 rampingcurve;
2322} __packed;
2323
2324#define ASM_END_POINT_DEVICE_MATRIX 0
2325/* Front left channel. */
2326#define PCM_CHANNEL_FL 1
2327
2328/* Front right channel. */
2329#define PCM_CHANNEL_FR 2
2330
2331/* Front center channel. */
2332#define PCM_CHANNEL_FC 3
2333
2334/* Left surround channel.*/
2335#define PCM_CHANNEL_LS 4
2336
2337/* Right surround channel.*/
2338#define PCM_CHANNEL_RS 5
2339
2340/* Low frequency effect channel. */
2341#define PCM_CHANNEL_LFE 6
2342
2343/* Center surround channel; Rear center channel. */
2344#define PCM_CHANNEL_CS 7
2345
2346/* Left back channel; Rear left channel. */
2347#define PCM_CHANNEL_LB 8
2348
2349/* Right back channel; Rear right channel. */
2350#define PCM_CHANNEL_RB 9
2351
2352/* Top surround channel. */
2353#define PCM_CHANNELS 10
2354
2355/* Center vertical height channel.*/
2356#define PCM_CHANNEL_CVH 11
2357
2358/* Mono surround channel.*/
2359#define PCM_CHANNEL_MS 12
2360
2361/* Front left of center. */
2362#define PCM_CHANNEL_FLC 13
2363
2364/* Front right of center. */
2365#define PCM_CHANNEL_FRC 14
2366
2367/* Rear left of center. */
2368#define PCM_CHANNEL_RLC 15
2369
2370/* Rear right of center. */
2371#define PCM_CHANNEL_RRC 16
2372
2373#define PCM_FORMAT_MAX_NUM_CHANNEL 8
2374
2375#define ASM_MEDIA_FMT_MULTI_CHANNEL_PCM_V2 0x00010DA5
2376
2377#define ASM_STREAM_POSTPROC_TOPO_ID_DEFAULT 0x00010BE4
2378
2379#define ASM_MEDIA_FMT_EVRCB_FS 0x00010BEF
2380
2381#define ASM_MEDIA_FMT_EVRCWB_FS 0x00010BF0
2382
2383#define ASM_MAX_EQ_BANDS 12
2384
2385#define ASM_DATA_CMD_MEDIA_FMT_UPDATE_V2 0x00010D98
2386
2387struct asm_data_cmd_media_fmt_update_v2 {
2388u32 fmt_blk_size;
2389 /* Media format block size in bytes.*/
2390} __packed;
2391
2392struct asm_multi_channel_pcm_fmt_blk_v2 {
2393 struct apr_hdr hdr;
2394 struct asm_data_cmd_media_fmt_update_v2 fmt_blk;
2395
2396 u16 num_channels;
2397 /* Number of channels. Supported values: 1 to 8 */
2398 u16 bits_per_sample;
2399/* Number of bits per sample per channel. * Supported values:
2400 * 16, 24 * When used for playback, the client must send 24-bit
2401 * samples packed in 32-bit words. The 24-bit samples must be placed
2402 * in the most significant 24 bits of the 32-bit word. When used for
2403 * recording, the aDSP sends 24-bit samples packed in 32-bit words.
2404 * The 24-bit samples are placed in the most significant 24 bits of
2405 * the 32-bit word.
2406 */
2407
2408
2409 u32 sample_rate;
2410/* Number of samples per second (in Hertz).
2411 * Supported values: 2000 to 48000
2412 */
2413
2414 u16 is_signed;
2415 /* Flag that indicates the samples are signed (1). */
2416
2417 u16 reserved;
2418 /* reserved field for 32 bit alignment. must be set to zero. */
2419
2420 u8 channel_mapping[8];
2421/* Channel array of size 8.
2422 * Supported values:
2423 * - #PCM_CHANNEL_L
2424 * - #PCM_CHANNEL_R
2425 * - #PCM_CHANNEL_C
2426 * - #PCM_CHANNEL_LS
2427 * - #PCM_CHANNEL_RS
2428 * - #PCM_CHANNEL_LFE
2429 * - #PCM_CHANNEL_CS
2430 * - #PCM_CHANNEL_LB
2431 * - #PCM_CHANNEL_RB
2432 * - #PCM_CHANNELS
2433 * - #PCM_CHANNEL_CVH
2434 * - #PCM_CHANNEL_MS
2435 * - #PCM_CHANNEL_FLC
2436 * - #PCM_CHANNEL_FRC
2437 * - #PCM_CHANNEL_RLC
2438 * - #PCM_CHANNEL_RRC
2439 *
2440 * Channel[i] mapping describes channel I. Each element i of the
2441 * array describes channel I inside the buffer where 0 @le I <
2442 * num_channels. An unused channel is set to zero.
2443 */
2444} __packed;
2445
2446struct asm_stream_cmd_set_encdec_param {
2447 u32 param_id;
2448 /* ID of the parameter. */
2449
2450 u32 param_size;
2451/* Data size of this parameter, in bytes. The size is a multiple
2452 * of 4 bytes.
2453 */
2454
2455} __packed;
2456
2457struct asm_enc_cfg_blk_param_v2 {
2458 u32 frames_per_buf;
2459/* Number of encoded frames to pack into each buffer.
2460 *
2461 * @note1hang This is only guidance information for the aDSP. The
2462 * number of encoded frames put into each buffer (specified by the
2463 * client) is less than or equal to this number.
2464 */
2465
2466 u32 enc_cfg_blk_size;
2467/* Size in bytes of the encoder configuration block that follows
2468 * this member.
2469 */
2470
2471} __packed;
2472
2473/* @brief Multichannel PCM encoder configuration structure used
2474 * in the #ASM_STREAM_CMD_OPEN_READ_V2 command.
2475 */
2476
2477struct asm_multi_channel_pcm_enc_cfg_v2 {
2478 struct apr_hdr hdr;
2479 struct asm_stream_cmd_set_encdec_param encdec;
2480 struct asm_enc_cfg_blk_param_v2 encblk;
2481 uint16_t num_channels;
2482/*< Number of PCM channels.
2483 *
2484 * Supported values: - 0 -- Native mode - 1 -- 8 Native mode
2485 * indicates that encoding must be performed with the number of
2486 * channels at the input.
2487 */
2488
2489 uint16_t bits_per_sample;
2490/*< Number of bits per sample per channel.
2491 * Supported values: 16, 24
2492 */
2493
2494 uint32_t sample_rate;
2495/*< Number of samples per second (in Hertz).
2496 *
2497 * Supported values: 0, 8000 to 48000 A value of 0 indicates the
2498 * native sampling rate. Encoding is performed at the input sampling
2499 * rate.
2500 */
2501
2502 uint16_t is_signed;
2503/*< Specifies whether the samples are signed (1). Currently,
2504 * only signed samples are supported.
2505 */
2506
2507 uint16_t reserved;
2508/*< reserved field for 32 bit alignment. must be set to zero.*/
2509
2510
2511 uint8_t channel_mapping[8];
2512} __packed;
2513
2514#define ASM_MEDIA_FMT_MP3 0x00010BE9
2515#define ASM_MEDIA_FMT_AAC_V2 0x00010DA6
2516
2517/* @xreflabel
2518 * {hdr:AsmMediaFmtDolbyAac} Media format ID for the
2519 * Dolby AAC decoder. This format ID is be used if the client wants
2520 * to use the Dolby AAC decoder to decode MPEG2 and MPEG4 AAC
2521 * contents.
2522 */
2523
2524#define ASM_MEDIA_FMT_DOLBY_AAC 0x00010D86
2525
2526/* Enumeration for the audio data transport stream AAC format. */
2527#define ASM_MEDIA_FMT_AAC_FORMAT_FLAG_ADTS 0
2528
2529/* Enumeration for low overhead audio stream AAC format. */
2530#define ASM_MEDIA_FMT_AAC_FORMAT_FLAG_LOAS 1
2531
2532/* Enumeration for the audio data interchange format
2533 * AAC format.
2534 */
2535#define ASM_MEDIA_FMT_AAC_FORMAT_FLAG_ADIF 2
2536
2537/* Enumeration for the raw AAC format. */
2538#define ASM_MEDIA_FMT_AAC_FORMAT_FLAG_RAW 3
2539
2540#define ASM_MEDIA_FMT_AAC_AOT_LC 2
2541#define ASM_MEDIA_FMT_AAC_AOT_SBR 5
2542#define ASM_MEDIA_FMT_AAC_AOT_PS 29
2543#define ASM_MEDIA_FMT_AAC_AOT_BSAC 22
2544
2545struct asm_aac_fmt_blk_v2 {
2546 struct apr_hdr hdr;
2547 struct asm_data_cmd_media_fmt_update_v2 fmt_blk;
2548
2549 u16 aac_fmt_flag;
2550/* Bitstream format option.
2551 * Supported values:
2552 * - #ASM_MEDIA_FMT_AAC_FORMAT_FLAG_ADTS
2553 * - #ASM_MEDIA_FMT_AAC_FORMAT_FLAG_LOAS
2554 * - #ASM_MEDIA_FMT_AAC_FORMAT_FLAG_ADIF
2555 * - #ASM_MEDIA_FMT_AAC_FORMAT_FLAG_RAW
2556 */
2557
2558 u16 audio_objype;
2559/* Audio Object Type (AOT) present in the AAC stream.
2560 * Supported values:
2561 * - #ASM_MEDIA_FMT_AAC_AOT_LC
2562 * - #ASM_MEDIA_FMT_AAC_AOT_SBR
2563 * - #ASM_MEDIA_FMT_AAC_AOT_BSAC
2564 * - #ASM_MEDIA_FMT_AAC_AOT_PS
2565 * - Otherwise -- Not supported
2566 */
2567
2568 u16 channel_config;
2569/* Number of channels present in the AAC stream.
2570 * Supported values:
2571 * - 1 -- Mono
2572 * - 2 -- Stereo
2573 * - 6 -- 5.1 content
2574 */
2575
2576 u16 reserved;
2577 /* Reserved. Clients must set this field to zero. */
2578
2579 u16 total_size_of_PCE_bits;
2580/* greater or equal to zero. * -In case of RAW formats and
2581 * channel config = 0 (PCE), client can send * the bit stream
2582 * containing PCE immediately following this structure * (in-band).
2583 * -This number does not include bits included for 32 bit alignment.
2584 * -If zero, then the PCE info is assumed to be available in the
2585 * audio -bit stream & not in-band.
2586 */
2587
2588 u32 sample_rate;
2589/* Number of samples per second (in Hertz).
2590 *
2591 * Supported values: 8000, 11025, 12000, 16000, 22050, 24000, 32000,
2592 * 44100, 48000
2593 *
2594 * This field must be equal to the sample rate of the AAC-LC
2595 * decoder's output. - For MP4 or 3GP containers, this is indicated
2596 * by the samplingFrequencyIndex field in the AudioSpecificConfig
2597 * element. - For ADTS format, this is indicated by the
2598 * samplingFrequencyIndex in the ADTS fixed header. - For ADIF
2599 * format, this is indicated by the samplingFrequencyIndex in the
2600 * program_config_element present in the ADIF header.
2601 */
2602
2603} __packed;
2604
2605struct asm_aac_enc_cfg_v2 {
2606 struct apr_hdr hdr;
2607 struct asm_stream_cmd_set_encdec_param encdec;
2608 struct asm_enc_cfg_blk_param_v2 encblk;
2609
2610 u32 bit_rate;
2611 /* Encoding rate in bits per second. */
2612 u32 enc_mode;
2613/* Encoding mode.
2614 * Supported values:
2615 * - #ASM_MEDIA_FMT_AAC_AOT_LC
2616 * - #ASM_MEDIA_FMT_AAC_AOT_SBR
2617 * - #ASM_MEDIA_FMT_AAC_AOT_PS
2618 */
2619 u16 aac_fmt_flag;
2620/* AAC format flag.
2621 * Supported values:
2622 * - #ASM_MEDIA_FMT_AAC_FORMAT_FLAG_ADTS
2623 * - #ASM_MEDIA_FMT_AAC_FORMAT_FLAG_RAW
2624 */
2625 u16 channel_cfg;
2626/* Number of channels to encode.
2627 * Supported values:
2628 * - 0 -- Native mode
2629 * - 1 -- Mono
2630 * - 2 -- Stereo
2631 * - Other values are not supported.
2632 * @note1hang The eAAC+ encoder mode supports only stereo.
2633 * Native mode indicates that encoding must be performed with the
2634 * number of channels at the input.
2635 * The number of channels must not change during encoding.
2636 */
2637
2638 u32 sample_rate;
2639/* Number of samples per second.
2640 * Supported values: - 0 -- Native mode - For other values,
2641 * Native mode indicates that encoding must be performed with the
2642 * sampling rate at the input.
2643 * The sampling rate must not change during encoding.
2644 */
2645
2646} __packed;
2647
2648#define ASM_MEDIA_FMT_AMRNB_FS 0x00010BEB
2649
2650/* Enumeration for 4.75 kbps AMR-NB Encoding mode. */
2651#define ASM_MEDIA_FMT_AMRNB_FS_ENCODE_MODE_MR475 0
2652
2653/* Enumeration for 5.15 kbps AMR-NB Encoding mode. */
2654#define ASM_MEDIA_FMT_AMRNB_FS_ENCODE_MODE_MR515 1
2655
2656/* Enumeration for 5.90 kbps AMR-NB Encoding mode. */
2657#define ASM_MEDIA_FMT_AMRNB_FS_ENCODE_MODE_MMR59 2
2658
2659/* Enumeration for 6.70 kbps AMR-NB Encoding mode. */
2660#define ASM_MEDIA_FMT_AMRNB_FS_ENCODE_MODE_MMR67 3
2661
2662/* Enumeration for 7.40 kbps AMR-NB Encoding mode. */
2663#define ASM_MEDIA_FMT_AMRNB_FS_ENCODE_MODE_MMR74 4
2664
2665/* Enumeration for 7.95 kbps AMR-NB Encoding mode. */
2666#define ASM_MEDIA_FMT_AMRNB_FS_ENCODE_MODE_MMR795 5
2667
2668/* Enumeration for 10.20 kbps AMR-NB Encoding mode. */
2669#define ASM_MEDIA_FMT_AMRNB_FS_ENCODE_MODE_MMR102 6
2670
2671/* Enumeration for 12.20 kbps AMR-NB Encoding mode. */
2672#define ASM_MEDIA_FMT_AMRNB_FS_ENCODE_MODE_MMR122 7
2673
2674/* Enumeration for AMR-NB Discontinuous Transmission mode off. */
2675#define ASM_MEDIA_FMT_AMRNB_FS_DTX_MODE_OFF 0
2676
2677/* Enumeration for AMR-NB DTX mode VAD1. */
2678#define ASM_MEDIA_FMT_AMRNB_FS_DTX_MODE_VAD1 1
2679
2680/* Enumeration for AMR-NB DTX mode VAD2. */
2681#define ASM_MEDIA_FMT_AMRNB_FS_DTX_MODE_VAD2 2
2682
2683/* Enumeration for AMR-NB DTX mode auto.
2684 */
2685#define ASM_MEDIA_FMT_AMRNB_FS_DTX_MODE_AUTO 3
2686
2687struct asm_amrnb_enc_cfg {
2688 struct apr_hdr hdr;
2689 struct asm_stream_cmd_set_encdec_param encdec;
2690 struct asm_enc_cfg_blk_param_v2 encblk;
2691
2692 u16 enc_mode;
2693/* AMR-NB encoding rate.
2694 * Supported values:
2695 * Use the ASM_MEDIA_FMT_AMRNB_FS_ENCODE_MODE_*
2696 * macros
2697 */
2698
2699 u16 dtx_mode;
2700/* Specifies whether DTX mode is disabled or enabled.
2701 * Supported values:
2702 * - #ASM_MEDIA_FMT_AMRNB_FS_DTX_MODE_OFF
2703 * - #ASM_MEDIA_FMT_AMRNB_FS_DTX_MODE_VAD1
2704 */
2705} __packed;
2706
2707#define ASM_MEDIA_FMT_AMRWB_FS 0x00010BEC
2708
2709/* Enumeration for 6.6 kbps AMR-WB Encoding mode. */
2710#define ASM_MEDIA_FMT_AMRWB_FS_ENCODE_MODE_MR66 0
2711
2712/* Enumeration for 8.85 kbps AMR-WB Encoding mode. */
2713#define ASM_MEDIA_FMT_AMRWB_FS_ENCODE_MODE_MR885 1
2714
2715/* Enumeration for 12.65 kbps AMR-WB Encoding mode. */
2716#define ASM_MEDIA_FMT_AMRWB_FS_ENCODE_MODE_MR1265 2
2717
2718/* Enumeration for 14.25 kbps AMR-WB Encoding mode. */
2719#define ASM_MEDIA_FMT_AMRWB_FS_ENCODE_MODE_MR1425 3
2720
2721/* Enumeration for 15.85 kbps AMR-WB Encoding mode. */
2722#define ASM_MEDIA_FMT_AMRWB_FS_ENCODE_MODE_MR1585 4
2723
2724/* Enumeration for 18.25 kbps AMR-WB Encoding mode. */
2725#define ASM_MEDIA_FMT_AMRWB_FS_ENCODE_MODE_MR1825 5
2726
2727/* Enumeration for 19.85 kbps AMR-WB Encoding mode. */
2728#define ASM_MEDIA_FMT_AMRWB_FS_ENCODE_MODE_MR1985 6
2729
2730/* Enumeration for 23.05 kbps AMR-WB Encoding mode. */
2731#define ASM_MEDIA_FMT_AMRWB_FS_ENCODE_MODE_MR2305 7
2732
2733/* Enumeration for 23.85 kbps AMR-WB Encoding mode.
2734 */
2735#define ASM_MEDIA_FMT_AMRWB_FS_ENCODE_MODE_MR2385 8
2736
2737struct asm_amrwb_enc_cfg {
2738 struct apr_hdr hdr;
2739 struct asm_stream_cmd_set_encdec_param encdec;
2740 struct asm_enc_cfg_blk_param_v2 encblk;
2741
2742 u16 enc_mode;
2743/* AMR-WB encoding rate.
2744 * Suupported values:
2745 * Use the ASM_MEDIA_FMT_AMRWB_FS_ENCODE_MODE_*
2746 * macros
2747 */
2748
2749 u16 dtx_mode;
2750/* Specifies whether DTX mode is disabled or enabled.
2751 * Supported values:
2752 * - #ASM_MEDIA_FMT_AMRNB_FS_DTX_MODE_OFF
2753 * - #ASM_MEDIA_FMT_AMRNB_FS_DTX_MODE_VAD1
2754 */
2755} __packed;
2756
2757#define ASM_MEDIA_FMT_V13K_FS 0x00010BED
2758
2759/* Enumeration for 14.4 kbps V13K Encoding mode. */
2760#define ASM_MEDIA_FMT_V13K_FS_ENCODE_MODE_MR1440 0
2761
2762/* Enumeration for 12.2 kbps V13K Encoding mode. */
2763#define ASM_MEDIA_FMT_V13K_FS_ENCODE_MODE_MR1220 1
2764
2765/* Enumeration for 11.2 kbps V13K Encoding mode. */
2766#define ASM_MEDIA_FMT_V13K_FS_ENCODE_MODE_MR1120 2
2767
2768/* Enumeration for 9.0 kbps V13K Encoding mode. */
2769#define ASM_MEDIA_FMT_V13K_FS_ENCODE_MODE_MR90 3
2770
2771/* Enumeration for 7.2 kbps V13K eEncoding mode. */
2772#define ASM_MEDIA_FMT_V13K_FS_ENCODE_MODE_MR720 4
2773
2774/* Enumeration for 1/8 vocoder rate.*/
2775#define ASM_MEDIA_FMT_VOC_ONE_EIGHTH_RATE 1
2776
2777/* Enumeration for 1/4 vocoder rate. */
2778#define ASM_MEDIA_FMT_VOC_ONE_FOURTH_RATE 2
2779
2780/* Enumeration for 1/2 vocoder rate. */
2781#define ASM_MEDIA_FMT_VOC_HALF_RATE 3
2782
2783/* Enumeration for full vocoder rate.
2784 */
2785#define ASM_MEDIA_FMT_VOC_FULL_RATE 4
2786
2787struct asm_v13k_enc_cfg {
2788 struct apr_hdr hdr;
2789 struct asm_stream_cmd_set_encdec_param encdec;
2790 struct asm_enc_cfg_blk_param_v2 encblk;
2791 u16 max_rate;
2792/* Maximum allowed encoder frame rate.
2793 * Supported values:
2794 * - #ASM_MEDIA_FMT_VOC_ONE_EIGHTH_RATE
2795 * - #ASM_MEDIA_FMT_VOC_ONE_FOURTH_RATE
2796 * - #ASM_MEDIA_FMT_VOC_HALF_RATE
2797 * - #ASM_MEDIA_FMT_VOC_FULL_RATE
2798 */
2799
2800 u16 min_rate;
2801/* Minimum allowed encoder frame rate.
2802 * Supported values:
2803 * - #ASM_MEDIA_FMT_VOC_ONE_EIGHTH_RATE
2804 * - #ASM_MEDIA_FMT_VOC_ONE_FOURTH_RATE
2805 * - #ASM_MEDIA_FMT_VOC_HALF_RATE
2806 * - #ASM_MEDIA_FMT_VOC_FULL_RATE
2807 */
2808
2809 u16 reduced_rate_cmd;
2810/* Reduced rate command, used to change
2811 * the average bitrate of the V13K
2812 * vocoder.
2813 * Supported values:
2814 * - #ASM_MEDIA_FMT_V13K_FS_ENCODE_MODE_MR1440 (Default)
2815 * - #ASM_MEDIA_FMT_V13K_FS_ENCODE_MODE_MR1220
2816 * - #ASM_MEDIA_FMT_V13K_FS_ENCODE_MODE_MR1120
2817 * - #ASM_MEDIA_FMT_V13K_FS_ENCODE_MODE_MR90
2818 * - #ASM_MEDIA_FMT_V13K_FS_ENCODE_MODE_MR720
2819 */
2820
2821 u16 rate_mod_cmd;
2822/* Rate modulation command. Default = 0.
2823 *- If bit 0=1, rate control is enabled.
2824 *- If bit 1=1, the maximum number of consecutive full rate
2825 * frames is limited with numbers supplied in
2826 * bits 2 to 10.
2827 *- If bit 1=0, the minimum number of non-full rate frames
2828 * in between two full rate frames is forced to
2829 * the number supplied in bits 2 to 10. In both cases, if necessary,
2830 * half rate is used to substitute full rate. - Bits 15 to 10 are
2831 * reserved and must all be set to zero.
2832 */
2833
2834} __packed;
2835
2836#define ASM_MEDIA_FMT_EVRC_FS 0x00010BEE
2837
2838/* EVRC encoder configuration structure used in the
2839 * #ASM_STREAM_CMD_OPEN_READ_V2 command.
2840 */
2841struct asm_evrc_enc_cfg {
2842 struct apr_hdr hdr;
2843 struct asm_stream_cmd_set_encdec_param encdec;
2844 struct asm_enc_cfg_blk_param_v2 encblk;
2845 u16 max_rate;
2846/* Maximum allowed encoder frame rate.
2847 * Supported values:
2848 * - #ASM_MEDIA_FMT_VOC_ONE_EIGHTH_RATE
2849 * - #ASM_MEDIA_FMT_VOC_ONE_FOURTH_RATE
2850 * - #ASM_MEDIA_FMT_VOC_HALF_RATE
2851 * - #ASM_MEDIA_FMT_VOC_FULL_RATE
2852 */
2853
2854 u16 min_rate;
2855/* Minimum allowed encoder frame rate.
2856 * Supported values:
2857 * - #ASM_MEDIA_FMT_VOC_ONE_EIGHTH_RATE
2858 * - #ASM_MEDIA_FMT_VOC_ONE_FOURTH_RATE
2859 * - #ASM_MEDIA_FMT_VOC_HALF_RATE
2860 * - #ASM_MEDIA_FMT_VOC_FULL_RATE
2861 */
2862
2863 u16 rate_mod_cmd;
2864/* Rate modulation command. Default: 0.
2865 * - If bit 0=1, rate control is enabled.
2866 * - If bit 1=1, the maximum number of consecutive full rate frames
2867 * is limited with numbers supplied in bits 2 to 10.
2868 *
2869 * - If bit 1=0, the minimum number of non-full rate frames in
2870 * between two full rate frames is forced to the number supplied in
2871 * bits 2 to 10. In both cases, if necessary, half rate is used to
2872 * substitute full rate.
2873 *
2874 * - Bits 15 to 10 are reserved and must all be set to zero.
2875 */
2876
2877 u16 reserved;
2878 /* Reserved. Clients must set this field to zero. */
2879} __packed;
2880
2881#define ASM_MEDIA_FMT_WMA_V10PRO_V2 0x00010DA7
2882
2883struct asm_wmaprov10_fmt_blk_v2 {
2884 struct apr_hdr hdr;
2885 struct asm_data_cmd_media_fmt_update_v2 fmtblk;
2886
2887 u16 fmtag;
2888/* WMA format type.
2889 * Supported values:
2890 * - 0x162 -- WMA 9 Pro
2891 * - 0x163 -- WMA 9 Pro Lossless
2892 * - 0x166 -- WMA 10 Pro
2893 * - 0x167 -- WMA 10 Pro Lossless
2894 */
2895
2896 u16 num_channels;
2897/* Number of channels encoded in the input stream.
2898 * Supported values: 1 to 8
2899 */
2900
2901 u32 sample_rate;
2902/* Number of samples per second (in Hertz).
2903 * Supported values: 11025, 16000, 22050, 32000, 44100, 48000,
2904 * 88200, 96000
2905 */
2906
2907 u32 avg_bytes_per_sec;
2908/* Bitrate expressed as the average bytes per second.
2909 * Supported values: 2000 to 96000
2910 */
2911
2912 u16 blk_align;
2913/* Size of the bitstream packet size in bytes. WMA Pro files
2914 * have a payload of one block per bitstream packet.
2915 * Supported values: @le 13376
2916 */
2917
2918 u16 bits_per_sample;
2919/* Number of bits per sample in the encoded WMA stream.
2920 * Supported values: 16, 24
2921 */
2922
2923 u32 channel_mask;
2924/* Bit-packed double word (32-bits) that indicates the
2925 * recommended speaker positions for each source channel.
2926 */
2927
2928 u16 enc_options;
2929/* Bit-packed word with values that indicate whether certain
2930 * features of the bitstream are used.
2931 * Supported values: - 0x0001 -- ENCOPT3_PURE_LOSSLESS - 0x0006 --
2932 * ENCOPT3_FRM_SIZE_MOD - 0x0038 -- ENCOPT3_SUBFRM_DIV - 0x0040 --
2933 * ENCOPT3_WRITE_FRAMESIZE_IN_HDR - 0x0080 --
2934 * ENCOPT3_GENERATE_DRC_PARAMS - 0x0100 -- ENCOPT3_RTMBITS
2935 */
2936
2937
2938 u16 usAdvancedEncodeOpt;
2939 /* Advanced encoding option. */
2940
2941 u32 advanced_enc_options2;
2942 /* Advanced encoding option 2. */
2943
2944} __packed;
2945
2946#define ASM_MEDIA_FMT_WMA_V9_V2 0x00010DA8
2947struct asm_wmastdv9_fmt_blk_v2 {
2948 struct apr_hdr hdr;
2949 struct asm_data_cmd_media_fmt_update_v2 fmtblk;
2950 u16 fmtag;
2951/* WMA format tag.
2952 * Supported values: 0x161 (WMA 9 standard)
2953 */
2954
2955 u16 num_channels;
2956/* Number of channels in the stream.
2957 * Supported values: 1, 2
2958 */
2959
2960 u32 sample_rate;
2961/* Number of samples per second (in Hertz).
2962 * Supported values: 48000
2963 */
2964
2965 u32 avg_bytes_per_sec;
2966 /* Bitrate expressed as the average bytes per second. */
2967
2968 u16 blk_align;
2969/* Block align. All WMA files with a maximum packet size of
2970 * 13376 are supported.
2971 */
2972
2973
2974 u16 bits_per_sample;
2975/* Number of bits per sample in the output.
2976 * Supported values: 16
2977 */
2978
2979 u32 channel_mask;
2980/* Channel mask.
2981 * Supported values:
2982 * - 3 -- Stereo (front left/front right)
2983 * - 4 -- Mono (center)
2984 */
2985
2986 u16 enc_options;
2987 /* Options used during encoding. */
2988
2989} __packed;
2990
2991#define ASM_MEDIA_FMT_WMA_V8 0x00010D91
2992
2993struct asm_wmastdv8_enc_cfg {
2994 struct apr_hdr hdr;
2995 struct asm_stream_cmd_set_encdec_param encdec;
2996 struct asm_enc_cfg_blk_param_v2 encblk;
2997 u32 bit_rate;
2998 /* Encoding rate in bits per second. */
2999
3000 u32 sample_rate;
3001/* Number of samples per second.
3002 *
3003 * Supported values:
3004 * - 0 -- Native mode
3005 * - Other Supported values are 22050, 32000, 44100, and 48000.
3006 *
3007 * Native mode indicates that encoding must be performed with the
3008 * sampling rate at the input.
3009 * The sampling rate must not change during encoding.
3010 */
3011
3012 u16 channel_cfg;
3013/* Number of channels to encode.
3014 * Supported values:
3015 * - 0 -- Native mode
3016 * - 1 -- Mono
3017 * - 2 -- Stereo
3018 * - Other values are not supported.
3019 *
3020 * Native mode indicates that encoding must be performed with the
3021 * number of channels at the input.
3022 * The number of channels must not change during encoding.
3023 */
3024
3025 u16 reserved;
3026 /* Reserved. Clients must set this field to zero.*/
3027 } __packed;
3028
3029#define ASM_MEDIA_FMT_AMR_WB_PLUS_V2 0x00010DA9
3030
3031struct asm_amrwbplus_fmt_blk_v2 {
3032 struct apr_hdr hdr;
3033 struct asm_data_cmd_media_fmt_update_v2 fmtblk;
3034 u32 amr_frame_fmt;
3035/* AMR frame format.
3036 * Supported values:
3037 * - 6 -- Transport Interface Format (TIF)
3038 * - Any other value -- File storage format (FSF)
3039 *
3040 * TIF stream contains 2-byte header for each frame within the
3041 * superframe. FSF stream contains one 2-byte header per superframe.
3042 */
3043
3044} __packed;
3045
3046#define ASM_MEDIA_FMT_AC3_DEC 0x00010BF6
3047#define ASM_MEDIA_FMT_EAC3_DEC 0x00010C3C
3048#define ASM_MEDIA_FMT_DTS 0x00010D88
3049
3050/* Media format ID for adaptive transform acoustic coding. This
3051 * ID is used by the #ASM_STREAM_CMD_OPEN_WRITE_COMPRESSED command
3052 * only.
3053 */
3054
3055#define ASM_MEDIA_FMT_ATRAC 0x00010D89
3056
3057/* Media format ID for metadata-enhanced audio transmission.
3058 * This ID is used by the #ASM_STREAM_CMD_OPEN_WRITE_COMPRESSED
3059 * command only.
3060 */
3061
3062#define ASM_MEDIA_FMT_MAT 0x00010D8A
3063
3064/* adsp_media_fmt.h */
3065
3066#define ASM_DATA_CMD_WRITE_V2 0x00010DAB
3067
3068struct asm_data_cmd_write_v2 {
3069 struct apr_hdr hdr;
3070 u32 buf_addr_lsw;
3071/* The 64 bit address msw-lsw should be a valid, mapped address.
3072 * 64 bit address should be a multiple of 32 bytes
3073 */
3074
3075 u32 buf_addr_msw;
3076/* The 64 bit address msw-lsw should be a valid, mapped address.
3077 * 64 bit address should be a multiple of 32 bytes.
3078 * -Address of the buffer containing the data to be decoded.
3079 * The buffer should be aligned to a 32 byte boundary.
3080 * -In the case of 32 bit Shared memory address, msw field must
3081 * -be set to zero.
3082 * -In the case of 36 bit shared memory address, bit 31 to bit 4
3083 * -of msw must be set to zero.
3084 */
3085 u32 mem_map_handle;
3086/* memory map handle returned by DSP through
3087 * ASM_CMD_SHARED_MEM_MAP_REGIONS command
3088 */
3089 u32 buf_size;
3090/* Number of valid bytes available in the buffer for decoding. The
3091 * first byte starts at buf_addr.
3092 */
3093
3094 u32 seq_id;
3095 /* Optional buffer sequence ID. */
3096
3097 u32 timestamp_lsw;
3098/* Lower 32 bits of the 64-bit session time in microseconds of the
3099 * first buffer sample.
3100 */
3101
3102 u32 timestamp_msw;
3103/* Upper 32 bits of the 64-bit session time in microseconds of the
3104 * first buffer sample.
3105 */
3106
3107 u32 flags;
3108/* Bitfield of flags.
3109 * Supported values for bit 31:
3110 * - 1 -- Valid timestamp.
3111 * - 0 -- Invalid timestamp.
3112 * - Use #ASM_BIT_MASKIMESTAMP_VALID_FLAG as the bitmask and
3113 * #ASM_SHIFTIMESTAMP_VALID_FLAG as the shift value to set this bit.
3114 * Supported values for bit 30:
3115 * - 1 -- Last buffer.
3116 * - 0 -- Not the last buffer.
3117 *
3118 * Supported values for bit 29:
3119 * - 1 -- Continue the timestamp from the previous buffer.
3120 * - 0 -- Timestamp of the current buffer is not related
3121 * to the timestamp of the previous buffer.
3122 * - Use #ASM_BIT_MASKS_CONTINUE_FLAG and #ASM_SHIFTS_CONTINUE_FLAG
3123 * to set this bit.
3124 *
3125 * Supported values for bit 4:
3126 * - 1 -- End of the frame.
3127 * - 0 -- Not the end of frame, or this information is not known.
3128 * - Use #ASM_BIT_MASK_EOF_FLAG as the bitmask and #ASM_SHIFT_EOF_FLAG
3129 * as the shift value to set this bit.
3130 *
3131 * All other bits are reserved and must be set to 0.
3132 *
3133 * If bit 31=0 and bit 29=1: The timestamp of the first sample in
3134 * this buffer continues from the timestamp of the last sample in
3135 * the previous buffer. If there is no previous buffer (i.e., this
3136 * is the first buffer sent after opening the stream or after a
3137 * flush operation), or if the previous buffer does not have a valid
3138 * timestamp, the samples in the current buffer also do not have a
3139 * valid timestamp. They are played out as soon as possible.
3140 *
3141 *
3142 * If bit 31=0 and bit 29=0: No timestamp is associated with the
3143 * first sample in this buffer. The samples are played out as soon
3144 * as possible.
3145 *
3146 *
3147 * If bit 31=1 and bit 29 is ignored: The timestamp specified in
3148 * this payload is honored.
3149 *
3150 *
3151 * If bit 30=0: Not the last buffer in the stream. This is useful
3152 * in removing trailing samples.
3153 *
3154 *
3155 * For bit 4: The client can set this flag for every buffer sent in
3156 * which the last byte is the end of a frame. If this flag is set,
3157 * the buffer can contain data from multiple frames, but it should
3158 * always end at a frame boundary. Restrictions allow the aDSP to
3159 * detect an end of frame without requiring additional processing.
3160 */
3161
3162} __packed;
3163
3164#define ASM_DATA_CMD_READ_V2 0x00010DAC
3165
3166struct asm_data_cmd_read_v2 {
3167 struct apr_hdr hdr;
3168 u32 buf_addr_lsw;
3169/* the 64 bit address msw-lsw should be a valid mapped address
3170 * and should be a multiple of 32 bytes
3171 */
3172
3173
3174 u32 buf_addr_msw;
3175/* the 64 bit address msw-lsw should be a valid mapped address
3176 * and should be a multiple of 32 bytes.
3177* - Address of the buffer where the DSP puts the encoded data,
3178* potentially, at an offset specified by the uOffset field in
3179* ASM_DATA_EVENT_READ_DONE structure. The buffer should be aligned
3180* to a 32 byte boundary.
3181*- In the case of 32 bit Shared memory address, msw field must
3182*- be set to zero.
3183*- In the case of 36 bit shared memory address, bit 31 to bit
3184*- 4 of msw must be set to zero.
3185*/
3186 u32 mem_map_handle;
3187/* memory map handle returned by DSP through
3188 * ASM_CMD_SHARED_MEM_MAP_REGIONS command.
3189 */
3190
3191 u32 buf_size;
3192/* Number of bytes available for the aDSP to write. The aDSP
3193 * starts writing from buf_addr.
3194 */
3195
3196 u32 seq_id;
3197 /* Optional buffer sequence ID.
3198 */
3199} __packed;
3200
3201#define ASM_DATA_CMD_EOS 0x00010BDB
3202#define ASM_DATA_EVENT_RENDERED_EOS 0x00010C1C
3203#define ASM_DATA_EVENT_EOS 0x00010BDD
3204
3205#define ASM_DATA_EVENT_WRITE_DONE_V2 0x00010D99
3206struct asm_data_event_write_done_v2 {
3207 u32 buf_addr_lsw;
3208 /* lsw of the 64 bit address */
3209 u32 buf_addr_msw;
3210 /* msw of the 64 bit address. address given by the client in
3211 * ASM_DATA_CMD_WRITE_V2 command.
3212 */
3213 u32 mem_map_handle;
3214 /* memory map handle in the ASM_DATA_CMD_WRITE_V2 */
3215
3216 u32 status;
3217/* Status message (error code) that indicates whether the
3218 * referenced buffer has been successfully consumed.
3219 * Supported values: Refer to @xhyperref{Q3,[Q3]}
3220 */
3221} __packed;
3222
3223#define ASM_DATA_EVENT_READ_DONE_V2 0x00010D9A
3224
3225/* Definition of the frame metadata flag bitmask.*/
3226#define ASM_BIT_MASK_FRAME_METADATA_FLAG (0x40000000UL)
3227
3228/* Definition of the frame metadata flag shift value. */
3229#define ASM_SHIFT_FRAME_METADATA_FLAG 30
3230
3231struct asm_data_event_read_done_v2 {
3232 u32 status;
3233/* Status message (error code).
3234 * Supported values: Refer to @xhyperref{Q3,[Q3]}
3235 */
3236
3237u32 buf_addr_lsw;
3238/* 64 bit address msw-lsw is a valid, mapped address. 64 bit
3239 * address is a multiple of 32 bytes.
3240 */
3241
3242u32 buf_addr_msw;
3243/* 64 bit address msw-lsw is a valid, mapped address. 64 bit
3244* address is a multiple of 32 bytes.
3245*
3246* -Same address provided by the client in ASM_DATA_CMD_READ_V2
3247* -In the case of 32 bit Shared memory address, msw field is set to
3248* zero.
3249* -In the case of 36 bit shared memory address, bit 31 to bit 4
3250* -of msw is set to zero.
3251*/
3252
3253u32 mem_map_handle;
3254/* memory map handle in the ASM_DATA_CMD_READ_V2 */
3255
3256u32 enc_framesotal_size;
3257/* Total size of the encoded frames in bytes.
3258 * Supported values: >0
3259 */
3260
3261u32 offset;
3262/* Offset (from buf_addr) to the first byte of the first encoded
3263 * frame. All encoded frames are consecutive, starting from this
3264 * offset.
3265 * Supported values: > 0
3266 */
3267
3268u32 timestamp_lsw;
3269/* Lower 32 bits of the 64-bit session time in microseconds of
3270 * the first sample in the buffer. If Bit 5 of mode_flags flag of
3271 * ASM_STREAM_CMD_OPEN_READ_V2 is 1 then the 64 bit timestamp is
3272 * absolute capture time otherwise it is relative session time. The
3273 * absolute timestamp doesnt reset unless the system is reset.
3274 */
3275
3276
3277u32 timestamp_msw;
3278/* Upper 32 bits of the 64-bit session time in microseconds of
3279 * the first sample in the buffer.
3280 */
3281
3282
3283u32 flags;
3284/* Bitfield of flags. Bit 30 indicates whether frame metadata is
3285 * present. If frame metadata is present, num_frames consecutive
3286 * instances of @xhyperref{hdr:FrameMetaData,Frame metadata} start
3287 * at the buffer address.
3288 * Supported values for bit 31:
3289 * - 1 -- Timestamp is valid.
3290 * - 0 -- Timestamp is invalid.
3291 * - Use #ASM_BIT_MASKIMESTAMP_VALID_FLAG and
3292 * #ASM_SHIFTIMESTAMP_VALID_FLAG to set this bit.
3293 *
3294 * Supported values for bit 30:
3295 * - 1 -- Frame metadata is present.
3296 * - 0 -- Frame metadata is absent.
3297 * - Use #ASM_BIT_MASK_FRAME_METADATA_FLAG and
3298 * #ASM_SHIFT_FRAME_METADATA_FLAG to set this bit.
3299 *
3300 * All other bits are reserved; the aDSP sets them to 0.
3301 */
3302
3303u32 num_frames;
3304/* Number of encoded frames in the buffer. */
3305
3306u32 seq_id;
3307/* Optional buffer sequence ID. */
3308} __packed;
3309
3310struct asm_data_read_buf_metadata_v2 {
3311 u32 offset;
3312/* Offset from buf_addr in #ASM_DATA_EVENT_READ_DONE_PAYLOAD to
3313 * the frame associated with this metadata.
3314 * Supported values: > 0
3315 */
3316
3317u32 frm_size;
3318/* Size of the encoded frame in bytes.
3319 * Supported values: > 0
3320 */
3321
3322u32 num_encoded_pcm_samples;
3323/* Number of encoded PCM samples (per channel) in the frame
3324 * associated with this metadata.
3325 * Supported values: > 0
3326 */
3327
3328u32 timestamp_lsw;
3329/* Lower 32 bits of the 64-bit session time in microseconds of the
3330 * first sample for this frame.
3331 * If Bit 5 of mode_flags flag of ASM_STREAM_CMD_OPEN_READ_V2 is 1
3332 * then the 64 bit timestamp is absolute capture time otherwise it
3333 * is relative session time. The absolute timestamp doesnt reset
3334 * unless the system is reset.
3335 */
3336
3337
3338u32 timestamp_msw;
3339/* Lower 32 bits of the 64-bit session time in microseconds of the
3340 * first sample for this frame.
3341 */
3342
3343u32 flags;
3344/* Frame flags.
3345 * Supported values for bit 31:
3346 * - 1 -- Time stamp is valid
3347 * - 0 -- Time stamp is not valid
3348 * - All other bits are reserved; the aDSP sets them to 0.
3349*/
3350} __packed;
3351
3352/* Notifies the client of a change in the data sampling rate or
3353 * Channel mode. This event is raised by the decoder service. The
3354 * event is enabled through the mode flags of
3355 * #ASM_STREAM_CMD_OPEN_WRITE_V2 or
3356 * #ASM_STREAM_CMD_OPEN_READWRITE_V2. - The decoder detects a change
3357 * in the output sampling frequency or the number/positioning of
3358 * output channels, or if it is the first frame decoded.The new
3359 * sampling frequency or the new channel configuration is
3360 * communicated back to the client asynchronously.
3361 */
3362
3363#define ASM_DATA_EVENT_SR_CM_CHANGE_NOTIFY 0x00010C65
3364
3365/* Payload of the #ASM_DATA_EVENT_SR_CM_CHANGE_NOTIFY event.
3366 * This event is raised when the following conditions are both true:
3367 * - The event is enabled through the mode_flags of
3368 * #ASM_STREAM_CMD_OPEN_WRITE_V2 or
3369 * #ASM_STREAM_CMD_OPEN_READWRITE_V2. - The decoder detects a change
3370 * in either the output sampling frequency or the number/positioning
3371 * of output channels, or if it is the first frame decoded.
3372 * This event is not raised (even if enabled) if the decoder is
3373 * MIDI, because
3374 */
3375
3376
3377struct asm_data_event_sr_cm_change_notify {
3378 u32 sample_rate;
3379/* New sampling rate (in Hertz) after detecting a change in the
3380 * bitstream.
3381 * Supported values: 2000 to 48000
3382 */
3383
3384 u16 num_channels;
3385/* New number of channels after detecting a change in the
3386 * bitstream.
3387 * Supported values: 1 to 8
3388 */
3389
3390
3391 u16 reserved;
3392 /* Reserved for future use. This field must be set to 0.*/
3393
3394 u8 channel_mapping[8];
3395
3396} __packed;
3397
3398/* Notifies the client of a data sampling rate or channel mode
3399 * change. This event is raised by the encoder service.
3400 * This event is raised when :
3401 * - Native mode encoding was requested in the encoder
3402 * configuration (i.e., the channel number was 0), the sample rate
3403 * was 0, or both were 0.
3404 *
3405 * - The input data frame at the encoder is the first one, or the
3406 * sampling rate/channel mode is different from the previous input
3407 * data frame.
3408 *
3409 */
3410#define ASM_DATA_EVENT_ENC_SR_CM_CHANGE_NOTIFY 0x00010BDE
3411
3412struct asm_data_event_enc_sr_cm_change_notify {
3413 u32 sample_rate;
3414/* New sampling rate (in Hertz) after detecting a change in the
3415 * input data.
3416 * Supported values: 2000 to 48000
3417 */
3418
3419
3420 u16 num_channels;
3421/* New number of channels after detecting a change in the input
3422 * data. Supported values: 1 to 8
3423 */
3424
3425
3426 u16 bits_per_sample;
3427/* New bits per sample after detecting a change in the input
3428 * data.
3429 * Supported values: 16, 24
3430 */
3431
3432
3433 u8 channel_mapping[8];
3434
3435} __packed;
3436#define ASM_DATA_CMD_IEC_60958_FRAME_RATE 0x00010D87
3437
3438
3439/* Payload of the #ASM_DATA_CMD_IEC_60958_FRAME_RATE command,
3440 * which is used to indicate the IEC 60958 frame rate of a given
3441 * packetized audio stream.
3442 */
3443
3444struct asm_data_cmd_iec_60958_frame_rate {
3445 u32 frame_rate;
3446/* IEC 60958 frame rate of the incoming IEC 61937 packetized stream.
3447 * Supported values: Any valid frame rate
3448 */
3449} __packed;
3450
3451/* adsp_asm_data_commands.h*/
3452#define ASM_SVC_CMD_GET_STREAM_HANDLES 0x00010C0B
3453
3454#define ASM_SVC_CMDRSP_GET_STREAM_HANDLES 0x00010C1B
3455
3456/* Definition of the stream ID bitmask.*/
3457#define ASM_BIT_MASK_STREAM_ID (0x000000FFUL)
3458
3459/* Definition of the stream ID shift value.*/
3460#define ASM_SHIFT_STREAM_ID 0
3461
3462/* Definition of the session ID bitmask.*/
3463#define ASM_BIT_MASK_SESSION_ID (0x0000FF00UL)
3464
3465/* Definition of the session ID shift value.*/
3466#define ASM_SHIFT_SESSION_ID 8
3467
3468/* Definition of the service ID bitmask.*/
3469#define ASM_BIT_MASK_SERVICE_ID (0x00FF0000UL)
3470
3471/* Definition of the service ID shift value.*/
3472#define ASM_SHIFT_SERVICE_ID 16
3473
3474/* Definition of the domain ID bitmask.*/
3475#define ASM_BIT_MASK_DOMAIN_ID (0xFF000000UL)
3476
3477/* Definition of the domain ID shift value.*/
3478#define ASM_SHIFT_DOMAIN_ID 24
3479
3480/* Payload of the #ASM_SVC_CMDRSP_GET_STREAM_HANDLES message,
3481 * which returns a list of currently active stream handles.
3482 * Immediately following this structure are num_handles of uint32
3483 * stream handles.
3484 */
3485
3486
3487struct asm_svc_cmdrsp_get_stream_handles {
3488 u32 num_handles;
3489 /* Number of active stream handles. */
3490} __packed;
3491
3492#define ASM_CMD_SHARED_MEM_MAP_REGIONS 0x00010D92
3493#define ASM_CMDRSP_SHARED_MEM_MAP_REGIONS 0x00010D93
3494#define ASM_CMD_SHARED_MEM_UNMAP_REGIONS 0x00010D94
3495
3496/* adsp_asm_service_commands.h */
3497
3498#define ASM_MAX_SESSION_ID (8)
3499
3500/* Maximum number of sessions.*/
3501#define ASM_MAX_NUM_SESSIONS ASM_MAX_SESSION_ID
3502
3503/* Maximum number of streams per session.*/
3504#define ASM_MAX_STREAMS_PER_SESSION (8)
3505#define ASM_SESSION_CMD_RUN_V2 0x00010DAA
3506#define ASM_SESSION_CMD_RUN_STARTIME_RUN_IMMEDIATE 0
3507#define ASM_SESSION_CMD_RUN_STARTIME_RUN_AT_ABSOLUTEIME 1
3508#define ASM_SESSION_CMD_RUN_STARTIME_RUN_AT_RELATIVEIME 2
3509#define ASM_SESSION_CMD_RUN_STARTIME_RUN_WITH_DELAY 3
3510
3511#define ASM_BIT_MASK_RUN_STARTIME (0x00000003UL)
3512
3513/* Bit shift value used to specify the start time for the
3514 * ASM_SESSION_CMD_RUN_V2 command.
3515 */
3516#define ASM_SHIFT_RUN_STARTIME 0
3517struct asm_session_cmd_run_v2 {
3518 struct apr_hdr hdr;
3519 u32 flags;
3520/* Specifies whether to run immediately or at a specific
3521 * rendering time or with a specified delay. Run with delay is
3522 * useful for delaying in case of ASM loopback opened through
3523 * ASM_STREAM_CMD_OPEN_LOOPBACK_V2. Use #ASM_BIT_MASK_RUN_STARTIME
3524 * and #ASM_SHIFT_RUN_STARTIME to set this 2-bit flag.
3525 *
3526 *
3527 *Bits 0 and 1 can take one of four possible values:
3528 *
3529 *- #ASM_SESSION_CMD_RUN_STARTIME_RUN_IMMEDIATE
3530 *- #ASM_SESSION_CMD_RUN_STARTIME_RUN_AT_ABSOLUTEIME
3531 *- #ASM_SESSION_CMD_RUN_STARTIME_RUN_AT_RELATIVEIME
3532 *- #ASM_SESSION_CMD_RUN_STARTIME_RUN_WITH_DELAY
3533 *
3534 *All other bits are reserved; clients must set them to zero.
3535 */
3536
3537 u32 time_lsw;
3538/* Lower 32 bits of the time in microseconds used to align the
3539 * session origin time. When bits 0-1 of flags is
3540 * ASM_SESSION_CMD_RUN_START_RUN_WITH_DELAY, time lsw is the lsw of
3541 * the delay in us. For ASM_SESSION_CMD_RUN_START_RUN_WITH_DELAY,
3542 * maximum value of the 64 bit delay is 150 ms.
3543 */
3544
3545 u32 time_msw;
3546/* Upper 32 bits of the time in microseconds used to align the
3547 * session origin time. When bits 0-1 of flags is
3548 * ASM_SESSION_CMD_RUN_START_RUN_WITH_DELAY, time msw is the msw of
3549 * the delay in us. For ASM_SESSION_CMD_RUN_START_RUN_WITH_DELAY,
3550 * maximum value of the 64 bit delay is 150 ms.
3551 */
3552
3553} __packed;
3554
3555#define ASM_SESSION_CMD_PAUSE 0x00010BD3
3556#define ASM_SESSION_CMD_GET_SESSIONTIME_V3 0x00010D9D
3557#define ASM_SESSION_CMD_REGISTER_FOR_RX_UNDERFLOW_EVENTS 0x00010BD5
3558
3559struct asm_session_cmd_rgstr_rx_underflow {
3560 struct apr_hdr hdr;
3561 u16 enable_flag;
3562/* Specifies whether a client is to receive events when an Rx
3563 * session underflows.
3564 * Supported values:
3565 * - 0 -- Do not send underflow events
3566 * - 1 -- Send underflow events
3567 */
3568 u16 reserved;
3569 /* Reserved. This field must be set to zero.*/
3570} __packed;
3571
3572#define ASM_SESSION_CMD_REGISTER_FORX_OVERFLOW_EVENTS 0x00010BD6
3573
3574struct asm_session_cmd_regx_overflow {
3575 struct apr_hdr hdr;
3576 u16 enable_flag;
3577/* Specifies whether a client is to receive events when a Tx
3578* session overflows.
3579 * Supported values:
3580 * - 0 -- Do not send overflow events
3581 * - 1 -- Send overflow events
3582 */
3583
3584 u16 reserved;
3585 /* Reserved. This field must be set to zero.*/
3586} __packed;
3587
3588#define ASM_SESSION_EVENT_RX_UNDERFLOW 0x00010C17
3589#define ASM_SESSION_EVENTX_OVERFLOW 0x00010C18
3590#define ASM_SESSION_CMDRSP_GET_SESSIONTIME_V3 0x00010D9E
3591
3592struct asm_session_cmdrsp_get_sessiontime_v3 {
3593 u32 status;
3594 /* Status message (error code).
3595 * Supported values: Refer to @xhyperref{Q3,[Q3]}
3596 */
3597
3598 u32 sessiontime_lsw;
3599 /* Lower 32 bits of the current session time in microseconds.*/
3600
3601 u32 sessiontime_msw;
3602 /* Upper 32 bits of the current session time in microseconds.*/
3603
3604 u32 absolutetime_lsw;
3605/* Lower 32 bits in micro seconds of the absolute time at which
3606 * the * sample corresponding to the above session time gets
3607 * rendered * to hardware. This absolute time may be slightly in the
3608 * future or past.
3609 */
3610
3611
3612 u32 absolutetime_msw;
3613/* Upper 32 bits in micro seconds of the absolute time at which
3614 * the * sample corresponding to the above session time gets
3615 * rendered to * hardware. This absolute time may be slightly in the
3616 * future or past.
3617 */
3618
3619} __packed;
3620
3621#define ASM_SESSION_CMD_ADJUST_SESSION_CLOCK_V2 0x00010D9F
3622
3623struct asm_session_cmd_adjust_session_clock_v2 {
3624 struct apr_hdr hdr;
3625u32 adjustime_lsw;
3626/* Lower 32 bits of the signed 64-bit quantity that specifies the
3627 * adjustment time in microseconds to the session clock.
3628 *
3629 * Positive values indicate advancement of the session clock.
3630 * Negative values indicate delay of the session clock.
3631 */
3632
3633
3634 u32 adjustime_msw;
3635/* Upper 32 bits of the signed 64-bit quantity that specifies
3636 * the adjustment time in microseconds to the session clock.
3637 * Positive values indicate advancement of the session clock.
3638 * Negative values indicate delay of the session clock.
3639 */
3640
3641} __packed;
3642
3643#define ASM_SESSION_CMDRSP_ADJUST_SESSION_CLOCK_V2 0x00010DA0
3644
3645struct asm_session_cmdrsp_adjust_session_clock_v2 {
3646 u32 status;
3647/* Status message (error code).
3648 * Supported values: Refer to @xhyperref{Q3,[Q3]}
3649 * An error means the session clock is not adjusted. In this case,
3650 * the next two fields are irrelevant.
3651 */
3652
3653
3654 u32 actual_adjustime_lsw;
3655/* Lower 32 bits of the signed 64-bit quantity that specifies
3656 * the actual adjustment in microseconds performed by the aDSP.
3657 * A positive value indicates advancement of the session clock. A
3658 * negative value indicates delay of the session clock.
3659 */
3660
3661
3662 u32 actual_adjustime_msw;
3663/* Upper 32 bits of the signed 64-bit quantity that specifies
3664 * the actual adjustment in microseconds performed by the aDSP.
3665 * A positive value indicates advancement of the session clock. A
3666 * negative value indicates delay of the session clock.
3667 */
3668
3669
3670 u32 cmd_latency_lsw;
3671/* Lower 32 bits of the unsigned 64-bit quantity that specifies
3672 * the amount of time in microseconds taken to perform the session
3673 * clock adjustment.
3674 */
3675
3676
3677 u32 cmd_latency_msw;
3678/* Upper 32 bits of the unsigned 64-bit quantity that specifies
3679 * the amount of time in microseconds taken to perform the session
3680 * clock adjustment.
3681 */
3682
3683} __packed;
3684
3685#define ASM_SESSION_CMD_GET_PATH_DELAY_V2 0x00010DAF
3686#define ASM_SESSION_CMDRSP_GET_PATH_DELAY_V2 0x00010DB0
3687
3688struct asm_session_cmdrsp_get_path_delay_v2 {
3689 u32 status;
3690/* Status message (error code). Whether this get delay operation
3691 * is successful or not. Delay value is valid only if status is
3692 * success.
3693 * Supported values: Refer to @xhyperref{Q5,[Q5]}
3694 */
3695
3696 u32 audio_delay_lsw;
3697 /* Upper 32 bits of the aDSP delay in microseconds. */
3698
3699 u32 audio_delay_msw;
3700 /* Lower 32 bits of the aDSP delay in microseconds. */
3701
3702} __packed;
3703
3704/* adsp_asm_session_command.h*/
3705#define ASM_STREAM_CMD_OPEN_WRITE_V2 0x00010D8F
3706
3707struct asm_stream_cmd_open_write_v2 {
3708 struct apr_hdr hdr;
3709 uint32_t mode_flags;
3710/* Mode flags that configure the stream to notify the client
3711 * whenever it detects an SR/CM change at the input to its POPP.
3712 * Supported values for bits 0 to 1:
3713 * - Reserved; clients must set them to zero.
3714 * Supported values for bit 2:
3715 * - 0 -- SR/CM change notification event is disabled.
3716 * - 1 -- SR/CM change notification event is enabled.
3717 * - Use #ASM_BIT_MASK_SR_CM_CHANGE_NOTIFY_FLAG and
3718 * #ASM_SHIFT_SR_CM_CHANGE_NOTIFY_FLAG to set or get this bit.
3719 *
3720 * Supported values for bit 31:
3721 * - 0 -- Stream to be opened in on-Gapless mode.
3722 * - 1 -- Stream to be opened in Gapless mode. In Gapless mode,
3723 * successive streams must be opened with same session ID but
3724 * different stream IDs.
3725 *
3726 * - Use #ASM_BIT_MASK_GAPLESS_MODE_FLAG and
3727 * #ASM_SHIFT_GAPLESS_MODE_FLAG to set or get this bit.
3728 *
3729 *
3730 * @note1hang MIDI and DTMF streams cannot be opened in Gapless mode.
3731 */
3732
3733 uint16_t sink_endpointype;
3734/*< Sink point type.
3735 * Supported values:
3736 * - 0 -- Device matrix
3737 * - Other values are reserved.
3738 *
3739 * The device matrix is the gateway to the hardware ports.
3740 */
3741
3742 uint16_t bits_per_sample;
3743/*< Number of bits per sample processed by ASM modules.
3744 * Supported values: 16 and 24 bits per sample
3745 */
3746
3747 uint32_t postprocopo_id;
3748/*< Specifies the topology (order of processing) of
3749 * postprocessing algorithms. <i>None</i> means no postprocessing.
3750 * Supported values:
3751 * - #ASM_STREAM_POSTPROCOPO_ID_DEFAULT
3752 * - #ASM_STREAM_POSTPROCOPO_ID_MCH_PEAK_VOL
3753 * - #ASM_STREAM_POSTPROCOPO_ID_NONE
3754 *
3755 * This field can also be enabled through SetParams flags.
3756 */
3757
3758 uint32_t dec_fmt_id;
3759/*< Configuration ID of the decoder media format.
3760 *
3761 * Supported values:
3762 * - #ASM_MEDIA_FMT_MULTI_CHANNEL_PCM_V2
3763 * - #ASM_MEDIA_FMT_ADPCM
3764 * - #ASM_MEDIA_FMT_MP3
3765 * - #ASM_MEDIA_FMT_AAC_V2
3766 * - #ASM_MEDIA_FMT_DOLBY_AAC
3767 * - #ASM_MEDIA_FMT_AMRNB_FS
3768 * - #ASM_MEDIA_FMT_AMRWB_FS
3769 * - #ASM_MEDIA_FMT_AMR_WB_PLUS_V2
3770 * - #ASM_MEDIA_FMT_V13K_FS
3771 * - #ASM_MEDIA_FMT_EVRC_FS
3772 * - #ASM_MEDIA_FMT_EVRCB_FS
3773 * - #ASM_MEDIA_FMT_EVRCWB_FS
3774 * - #ASM_MEDIA_FMT_SBC
3775 * - #ASM_MEDIA_FMT_WMA_V10PRO_V2
3776 * - #ASM_MEDIA_FMT_WMA_V9_V2
3777 * - #ASM_MEDIA_FMT_AC3_DEC
3778 * - #ASM_MEDIA_FMT_EAC3_DEC
3779 * - #ASM_MEDIA_FMT_G711_ALAW_FS
3780 * - #ASM_MEDIA_FMT_G711_MLAW_FS
3781 * - #ASM_MEDIA_FMT_G729A_FS
3782 * - #ASM_MEDIA_FMT_FR_FS
3783 * - #ASM_MEDIA_FMT_VORBIS
3784 * - #ASM_MEDIA_FMT_FLAC
3785 * - #ASM_MEDIA_FMT_EXAMPLE
3786 */
3787} __packed;
3788
3789#define ASM_STREAM_CMD_OPEN_READ_V2 0x00010D8C
3790/* Definition of the timestamp type flag bitmask */
3791#define ASM_BIT_MASKIMESTAMPYPE_FLAG (0x00000020UL)
3792
3793/* Definition of the timestamp type flag shift value. */
3794#define ASM_SHIFTIMESTAMPYPE_FLAG 5
3795
3796/* Relative timestamp is identified by this value.*/
3797#define ASM_RELATIVEIMESTAMP 0
3798
3799/* Absolute timestamp is identified by this value.*/
3800#define ASM_ABSOLUTEIMESTAMP 1
3801
3802
3803struct asm_stream_cmd_open_read_v2 {
3804 struct apr_hdr hdr;
3805 u32 mode_flags;
3806/* Mode flags that indicate whether meta information per encoded
3807 * frame is to be provided.
3808 * Supported values for bit 4:
3809 *
3810 * - 0 -- Return data buffer contains all encoded frames only; it
3811 * does not contain frame metadata.
3812 *
3813 * - 1 -- Return data buffer contains an array of metadata and
3814 * encoded frames.
3815 *
3816 * - Use #ASM_BIT_MASK_META_INFO_FLAG as the bitmask and
3817 * #ASM_SHIFT_META_INFO_FLAG as the shift value for this bit.
3818 *
3819 *
3820 * Supported values for bit 5:
3821 *
3822 * - ASM_RELATIVEIMESTAMP -- ASM_DATA_EVENT_READ_DONE_V2 will have
3823 * - relative time-stamp.
3824 * - ASM_ABSOLUTEIMESTAMP -- ASM_DATA_EVENT_READ_DONE_V2 will
3825 * - have absolute time-stamp.
3826 *
3827 * - Use #ASM_BIT_MASKIMESTAMPYPE_FLAG as the bitmask and
3828 * #ASM_SHIFTIMESTAMPYPE_FLAG as the shift value for this bit.
3829 *
3830 * All other bits are reserved; clients must set them to zero.
3831 */
3832
3833 u32 src_endpointype;
3834/* Specifies the endpoint providing the input samples.
3835 * Supported values:
3836 * - 0 -- Device matrix
3837 * - All other values are reserved; clients must set them to zero.
3838 * Otherwise, an error is returned.
3839 * The device matrix is the gateway from the tunneled Tx ports.
3840 */
3841
3842 u32 preprocopo_id;
3843/* Specifies the topology (order of processing) of preprocessing
3844 * algorithms. <i>None</i> means no preprocessing.
3845 * Supported values:
3846 * - #ASM_STREAM_PREPROCOPO_ID_DEFAULT
3847 * - #ASM_STREAM_PREPROCOPO_ID_NONE
3848 *
3849 * This field can also be enabled through SetParams flags.
3850 */
3851
3852 u32 enc_cfg_id;
3853/* Media configuration ID for encoded output.
3854 * Supported values:
3855 * - #ASM_MEDIA_FMT_MULTI_CHANNEL_PCM_V2
3856 * - #ASM_MEDIA_FMT_AAC_V2
3857 * - #ASM_MEDIA_FMT_AMRNB_FS
3858 * - #ASM_MEDIA_FMT_AMRWB_FS
3859 * - #ASM_MEDIA_FMT_V13K_FS
3860 * - #ASM_MEDIA_FMT_EVRC_FS
3861 * - #ASM_MEDIA_FMT_EVRCB_FS
3862 * - #ASM_MEDIA_FMT_EVRCWB_FS
3863 * - #ASM_MEDIA_FMT_SBC
3864 * - #ASM_MEDIA_FMT_G711_ALAW_FS
3865 * - #ASM_MEDIA_FMT_G711_MLAW_FS
3866 * - #ASM_MEDIA_FMT_G729A_FS
3867 * - #ASM_MEDIA_FMT_EXAMPLE
3868 * - #ASM_MEDIA_FMT_WMA_V8
3869 */
3870
3871 u16 bits_per_sample;
3872/* Number of bits per sample processed by ASM modules.
3873 * Supported values: 16 and 24 bits per sample
3874 */
3875
3876 u16 reserved;
3877/* Reserved for future use. This field must be set to zero.*/
3878} __packed;
3879
3880#define ASM_POPP_OUTPUT_SR_NATIVE_RATE 0
3881
3882/* Enumeration for the maximum sampling rate at the POPP output.*/
3883#define ASM_POPP_OUTPUT_SR_MAX_RATE 48000
3884
3885#define ASM_STREAM_CMD_OPEN_READWRITE_V2 0x00010D8D
3886#define ASM_STREAM_CMD_OPEN_READWRITE_V2 0x00010D8D
3887#define ASM_STREAM_CMD_OPEN_READ_V2 0x00010D8C
3888
3889struct asm_stream_cmd_open_readwrite_v2 {
3890 struct apr_hdr hdr;
3891 u32 mode_flags;
3892/* Mode flags.
3893 * Supported values for bit 2:
3894 * - 0 -- SR/CM change notification event is disabled.
3895 * - 1 -- SR/CM change notification event is enabled. Use
3896 * #ASM_BIT_MASK_SR_CM_CHANGE_NOTIFY_FLAG and
3897 * #ASM_SHIFT_SR_CM_CHANGE_NOTIFY_FLAG to set or
3898 * getting this flag.
3899 *
3900 * Supported values for bit 4:
3901 * - 0 -- Return read data buffer contains all encoded frames only; it
3902 * does not contain frame metadata.
3903 * - 1 -- Return read data buffer contains an array of metadata and
3904 * encoded frames.
3905 *
3906 * All other bits are reserved; clients must set them to zero.
3907 */
3908
3909 u32 postprocopo_id;
3910/* Specifies the topology (order of processing) of postprocessing
3911 * algorithms. <i>None</i> means no postprocessing.
3912 *
3913 * Supported values:
3914 * - #ASM_STREAM_POSTPROCOPO_ID_DEFAULT
3915 * - #ASM_STREAM_POSTPROCOPO_ID_MCH_PEAK_VOL
3916 * - #ASM_STREAM_POSTPROCOPO_ID_NONE
3917 */
3918
3919 u32 dec_fmt_id;
3920/* Specifies the media type of the input data. PCM indicates that
3921 * no decoding must be performed, e.g., this is an NT encoder
3922 * session.
3923 * Supported values:
3924 * - #ASM_MEDIA_FMT_MULTI_CHANNEL_PCM_V2
3925 * - #ASM_MEDIA_FMT_ADPCM
3926 * - #ASM_MEDIA_FMT_MP3
3927 * - #ASM_MEDIA_FMT_AAC_V2
3928 * - #ASM_MEDIA_FMT_DOLBY_AAC
3929 * - #ASM_MEDIA_FMT_AMRNB_FS
3930 * - #ASM_MEDIA_FMT_AMRWB_FS
3931 * - #ASM_MEDIA_FMT_V13K_FS
3932 * - #ASM_MEDIA_FMT_EVRC_FS
3933 * - #ASM_MEDIA_FMT_EVRCB_FS
3934 * - #ASM_MEDIA_FMT_EVRCWB_FS
3935 * - #ASM_MEDIA_FMT_SBC
3936 * - #ASM_MEDIA_FMT_WMA_V10PRO_V2
3937 * - #ASM_MEDIA_FMT_WMA_V9_V2
3938 * - #ASM_MEDIA_FMT_AMR_WB_PLUS_V2
3939 * - #ASM_MEDIA_FMT_AC3_DEC
3940 * - #ASM_MEDIA_FMT_G711_ALAW_FS
3941 * - #ASM_MEDIA_FMT_G711_MLAW_FS
3942 * - #ASM_MEDIA_FMT_G729A_FS
3943 * - #ASM_MEDIA_FMT_EXAMPLE
3944 */
3945
3946 u32 enc_cfg_id;
3947/* Specifies the media type for the output of the stream. PCM
3948 * indicates that no encoding must be performed, e.g., this is an NT
3949 * decoder session.
3950 * Supported values:
3951 * - #ASM_MEDIA_FMT_MULTI_CHANNEL_PCM_V2
3952 * - #ASM_MEDIA_FMT_AAC_V2
3953 * - #ASM_MEDIA_FMT_AMRNB_FS
3954 * - #ASM_MEDIA_FMT_AMRWB_FS
3955 * - #ASM_MEDIA_FMT_V13K_FS
3956 * - #ASM_MEDIA_FMT_EVRC_FS
3957 * - #ASM_MEDIA_FMT_EVRCB_FS
3958 * - #ASM_MEDIA_FMT_EVRCWB_FS
3959 * - #ASM_MEDIA_FMT_SBC
3960 * - #ASM_MEDIA_FMT_G711_ALAW_FS
3961 * - #ASM_MEDIA_FMT_G711_MLAW_FS
3962 * - #ASM_MEDIA_FMT_G729A_FS
3963 * - #ASM_MEDIA_FMT_EXAMPLE
3964 * - #ASM_MEDIA_FMT_WMA_V8
3965 */
3966
3967 u16 bits_per_sample;
3968/* Number of bits per sample processed by ASM modules.
3969 * Supported values: 16 and 24 bits per sample
3970 */
3971
3972 u16 reserved;
3973/* Reserved for future use. This field must be set to zero.*/
3974
3975} __packed;
3976
3977#define ASM_STREAM_CMD_OPEN_LOOPBACK_V2 0x00010D8E
3978struct asm_stream_cmd_open_loopback_v2 {
3979 struct apr_hdr hdr;
3980 u32 mode_flags;
3981/* Mode flags.
3982 * Bit 0-31: reserved; client should set these bits to 0
3983 */
3984 u16 src_endpointype;
3985 /* Endpoint type. 0 = Tx Matrix */
3986 u16 sink_endpointype;
3987 /* Endpoint type. 0 = Rx Matrix */
3988 u32 postprocopo_id;
3989/* Postprocessor topology ID. Specifies the topology of
3990 * postprocessing algorithms.
3991 */
3992
3993 u16 bits_per_sample;
3994/* The number of bits per sample processed by ASM modules
3995 * Supported values: 16 and 24 bits per sample
3996 */
3997 u16 reserved;
3998/* Reserved for future use. This field must be set to zero. */
3999} __packed;
4000
4001#define ASM_STREAM_CMD_CLOSE 0x00010BCD
4002#define ASM_STREAM_CMD_FLUSH 0x00010BCE
4003
4004
4005#define ASM_STREAM_CMD_FLUSH_READBUFS 0x00010C09
4006#define ASM_STREAM_CMD_SET_PP_PARAMS_V2 0x00010DA1
4007
4008struct asm_stream_cmd_set_pp_params_v2 {
4009 u32 data_payload_addr_lsw;
4010/* LSW of parameter data payload address. Supported values: any. */
4011 u32 data_payload_addr_msw;
4012/* MSW of Parameter data payload address. Supported values: any.
4013 * - Must be set to zero for in-band data.
4014 * - In the case of 32 bit Shared memory address, msw field must be
4015 * - set to zero.
4016 * - In the case of 36 bit shared memory address, bit 31 to bit 4 of
4017 * msw
4018 *
4019 * - must be set to zero.
4020 */
4021 u32 mem_map_handle;
4022/* Supported Values: Any.
4023* memory map handle returned by DSP through
4024* ASM_CMD_SHARED_MEM_MAP_REGIONS
4025* command.
4026* if mmhandle is NULL, the ParamData payloads are within the
4027* message payload (in-band).
4028* If mmhandle is non-NULL, the ParamData payloads begin at the
4029* address specified in the address msw and lsw (out-of-band).
4030*/
4031
4032 u32 data_payload_size;
4033/* Size in bytes of the variable payload accompanying the
4034message, or in shared memory. This field is used for parsing the
4035parameter payload. */
4036
4037} __packed;
4038
4039
4040struct asm_stream_param_data_v2 {
4041 u32 module_id;
4042 /* Unique module ID. */
4043
4044 u32 param_id;
4045 /* Unique parameter ID. */
4046
4047 u16 param_size;
4048/* Data size of the param_id/module_id combination. This is
4049 * a multiple of 4 bytes.
4050 */
4051
4052 u16 reserved;
4053/* Reserved for future enhancements. This field must be set to
4054 * zero.
4055 */
4056
4057} __packed;
4058
4059#define ASM_STREAM_CMD_GET_PP_PARAMS_V2 0x00010DA2
4060
4061struct asm_stream_cmd_get_pp_params_v2 {
4062 u32 data_payload_addr_lsw;
4063 /* LSW of the parameter data payload address. */
4064 u32 data_payload_addr_msw;
4065/* MSW of the parameter data payload address.
4066 * - Size of the shared memory, if specified, shall be large enough
4067 * to contain the whole ParamData payload, including Module ID,
4068 * Param ID, Param Size, and Param Values
4069 * - Must be set to zero for in-band data
4070 * - In the case of 32 bit Shared memory address, msw field must be
4071 * set to zero.
4072 * - In the case of 36 bit shared memory address, bit 31 to bit 4 of
4073 * msw must be set to zero.
4074 */
4075
4076 u32 mem_map_handle;
4077/* Supported Values: Any.
4078* memory map handle returned by DSP through ASM_CMD_SHARED_MEM_MAP_REGIONS
4079* command.
4080* if mmhandle is NULL, the ParamData payloads in the ACK are within the
4081* message payload (in-band).
4082* If mmhandle is non-NULL, the ParamData payloads in the ACK begin at the
4083* address specified in the address msw and lsw.
4084* (out-of-band).
4085*/
4086
4087 u32 module_id;
4088 /* Unique module ID. */
4089
4090 u32 param_id;
4091 /* Unique parameter ID. */
4092
4093 u16 param_max_size;
4094/* Maximum data size of the module_id/param_id combination. This
4095 * is a multiple of 4 bytes.
4096 */
4097
4098
4099 u16 reserved;
4100/* Reserved for backward compatibility. Clients must set this
4101* field to zero.
4102*/
4103
4104} __packed;
4105
4106#define ASM_STREAM_CMD_SET_ENCDEC_PARAM 0x00010C10
4107
4108#define ASM_PARAM_ID_ENCDEC_BITRATE 0x00010C13
4109
4110struct asm_bitrate_param {
4111 u32 bitrate;
4112/* Maximum supported bitrate. Only the AAC encoder is supported.*/
4113
4114} __packed;
4115
4116#define ASM_PARAM_ID_ENCDEC_ENC_CFG_BLK_V2 0x00010DA3
4117#define ASM_PARAM_ID_AAC_SBR_PS_FLAG 0x00010C63
4118
4119/* Flag to turn off both SBR and PS processing, if they are
4120 * present in the bitstream.
4121 */
4122
4123#define ASM_AAC_SBR_OFF_PS_OFF (2)
4124
4125/* Flag to turn on SBR but turn off PS processing,if they are
4126 * present in the bitstream.
4127 */
4128
4129#define ASM_AAC_SBR_ON_PS_OFF (1)
4130
4131/* Flag to turn on both SBR and PS processing, if they are
4132 * present in the bitstream (default behavior).
4133 */
4134
4135
4136#define ASM_AAC_SBR_ON_PS_ON (0)
4137
4138/* Structure for an AAC SBR PS processing flag. */
4139
4140/* Payload of the #ASM_PARAM_ID_AAC_SBR_PS_FLAG parameter in the
4141 * #ASM_STREAM_CMD_SET_ENCDEC_PARAM command.
4142 */
4143struct asm_aac_sbr_ps_flag_param {
4144 struct apr_hdr hdr;
4145 struct asm_stream_cmd_set_encdec_param encdec;
4146 struct asm_enc_cfg_blk_param_v2 encblk;
4147
4148 u32 sbr_ps_flag;
4149/* Control parameter to enable or disable SBR/PS processing in
4150 * the AAC bitstream. Use the following macros to set this field:
4151 * - #ASM_AAC_SBR_OFF_PS_OFF -- Turn off both SBR and PS
4152 * processing, if they are present in the bitstream.
4153 * - #ASM_AAC_SBR_ON_PS_OFF -- Turn on SBR processing, but not PS
4154 * processing, if they are present in the bitstream.
4155 * - #ASM_AAC_SBR_ON_PS_ON -- Turn on both SBR and PS processing,
4156 * if they are present in the bitstream (default behavior).
4157 * - All other values are invalid.
4158 * Changes are applied to the next decoded frame.
4159 */
4160} __packed;
4161
4162#define ASM_PARAM_ID_AAC_DUAL_MONO_MAPPING 0x00010C64
4163
4164/* First single channel element in a dual mono bitstream.*/
4165#define ASM_AAC_DUAL_MONO_MAP_SCE_1 (1)
4166
4167/* Second single channel element in a dual mono bitstream.*/
4168#define ASM_AAC_DUAL_MONO_MAP_SCE_2 (2)
4169
4170/* Structure for AAC decoder dual mono channel mapping. */
4171
4172
4173struct asm_aac_dual_mono_mapping_param {
4174 struct apr_hdr hdr;
4175 struct asm_stream_cmd_set_encdec_param encdec;
4176 struct asm_enc_cfg_blk_param_v2 encblk;
4177 u16 left_channel_sce;
4178 u16 right_channel_sce;
4179
4180} __packed;
4181
4182#define ASM_STREAM_CMDRSP_GET_PP_PARAMS_V2 0x00010DA4
4183
4184struct asm_stream_cmdrsp_get_pp_params_v2 {
4185 u32 status;
4186} __packed;
4187
4188#define ASM_PARAM_ID_AC3_KARAOKE_MODE 0x00010D73
4189
4190/* Enumeration for both vocals in a karaoke stream.*/
4191#define AC3_KARAOKE_MODE_NO_VOCAL (0)
4192
4193/* Enumeration for only the left vocal in a karaoke stream.*/
4194#define AC3_KARAOKE_MODE_LEFT_VOCAL (1)
4195
4196/* Enumeration for only the right vocal in a karaoke stream.*/
4197#define AC3_KARAOKE_MODE_RIGHT_VOCAL (2)
4198
4199/* Enumeration for both vocal channels in a karaoke stream.*/
4200#define AC3_KARAOKE_MODE_BOTH_VOCAL (3)
4201#define ASM_PARAM_ID_AC3_DRC_MODE 0x00010D74
4202/* Enumeration for the Custom Analog mode.*/
4203#define AC3_DRC_MODE_CUSTOM_ANALOG (0)
4204
4205/* Enumeration for the Custom Digital mode.*/
4206#define AC3_DRC_MODE_CUSTOM_DIGITAL (1)
4207/* Enumeration for the Line Out mode (light compression).*/
4208#define AC3_DRC_MODE_LINE_OUT (2)
4209
4210/* Enumeration for the RF remodulation mode (heavy compression).*/
4211#define AC3_DRC_MODE_RF_REMOD (3)
4212#define ASM_PARAM_ID_AC3_DUAL_MONO_MODE 0x00010D75
4213
4214/* Enumeration for playing dual mono in stereo mode.*/
4215#define AC3_DUAL_MONO_MODE_STEREO (0)
4216
4217/* Enumeration for playing left mono.*/
4218#define AC3_DUAL_MONO_MODE_LEFT_MONO (1)
4219
4220/* Enumeration for playing right mono.*/
4221#define AC3_DUAL_MONO_MODE_RIGHT_MONO (2)
4222
4223/* Enumeration for mixing both dual mono channels and playing them.*/
4224#define AC3_DUAL_MONO_MODE_MIXED_MONO (3)
4225#define ASM_PARAM_ID_AC3_STEREO_DOWNMIX_MODE 0x00010D76
4226
4227/* Enumeration for using the Downmix mode indicated in the bitstream. */
4228
4229#define AC3_STEREO_DOWNMIX_MODE_AUTO_DETECT (0)
4230
4231/* Enumeration for Surround Compatible mode (preserves the
4232 * surround information).
4233 */
4234
4235#define AC3_STEREO_DOWNMIX_MODE_LT_RT (1)
4236/* Enumeration for Mono Compatible mode (if the output is to be
4237 * further downmixed to mono).
4238 */
4239
4240#define AC3_STEREO_DOWNMIX_MODE_LO_RO (2)
4241
4242/* ID of the AC3 PCM scale factor parameter in the
4243 * #ASM_STREAM_CMD_SET_ENCDEC_PARAM command.
4244 */
4245#define ASM_PARAM_ID_AC3_PCM_SCALEFACTOR 0x00010D78
4246
4247/* ID of the AC3 DRC boost scale factor parameter in the
4248 * #ASM_STREAM_CMD_SET_ENCDEC_PARAM command.
4249 */
4250#define ASM_PARAM_ID_AC3_DRC_BOOST_SCALEFACTOR 0x00010D79
4251
4252/* ID of the AC3 DRC cut scale factor parameter in the
4253 * #ASM_STREAM_CMD_SET_ENCDEC_PARAM command.
4254 */
4255#define ASM_PARAM_ID_AC3_DRC_CUT_SCALEFACTOR 0x00010D7A
4256
4257/* Structure for AC3 Generic Parameter. */
4258
4259/* Payload of the AC3 parameters in the
4260 * #ASM_STREAM_CMD_SET_ENCDEC_PARAM command.
4261 */
4262struct asm_ac3_generic_param {
4263 struct apr_hdr hdr;
4264 struct asm_stream_cmd_set_encdec_param encdec;
4265 struct asm_enc_cfg_blk_param_v2 encblk;
4266 u32 generic_parameter;
4267/* AC3 generic parameter. Select from one of the following
4268 * possible values.
4269 *
4270 * For #ASM_PARAM_ID_AC3_KARAOKE_MODE, supported values are:
4271 * - AC3_KARAOKE_MODE_NO_VOCAL
4272 * - AC3_KARAOKE_MODE_LEFT_VOCAL
4273 * - AC3_KARAOKE_MODE_RIGHT_VOCAL
4274 * - AC3_KARAOKE_MODE_BOTH_VOCAL
4275 *
4276 * For #ASM_PARAM_ID_AC3_DRC_MODE, supported values are:
4277 * - AC3_DRC_MODE_CUSTOM_ANALOG
4278 * - AC3_DRC_MODE_CUSTOM_DIGITAL
4279 * - AC3_DRC_MODE_LINE_OUT
4280 * - AC3_DRC_MODE_RF_REMOD
4281 *
4282 * For #ASM_PARAM_ID_AC3_DUAL_MONO_MODE, supported values are:
4283 * - AC3_DUAL_MONO_MODE_STEREO
4284 * - AC3_DUAL_MONO_MODE_LEFT_MONO
4285 * - AC3_DUAL_MONO_MODE_RIGHT_MONO
4286 * - AC3_DUAL_MONO_MODE_MIXED_MONO
4287 *
4288 * For #ASM_PARAM_ID_AC3_STEREO_DOWNMIX_MODE, supported values are:
4289 * - AC3_STEREO_DOWNMIX_MODE_AUTO_DETECT
4290 * - AC3_STEREO_DOWNMIX_MODE_LT_RT
4291 * - AC3_STEREO_DOWNMIX_MODE_LO_RO
4292 *
4293 * For #ASM_PARAM_ID_AC3_PCM_SCALEFACTOR, supported values are
4294 * 0 to 1 in Q31 format.
4295 *
4296 * For #ASM_PARAM_ID_AC3_DRC_BOOST_SCALEFACTOR, supported values are
4297 * 0 to 1 in Q31 format.
4298 *
4299 * For #ASM_PARAM_ID_AC3_DRC_CUT_SCALEFACTOR, supported values are
4300 * 0 to 1 in Q31 format.
4301 */
4302} __packed;
4303
4304/* Enumeration for Raw mode (no downmixing), which specifies
4305 * that all channels in the bitstream are to be played out as is
4306 * without any downmixing. (Default)
4307 */
4308
4309#define WMAPRO_CHANNEL_MASK_RAW (-1)
4310
4311/* Enumeration for setting the channel mask to 0. The 7.1 mode
4312 * (Home Theater) is assigned.
4313 */
4314
4315
4316#define WMAPRO_CHANNEL_MASK_ZERO 0x0000
4317
4318/* Speaker layout mask for one channel (Home Theater, mono).
4319 * - Speaker front center
4320 */
4321#define WMAPRO_CHANNEL_MASK_1_C 0x0004
4322
4323/* Speaker layout mask for two channels (Home Theater, stereo).
4324 * - Speaker front left
4325 * - Speaker front right
4326 */
4327#define WMAPRO_CHANNEL_MASK_2_L_R 0x0003
4328
4329/* Speaker layout mask for three channels (Home Theater).
4330 * - Speaker front left
4331 * - Speaker front right
4332 * - Speaker front center
4333 */
4334#define WMAPRO_CHANNEL_MASK_3_L_C_R 0x0007
4335
4336/* Speaker layout mask for two channels (stereo).
4337 * - Speaker back left
4338 * - Speaker back right
4339 */
4340#define WMAPRO_CHANNEL_MASK_2_Bl_Br 0x0030
4341
4342/* Speaker layout mask for four channels.
4343 * - Speaker front left
4344 * - Speaker front right
4345 * - Speaker back left
4346 * - Speaker back right
4347*/
4348#define WMAPRO_CHANNEL_MASK_4_L_R_Bl_Br 0x0033
4349
4350/* Speaker layout mask for four channels (Home Theater).
4351 * - Speaker front left
4352 * - Speaker front right
4353 * - Speaker front center
4354 * - Speaker back center
4355*/
4356#define WMAPRO_CHANNEL_MASK_4_L_R_C_Bc_HT 0x0107
4357/* Speaker layout mask for five channels.
4358 * - Speaker front left
4359 * - Speaker front right
4360 * - Speaker front center
4361 * - Speaker back left
4362 * - Speaker back right
4363 */
4364#define WMAPRO_CHANNEL_MASK_5_L_C_R_Bl_Br 0x0037
4365
4366/* Speaker layout mask for five channels (5 mode, Home Theater).
4367 * - Speaker front left
4368 * - Speaker front right
4369 * - Speaker front center
4370 * - Speaker side left
4371 * - Speaker side right
4372 */
4373#define WMAPRO_CHANNEL_MASK_5_L_C_R_Sl_Sr_HT 0x0607
4374/* Speaker layout mask for six channels (5.1 mode).
4375 * - Speaker front left
4376 * - Speaker front right
4377 * - Speaker front center
4378 * - Speaker low frequency
4379 * - Speaker back left
4380 * - Speaker back right
4381 */
4382#define WMAPRO_CHANNEL_MASK_5DOT1_L_C_R_Bl_Br_SLF 0x003F
4383/* Speaker layout mask for six channels (5.1 mode, Home Theater).
4384 * - Speaker front left
4385 * - Speaker front right
4386 * - Speaker front center
4387 * - Speaker low frequency
4388 * - Speaker side left
4389 * - Speaker side right
4390 */
4391#define WMAPRO_CHANNEL_MASK_5DOT1_L_C_R_Sl_Sr_SLF_HT 0x060F
4392/* Speaker layout mask for six channels (5.1 mode, no LFE).
4393 * - Speaker front left
4394 * - Speaker front right
4395 * - Speaker front center
4396 * - Speaker back left
4397 * - Speaker back right
4398 * - Speaker back center
4399 */
4400#define WMAPRO_CHANNEL_MASK_5DOT1_L_C_R_Bl_Br_Bc 0x0137
4401/* Speaker layout mask for six channels (5.1 mode, Home Theater,
4402 * no LFE).
4403 * - Speaker front left
4404 * - Speaker front right
4405 * - Speaker front center
4406 * - Speaker back center
4407 * - Speaker side left
4408 * - Speaker side right
4409 */
4410#define WMAPRO_CHANNEL_MASK_5DOT1_L_C_R_Sl_Sr_Bc_HT 0x0707
4411
4412/* Speaker layout mask for seven channels (6.1 mode).
4413 * - Speaker front left
4414 * - Speaker front right
4415 * - Speaker front center
4416 * - Speaker low frequency
4417 * - Speaker back left
4418 * - Speaker back right
4419 * - Speaker back center
4420 */
4421#define WMAPRO_CHANNEL_MASK_6DOT1_L_C_R_Bl_Br_Bc_SLF 0x013F
4422
4423/* Speaker layout mask for seven channels (6.1 mode, Home
4424 * Theater).
4425 * - Speaker front left
4426 * - Speaker front right
4427 * - Speaker front center
4428 * - Speaker low frequency
4429 * - Speaker back center
4430 * - Speaker side left
4431 * - Speaker side right
4432*/
4433#define WMAPRO_CHANNEL_MASK_6DOT1_L_C_R_Sl_Sr_Bc_SLF_HT 0x070F
4434
4435/* Speaker layout mask for seven channels (6.1 mode, no LFE).
4436 * - Speaker front left
4437 * - Speaker front right
4438 * - Speaker front center
4439 * - Speaker back left
4440 * - Speaker back right
4441 * - Speaker front left of center
4442 * - Speaker front right of center
4443*/
4444#define WMAPRO_CHANNEL_MASK_6DOT1_L_C_R_Bl_Br_SFLOC_SFROC 0x00F7
4445
4446/* Speaker layout mask for seven channels (6.1 mode, Home
4447 * Theater, no LFE).
4448 * - Speaker front left
4449 * - Speaker front right
4450 * - Speaker front center
4451 * - Speaker side left
4452 * - Speaker side right
4453 * - Speaker front left of center
4454 * - Speaker front right of center
4455*/
4456#define WMAPRO_CHANNEL_MASK_6DOT1_L_C_R_Sl_Sr_SFLOC_SFROC_HT 0x0637
4457
4458/* Speaker layout mask for eight channels (7.1 mode).
4459 * - Speaker front left
4460 * - Speaker front right
4461 * - Speaker front center
4462 * - Speaker back left
4463 * - Speaker back right
4464 * - Speaker low frequency
4465 * - Speaker front left of center
4466 * - Speaker front right of center
4467 */
4468#define WMAPRO_CHANNEL_MASK_7DOT1_L_C_R_Bl_Br_SLF_SFLOC_SFROC \
4469 0x00FF
4470
4471/* Speaker layout mask for eight channels (7.1 mode, Home Theater).
4472 * - Speaker front left
4473 * - Speaker front right
4474 * - Speaker front center
4475 * - Speaker side left
4476 * - Speaker side right
4477 * - Speaker low frequency
4478 * - Speaker front left of center
4479 * - Speaker front right of center
4480 *
4481*/
4482#define WMAPRO_CHANNEL_MASK_7DOT1_L_C_R_Sl_Sr_SLF_SFLOC_SFROC_HT \
4483 0x063F
4484
4485#define ASM_PARAM_ID_DEC_OUTPUT_CHAN_MAP 0x00010D82
4486
4487/* Maximum number of decoder output channels.*/
4488#define MAX_CHAN_MAP_CHANNELS 16
4489
4490/* Structure for decoder output channel mapping. */
4491
4492/* Payload of the #ASM_PARAM_ID_DEC_OUTPUT_CHAN_MAP parameter in the
4493 * #ASM_STREAM_CMD_SET_ENCDEC_PARAM command.
4494 */
4495struct asm_dec_out_chan_map_param {
4496 struct apr_hdr hdr;
4497 struct asm_stream_cmd_set_encdec_param encdec;
4498 struct asm_enc_cfg_blk_param_v2 encblk;
4499 u32 num_channels;
4500/* Number of decoder output channels.
4501 * Supported values: 0 to #MAX_CHAN_MAP_CHANNELS
4502 *
4503 * A value of 0 indicates native channel mapping, which is valid
4504 * only for NT mode. This means the output of the decoder is to be
4505 * preserved as is.
4506 */
4507 u8 channel_mapping[MAX_CHAN_MAP_CHANNELS];
4508} __packed;
4509
4510#define ASM_STREAM_CMD_OPEN_WRITE_COMPRESSED 0x00010D84
4511
4512/* Bitmask for the IEC 61937 enable flag.*/
4513#define ASM_BIT_MASK_IEC_61937_STREAM_FLAG (0x00000001UL)
4514
4515/* Shift value for the IEC 61937 enable flag.*/
4516#define ASM_SHIFT_IEC_61937_STREAM_FLAG 0
4517
4518/* Bitmask for the IEC 60958 enable flag.*/
4519#define ASM_BIT_MASK_IEC_60958_STREAM_FLAG (0x00000002UL)
4520
4521/* Shift value for the IEC 60958 enable flag.*/
4522#define ASM_SHIFT_IEC_60958_STREAM_FLAG 1
4523
4524/* Payload format for open write compressed comand */
4525
4526/* Payload format for the #ASM_STREAM_CMD_OPEN_WRITE_COMPRESSED
4527 * comand, which opens a stream for a given session ID and stream ID
4528 * to be rendered in the compressed format.
4529 */
4530
4531struct asm_stream_cmd_open_write_compressed {
4532 struct apr_hdr hdr;
4533 u32 flags;
4534/* Mode flags that configure the stream for a specific format.
4535 * Supported values:
4536 * - Bit 0 -- IEC 61937 compatibility
4537 * - 0 -- Stream is not in IEC 61937 format
4538 * - 1 -- Stream is in IEC 61937 format
4539 * - Bit 1 -- IEC 60958 compatibility
4540 * - 0 -- Stream is not in IEC 60958 format
4541 * - 1 -- Stream is in IEC 60958 format
4542 * - Bits 2 to 31 -- 0 (Reserved)
4543 *
4544 * For the same stream, bit 0 cannot be set to 0 and bit 1 cannot
4545 * be set to 1. A compressed stream connot have IEC 60958
4546 * packetization applied without IEC 61937 packetization.
4547 * @note1hang Currently, IEC 60958 packetized input streams are not
4548 * supported.
4549 */
4550
4551
4552 u32 fmt_id;
4553/* Specifies the media type of the HDMI stream to be opened.
4554 * Supported values:
4555 * - #ASM_MEDIA_FMT_AC3_DEC
4556 * - #ASM_MEDIA_FMT_EAC3_DEC
4557 * - #ASM_MEDIA_FMT_DTS
4558 * - #ASM_MEDIA_FMT_ATRAC
4559 * - #ASM_MEDIA_FMT_MAT
4560 *
4561 * @note1hang This field must be set to a valid media type even if
4562 * IEC 61937 packetization is not performed by the aDSP.
4563 */
4564
4565} __packed;
4566
4567#define ASM_STREAM_CMD_OPEN_READ_COMPRESSED 0x00010D95
4568
4569struct asm_stream_cmd_open_read_compressed {
4570 struct apr_hdr hdr;
4571 u32 mode_flags;
4572/* Mode flags that indicate whether meta information per encoded
4573 * frame is to be provided.
4574 * Supported values for bit 4:
4575 * - 0 -- Return data buffer contains all encoded frames only; it does
4576 * not contain frame metadata.
4577 * - 1 -- Return data buffer contains an array of metadata and encoded
4578 * frames.
4579 * - Use #ASM_BIT_MASK_META_INFO_FLAG to set the bitmask and
4580 * #ASM_SHIFT_META_INFO_FLAG to set the shift value for this bit.
4581 * All other bits are reserved; clients must set them to zero.
4582 */
4583
4584 u32 frames_per_buf;
4585/* Indicates the number of frames that need to be returned per
4586 * read buffer
4587 * Supported values: should be greater than 0
4588 */
4589
4590} __packed;
4591
4592/* adsp_asm_stream_commands.h*/
4593
4594
4595/* adsp_asm_api.h (no changes)*/
4596#define ASM_STREAM_POSTPROCOPO_ID_DEFAULT \
4597 0x00010BE4
4598#define ASM_STREAM_POSTPROCOPO_ID_PEAKMETER \
4599 0x00010D83
4600#define ASM_STREAM_POSTPROCOPO_ID_NONE \
4601 0x00010C68
4602#define ASM_STREAM_POSTPROCOPO_ID_MCH_PEAK_VOL \
4603 0x00010D8B
4604#define ASM_STREAM_PREPROCOPO_ID_DEFAULT \
4605 ASM_STREAM_POSTPROCOPO_ID_DEFAULT
4606#define ASM_STREAM_PREPROCOPO_ID_NONE \
4607 ASM_STREAM_POSTPROCOPO_ID_NONE
4608#define ADM_CMD_COPP_OPENOPOLOGY_ID_NONE_AUDIO_COPP \
4609 0x00010312
4610#define ADM_CMD_COPP_OPENOPOLOGY_ID_SPEAKER_MONO_AUDIO_COPP \
4611 0x00010313
4612#define ADM_CMD_COPP_OPENOPOLOGY_ID_SPEAKER_STEREO_AUDIO_COPP \
4613 0x00010314
4614#define ADM_CMD_COPP_OPENOPOLOGY_ID_SPEAKER_STEREO_IIR_AUDIO_COPP\
4615 0x00010704
4616#define ADM_CMD_COPP_OPENOPOLOGY_ID_SPEAKER_MONO_AUDIO_COPP_MBDRCV2\
4617 0x0001070D
4618#define ADM_CMD_COPP_OPENOPOLOGY_ID_SPEAKER_STEREO_AUDIO_COPP_MBDRCV2\
4619 0x0001070E
4620#define ADM_CMD_COPP_OPENOPOLOGY_ID_SPEAKER_STEREO_IIR_AUDIO_COPP_MBDRCV2\
4621 0x0001070F
4622#define ADM_CMD_COPP_OPENOPOLOGY_ID_SPEAKER_MCH_PEAK_VOL \
4623 0x0001031B
4624#define ADM_CMD_COPP_OPENOPOLOGY_ID_MIC_MONO_AUDIO_COPP 0x00010315
4625#define ADM_CMD_COPP_OPENOPOLOGY_ID_MIC_STEREO_AUDIO_COPP 0x00010316
4626#define AUDPROC_COPPOPOLOGY_ID_MCHAN_IIR_AUDIO 0x00010715
4627#define ADM_CMD_COPP_OPENOPOLOGY_ID_DEFAULT_AUDIO_COPP 0x00010BE3
4628#define ADM_CMD_COPP_OPENOPOLOGY_ID_PEAKMETER_AUDIO_COPP 0x00010317
4629#define AUDPROC_MODULE_ID_AIG 0x00010716
4630#define AUDPROC_PARAM_ID_AIG_ENABLE 0x00010717
4631#define AUDPROC_PARAM_ID_AIG_CONFIG 0x00010718
4632
4633struct Audio_AigParam {
4634 uint16_t mode;
4635/*< Mode word for enabling AIG/SIG mode .
4636 * Byte offset: 0
4637 */
4638 int16_t staticGainL16Q12;
4639/*< Static input gain when aigMode is set to 1.
4640 * Byte offset: 2
4641 */
4642 int16_t initialGainDBL16Q7;
4643/*<Initial value that the adaptive gain update starts from dB
4644 * Q7 Byte offset: 4
4645 */
4646 int16_t idealRMSDBL16Q7;
4647/*<Average RMS level that AIG attempts to achieve Q8.7
4648 * Byte offset: 6
4649 */
4650 int32_t noiseGateL32;
4651/*Threshold below which signal is considered as noise and AIG
4652 * Byte offset: 8
4653 */
4654 int32_t minGainL32Q15;
4655/*Minimum gain that can be provided by AIG Q16.15
4656 * Byte offset: 12
4657 */
4658 int32_t maxGainL32Q15;
4659/*Maximum gain that can be provided by AIG Q16.15
4660 * Byte offset: 16
4661 */
4662 uint32_t gainAtRtUL32Q31;
4663/*Attack/release time for AIG update Q1.31
4664 * Byte offset: 20
4665 */
4666 uint32_t longGainAtRtUL32Q31;
4667/*Long attack/release time while updating gain for
4668 * noise/silence Q1.31 Byte offset: 24
4669 */
4670
4671 uint32_t rmsTavUL32Q32;
4672/* RMS smoothing time constant used for long-term RMS estimate
4673 * Q0.32 Byte offset: 28
4674 */
4675
4676 uint32_t gainUpdateStartTimMsUL32Q0;
4677/* The waiting time before which AIG starts to apply adaptive
4678 * gain update Q32.0 Byte offset: 32
4679 */
4680
4681} __packed;
4682
4683
4684#define ADM_MODULE_ID_EANS 0x00010C4A
4685#define ADM_PARAM_ID_EANS_ENABLE 0x00010C4B
4686#define ADM_PARAM_ID_EANS_PARAMS 0x00010C4C
4687
4688struct adm_eans_enable {
4689
4690 uint32_t enable_flag;
4691/*< Specifies whether EANS is disabled (0) or enabled
4692 * (nonzero).
4693 * This is supported only for sampling rates of 8, 12, 16, 24, 32,
4694 * and 48 kHz. It is not supported for sampling rates of 11.025,
4695 * 22.05, or 44.1 kHz.
4696 */
4697
4698} __packed;
4699
4700
4701struct adm_eans_params {
4702 int16_t eans_mode;
4703/*< Mode word for enabling/disabling submodules.
4704 * Byte offset: 0
4705 */
4706
4707 int16_t eans_input_gain;
4708/*< Q2.13 input gain to the EANS module.
4709 * Byte offset: 2
4710 */
4711
4712 int16_t eans_output_gain;
4713/*< Q2.13 output gain to the EANS module.
4714 * Byte offset: 4
4715 */
4716
4717 int16_t eansarget_ns;
4718/*< Target noise suppression level in dB.
4719 * Byte offset: 6
4720 */
4721
4722 int16_t eans_s_alpha;
4723/*< Q3.12 over-subtraction factor for stationary noise
4724 * suppression.
4725 * Byte offset: 8
4726 */
4727
4728 int16_t eans_n_alpha;
4729/* < Q3.12 over-subtraction factor for nonstationary noise
4730 * suppression.
4731 * Byte offset: 10
4732 */
4733
4734 int16_t eans_n_alphamax;
4735/*< Q3.12 maximum over-subtraction factor for nonstationary
4736 * noise suppression.
4737 * Byte offset: 12
4738 */
4739 int16_t eans_e_alpha;
4740/*< Q15 scaling factor for excess noise suppression.
4741 * Byte offset: 14
4742 */
4743
4744 int16_t eans_ns_snrmax;
4745/*< Upper boundary in dB for SNR estimation.
4746 * Byte offset: 16
4747 */
4748
4749 int16_t eans_sns_block;
4750/*< Quarter block size for stationary noise suppression.
4751 * Byte offset: 18
4752 */
4753
4754 int16_t eans_ns_i;
4755/*< Initialization block size for noise suppression.
4756 * Byte offset: 20
4757 */
4758 int16_t eans_np_scale;
4759/*< Power scale factor for nonstationary noise update.
4760 * Byte offset: 22
4761 */
4762
4763 int16_t eans_n_lambda;
4764/*< Smoothing factor for higher level nonstationary noise
4765 * update.
4766 * Byte offset: 24
4767 */
4768
4769 int16_t eans_n_lambdaf;
4770/*< Medium averaging factor for noise update.
4771 * Byte offset: 26
4772 */
4773
4774 int16_t eans_gs_bias;
4775/*< Bias factor in dB for gain calculation.
4776 * Byte offset: 28
4777 */
4778
4779 int16_t eans_gs_max;
4780/*< SNR lower boundary in dB for aggressive gain calculation.
4781 * Byte offset: 30
4782 */
4783
4784 int16_t eans_s_alpha_hb;
4785/*< Q3.12 over-subtraction factor for high-band stationary
4786 * noise suppression.
4787 * Byte offset: 32
4788 */
4789
4790 int16_t eans_n_alphamax_hb;
4791/*< Q3.12 maximum over-subtraction factor for high-band
4792 * nonstationary noise suppression.
4793 * Byte offset: 34
4794 */
4795
4796 int16_t eans_e_alpha_hb;
4797/*< Q15 scaling factor for high-band excess noise suppression.
4798 * Byte offset: 36
4799 */
4800
4801 int16_t eans_n_lambda0;
4802/*< Smoothing factor for nonstationary noise update during
4803 * speech activity.
4804 * Byte offset: 38
4805 */
4806
4807 int16_t thresh;
4808/*< Threshold for generating a binary VAD decision.
4809 * Byte offset: 40
4810 */
4811
4812 int16_t pwr_scale;
4813/*< Indirect lower boundary of the noise level estimate.
4814 * Byte offset: 42
4815 */
4816
4817 int16_t hangover_max;
4818/*< Avoids mid-speech clipping and reliably detects weak speech
4819 * bursts at the end of speech activity.
4820 * Byte offset: 44
4821 */
4822
4823 int16_t alpha_snr;
4824/*< Controls responsiveness of the VAD.
4825 * Byte offset: 46
4826 */
4827
4828 int16_t snr_diff_max;
4829/*< Maximum SNR difference. Decreasing this parameter value may
4830 * help in making correct decisions during abrupt changes; however,
4831 * decreasing too much may increase false alarms during long
4832 * pauses/silences.
4833 * Byte offset: 48
4834 */
4835
4836 int16_t snr_diff_min;
4837/*< Minimum SNR difference. Decreasing this parameter value may
4838 * help in making correct decisions during abrupt changes; however,
4839 * decreasing too much may increase false alarms during long
4840 * pauses/silences.
4841 * Byte offset: 50
4842 */
4843
4844 int16_t init_length;
4845/*< Defines the number of frames for which a noise level
4846 * estimate is set to a fixed value.
4847 * Byte offset: 52
4848 */
4849
4850 int16_t max_val;
4851/*< Defines the upper limit of the noise level.
4852 * Byte offset: 54
4853 */
4854
4855 int16_t init_bound;
4856/*< Defines the initial bounding value for the noise level
4857 * estimate. This is used during the initial segment defined by the
4858 * init_length parameter.
4859 * Byte offset: 56
4860 */
4861
4862 int16_t reset_bound;
4863/*< Reset boundary for noise tracking.
4864 * Byte offset: 58
4865 */
4866
4867 int16_t avar_scale;
4868/*< Defines the bias factor in noise estimation.
4869 * Byte offset: 60
4870 */
4871
4872 int16_t sub_nc;
4873/*< Defines the window length for noise estimation.
4874 * Byte offset: 62
4875 */
4876
4877 int16_t spow_min;
4878/*< Defines the minimum signal power required to update the
4879 * boundaries for the noise floor estimate.
4880 * Byte offset: 64
4881 */
4882
4883 int16_t eans_gs_fast;
4884/*< Fast smoothing factor for postprocessor gain.
4885 * Byte offset: 66
4886 */
4887
4888 int16_t eans_gs_med;
4889/*< Medium smoothing factor for postprocessor gain.
4890 * Byte offset: 68
4891 */
4892
4893 int16_t eans_gs_slow;
4894/*< Slow smoothing factor for postprocessor gain.
4895 * Byte offset: 70
4896 */
4897
4898 int16_t eans_swb_salpha;
4899/*< Q3.12 super wideband aggressiveness factor for stationary
4900 * noise suppression.
4901 * Byte offset: 72
4902 */
4903
4904 int16_t eans_swb_nalpha;
4905/*< Q3.12 super wideband aggressiveness factor for
4906 * nonstationary noise suppression.
4907 * Byte offset: 74
4908 */
4909} __packed;
4910#define ADM_MODULE_IDX_MIC_GAIN_CTRL 0x00010C35
4911
4912/* @addtogroup audio_pp_param_ids
4913 * ID of the Tx mic gain control parameter used by the
4914 * #ADM_MODULE_IDX_MIC_GAIN_CTRL module.
4915 * @messagepayload
4916 * @structure{admx_mic_gain}
4917 * @tablespace
4918 * @inputtable{Audio_Postproc_ADM_PARAM_IDX_MIC_GAIN.tex}
4919 */
4920#define ADM_PARAM_IDX_MIC_GAIN 0x00010C36
4921
4922/* Structure for a Tx mic gain parameter for the mic gain
4923 * control module.
4924 */
4925
4926
4927/* @brief Payload of the #ADM_PARAM_IDX_MIC_GAIN parameter in the
4928 * Tx Mic Gain Control module.
4929 */
4930struct admx_mic_gain {
4931 uint16_t tx_mic_gain;
4932 /*< Linear gain in Q13 format. */
4933
4934 uint16_t reserved;
4935 /*< Clients must set this field to zero. */
4936} __packed;
4937
4938/* end_addtogroup audio_pp_param_ids */
4939
4940/* @ingroup audio_pp_module_ids
4941 * ID of the Rx Codec Gain Control module.
4942 *
4943 * This module supports the following parameter ID:
4944 * - #ADM_PARAM_ID_RX_CODEC_GAIN
4945 */
4946#define ADM_MODULE_ID_RX_CODEC_GAIN_CTRL 0x00010C37
4947
4948/* @addtogroup audio_pp_param_ids
4949 * ID of the Rx codec gain control parameter used by the
4950 * #ADM_MODULE_ID_RX_CODEC_GAIN_CTRL module.
4951 *
4952 * @messagepayload
4953 * @structure{adm_rx_codec_gain}
4954 * @tablespace
4955 * @inputtable{Audio_Postproc_ADM_PARAM_ID_RX_CODEC_GAIN.tex}
4956*/
4957#define ADM_PARAM_ID_RX_CODEC_GAIN 0x00010C38
4958
4959/* Structure for the Rx common codec gain control module. */
4960
4961
4962/* @brief Payload of the #ADM_PARAM_ID_RX_CODEC_GAIN parameter
4963 * in the Rx Codec Gain Control module.
4964 */
4965
4966
4967struct adm_rx_codec_gain {
4968 uint16_t rx_codec_gain;
4969 /*< Linear gain in Q13 format. */
4970
4971 uint16_t reserved;
4972 /*< Clients must set this field to zero.*/
4973} __packed;
4974
4975/* end_addtogroup audio_pp_param_ids */
4976
4977/* @ingroup audio_pp_module_ids
4978 * ID of the HPF Tuning Filter module on the Tx path.
4979 * This module supports the following parameter IDs:
4980 * - #ADM_PARAM_ID_HPF_IIRX_FILTER_ENABLE_CONFIG
4981 * - #ADM_PARAM_ID_HPF_IIRX_FILTER_PRE_GAIN
4982 * - #ADM_PARAM_ID_HPF_IIRX_FILTER_CONFIG_PARAMS
4983 */
4984#define ADM_MODULE_ID_HPF_IIRX_FILTER 0x00010C3D
4985
4986/* @addtogroup audio_pp_param_ids */
4987/* ID of the Tx HPF IIR filter enable parameter used by the
4988 * #ADM_MODULE_ID_HPF_IIRX_FILTER module.
4989 * @parspace Message payload
4990 * @structure{adm_hpfx_iir_filter_enable_cfg}
4991 * @tablespace
4992 * @inputtable{Audio_Postproc_ADM_PARAM_ID_HPF_IIRX_FILTER_ENABLE_CONFIG.tex}
4993 */
4994#define ADM_PARAM_ID_HPF_IIRX_FILTER_ENABLE_CONFIG 0x00010C3E
4995
4996/* ID of the Tx HPF IIR filter pregain parameter used by the
4997 * #ADM_MODULE_ID_HPF_IIRX_FILTER module.
4998 * @parspace Message payload
4999 * @structure{adm_hpfx_iir_filter_pre_gain}
5000 * @tablespace
5001 * @inputtable{Audio_Postproc_ADM_PARAM_ID_HPF_IIRX_FILTER_PRE_GAIN.tex}
5002 */
5003#define ADM_PARAM_ID_HPF_IIRX_FILTER_PRE_GAIN 0x00010C3F
5004
5005/* ID of the Tx HPF IIR filter configuration parameters used by the
5006 * #ADM_MODULE_ID_HPF_IIRX_FILTER module.
5007 * @parspace Message payload
5008 * @structure{adm_hpfx_iir_filter_cfg_params}
5009 * @tablespace
5010 * @inputtable{Audio_Postproc_ADM_PARAM_ID_HPF_IIRX_FILTER_CONFIG_PA
5011 * RAMS.tex}
5012 */
5013#define ADM_PARAM_ID_HPF_IIRX_FILTER_CONFIG_PARAMS 0x00010C40
5014
5015/* Structure for enabling a configuration parameter for
5016 * the HPF IIR tuning filter module on the Tx path.
5017 */
5018
5019/* @brief Payload of the #ADM_PARAM_ID_HPF_IIRX_FILTER_ENABLE_CONFIG
5020 * parameter in the Tx path HPF Tuning Filter module.
5021 */
5022struct adm_hpfx_iir_filter_enable_cfg {
5023 uint32_t enable_flag;
5024/*< Specifies whether the HPF tuning filter is disabled (0) or
5025 * enabled (nonzero).
5026 */
5027} __packed;
5028
5029
5030/* Structure for the pregain parameter for the HPF
5031 IIR tuning filter module on the Tx path. */
5032
5033
5034/* @brief Payload of the #ADM_PARAM_ID_HPF_IIRX_FILTER_PRE_GAIN parameter
5035 * in the Tx path HPF Tuning Filter module.
5036 */
5037struct adm_hpfx_iir_filter_pre_gain {
5038 uint16_t pre_gain;
5039 /*< Linear gain in Q13 format. */
5040
5041 uint16_t reserved;
5042 /*< Clients must set this field to zero.*/
5043} __packed;
5044
5045
5046/* Structure for the configuration parameter for the
5047 HPF IIR tuning filter module on the Tx path. */
5048
5049
5050/* @brief Payload of the #ADM_PARAM_ID_HPF_IIRX_FILTER_CONFIG_PARAMS
5051 * parameters in the Tx path HPF Tuning Filter module. \n
5052 * \n
5053 * This structure is followed by tuning filter coefficients as follows: \n
5054 * - Sequence of int32_t FilterCoeffs.
5055 * Each band has five coefficients, each in int32_t format in the order of
5056 * b0, b1, b2, a1, a2.
5057 * - Sequence of int16_t NumShiftFactor.
5058 * One int16_t per band. The numerator shift factor is related to the Q
5059 * factor of the filter coefficients.
5060 * - Sequence of uint16_t PanSetting.
5061 * One uint16_t for each band to indicate application of the filter to
5062 * left (0), right (1), or both (2) channels.
5063 */
5064struct adm_hpfx_iir_filter_cfg_params {
5065 uint16_t num_biquad_stages;
5066/*< Number of bands.
5067 * Supported values: 0 to 20
5068 */
5069
5070 uint16_t reserved;
5071 /*< Clients must set this field to zero.*/
5072} __packed;
5073
5074/* end_addtogroup audio_pp_module_ids */
5075
5076/* @addtogroup audio_pp_module_ids */
5077/* ID of the Tx path IIR Tuning Filter module.
5078 * This module supports the following parameter IDs:
5079 * - #ADM_PARAM_IDX_IIR_FILTER_ENABLE_CONFIG
5080 */
5081#define ADM_MODULE_IDX_IIR_FILTER 0x00010C41
5082
5083/* ID of the Rx path IIR Tuning Filter module for the left channel.
5084 * The parameter IDs of the IIR tuning filter module
5085 * (#ASM_MODULE_ID_IIRUNING_FILTER) are used for the left IIR Rx tuning
5086 * filter.
5087 *
5088 * Pan parameters are not required for this per-channel IIR filter; the pan
5089 * parameters are ignored by this module.
5090 */
5091#define ADM_MODULE_ID_LEFT_IIRUNING_FILTER 0x00010705
5092
5093/* ID of the the Rx path IIR Tuning Filter module for the right
5094 * channel.
5095 * The parameter IDs of the IIR tuning filter module
5096 * (#ASM_MODULE_ID_IIRUNING_FILTER) are used for the right IIR Rx
5097 * tuning filter.
5098 *
5099 * Pan parameters are not required for this per-channel IIR filter;
5100 * the pan parameters are ignored by this module.
5101 */
5102#define ADM_MODULE_ID_RIGHT_IIRUNING_FILTER 0x00010706
5103
5104/* end_addtogroup audio_pp_module_ids */
5105
5106/* @addtogroup audio_pp_param_ids */
5107
5108/* ID of the Tx IIR filter enable parameter used by the
5109 * #ADM_MODULE_IDX_IIR_FILTER module.
5110 * @parspace Message payload
5111 * @structure{admx_iir_filter_enable_cfg}
5112 * @tablespace
5113 * @inputtable{Audio_Postproc_ADM_PARAM_IDX_IIR_FILTER_ENABLE_CONFIG.tex}
5114 */
5115#define ADM_PARAM_IDX_IIR_FILTER_ENABLE_CONFIG 0x00010C42
5116
5117/* ID of the Tx IIR filter pregain parameter used by the
5118 * #ADM_MODULE_IDX_IIR_FILTER module.
5119 * @parspace Message payload
5120 * @structure{admx_iir_filter_pre_gain}
5121 * @tablespace
5122 * @inputtable{Audio_Postproc_ADM_PARAM_IDX_IIR_FILTER_PRE_GAIN.tex}
5123 */
5124#define ADM_PARAM_IDX_IIR_FILTER_PRE_GAIN 0x00010C43
5125
5126/* ID of the Tx IIR filter configuration parameters used by the
5127 * #ADM_MODULE_IDX_IIR_FILTER module.
5128 * @parspace Message payload
5129 * @structure{admx_iir_filter_cfg_params}
5130 * @tablespace
5131 * @inputtable{Audio_Postproc_ADM_PARAM_IDX_IIR_FILTER_CONFIG_PARAMS.tex}
5132 */
5133#define ADM_PARAM_IDX_IIR_FILTER_CONFIG_PARAMS 0x00010C44
5134
5135/* Structure for enabling the configuration parameter for the
5136 * IIR filter module on the Tx path.
5137 */
5138
5139/* @brief Payload of the #ADM_PARAM_IDX_IIR_FILTER_ENABLE_CONFIG
5140 * parameter in the Tx Path IIR Tuning Filter module.
5141 */
5142
5143struct admx_iir_filter_enable_cfg {
5144 uint32_t enable_flag;
5145/*< Specifies whether the IIR tuning filter is disabled (0) or
5146 * enabled (nonzero).
5147 */
5148
5149} __packed;
5150
5151
5152/* Structure for the pregain parameter for the
5153 * IIR filter module on the Tx path.
5154 */
5155
5156
5157/* @brief Payload of the #ADM_PARAM_IDX_IIR_FILTER_PRE_GAIN
5158 * parameter in the Tx Path IIR Tuning Filter module.
5159 */
5160
5161struct admx_iir_filter_pre_gain {
5162 uint16_t pre_gain;
5163 /*< Linear gain in Q13 format. */
5164
5165 uint16_t reserved;
5166 /*< Clients must set this field to zero.*/
5167} __packed;
5168
5169
5170/* Structure for the configuration parameter for the
5171 * IIR filter module on the Tx path.
5172 */
5173
5174
5175/* @brief Payload of the #ADM_PARAM_IDX_IIR_FILTER_CONFIG_PARAMS
5176 * parameter in the Tx Path IIR Tuning Filter module. \n
5177 * \n
5178 * This structure is followed by the HPF IIR filter coefficients on
5179 * the Tx path as follows: \n
5180 * - Sequence of int32_t ulFilterCoeffs. Each band has five
5181 * coefficients, each in int32_t format in the order of b0, b1, b2,
5182 * a1, a2.
5183 * - Sequence of int16_t sNumShiftFactor. One int16_t per band. The
5184 * numerator shift factor is related to the Q factor of the filter
5185 * coefficients.
5186 * - Sequence of uint16_t usPanSetting. One uint16_t for each band
5187 * to indicate if the filter is applied to left (0), right (1), or
5188 * both (2) channels.
5189 */
5190struct admx_iir_filter_cfg_params {
5191 uint16_t num_biquad_stages;
5192/*< Number of bands.
5193 * Supported values: 0 to 20
5194 */
5195
5196 uint16_t reserved;
5197 /*< Clients must set this field to zero.*/
5198} __packed;
5199
5200/* end_addtogroup audio_pp_module_ids */
5201
5202/* @ingroup audio_pp_module_ids
5203 * ID of the QEnsemble module.
5204 * This module supports the following parameter IDs:
5205 * - #ADM_PARAM_ID_QENSEMBLE_ENABLE
5206 * - #ADM_PARAM_ID_QENSEMBLE_BACKGAIN
5207 * - #ADM_PARAM_ID_QENSEMBLE_SET_NEW_ANGLE
5208 */
5209#define ADM_MODULE_ID_QENSEMBLE 0x00010C59
5210
5211/* @addtogroup audio_pp_param_ids */
5212/* ID of the QEnsemble enable parameter used by the
5213 * #ADM_MODULE_ID_QENSEMBLE module.
5214 * @messagepayload
5215 * @structure{adm_qensemble_enable}
5216 * @tablespace
5217 * @inputtable{Audio_Postproc_ADM_PARAM_ID_QENSEMBLE_ENABLE.tex}
5218 */
5219#define ADM_PARAM_ID_QENSEMBLE_ENABLE 0x00010C60
5220
5221/* ID of the QEnsemble back gain parameter used by the
5222 * #ADM_MODULE_ID_QENSEMBLE module.
5223 * @messagepayload
5224 * @structure{adm_qensemble_param_backgain}
5225 * @tablespace
5226 * @inputtable{Audio_Postproc_ADM_PARAM_ID_QENSEMBLE_BACKGAIN.tex}
5227 */
5228#define ADM_PARAM_ID_QENSEMBLE_BACKGAIN 0x00010C61
5229
5230/* ID of the QEnsemble new angle parameter used by the
5231 * #ADM_MODULE_ID_QENSEMBLE module.
5232 * @messagepayload
5233 * @structure{adm_qensemble_param_set_new_angle}
5234 * @tablespace
5235 * @inputtable{Audio_Postproc_ADM_PARAM_ID_QENSEMBLE_SET_NEW_ANGLE.tex}
5236 */
5237#define ADM_PARAM_ID_QENSEMBLE_SET_NEW_ANGLE 0x00010C62
5238
5239/* Structure for enabling the configuration parameter for the
5240 * QEnsemble module.
5241 */
5242
5243
5244/* @brief Payload of the #ADM_PARAM_ID_QENSEMBLE_ENABLE
5245 * parameter used by the QEnsemble module.
5246 */
5247struct adm_qensemble_enable {
5248 uint32_t enable_flag;
5249/*< Specifies whether the QEnsemble module is disabled (0) or enabled
5250 * (nonzero).
5251 */
5252} __packed;
5253
5254
5255/* Structure for the background gain for the QEnsemble module. */
5256
5257
5258/* @brief Payload of the #ADM_PARAM_ID_QENSEMBLE_BACKGAIN
5259 * parameter used by
5260 * the QEnsemble module.
5261 */
5262struct adm_qensemble_param_backgain {
5263 int16_t back_gain;
5264/*< Linear gain in Q15 format.
5265 * Supported values: 0 to 32767
5266 */
5267
5268 uint16_t reserved;
5269 /*< Clients must set this field to zero.*/
5270} __packed;
5271/* Structure for setting a new angle for the QEnsemble module. */
5272
5273
5274/* @brief Payload of the #ADM_PARAM_ID_QENSEMBLE_SET_NEW_ANGLE
5275 * parameter used
5276 * by the QEnsemble module.
5277 */
5278struct adm_qensemble_param_set_new_angle {
5279 int16_t new_angle;
5280/*< New angle in degrees.
5281 * Supported values: 0 to 359
5282 */
5283
5284 int16_t time_ms;
5285/*< Transition time in milliseconds to set the new angle.
5286 * Supported values: 0 to 32767
5287 */
5288} __packed;
5289
5290/* end_addtogroup audio_pp_module_ids */
5291
5292/* @ingroup audio_pp_module_ids
5293 * ID of the Volume Control module pre/postprocessing block.
5294 * This module supports the following parameter IDs:
5295 * - #ASM_PARAM_ID_VOL_CTRL_MASTER_GAIN
5296 * - #ASM_PARAM_ID_VOL_CTRL_LR_CHANNEL_GAIN
5297 * - #ASM_PARAM_ID_VOL_CTRL_MUTE_CONFIG
5298 * - #ASM_PARAM_ID_SOFT_VOL_STEPPING_PARAMETERS
5299 * - #ASM_PARAM_ID_SOFT_PAUSE_PARAMETERS
5300 * - #ASM_PARAM_ID_MULTICHANNEL_GAIN
5301 * - #ASM_PARAM_ID_MULTICHANNEL_MUTE
5302 */
5303#define ASM_MODULE_ID_VOL_CTRL 0x00010BFE
5304
5305/* @addtogroup audio_pp_param_ids */
5306/* ID of the master gain parameter used by the #ASM_MODULE_ID_VOL_CTRL
5307 * module.
5308 * @messagepayload
5309 * @structure{asm_volume_ctrl_master_gain}
5310 * @tablespace
5311 * @inputtable{Audio_Postproc_ASM_PARAM_ID_VOL_CTRL_MASTER_GAIN.tex}
5312 */
5313#define ASM_PARAM_ID_VOL_CTRL_MASTER_GAIN 0x00010BFF
5314
5315/* ID of the left/right channel gain parameter used by the
5316 * #ASM_MODULE_ID_VOL_CTRL module.
5317 * @messagepayload
5318 * @structure{asm_volume_ctrl_lr_chan_gain}
5319 * @tablespace
5320 * @inputtable{Audio_Postproc_ASM_PARAM_ID_VOL_CTRL_LR_CHANNEL_GAIN.tex}
5321 */
5322#define ASM_PARAM_ID_VOL_CTRL_LR_CHANNEL_GAIN 0x00010C00
5323
5324/* ID of the mute configuration parameter used by the
5325 * #ASM_MODULE_ID_VOL_CTRL module.
5326 * @messagepayload
5327 * @structure{asm_volume_ctrl_mute_config}
5328 * @tablespace
5329 * @inputtable{Audio_Postproc_ASM_PARAM_ID_VOL_CTRL_MUTE_CONFIG.tex}
5330 */
5331#define ASM_PARAM_ID_VOL_CTRL_MUTE_CONFIG 0x00010C01
5332
5333/* ID of the soft stepping volume parameters used by the
5334 * #ASM_MODULE_ID_VOL_CTRL module.
5335 * @messagepayload
5336 * @structure{asm_soft_step_volume_params}
5337 * @tablespace
5338 * @inputtable{Audio_Postproc_ASM_PARAM_ID_SOFT_VOL_STEPPING_PARAMET
5339 * ERS.tex}
5340 */
5341#define ASM_PARAM_ID_SOFT_VOL_STEPPING_PARAMETERS 0x00010C29
5342
5343/* ID of the soft pause parameters used by the #ASM_MODULE_ID_VOL_CTRL
5344 * module.
5345 */
5346#define ASM_PARAM_ID_SOFT_PAUSE_PARAMETERS 0x00010D6A
5347
5348/* ID of the multiple-channel volume control parameters used by the
5349 * #ASM_MODULE_ID_VOL_CTRL module.
5350 */
5351#define ASM_PARAM_ID_MULTICHANNEL_GAIN 0x00010713
5352
5353/* ID of the multiple-channel mute configuration parameters used by the
5354 * #ASM_MODULE_ID_VOL_CTRL module.
5355 */
5356
5357#define ASM_PARAM_ID_MULTICHANNEL_MUTE 0x00010714
5358
5359/* Structure for the master gain parameter for a volume control
5360 * module.
5361 */
5362
5363
5364/* @brief Payload of the #ASM_PARAM_ID_VOL_CTRL_MASTER_GAIN
5365 * parameter used by the Volume Control module.
5366 */
5367
5368
5369
5370struct asm_volume_ctrl_master_gain {
5371 struct apr_hdr hdr;
5372 struct asm_stream_cmd_set_pp_params_v2 param;
5373 struct asm_stream_param_data_v2 data;
5374 uint16_t master_gain;
5375 /*< Linear gain in Q13 format. */
5376
5377 uint16_t reserved;
5378 /*< Clients must set this field to zero.
5379 */
5380} __packed;
5381
5382
5383/* Structure for the left/right channel gain parameter for a
5384 * volume control module.
5385 */
5386
5387
5388/* @brief Payload of the #ASM_PARAM_ID_VOL_CTRL_LR_CHANNEL_GAIN
5389 * parameters used by the Volume Control module.
5390 */
5391
5392
5393
5394struct asm_volume_ctrl_lr_chan_gain {
5395 struct apr_hdr hdr;
5396 struct asm_stream_cmd_set_pp_params_v2 param;
5397 struct asm_stream_param_data_v2 data;
5398
5399 uint16_t l_chan_gain;
5400 /*< Linear gain in Q13 format for the left channel. */
5401
5402 uint16_t r_chan_gain;
5403 /*< Linear gain in Q13 format for the right channel.*/
5404} __packed;
5405
5406
5407/* Structure for the mute configuration parameter for a
5408 volume control module. */
5409
5410
5411/* @brief Payload of the #ASM_PARAM_ID_VOL_CTRL_MUTE_CONFIG
5412 * parameter used by the Volume Control module.
5413 */
5414
5415
5416struct asm_volume_ctrl_mute_config {
5417 struct apr_hdr hdr;
5418 struct asm_stream_cmd_set_pp_params_v2 param;
5419 struct asm_stream_param_data_v2 data;
5420 uint32_t mute_flag;
5421/*< Specifies whether mute is disabled (0) or enabled (nonzero).*/
5422
5423} __packed;
5424
5425/*
5426 * Supported parameters for a soft stepping linear ramping curve.
5427 */
5428#define ASM_PARAM_SVC_RAMPINGCURVE_LINEAR 0
5429
5430/*
5431 * Exponential ramping curve.
5432 */
5433#define ASM_PARAM_SVC_RAMPINGCURVE_EXP 1
5434
5435/*
5436 * Logarithmic ramping curve.
5437 */
5438#define ASM_PARAM_SVC_RAMPINGCURVE_LOG 2
5439
5440/* Structure for holding soft stepping volume parameters. */
5441
5442
5443/* Payload of the #ASM_PARAM_ID_SOFT_VOL_STEPPING_PARAMETERS
5444 * parameters used by the Volume Control module.
5445 */
5446struct asm_soft_step_volume_params {
5447 struct apr_hdr hdr;
5448 struct asm_stream_cmd_set_pp_params_v2 param;
5449 struct asm_stream_param_data_v2 data;
5450 uint32_t period;
5451/*< Period in milliseconds.
5452 * Supported values: 0 to 15000
5453 */
5454
5455 uint32_t step;
5456/*< Step in microseconds.
5457 * Supported values: 0 to 15000000
5458 */
5459
5460 uint32_t ramping_curve;
5461/*< Ramping curve type.
5462 * Supported values:
5463 * - #ASM_PARAM_SVC_RAMPINGCURVE_LINEAR
5464 * - #ASM_PARAM_SVC_RAMPINGCURVE_EXP
5465 * - #ASM_PARAM_SVC_RAMPINGCURVE_LOG
5466 */
5467} __packed;
5468
5469
5470/* Structure for holding soft pause parameters. */
5471
5472
5473/* Payload of the #ASM_PARAM_ID_SOFT_PAUSE_PARAMETERS
5474 * parameters used by the Volume Control module.
5475 */
5476
5477
5478struct asm_soft_pause_params {
5479 struct apr_hdr hdr;
5480 struct asm_stream_cmd_set_pp_params_v2 param;
5481 struct asm_stream_param_data_v2 data;
5482 uint32_t enable_flag;
5483/*< Specifies whether soft pause is disabled (0) or enabled
5484 * (nonzero).
5485 */
5486
5487
5488
5489 uint32_t period;
5490/*< Period in milliseconds.
5491 * Supported values: 0 to 15000
5492 */
5493
5494 uint32_t step;
5495/*< Step in microseconds.
5496 * Supported values: 0 to 15000000
5497 */
5498
5499 uint32_t ramping_curve;
5500/*< Ramping curve.
5501 * Supported values:
5502 * - #ASM_PARAM_SVC_RAMPINGCURVE_LINEAR
5503 * - #ASM_PARAM_SVC_RAMPINGCURVE_EXP
5504 * - #ASM_PARAM_SVC_RAMPINGCURVE_LOG
5505 */
5506} __packed;
5507
5508
5509/* Maximum number of channels.*/
5510#define VOLUME_CONTROL_MAX_CHANNELS 8
5511
5512/* Structure for holding one channel type - gain pair. */
5513
5514
5515/* Payload of the #ASM_PARAM_ID_MULTICHANNEL_GAIN channel
5516 * type/gain pairs used by the Volume Control module. \n \n This
5517 * structure immediately follows the
5518 * asm_volume_ctrl_multichannel_gain structure.
5519 */
5520
5521
5522struct asm_volume_ctrl_channelype_gain_pair {
5523 struct apr_hdr hdr;
5524 struct asm_stream_cmd_set_pp_params_v2 param;
5525 struct asm_stream_param_data_v2 data;
5526 uint8_t channelype;
5527/*< Channel type for which the gain setting is to be applied.
5528 * Supported values:
5529 * - #PCM_CHANNEL_L
5530 * - #PCM_CHANNEL_R
5531 * - #PCM_CHANNEL_C
5532 * - #PCM_CHANNEL_LS
5533 * - #PCM_CHANNEL_RS
5534 * - #PCM_CHANNEL_LFE
5535 * - #PCM_CHANNEL_CS
5536 * - #PCM_CHANNEL_LB
5537 * - #PCM_CHANNEL_RB
5538 * - #PCM_CHANNELS
5539 * - #PCM_CHANNEL_CVH
5540 * - #PCM_CHANNEL_MS
5541 * - #PCM_CHANNEL_FLC
5542 * - #PCM_CHANNEL_FRC
5543 * - #PCM_CHANNEL_RLC
5544 * - #PCM_CHANNEL_RRC
5545 */
5546
5547 uint8_t reserved1;
5548 /*< Clients must set this field to zero. */
5549
5550 uint8_t reserved2;
5551 /*< Clients must set this field to zero. */
5552
5553 uint8_t reserved3;
5554 /*< Clients must set this field to zero. */
5555
5556 uint32_t gain;
5557/*< Gain value for this channel in Q28 format.
5558 * Supported values: Any
5559 */
5560} __packed;
5561
5562
5563/* Structure for the multichannel gain command */
5564
5565
5566/* Payload of the #ASM_PARAM_ID_MULTICHANNEL_GAIN
5567 * parameters used by the Volume Control module.
5568 */
5569
5570
5571struct asm_volume_ctrl_multichannel_gain {
5572 struct apr_hdr hdr;
5573 struct asm_stream_cmd_set_pp_params_v2 param;
5574 struct asm_stream_param_data_v2 data;
5575 uint32_t num_channels;
5576/*< Number of channels for which gain values are provided. Any
5577 * channels present in the data for which gain is not provided are
5578 * set to unity gain.
5579 * Supported values: 1 to 8
5580 */
5581
5582
5583 struct asm_volume_ctrl_channelype_gain_pair
5584 gain_data[VOLUME_CONTROL_MAX_CHANNELS];
5585 /*< Array of channel type/gain pairs.*/
5586} __packed;
5587
5588
5589/* Structure for holding one channel type - mute pair. */
5590
5591
5592/* Payload of the #ASM_PARAM_ID_MULTICHANNEL_MUTE channel
5593 * type/mute setting pairs used by the Volume Control module. \n \n
5594 * This structure immediately follows the
5595 * asm_volume_ctrl_multichannel_mute structure.
5596 */
5597
5598
5599struct asm_volume_ctrl_channelype_mute_pair {
5600 struct apr_hdr hdr;
5601 struct asm_stream_cmd_set_pp_params_v2 param;
5602 struct asm_stream_param_data_v2 data;
5603 uint8_t channelype;
5604/*< Channel type for which the mute setting is to be applied.
5605 * Supported values:
5606 * - #PCM_CHANNEL_L
5607 * - #PCM_CHANNEL_R
5608 * - #PCM_CHANNEL_C
5609 * - #PCM_CHANNEL_LS
5610 * - #PCM_CHANNEL_RS
5611 * - #PCM_CHANNEL_LFE
5612 * - #PCM_CHANNEL_CS
5613 * - #PCM_CHANNEL_LB
5614 * - #PCM_CHANNEL_RB
5615 * - #PCM_CHANNELS
5616 * - #PCM_CHANNEL_CVH
5617 * - #PCM_CHANNEL_MS
5618 * - #PCM_CHANNEL_FLC
5619 * - #PCM_CHANNEL_FRC
5620 * - #PCM_CHANNEL_RLC
5621 * - #PCM_CHANNEL_RRC
5622 */
5623
5624 uint8_t reserved1;
5625 /*< Clients must set this field to zero. */
5626
5627 uint8_t reserved2;
5628 /*< Clients must set this field to zero. */
5629
5630 uint8_t reserved3;
5631 /*< Clients must set this field to zero. */
5632
5633 uint32_t mute;
5634/*< Mute setting for this channel.
5635 * Supported values:
5636 * - 0 = Unmute
5637 * - Nonzero = Mute
5638 */
5639} __packed;
5640
5641
5642/* Structure for the multichannel mute command */
5643
5644
5645/* @brief Payload of the #ASM_PARAM_ID_MULTICHANNEL_MUTE
5646 * parameters used by the Volume Control module.
5647 */
5648
5649
5650struct asm_volume_ctrl_multichannel_mute {
5651 struct apr_hdr hdr;
5652 struct asm_stream_cmd_set_pp_params_v2 param;
5653 struct asm_stream_param_data_v2 data;
5654 uint32_t num_channels;
5655/*< Number of channels for which mute configuration is
5656 * provided. Any channels present in the data for which mute
5657 * configuration is not provided are set to unmute.
5658 * Supported values: 1 to 8
5659 */
5660
5661struct asm_volume_ctrl_channelype_mute_pair
5662 mute_data[VOLUME_CONTROL_MAX_CHANNELS];
5663 /*< Array of channel type/mute setting pairs.*/
5664} __packed;
5665/* end_addtogroup audio_pp_param_ids */
5666
5667/* audio_pp_module_ids
5668 * ID of the IIR Tuning Filter module.
5669 * This module supports the following parameter IDs:
5670 * - #ASM_PARAM_ID_IIRUNING_FILTER_ENABLE_CONFIG
5671 * - #ASM_PARAM_ID_IIRUNING_FILTER_PRE_GAIN
5672 * - #ASM_PARAM_ID_IIRUNING_FILTER_CONFIG_PARAMS
5673 */
5674#define ASM_MODULE_ID_IIRUNING_FILTER 0x00010C02
5675
5676/* @addtogroup audio_pp_param_ids */
5677/* ID of the IIR tuning filter enable parameter used by the
5678 * #ASM_MODULE_ID_IIRUNING_FILTER module.
5679 * @messagepayload
5680 * @structure{asm_iiruning_filter_enable}
5681 * @tablespace
5682 * @inputtable{Audio_Postproc_ASM_PARAM_ID_IIRUNING_FILTER_ENABLE_CO
5683 * NFIG.tex}
5684 */
5685#define ASM_PARAM_ID_IIRUNING_FILTER_ENABLE_CONFIG 0x00010C03
5686
5687/* ID of the IIR tuning filter pregain parameter used by the
5688 * #ASM_MODULE_ID_IIRUNING_FILTER module.
5689 */
5690#define ASM_PARAM_ID_IIRUNING_FILTER_PRE_GAIN 0x00010C04
5691
5692/* ID of the IIR tuning filter configuration parameters used by the
5693 * #ASM_MODULE_ID_IIRUNING_FILTER module.
5694 */
5695#define ASM_PARAM_ID_IIRUNING_FILTER_CONFIG_PARAMS 0x00010C05
5696
5697/* Structure for an enable configuration parameter for an
5698 * IIR tuning filter module.
5699 */
5700
5701
5702/* @brief Payload of the #ASM_PARAM_ID_IIRUNING_FILTER_ENABLE_CONFIG
5703 * parameter used by the IIR Tuning Filter module.
5704 */
5705struct asm_iiruning_filter_enable {
5706 uint32_t enable_flag;
5707/*< Specifies whether the IIR tuning filter is disabled (0) or
5708 * enabled (1).
5709 */
5710} __packed;
5711
5712/* Structure for the pregain parameter for an IIR tuning filter module. */
5713
5714
5715/* Payload of the #ASM_PARAM_ID_IIRUNING_FILTER_PRE_GAIN
5716 * parameters used by the IIR Tuning Filter module.
5717 */
5718struct asm_iiruning_filter_pregain {
5719 uint16_t pregain;
5720 /*< Linear gain in Q13 format. */
5721
5722 uint16_t reserved;
5723 /*< Clients must set this field to zero.*/
5724} __packed;
5725
5726/* Structure for the configuration parameter for an IIR tuning filter
5727 * module.
5728 */
5729
5730
5731/* @brief Payload of the #ASM_PARAM_ID_IIRUNING_FILTER_CONFIG_PARAMS
5732 * parameters used by the IIR Tuning Filter module. \n
5733 * \n
5734 * This structure is followed by the IIR filter coefficients: \n
5735 * - Sequence of int32_t FilterCoeffs \n
5736 * Five coefficients for each band. Each coefficient is in int32_t format, in
5737 * the order of b0, b1, b2, a1, a2.
5738 * - Sequence of int16_t NumShiftFactor \n
5739 * One int16_t per band. The numerator shift factor is related to the Q
5740 * factor of the filter coefficients.
5741 * - Sequence of uint16_t PanSetting \n
5742 * One uint16_t per band, indicating if the filter is applied to left (0),
5743 * right (1), or both (2) channels.
5744 */
5745struct asm_iir_filter_config_params {
5746 uint16_t num_biquad_stages;
5747/*< Number of bands.
5748 * Supported values: 0 to 20
5749 */
5750
5751 uint16_t reserved;
5752 /*< Clients must set this field to zero.*/
5753} __packed;
5754
5755/* audio_pp_module_ids
5756 * ID of the Multiband Dynamic Range Control (MBDRC) module on the Tx/Rx
5757 * paths.
5758 * This module supports the following parameter IDs:
5759 * - #ASM_PARAM_ID_MBDRC_ENABLE
5760 * - #ASM_PARAM_ID_MBDRC_CONFIG_PARAMS
5761 */
5762#define ASM_MODULE_ID_MBDRC 0x00010C06
5763
5764/* audio_pp_param_ids */
5765/* ID of the MBDRC enable parameter used by the #ASM_MODULE_ID_MBDRC module.
5766 * @messagepayload
5767 * @structure{asm_mbdrc_enable}
5768 * @tablespace
5769 * @inputtable{Audio_Postproc_ASM_PARAM_ID_MBDRC_ENABLE.tex}
5770 */
5771#define ASM_PARAM_ID_MBDRC_ENABLE 0x00010C07
5772
5773/* ID of the MBDRC configuration parameters used by the
5774 * #ASM_MODULE_ID_MBDRC module.
5775 * @messagepayload
5776 * @structure{asm_mbdrc_config_params}
5777 * @tablespace
5778 * @inputtable{Audio_Postproc_ASM_PARAM_ID_MBDRC_CONFIG_PARAMS.tex}
5779 *
5780 * @parspace Sub-band DRC configuration parameters
5781 * @structure{asm_subband_drc_config_params}
5782 * @tablespace
5783 * @inputtable{Audio_Postproc_ASM_PARAM_ID_MBDRC_CONFIG_PARAMS_subband_DRC.tex}
5784 *
5785 * @keep{6}
5786 * To obtain legacy ADRC from MBDRC, use the calibration tool to:
5787 *
5788 * - Enable MBDRC (EnableFlag = TRUE)
5789 * - Set number of bands to 1 (uiNumBands = 1)
5790 * - Enable the first MBDRC band (DrcMode[0] = DRC_ENABLED = 1)
5791 * - Clear the first band mute flag (MuteFlag[0] = 0)
5792 * - Set the first band makeup gain to unity (compMakeUpGain[0] = 0x2000)
5793 * - Use the legacy ADRC parameters to calibrate the rest of the MBDRC
5794 * parameters.
5795 */
5796#define ASM_PARAM_ID_MBDRC_CONFIG_PARAMS 0x00010C08
5797
5798/* end_addtogroup audio_pp_param_ids */
5799
5800/* audio_pp_module_ids
5801 * ID of the MMBDRC module version 2 pre/postprocessing block.
5802 * This module differs from the original MBDRC (#ASM_MODULE_ID_MBDRC) in
5803 * the length of the filters used in each sub-band.
5804 * This module supports the following parameter ID:
5805 * - #ASM_PARAM_ID_MBDRC_CONFIG_PARAMS_IMPROVED_FILTBANK_V2
5806 */
5807#define ASM_MODULE_ID_MBDRCV2 0x0001070B
5808
5809/* @addtogroup audio_pp_param_ids */
5810/* ID of the configuration parameters used by the
5811 * #ASM_MODULE_ID_MBDRCV2 module for the improved filter structure
5812 * of the MBDRC v2 pre/postprocessing block.
5813 * The update to this configuration structure from the original
5814 * MBDRC is the number of filter coefficients in the filter
5815 * structure. The sequence for is as follows:
5816 * - 1 band = 0 FIR coefficient + 1 mute flag + uint16_t padding
5817 * - 2 bands = 141 FIR coefficients + 2 mute flags + uint16_t padding
5818 * - 3 bands = 141+81 FIR coefficients + 3 mute flags + uint16_t padding
5819 * - 4 bands = 141+81+61 FIR coefficients + 4 mute flags + uint16_t
5820 * padding
5821 * - 5 bands = 141+81+61+61 FIR coefficients + 5 mute flags +
5822 * uint16_t padding
5823 * This block uses the same parameter structure as
5824 * #ASM_PARAM_ID_MBDRC_CONFIG_PARAMS.
5825 */
5826#define ASM_PARAM_ID_MBDRC_CONFIG_PARAMS_IMPROVED_FILTBANK_V2 \
5827 0x0001070C
5828
5829/* Structure for the enable parameter for an MBDRC module. */
5830
5831
5832/* Payload of the #ASM_PARAM_ID_MBDRC_ENABLE parameter used by the
5833 * MBDRC module.
5834 */
5835struct asm_mbdrc_enable {
5836 uint32_t enable_flag;
5837/*< Specifies whether MBDRC is disabled (0) or enabled (nonzero).*/
5838} __packed;
5839
5840/* Structure for the configuration parameters for an MBDRC module. */
5841
5842
5843/* Payload of the #ASM_PARAM_ID_MBDRC_CONFIG_PARAMS
5844 * parameters used by the MBDRC module. \n \n Following this
5845 * structure is the payload for sub-band DRC configuration
5846 * parameters (asm_subband_drc_config_params). This sub-band
5847 * structure must be repeated for each band.
5848 */
5849
5850
5851struct asm_mbdrc_config_params {
5852 uint16_t num_bands;
5853/*< Number of bands.
5854 * Supported values: 1 to 5
5855 */
5856
5857 int16_t limiterhreshold;
5858/*< Threshold in decibels for the limiter output.
5859 * Supported values: -72 to 18 \n
5860 * Recommended value: 3994 (-0.22 db in Q3.12 format)
5861 */
5862
5863 int16_t limiter_makeup_gain;
5864/*< Makeup gain in decibels for the limiter output.
5865 * Supported values: -42 to 42 \n
5866 * Recommended value: 256 (0 dB in Q7.8 format)
5867 */
5868
5869 int16_t limiter_gc;
5870/*< Limiter gain recovery coefficient.
5871 * Supported values: 0.5 to 0.99 \n
5872 * Recommended value: 32440 (0.99 in Q15 format)
5873 */
5874
5875 int16_t limiter_delay;
5876/*< Limiter delay in samples.
5877 * Supported values: 0 to 10 \n
5878 * Recommended value: 262 (0.008 samples in Q15 format)
5879 */
5880
5881 int16_t limiter_max_wait;
5882/*< Maximum limiter waiting time in samples.
5883 * Supported values: 0 to 10 \n
5884 * Recommended value: 262 (0.008 samples in Q15 format)
5885 */
5886} __packed;
5887
5888/* DRC configuration structure for each sub-band of an MBDRC module. */
5889
5890
5891/* Payload of the #ASM_PARAM_ID_MBDRC_CONFIG_PARAMS DRC
5892 * configuration parameters for each sub-band in the MBDRC module.
5893 * After this DRC structure is configured for valid bands, the next
5894 * MBDRC setparams expects the sequence of sub-band MBDRC filter
5895 * coefficients (the length depends on the number of bands) plus the
5896 * mute flag for that band plus uint16_t padding.
5897 *
5898 * @keep{10}
5899 * The filter coefficient and mute flag are of type int16_t:
5900 * - FIR coefficient = int16_t firFilter
5901 * - Mute flag = int16_t fMuteFlag
5902 *
5903 * The sequence is as follows:
5904 * - 1 band = 0 FIR coefficient + 1 mute flag + uint16_t padding
5905 * - 2 bands = 97 FIR coefficients + 2 mute flags + uint16_t padding
5906 * - 3 bands = 97+33 FIR coefficients + 3 mute flags + uint16_t padding
5907 * - 4 bands = 97+33+33 FIR coefficients + 4 mute flags + uint16_t padding
5908 * - 5 bands = 97+33+33+33 FIR coefficients + 5 mute flags + uint16_t padding
5909 *
5910 * For improved filterbank, the sequence is as follows:
5911 * - 1 band = 0 FIR coefficient + 1 mute flag + uint16_t padding
5912 * - 2 bands = 141 FIR coefficients + 2 mute flags + uint16_t padding
5913 * - 3 bands = 141+81 FIR coefficients + 3 mute flags + uint16_t padding
5914 * - 4 bands = 141+81+61 FIR coefficients + 4 mute flags + uint16_t padding
5915 * - 5 bands = 141+81+61+61 FIR coefficients + 5 mute flags + uint16_t padding
5916 */
5917struct asm_subband_drc_config_params {
5918 int16_t drc_stereo_linked_flag;
5919/*< Specifies whether all stereo channels have the same applied
5920 * dynamics (1) or if they process their dynamics independently (0).
5921 * Supported values:
5922 * - 0 -- Not linked
5923 * - 1 -- Linked
5924 */
5925
5926 int16_t drc_mode;
5927/*< Specifies whether DRC mode is bypassed for sub-bands.
5928 * Supported values:
5929 * - 0 -- Disabled
5930 * - 1 -- Enabled
5931 */
5932
5933 int16_t drc_down_sample_level;
5934/*< DRC down sample level.
5935 * Supported values: @ge 1
5936 */
5937
5938 int16_t drc_delay;
5939/*< DRC delay in samples.
5940 * Supported values: 0 to 1200
5941 */
5942
5943 uint16_t drc_rmsime_avg_const;
5944/*< RMS signal energy time-averaging constant.
5945 * Supported values: 0 to 2^16-1
5946 */
5947
5948 uint16_t drc_makeup_gain;
5949/*< DRC makeup gain in decibels.
5950 * Supported values: 258 to 64917
5951 */
5952 /* Down expander settings */
5953 int16_t down_expdrhreshold;
5954/*< Down expander threshold.
5955 * Supported Q7 format values: 1320 to up_cmpsrhreshold
5956 */
5957
5958 int16_t down_expdr_slope;
5959/*< Down expander slope.
5960 * Supported Q8 format values: -32768 to 0.
5961 */
5962
5963 uint32_t down_expdr_attack;
5964/*< Down expander attack constant.
5965 * Supported Q31 format values: 196844 to 2^31.
5966 */
5967
5968 uint32_t down_expdr_release;
5969/*< Down expander release constant.
5970 * Supported Q31 format values: 19685 to 2^31
5971 */
5972
5973 uint16_t down_expdr_hysteresis;
5974/*< Down expander hysteresis constant.
5975 * Supported Q14 format values: 1 to 32690
5976 */
5977
5978 uint16_t reserved;
5979 /*< Clients must set this field to zero. */
5980
5981 int32_t down_expdr_min_gain_db;
5982/*< Down expander minimum gain.
5983 * Supported Q23 format values: -805306368 to 0.
5984 */
5985
5986 /* Up compressor settings */
5987
5988 int16_t up_cmpsrhreshold;
5989/*< Up compressor threshold.
5990 * Supported Q7 format values: down_expdrhreshold to
5991 * down_cmpsrhreshold.
5992 */
5993
5994 uint16_t up_cmpsr_slope;
5995/*< Up compressor slope.
5996 * Supported Q16 format values: 0 to 64881.
5997 */
5998
5999 uint32_t up_cmpsr_attack;
6000/*< Up compressor attack constant.
6001 * Supported Q31 format values: 196844 to 2^31.
6002 */
6003
6004 uint32_t up_cmpsr_release;
6005/*< Up compressor release constant.
6006 * Supported Q31 format values: 19685 to 2^31.
6007 */
6008
6009 uint16_t up_cmpsr_hysteresis;
6010/*< Up compressor hysteresis constant.
6011 * Supported Q14 format values: 1 to 32690.
6012 */
6013
6014 /* Down compressor settings */
6015
6016 int16_t down_cmpsrhreshold;
6017/*< Down compressor threshold.
6018 * Supported Q7 format values: up_cmpsrhreshold to 11560.
6019 */
6020
6021 uint16_t down_cmpsr_slope;
6022/*< Down compressor slope.
6023 * Supported Q16 format values: 0 to 64881.
6024 */
6025
6026 uint16_t reserved1;
6027/*< Clients must set this field to zero. */
6028
6029 uint32_t down_cmpsr_attack;
6030/*< Down compressor attack constant.
6031 * Supported Q31 format values: 196844 to 2^31.
6032 */
6033
6034 uint32_t down_cmpsr_release;
6035/*< Down compressor release constant.
6036 * Supported Q31 format values: 19685 to 2^31.
6037 */
6038
6039 uint16_t down_cmpsr_hysteresis;
6040/*< Down compressor hysteresis constant.
6041 * Supported Q14 values: 1 to 32690.
6042 */
6043
6044 uint16_t reserved2;
6045/*< Clients must set this field to zero.*/
6046} __packed;
6047
6048#define ASM_MODULE_ID_EQUALIZER 0x00010C27
6049#define ASM_PARAM_ID_EQUALIZER_PARAMETERS 0x00010C28
6050
6051#define ASM_MAX_EQ_BANDS 12
6052
6053struct asm_eq_per_band_params {
6054 uint32_t band_idx;
6055/*< Band index.
6056 * Supported values: 0 to 11
6057 */
6058
6059 uint32_t filterype;
6060/*< Type of filter.
6061 * Supported values:
6062 * - #ASM_PARAM_EQYPE_NONE
6063 * - #ASM_PARAM_EQ_BASS_BOOST
6064 * - #ASM_PARAM_EQ_BASS_CUT
6065 * - #ASM_PARAM_EQREBLE_BOOST
6066 * - #ASM_PARAM_EQREBLE_CUT
6067 * - #ASM_PARAM_EQ_BAND_BOOST
6068 * - #ASM_PARAM_EQ_BAND_CUT
6069 */
6070
6071 uint32_t center_freq_hz;
6072 /*< Filter band center frequency in Hertz. */
6073
6074 int32_t filter_gain;
6075/*< Filter band initial gain.
6076 * Supported values: +12 to -12 dB in 1 dB increments
6077 */
6078
6079 int32_t q_factor;
6080/*< Filter band quality factor expressed as a Q8 number, i.e., a
6081 * fixed-point number with q factor of 8. For example, 3000/(2^8).
6082 */
6083} __packed;
6084
6085struct asm_eq_params {
6086 struct apr_hdr hdr;
6087 struct asm_stream_cmd_set_pp_params_v2 param;
6088 struct asm_stream_param_data_v2 data;
6089 uint32_t enable_flag;
6090/*< Specifies whether the equalizer module is disabled (0) or enabled
6091 * (nonzero).
6092 */
6093
6094 uint32_t num_bands;
6095/*< Number of bands.
6096 * Supported values: 1 to 12
6097 */
6098 struct asm_eq_per_band_params eq_bands[ASM_MAX_EQ_BANDS];
6099
6100} __packed;
6101
6102/* No equalizer effect.*/
6103#define ASM_PARAM_EQYPE_NONE 0
6104
6105/* Bass boost equalizer effect.*/
6106#define ASM_PARAM_EQ_BASS_BOOST 1
6107
6108/*Bass cut equalizer effect.*/
6109#define ASM_PARAM_EQ_BASS_CUT 2
6110
6111/* Treble boost equalizer effect */
6112#define ASM_PARAM_EQREBLE_BOOST 3
6113
6114/* Treble cut equalizer effect.*/
6115#define ASM_PARAM_EQREBLE_CUT 4
6116
6117/* Band boost equalizer effect.*/
6118#define ASM_PARAM_EQ_BAND_BOOST 5
6119
6120/* Band cut equalizer effect.*/
6121#define ASM_PARAM_EQ_BAND_CUT 6
6122
6123
6124/* ERROR CODES */
6125/* Success. The operation completed with no errors. */
6126#define ADSP_EOK 0x00000000
6127/* General failure. */
6128#define ADSP_EFAILED 0x00000001
6129/* Bad operation parameter. */
6130#define ADSP_EBADPARAM 0x00000002
6131/* Unsupported routine or operation. */
6132#define ADSP_EUNSUPPORTED 0x00000003
6133/* Unsupported version. */
6134#define ADSP_EVERSION 0x00000004
6135/* Unexpected problem encountered. */
6136#define ADSP_EUNEXPECTED 0x00000005
6137/* Unhandled problem occurred. */
6138#define ADSP_EPANIC 0x00000006
6139/* Unable to allocate resource. */
6140#define ADSP_ENORESOURCE 0x00000007
6141/* Invalid handle. */
6142#define ADSP_EHANDLE 0x00000008
6143/* Operation is already processed. */
6144#define ADSP_EALREADY 0x00000009
6145/* Operation is not ready to be processed. */
6146#define ADSP_ENOTREADY 0x0000000A
6147/* Operation is pending completion. */
6148#define ADSP_EPENDING 0x0000000B
6149/* Operation could not be accepted or processed. */
6150#define ADSP_EBUSY 0x0000000C
6151/* Operation aborted due to an error. */
6152#define ADSP_EABORTED 0x0000000D
6153/* Operation preempted by a higher priority. */
6154#define ADSP_EPREEMPTED 0x0000000E
6155/* Operation requests intervention to complete. */
6156#define ADSP_ECONTINUE 0x0000000F
6157/* Operation requests immediate intervention to complete. */
6158#define ADSP_EIMMEDIATE 0x00000010
6159/* Operation is not implemented. */
6160#define ADSP_ENOTIMPL 0x00000011
6161/* Operation needs more data or resources. */
6162#define ADSP_ENEEDMORE 0x00000012
6163/* Operation does not have memory. */
6164#define ADSP_ENOMEMORY 0x00000014
6165/* Item does not exist. */
6166#define ADSP_ENOTEXIST 0x00000015
6167/* Operation is finished. */
6168#define ADSP_ETERMINATED 0x00011174
6169
6170/*bharath, adsp_error_codes.h */
6171
6172#endif /*_APR_AUDIO_V2_H_ */