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