blob: d90288173f0e2a2e125cf589bde8fc5b5227acd7 [file] [log] [blame]
Bharath Ramachandramurthy2e3168f2012-05-03 16:29:09 -07001/* Copyright (c) 2012, Code Aurora Forum. All rights reserved.
2*
3* This program is free software; you can redistribute it and/or modify
4* it under the terms of the GNU General Public License version 2 and
5* only version 2 as published by the Free Software Foundation.
6*
7* This program is distributed in the hope that it will be useful,
8* but WITHOUT ANY WARRANTY; without even the implied warranty of
9* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10* GNU General Public License for more details.
11*/
12
13
14#ifndef _APR_AUDIO_V2_H_
15#define _APR_AUDIO_V2_H_
16
17#include <mach/qdsp6v2/apr.h>
18
19#define ADSP_ADM_VERSION 0x00070000
20
21#define ADM_CMD_SHARED_MEM_MAP_REGIONS 0x00010322
22#define ADM_CMDRSP_SHARED_MEM_MAP_REGIONS 0x00010323
23#define ADM_CMD_SHARED_MEM_UNMAP_REGIONS 0x00010324
24
25#define ADM_CMD_MATRIX_MAP_ROUTINGS_V5 0x00010325
26
27/* Enumeration for an audio Rx matrix ID.*/
28#define ADM_MATRIX_ID_AUDIO_RX 0
29
30#define ADM_MATRIX_ID_AUDIO_TX 1
31
32/* Enumeration for an audio Tx matrix ID.*/
33#define ADM_MATRIX_ID_AUDIOX 1
34
35#define ADM_MAX_COPPS 5
36
37
38/* Session map node structure.
39* Immediately following this structure are num_copps
40* entries of COPP IDs. The COPP IDs are 16 bits, so
41* there might be a padding 16-bit field if num_copps
42* is odd.
43*/
44struct adm_session_map_node_v5 {
45 u16 session_id;
46/* Handle of the ASM session to be routed. Supported values: 1
47* to 8.
48*/
49
50
51 u16 num_copps;
52 /* Number of COPPs to which this session is to be routed.
53 Supported values: 0 < num_copps <= ADM_MAX_COPPS.
54 */
55} __packed;
56
57/* Payload of the #ADM_CMD_MATRIX_MAP_ROUTINGS_V5 command.
58* Immediately following this structure are num_sessions of the session map
59* node payload (adm_session_map_node_v5).
60*/
61
62struct adm_cmd_matrix_map_routings_v5 {
63 struct apr_hdr hdr;
64
65 u32 matrix_id;
66/* Specifies whether the matrix ID is Audio Rx (0) or Audio Tx
67* (1). Use the ADM_MATRIX_ID_AUDIO_RX or ADM_MATRIX_ID_AUDIOX
68* macros to set this field.
69*/
70 u32 num_sessions;
71 /* Number of sessions being updated by this command (optional).*/
72} __packed;
73
74/* This command allows a client to open a COPP/Voice Proc. TX module
75* and sets up the device session: Matrix -> COPP -> AFE on the RX
76* and AFE -> COPP -> Matrix on the TX. This enables PCM data to
77* be transferred to/from the endpoint (AFEPortID).
78*
79* @return
80* #ADM_CMDRSP_DEVICE_OPEN_V5 with the resulting status and
81* COPP ID.
82*/
83#define ADM_CMD_DEVICE_OPEN_V5 0x00010326
84
85/* Indicates that endpoint_id_2 is to be ignored.*/
86#define ADM_CMD_COPP_OPEN_END_POINT_ID_2_IGNORE 0xFFFF
87
88#define ADM_CMD_COPP_OPEN_MODE_OF_OPERATION_RX_PATH_COPP 1
89
90#define ADM_CMD_COPP_OPEN_MODE_OF_OPERATIONX_PATH_LIVE_COPP 2
91
92#define ADM_CMD_COPP_OPEN_MODE_OF_OPERATIONX_PATH_NON_LIVE_COPP 3
93
94/* Indicates that an audio COPP is to send/receive a mono PCM
95 * stream to/from
96 * END_POINT_ID_1.
97 */
98#define ADM_CMD_COPP_OPEN_CHANNEL_CONFIG_MONO 1
99
100/* Indicates that an audio COPP is to send/receive a
101 * stereo PCM stream to/from END_POINT_ID_1.
102 */
103#define ADM_CMD_COPP_OPEN_CHANNEL_CONFIG_STEREO 2
104
105/* Sample rate is 8000 Hz.*/
106#define ADM_CMD_COPP_OPEN_SAMPLE_RATE_8K 8000
107
108/* Sample rate is 16000 Hz.*/
109#define ADM_CMD_COPP_OPEN_SAMPLE_RATE_16K 16000
110
111/* Sample rate is 48000 Hz.*/
112#define ADM_CMD_COPP_OPEN_SAMPLE_RATE_48K 48000
113
114/* Definition for a COPP live input flag bitmask.*/
115#define ADM_BIT_MASK_COPP_LIVE_INPUT_FLAG (0x0001U)
116
117/* Definition for a COPP live shift value bitmask.*/
118#define ADM_SHIFT_COPP_LIVE_INPUT_FLAG 0
119
120/* Definition for the COPP ID bitmask.*/
121#define ADM_BIT_MASK_COPP_ID (0x0000FFFFUL)
122
123/* Definition for the COPP ID shift value.*/
124#define ADM_SHIFT_COPP_ID 0
125
126/* Definition for the service ID bitmask.*/
127#define ADM_BIT_MASK_SERVICE_ID (0x00FF0000UL)
128
129/* Definition for the service ID shift value.*/
130#define ADM_SHIFT_SERVICE_ID 16
131
132/* Definition for the domain ID bitmask.*/
133#define ADM_BIT_MASK_DOMAIN_ID (0xFF000000UL)
134
135/* Definition for the domain ID shift value.*/
136#define ADM_SHIFT_DOMAIN_ID 24
137
138/* ADM device open command payload of the
139 #ADM_CMD_DEVICE_OPEN_V5 command.
140*/
141struct adm_cmd_device_open_v5 {
142 struct apr_hdr hdr;
143 u16 flags;
144/* Reserved for future use. Clients must set this field
145 * to zero.
146 */
147
148 u16 mode_of_operation;
149/* Specifies whether the COPP must be opened on the Tx or Rx
150 * path. Use the ADM_CMD_COPP_OPEN_MODE_OF_OPERATION_* macros for
151 * supported values and interpretation.
152 * Supported values:
153 * - 0x1 -- Rx path COPP
154 * - 0x2 -- Tx path live COPP
155 * - 0x3 -- Tx path nonlive COPP
156 * Live connections cause sample discarding in the Tx device
157 * matrix if the destination output ports do not pull them
158 * fast enough. Nonlive connections queue the samples
159 * indefinitely.
160 */
161
162 u16 endpoint_id_1;
163/* Logical and physical endpoint ID of the audio path.
164 * If the ID is a voice processor Tx block, it receives near
165 * samples. Supported values: Any pseudoport, AFE Rx port,
166 * or AFE Tx port For a list of valid IDs, refer to
167 * @xhyperref{Q4,[Q4]}.
168 * Q4 = Hexagon Multimedia: AFE Interface Specification
169 */
170
171 u16 endpoint_id_2;
172/* Logical and physical endpoint ID 2 for a voice processor
173 * Tx block.
174 * This is not applicable to audio COPP.
175 * Supported values:
176 * - AFE Rx port
177 * - 0xFFFF -- Endpoint 2 is unavailable and the voice
178 * processor Tx
179 * block ignores this endpoint
180 * When the voice processor Tx block is created on the audio
181 * record path,
182 * it can receive far-end samples from an AFE Rx port if the
183 * voice call
184 * is active. The ID of the AFE port is provided in this
185 * field.
186 * For a list of valid IDs, refer @xhyperref{Q4,[Q4]}.
187 */
188
189 u32 topology_id;
190 /* Audio COPP topology ID; 32-bit GUID. */
191
192 u16 dev_num_channel;
193/* Number of channels the audio COPP sends to/receives from
194 * the endpoint.
195 * Supported values: 1 to 8.
196 * The value is ignored for the voice processor Tx block,
197 * where channel
198 * configuration is derived from the topology ID.
199 */
200
201 u16 bit_width;
202/* Bit width (in bits) that the audio COPP sends to/receives
203 * from the
204 * endpoint. The value is ignored for the voice processing
205 * Tx block,
206 * where the PCM width is 16 bits.
207 */
208
209 u32 sample_rate;
210/* Sampling rate at which the audio COPP/voice processor
211 * Tx block
212 * interfaces with the endpoint.
213 * Supported values for voice processor Tx: 8000, 16000,
214 * 48000 Hz
215 * Supported values for audio COPP: >0 and <=192 kHz
216 */
217
218 u8 dev_channel_mapping[8];
219/* Array of channel mapping of buffers that the audio COPP
220 * sends to the endpoint. Channel[i] mapping describes channel
221 * I inside the buffer, where 0 < i < dev_num_channel.
222 * This value is relevent only for an audio Rx COPP.
223 * For the voice processor block and Tx audio block, this field
224 * is set to zero and is ignored.
225 */
226} __packed;
227
228/*
229 * This command allows the client to close a COPP and disconnect
230 * the device session.
231 */
232#define ADM_CMD_DEVICE_CLOSE_V5 0x00010327
233
234/* Sets one or more parameters to a COPP.
235*/
236#define ADM_CMD_SET_PP_PARAMS_V5 0x00010328
237
238/* Payload of the #ADM_CMD_SET_PP_PARAMS_V5 command.
239 * If the data_payload_addr_lsw and data_payload_addr_msw element
240 * are NULL, a series of adm_param_datastructures immediately
241 * follows, whose total size is data_payload_size bytes.
242 */
243struct adm_cmd_set_pp_params_v5 {
244 struct apr_hdr hdr;
Ben Romberger2245fc32012-09-19 14:11:27 -0700245 u32 payload_addr_lsw;
Bharath Ramachandramurthy2e3168f2012-05-03 16:29:09 -0700246 /* LSW of parameter data payload address.*/
Ben Romberger2245fc32012-09-19 14:11:27 -0700247 u32 payload_addr_msw;
Bharath Ramachandramurthy2e3168f2012-05-03 16:29:09 -0700248 /* MSW of parameter data payload address.*/
249
Ben Romberger2245fc32012-09-19 14:11:27 -0700250 u32 mem_map_handle;
Bharath Ramachandramurthy2e3168f2012-05-03 16:29:09 -0700251/* 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
Ben Romberger2245fc32012-09-19 14:11:27 -0700256 u32 payload_size;
Bharath Ramachandramurthy2e3168f2012-05-03 16:29:09 -0700257/* 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;
Phani Kumar Uppalapati64327942012-09-24 19:20:42 -07001893 struct afe_param_id_internal_bt_fm_cfg int_bt_fm;
Bharath Ramachandramurthy2e3168f2012-05-03 16:29:09 -07001894} __packed;
1895
1896struct afe_audioif_config_command {
1897 struct apr_hdr hdr;
1898 struct afe_port_cmd_set_param_v2 param;
1899 struct afe_port_param_data_v2 pdata;
1900 union afe_port_config port;
1901} __packed;
1902
1903#define AFE_PORT_CMD_DEVICE_START 0x000100E5
1904
1905/* Payload of the #AFE_PORT_CMD_DEVICE_START.*/
1906struct afe_port_cmd_device_start {
1907 struct apr_hdr hdr;
1908 u16 port_id;
1909/* Port interface and direction (Rx or Tx) to start. An even
1910 * number represents the Rx direction, and an odd number represents
1911 * the Tx direction.
1912 */
1913
1914
1915 u16 reserved;
1916/* Reserved for 32-bit alignment. This field must be set to 0.*/
1917
1918} __packed;
1919
1920#define AFE_PORT_CMD_DEVICE_STOP 0x000100E6
1921
1922/* Payload of the #AFE_PORT_CMD_DEVICE_STOP.
1923*/
1924struct afe_port_cmd_device_stop {
1925 struct apr_hdr hdr;
1926 u16 port_id;
1927/* Port interface and direction (Rx or Tx) to start. An even
1928 * number represents the Rx direction, and an odd number represents
1929 * the Tx direction.
1930 */
1931
1932 u16 reserved;
1933/* Reserved for 32-bit alignment. This field must be set to 0.*/
1934} __packed;
1935
1936#define AFE_SERVICE_CMD_SHARED_MEM_MAP_REGIONS 0x000100EA
1937
1938/* Memory map regions command payload used by the
1939 * #AFE_SERVICE_CMD_SHARED_MEM_MAP_REGIONS .
1940 * This structure allows clients to map multiple shared memory
1941 * regions in a single command. Following this structure are
1942 * num_regions of afe_service_shared_map_region_payload.
1943 */
1944struct afe_service_cmd_shared_mem_map_regions {
1945 struct apr_hdr hdr;
1946u16 mem_pool_id;
1947/* Type of memory on which this memory region is mapped.
1948 * Supported values:
1949 * - #ADSP_MEMORY_MAP_EBI_POOL
1950 * - #ADSP_MEMORY_MAP_SMI_POOL
1951 * - #ADSP_MEMORY_MAP_SHMEM8_4K_POOL
1952 * - Other values are reserved
1953 *
1954 * The memory pool ID implicitly defines the characteristics of the
1955 * memory. Characteristics may include alignment type, permissions,
1956 * etc.
1957 *
1958 * ADSP_MEMORY_MAP_EBI_POOL is External Buffer Interface type memory
1959 * ADSP_MEMORY_MAP_SMI_POOL is Shared Memory Interface type memory
1960 * ADSP_MEMORY_MAP_SHMEM8_4K_POOL is shared memory, byte
1961 * addressable, and 4 KB aligned.
1962 */
1963
1964
1965 u16 num_regions;
1966/* Number of regions to map.
1967 * Supported values:
1968 * - Any value greater than zero
1969 */
1970
1971 u32 property_flag;
1972/* Configures one common property for all the regions in the
1973 * payload.
1974 *
1975 * Supported values: - 0x00000000 to 0x00000001
1976 *
1977 * b0 - bit 0 indicates physical or virtual mapping 0 Shared memory
1978 * address provided in afe_service_shared_map_region_payloadis a
1979 * physical address. The shared memory needs to be mapped( hardware
1980 * TLB entry) and a software entry needs to be added for internal
1981 * book keeping.
1982 *
1983 * 1 Shared memory address provided in
1984 * afe_service_shared_map_region_payloadis a virtual address. The
1985 * shared memory must not be mapped (since hardware TLB entry is
1986 * already available) but a software entry needs to be added for
1987 * internal book keeping. This can be useful if two services with in
1988 * ADSP is communicating via APR. They can now directly communicate
1989 * via the Virtual address instead of Physical address. The virtual
1990 * regions must be contiguous. num_regions must be 1 in this case.
1991 *
1992 * b31-b1 - reserved bits. must be set to zero
1993 */
1994
1995
1996} __packed;
1997/* Map region payload used by the
1998 * afe_service_shared_map_region_payloadstructure.
1999 */
2000struct afe_service_shared_map_region_payload {
2001 u32 shm_addr_lsw;
2002/* least significant word of starting address in the memory
2003 * region to map. It must be contiguous memory, and it must be 4 KB
2004 * aligned.
2005 * Supported values: - Any 32 bit value
2006 */
2007
2008
2009 u32 shm_addr_msw;
2010/* most significant word of startng address in the memory region
2011 * to map. For 32 bit shared memory address, this field must be set
2012 * to zero. For 36 bit shared memory address, bit31 to bit 4 must be
2013 * set to zero
2014 *
2015 * Supported values: - For 32 bit shared memory address, this field
2016 * must be set to zero. - For 36 bit shared memory address, bit31 to
2017 * bit 4 must be set to zero - For 64 bit shared memory address, any
2018 * 32 bit value
2019 */
2020
2021
2022 u32 mem_size_bytes;
2023/* Number of bytes in the region. The aDSP will always map the
2024 * regions as virtual contiguous memory, but the memory size must be
2025 * in multiples of 4 KB to avoid gaps in the virtually contiguous
2026 * mapped memory.
2027 *
2028 * Supported values: - multiples of 4KB
2029 */
2030
2031} __packed;
2032
2033#define AFE_SERVICE_CMDRSP_SHARED_MEM_MAP_REGIONS 0x000100EB
2034struct afe_service_cmdrsp_shared_mem_map_regions {
2035 u32 mem_map_handle;
2036/* A memory map handle encapsulating shared memory attributes is
2037 * returned iff AFE_SERVICE_CMD_SHARED_MEM_MAP_REGIONS command is
2038 * successful. In the case of failure , a generic APR error response
2039 * is returned to the client.
2040 *
2041 * Supported Values: - Any 32 bit value
2042 */
2043
2044} __packed;
2045#define AFE_SERVICE_CMD_SHARED_MEM_UNMAP_REGIONS 0x000100EC
2046/* Memory unmap regions command payload used by the
2047 * #AFE_SERVICE_CMD_SHARED_MEM_UNMAP_REGIONS
2048 *
2049 * This structure allows clients to unmap multiple shared memory
2050 * regions in a single command.
2051 */
2052
2053
2054struct afe_service_cmd_shared_mem_unmap_regions {
2055 struct apr_hdr hdr;
2056u32 mem_map_handle;
2057/* memory map handle returned by
2058 * AFE_SERVICE_CMD_SHARED_MEM_MAP_REGIONS commands
2059 *
2060 * Supported Values:
2061 * - Any 32 bit value
2062 */
2063} __packed;
2064
2065#define AFE_PORT_CMD_GET_PARAM_V2 0x000100F0
2066
2067/* Payload of the #AFE_PORT_CMD_GET_PARAM_V2 command,
2068 * which queries for one post/preprocessing parameter of a
2069 * stream.
2070 */
2071struct afe_port_cmd_get_param_v2 {
2072
2073 struct apr_hdr hdr;
2074u16 port_id;
2075/* Port interface and direction (Rx or Tx) to start. */
2076
2077 u16 payload_size;
2078/* Maximum data size of the parameter ID/module ID combination.
2079 * This is a multiple of four bytes
2080 * Supported values: > 0
2081 */
2082
2083 u32 payload_address_lsw;
2084/* LSW of 64 bit Payload address. Address should be 32-byte,
2085 * 4kbyte aligned and must be contig memory.
2086 */
2087
2088
2089 u32 payload_address_msw;
2090/* MSW of 64 bit Payload address. In case of 32-bit shared
2091 * memory address, this field must be set to zero. In case of 36-bit
2092 * shared memory address, bit-4 to bit-31 must be set to zero.
2093 * Address should be 32-byte, 4kbyte aligned and must be contiguous
2094 * memory.
2095 */
2096
2097 u32 mem_map_handle;
2098/* Memory map handle returned by
2099 * AFE_SERVICE_CMD_SHARED_MEM_MAP_REGIONS commands.
2100 * Supported Values: - NULL -- Message. The parameter data is
2101 * in-band. - Non-NULL -- The parameter data is Out-band.Pointer to
2102 * - the physical address in shared memory of the payload data.
2103 * For detailed payload content, see the afe_port_param_data_v2
2104 * structure
2105 */
2106
2107
2108 u32 module_id;
2109/* ID of the module to be queried.
2110 * Supported values: Valid module ID
2111 */
2112
2113 u32 param_id;
2114/* ID of the parameter to be queried.
2115 * Supported values: Valid parameter ID
2116 */
2117} __packed;
2118
2119#define AFE_PORT_CMDRSP_GET_PARAM_V2 0x00010106
2120
2121/* Payload of the #AFE_PORT_CMDRSP_GET_PARAM_V2 message, which
2122 * responds to an #AFE_PORT_CMD_GET_PARAM_V2 command.
2123 *
2124 * Immediately following this structure is the parameters structure
2125 * (afe_port_param_data) containing the response(acknowledgment)
2126 * parameter payload. This payload is included for an in-band
2127 * scenario. For an address/shared memory-based set parameter, this
2128 * payload is not needed.
2129 */
2130
2131
2132struct afe_port_cmdrsp_get_param_v2 {
2133 u32 status;
2134} __packed;
2135
2136/* adsp_afe_service_commands.h */
2137
2138#define ADSP_MEMORY_MAP_EBI_POOL 0
2139
2140#define ADSP_MEMORY_MAP_SMI_POOL 1
2141#define ADSP_MEMORY_MAP_IMEM_POOL 2
2142#define ADSP_MEMORY_MAP_SHMEM8_4K_POOL 3
2143/*
2144* Definition of virtual memory flag
2145*/
2146#define ADSP_MEMORY_MAP_VIRTUAL_MEMORY 1
2147
2148/*
2149* Definition of physical memory flag
2150*/
2151#define ADSP_MEMORY_MAP_PHYSICAL_MEMORY 0
2152
2153
2154#define DEFAULT_COPP_TOPOLOGY 0x00010be3
2155#define DEFAULT_POPP_TOPOLOGY 0x00010be4
2156#define VPM_TX_SM_ECNS_COPP_TOPOLOGY 0x00010F71
2157#define VPM_TX_DM_FLUENCE_COPP_TOPOLOGY 0x00010F72
2158#define VPM_TX_QMIC_FLUENCE_COPP_TOPOLOGY 0x00010F75
2159
2160/* Memory map regions command payload used by the
2161 * #ASM_CMD_SHARED_MEM_MAP_REGIONS ,#ADM_CMD_SHARED_MEM_MAP_REGIONS
2162 * commands.
2163 *
2164 * This structure allows clients to map multiple shared memory
2165 * regions in a single command. Following this structure are
2166 * num_regions of avs_shared_map_region_payload.
2167 */
2168
2169
2170struct avs_cmd_shared_mem_map_regions {
2171 struct apr_hdr hdr;
2172 u16 mem_pool_id;
2173/* Type of memory on which this memory region is mapped.
2174 *
2175 * Supported values: - #ADSP_MEMORY_MAP_EBI_POOL -
2176 * #ADSP_MEMORY_MAP_SMI_POOL - #ADSP_MEMORY_MAP_IMEM_POOL
2177 * (unsupported) - #ADSP_MEMORY_MAP_SHMEM8_4K_POOL - Other values
2178 * are reserved
2179 *
2180 * The memory ID implicitly defines the characteristics of the
2181 * memory. Characteristics may include alignment type, permissions,
2182 * etc.
2183 *
2184 * SHMEM8_4K is shared memory, byte addressable, and 4 KB aligned.
2185 */
2186
2187
2188 u16 num_regions;
2189 /* Number of regions to map.*/
2190
2191 u32 property_flag;
2192/* Configures one common property for all the regions in the
2193 * payload. No two regions in the same memory map regions cmd can
2194 * have differnt property. Supported values: - 0x00000000 to
2195 * 0x00000001
2196 *
2197 * b0 - bit 0 indicates physical or virtual mapping 0 shared memory
2198 * address provided in avs_shared_map_regions_payload is physical
2199 * address. The shared memory needs to be mapped( hardware TLB
2200 * entry)
2201 *
2202 * and a software entry needs to be added for internal book keeping.
2203 *
2204 * 1 Shared memory address provided in MayPayload[usRegions] is
2205 * virtual address. The shared memory must not be mapped (since
2206 * hardware TLB entry is already available) but a software entry
2207 * needs to be added for internal book keeping. This can be useful
2208 * if two services with in ADSP is communicating via APR. They can
2209 * now directly communicate via the Virtual address instead of
2210 * Physical address. The virtual regions must be contiguous.
2211 *
2212 * b31-b1 - reserved bits. must be set to zero
2213 */
2214
2215} __packed;
2216
2217struct avs_shared_map_region_payload {
2218 u32 shm_addr_lsw;
2219/* least significant word of shared memory address of the memory
2220 * region to map. It must be contiguous memory, and it must be 4 KB
2221 * aligned.
2222 */
2223
2224 u32 shm_addr_msw;
2225/* most significant word of shared memory address of the memory
2226 * region to map. For 32 bit shared memory address, this field must
2227 * tbe set to zero. For 36 bit shared memory address, bit31 to bit 4
2228 * must be set to zero
2229 */
2230
2231 u32 mem_size_bytes;
2232/* Number of bytes in the region.
2233 *
2234 * The aDSP will always map the regions as virtual contiguous
2235 * memory, but the memory size must be in multiples of 4 KB to avoid
2236 * gaps in the virtually contiguous mapped memory.
2237 */
2238
2239} __packed;
2240
2241struct avs_cmd_shared_mem_unmap_regions {
2242 struct apr_hdr hdr;
2243 u32 mem_map_handle;
2244/* memory map handle returned by ASM_CMD_SHARED_MEM_MAP_REGIONS
2245 * , ADM_CMD_SHARED_MEM_MAP_REGIONS, commands
2246 */
2247
2248} __packed;
2249
2250/* Memory map command response payload used by the
2251 * #ASM_CMDRSP_SHARED_MEM_MAP_REGIONS
2252 * ,#ADM_CMDRSP_SHARED_MEM_MAP_REGIONS
2253 */
2254
2255
2256struct avs_cmdrsp_shared_mem_map_regions {
2257 u32 mem_map_handle;
2258/* A memory map handle encapsulating shared memory attributes is
2259 * returned
2260 */
2261
2262} __packed;
2263
2264/*adsp_audio_memmap_api.h*/
2265
2266/* ASM related data structures */
2267struct asm_wma_cfg {
2268 u16 format_tag;
2269 u16 ch_cfg;
2270 u32 sample_rate;
2271 u32 avg_bytes_per_sec;
2272 u16 block_align;
2273 u16 valid_bits_per_sample;
2274 u32 ch_mask;
2275 u16 encode_opt;
2276 u16 adv_encode_opt;
2277 u32 adv_encode_opt2;
2278 u32 drc_peak_ref;
2279 u32 drc_peak_target;
2280 u32 drc_ave_ref;
2281 u32 drc_ave_target;
2282} __packed;
2283
2284struct asm_wmapro_cfg {
2285 u16 format_tag;
2286 u16 ch_cfg;
2287 u32 sample_rate;
2288 u32 avg_bytes_per_sec;
2289 u16 block_align;
2290 u16 valid_bits_per_sample;
2291 u32 ch_mask;
2292 u16 encode_opt;
2293 u16 adv_encode_opt;
2294 u32 adv_encode_opt2;
2295 u32 drc_peak_ref;
2296 u32 drc_peak_target;
2297 u32 drc_ave_ref;
2298 u32 drc_ave_target;
2299} __packed;
2300
2301struct asm_aac_cfg {
2302 u16 format;
2303 u16 aot;
2304 u16 ep_config;
2305 u16 section_data_resilience;
2306 u16 scalefactor_data_resilience;
2307 u16 spectral_data_resilience;
2308 u16 ch_cfg;
2309 u16 reserved;
2310 u32 sample_rate;
2311} __packed;
2312
2313struct asm_softpause_params {
2314 u32 enable;
2315 u32 period;
2316 u32 step;
2317 u32 rampingcurve;
2318} __packed;
2319
2320struct asm_softvolume_params {
2321 u32 period;
2322 u32 step;
2323 u32 rampingcurve;
2324} __packed;
2325
2326#define ASM_END_POINT_DEVICE_MATRIX 0
Harmandeep Singheaf59b42012-06-05 21:46:02 -07002327
2328#define PCM_CHANNEL_NULL 0
2329
Bharath Ramachandramurthy2e3168f2012-05-03 16:29:09 -07002330/* Front left channel. */
2331#define PCM_CHANNEL_FL 1
2332
2333/* Front right channel. */
2334#define PCM_CHANNEL_FR 2
2335
2336/* Front center channel. */
2337#define PCM_CHANNEL_FC 3
2338
2339/* Left surround channel.*/
2340#define PCM_CHANNEL_LS 4
2341
2342/* Right surround channel.*/
2343#define PCM_CHANNEL_RS 5
2344
2345/* Low frequency effect channel. */
2346#define PCM_CHANNEL_LFE 6
2347
2348/* Center surround channel; Rear center channel. */
2349#define PCM_CHANNEL_CS 7
2350
2351/* Left back channel; Rear left channel. */
2352#define PCM_CHANNEL_LB 8
2353
2354/* Right back channel; Rear right channel. */
2355#define PCM_CHANNEL_RB 9
2356
2357/* Top surround channel. */
2358#define PCM_CHANNELS 10
2359
2360/* Center vertical height channel.*/
2361#define PCM_CHANNEL_CVH 11
2362
2363/* Mono surround channel.*/
2364#define PCM_CHANNEL_MS 12
2365
2366/* Front left of center. */
2367#define PCM_CHANNEL_FLC 13
2368
2369/* Front right of center. */
2370#define PCM_CHANNEL_FRC 14
2371
2372/* Rear left of center. */
2373#define PCM_CHANNEL_RLC 15
2374
2375/* Rear right of center. */
2376#define PCM_CHANNEL_RRC 16
2377
2378#define PCM_FORMAT_MAX_NUM_CHANNEL 8
2379
2380#define ASM_MEDIA_FMT_MULTI_CHANNEL_PCM_V2 0x00010DA5
2381
2382#define ASM_STREAM_POSTPROC_TOPO_ID_DEFAULT 0x00010BE4
2383
2384#define ASM_MEDIA_FMT_EVRCB_FS 0x00010BEF
2385
2386#define ASM_MEDIA_FMT_EVRCWB_FS 0x00010BF0
2387
2388#define ASM_MAX_EQ_BANDS 12
2389
2390#define ASM_DATA_CMD_MEDIA_FMT_UPDATE_V2 0x00010D98
2391
2392struct asm_data_cmd_media_fmt_update_v2 {
2393u32 fmt_blk_size;
2394 /* Media format block size in bytes.*/
2395} __packed;
2396
2397struct asm_multi_channel_pcm_fmt_blk_v2 {
2398 struct apr_hdr hdr;
2399 struct asm_data_cmd_media_fmt_update_v2 fmt_blk;
2400
2401 u16 num_channels;
2402 /* Number of channels. Supported values: 1 to 8 */
2403 u16 bits_per_sample;
2404/* Number of bits per sample per channel. * Supported values:
2405 * 16, 24 * When used for playback, the client must send 24-bit
2406 * samples packed in 32-bit words. The 24-bit samples must be placed
2407 * in the most significant 24 bits of the 32-bit word. When used for
2408 * recording, the aDSP sends 24-bit samples packed in 32-bit words.
2409 * The 24-bit samples are placed in the most significant 24 bits of
2410 * the 32-bit word.
2411 */
2412
2413
2414 u32 sample_rate;
2415/* Number of samples per second (in Hertz).
2416 * Supported values: 2000 to 48000
2417 */
2418
2419 u16 is_signed;
2420 /* Flag that indicates the samples are signed (1). */
2421
2422 u16 reserved;
2423 /* reserved field for 32 bit alignment. must be set to zero. */
2424
2425 u8 channel_mapping[8];
2426/* Channel array of size 8.
2427 * Supported values:
2428 * - #PCM_CHANNEL_L
2429 * - #PCM_CHANNEL_R
2430 * - #PCM_CHANNEL_C
2431 * - #PCM_CHANNEL_LS
2432 * - #PCM_CHANNEL_RS
2433 * - #PCM_CHANNEL_LFE
2434 * - #PCM_CHANNEL_CS
2435 * - #PCM_CHANNEL_LB
2436 * - #PCM_CHANNEL_RB
2437 * - #PCM_CHANNELS
2438 * - #PCM_CHANNEL_CVH
2439 * - #PCM_CHANNEL_MS
2440 * - #PCM_CHANNEL_FLC
2441 * - #PCM_CHANNEL_FRC
2442 * - #PCM_CHANNEL_RLC
2443 * - #PCM_CHANNEL_RRC
2444 *
2445 * Channel[i] mapping describes channel I. Each element i of the
2446 * array describes channel I inside the buffer where 0 @le I <
2447 * num_channels. An unused channel is set to zero.
2448 */
2449} __packed;
2450
2451struct asm_stream_cmd_set_encdec_param {
Harmandeep Singheaf59b42012-06-05 21:46:02 -07002452 u32 param_id;
Bharath Ramachandramurthy2e3168f2012-05-03 16:29:09 -07002453 /* ID of the parameter. */
2454
2455 u32 param_size;
2456/* Data size of this parameter, in bytes. The size is a multiple
2457 * of 4 bytes.
2458 */
2459
2460} __packed;
2461
2462struct asm_enc_cfg_blk_param_v2 {
2463 u32 frames_per_buf;
2464/* Number of encoded frames to pack into each buffer.
2465 *
2466 * @note1hang This is only guidance information for the aDSP. The
2467 * number of encoded frames put into each buffer (specified by the
2468 * client) is less than or equal to this number.
2469 */
2470
2471 u32 enc_cfg_blk_size;
2472/* Size in bytes of the encoder configuration block that follows
2473 * this member.
2474 */
2475
2476} __packed;
2477
2478/* @brief Multichannel PCM encoder configuration structure used
2479 * in the #ASM_STREAM_CMD_OPEN_READ_V2 command.
2480 */
2481
2482struct asm_multi_channel_pcm_enc_cfg_v2 {
2483 struct apr_hdr hdr;
2484 struct asm_stream_cmd_set_encdec_param encdec;
2485 struct asm_enc_cfg_blk_param_v2 encblk;
2486 uint16_t num_channels;
2487/*< Number of PCM channels.
2488 *
2489 * Supported values: - 0 -- Native mode - 1 -- 8 Native mode
2490 * indicates that encoding must be performed with the number of
2491 * channels at the input.
2492 */
2493
2494 uint16_t bits_per_sample;
2495/*< Number of bits per sample per channel.
2496 * Supported values: 16, 24
2497 */
2498
2499 uint32_t sample_rate;
2500/*< Number of samples per second (in Hertz).
2501 *
2502 * Supported values: 0, 8000 to 48000 A value of 0 indicates the
2503 * native sampling rate. Encoding is performed at the input sampling
2504 * rate.
2505 */
2506
2507 uint16_t is_signed;
2508/*< Specifies whether the samples are signed (1). Currently,
2509 * only signed samples are supported.
2510 */
2511
2512 uint16_t reserved;
2513/*< reserved field for 32 bit alignment. must be set to zero.*/
2514
2515
2516 uint8_t channel_mapping[8];
2517} __packed;
2518
2519#define ASM_MEDIA_FMT_MP3 0x00010BE9
2520#define ASM_MEDIA_FMT_AAC_V2 0x00010DA6
2521
2522/* @xreflabel
2523 * {hdr:AsmMediaFmtDolbyAac} Media format ID for the
2524 * Dolby AAC decoder. This format ID is be used if the client wants
2525 * to use the Dolby AAC decoder to decode MPEG2 and MPEG4 AAC
2526 * contents.
2527 */
2528
2529#define ASM_MEDIA_FMT_DOLBY_AAC 0x00010D86
2530
2531/* Enumeration for the audio data transport stream AAC format. */
2532#define ASM_MEDIA_FMT_AAC_FORMAT_FLAG_ADTS 0
2533
2534/* Enumeration for low overhead audio stream AAC format. */
2535#define ASM_MEDIA_FMT_AAC_FORMAT_FLAG_LOAS 1
2536
2537/* Enumeration for the audio data interchange format
2538 * AAC format.
2539 */
2540#define ASM_MEDIA_FMT_AAC_FORMAT_FLAG_ADIF 2
2541
2542/* Enumeration for the raw AAC format. */
2543#define ASM_MEDIA_FMT_AAC_FORMAT_FLAG_RAW 3
2544
2545#define ASM_MEDIA_FMT_AAC_AOT_LC 2
2546#define ASM_MEDIA_FMT_AAC_AOT_SBR 5
2547#define ASM_MEDIA_FMT_AAC_AOT_PS 29
2548#define ASM_MEDIA_FMT_AAC_AOT_BSAC 22
2549
2550struct asm_aac_fmt_blk_v2 {
2551 struct apr_hdr hdr;
2552 struct asm_data_cmd_media_fmt_update_v2 fmt_blk;
2553
2554 u16 aac_fmt_flag;
2555/* Bitstream format option.
2556 * Supported values:
2557 * - #ASM_MEDIA_FMT_AAC_FORMAT_FLAG_ADTS
2558 * - #ASM_MEDIA_FMT_AAC_FORMAT_FLAG_LOAS
2559 * - #ASM_MEDIA_FMT_AAC_FORMAT_FLAG_ADIF
2560 * - #ASM_MEDIA_FMT_AAC_FORMAT_FLAG_RAW
2561 */
2562
2563 u16 audio_objype;
2564/* Audio Object Type (AOT) present in the AAC stream.
2565 * Supported values:
2566 * - #ASM_MEDIA_FMT_AAC_AOT_LC
2567 * - #ASM_MEDIA_FMT_AAC_AOT_SBR
2568 * - #ASM_MEDIA_FMT_AAC_AOT_BSAC
2569 * - #ASM_MEDIA_FMT_AAC_AOT_PS
2570 * - Otherwise -- Not supported
2571 */
2572
2573 u16 channel_config;
2574/* Number of channels present in the AAC stream.
2575 * Supported values:
2576 * - 1 -- Mono
2577 * - 2 -- Stereo
2578 * - 6 -- 5.1 content
2579 */
2580
Bharath Ramachandramurthy2e3168f2012-05-03 16:29:09 -07002581 u16 total_size_of_PCE_bits;
2582/* greater or equal to zero. * -In case of RAW formats and
2583 * channel config = 0 (PCE), client can send * the bit stream
2584 * containing PCE immediately following this structure * (in-band).
2585 * -This number does not include bits included for 32 bit alignment.
2586 * -If zero, then the PCE info is assumed to be available in the
2587 * audio -bit stream & not in-band.
2588 */
2589
2590 u32 sample_rate;
2591/* Number of samples per second (in Hertz).
2592 *
2593 * Supported values: 8000, 11025, 12000, 16000, 22050, 24000, 32000,
2594 * 44100, 48000
2595 *
2596 * This field must be equal to the sample rate of the AAC-LC
2597 * decoder's output. - For MP4 or 3GP containers, this is indicated
2598 * by the samplingFrequencyIndex field in the AudioSpecificConfig
2599 * element. - For ADTS format, this is indicated by the
2600 * samplingFrequencyIndex in the ADTS fixed header. - For ADIF
2601 * format, this is indicated by the samplingFrequencyIndex in the
2602 * program_config_element present in the ADIF header.
2603 */
2604
2605} __packed;
2606
2607struct asm_aac_enc_cfg_v2 {
2608 struct apr_hdr hdr;
2609 struct asm_stream_cmd_set_encdec_param encdec;
2610 struct asm_enc_cfg_blk_param_v2 encblk;
2611
2612 u32 bit_rate;
2613 /* Encoding rate in bits per second. */
2614 u32 enc_mode;
2615/* Encoding mode.
2616 * Supported values:
2617 * - #ASM_MEDIA_FMT_AAC_AOT_LC
2618 * - #ASM_MEDIA_FMT_AAC_AOT_SBR
2619 * - #ASM_MEDIA_FMT_AAC_AOT_PS
2620 */
2621 u16 aac_fmt_flag;
2622/* AAC format flag.
2623 * Supported values:
2624 * - #ASM_MEDIA_FMT_AAC_FORMAT_FLAG_ADTS
2625 * - #ASM_MEDIA_FMT_AAC_FORMAT_FLAG_RAW
2626 */
2627 u16 channel_cfg;
2628/* Number of channels to encode.
2629 * Supported values:
2630 * - 0 -- Native mode
2631 * - 1 -- Mono
2632 * - 2 -- Stereo
2633 * - Other values are not supported.
2634 * @note1hang The eAAC+ encoder mode supports only stereo.
2635 * Native mode indicates that encoding must be performed with the
2636 * number of channels at the input.
2637 * The number of channels must not change during encoding.
2638 */
2639
2640 u32 sample_rate;
2641/* Number of samples per second.
2642 * Supported values: - 0 -- Native mode - For other values,
2643 * Native mode indicates that encoding must be performed with the
2644 * sampling rate at the input.
2645 * The sampling rate must not change during encoding.
2646 */
2647
2648} __packed;
2649
2650#define ASM_MEDIA_FMT_AMRNB_FS 0x00010BEB
2651
2652/* Enumeration for 4.75 kbps AMR-NB Encoding mode. */
2653#define ASM_MEDIA_FMT_AMRNB_FS_ENCODE_MODE_MR475 0
2654
2655/* Enumeration for 5.15 kbps AMR-NB Encoding mode. */
2656#define ASM_MEDIA_FMT_AMRNB_FS_ENCODE_MODE_MR515 1
2657
2658/* Enumeration for 5.90 kbps AMR-NB Encoding mode. */
2659#define ASM_MEDIA_FMT_AMRNB_FS_ENCODE_MODE_MMR59 2
2660
2661/* Enumeration for 6.70 kbps AMR-NB Encoding mode. */
2662#define ASM_MEDIA_FMT_AMRNB_FS_ENCODE_MODE_MMR67 3
2663
2664/* Enumeration for 7.40 kbps AMR-NB Encoding mode. */
2665#define ASM_MEDIA_FMT_AMRNB_FS_ENCODE_MODE_MMR74 4
2666
2667/* Enumeration for 7.95 kbps AMR-NB Encoding mode. */
2668#define ASM_MEDIA_FMT_AMRNB_FS_ENCODE_MODE_MMR795 5
2669
2670/* Enumeration for 10.20 kbps AMR-NB Encoding mode. */
2671#define ASM_MEDIA_FMT_AMRNB_FS_ENCODE_MODE_MMR102 6
2672
2673/* Enumeration for 12.20 kbps AMR-NB Encoding mode. */
2674#define ASM_MEDIA_FMT_AMRNB_FS_ENCODE_MODE_MMR122 7
2675
2676/* Enumeration for AMR-NB Discontinuous Transmission mode off. */
2677#define ASM_MEDIA_FMT_AMRNB_FS_DTX_MODE_OFF 0
2678
2679/* Enumeration for AMR-NB DTX mode VAD1. */
2680#define ASM_MEDIA_FMT_AMRNB_FS_DTX_MODE_VAD1 1
2681
2682/* Enumeration for AMR-NB DTX mode VAD2. */
2683#define ASM_MEDIA_FMT_AMRNB_FS_DTX_MODE_VAD2 2
2684
2685/* Enumeration for AMR-NB DTX mode auto.
2686 */
2687#define ASM_MEDIA_FMT_AMRNB_FS_DTX_MODE_AUTO 3
2688
2689struct asm_amrnb_enc_cfg {
2690 struct apr_hdr hdr;
2691 struct asm_stream_cmd_set_encdec_param encdec;
2692 struct asm_enc_cfg_blk_param_v2 encblk;
2693
2694 u16 enc_mode;
2695/* AMR-NB encoding rate.
2696 * Supported values:
2697 * Use the ASM_MEDIA_FMT_AMRNB_FS_ENCODE_MODE_*
2698 * macros
2699 */
2700
2701 u16 dtx_mode;
2702/* Specifies whether DTX mode is disabled or enabled.
2703 * Supported values:
2704 * - #ASM_MEDIA_FMT_AMRNB_FS_DTX_MODE_OFF
2705 * - #ASM_MEDIA_FMT_AMRNB_FS_DTX_MODE_VAD1
2706 */
2707} __packed;
2708
2709#define ASM_MEDIA_FMT_AMRWB_FS 0x00010BEC
2710
2711/* Enumeration for 6.6 kbps AMR-WB Encoding mode. */
2712#define ASM_MEDIA_FMT_AMRWB_FS_ENCODE_MODE_MR66 0
2713
2714/* Enumeration for 8.85 kbps AMR-WB Encoding mode. */
2715#define ASM_MEDIA_FMT_AMRWB_FS_ENCODE_MODE_MR885 1
2716
2717/* Enumeration for 12.65 kbps AMR-WB Encoding mode. */
2718#define ASM_MEDIA_FMT_AMRWB_FS_ENCODE_MODE_MR1265 2
2719
2720/* Enumeration for 14.25 kbps AMR-WB Encoding mode. */
2721#define ASM_MEDIA_FMT_AMRWB_FS_ENCODE_MODE_MR1425 3
2722
2723/* Enumeration for 15.85 kbps AMR-WB Encoding mode. */
2724#define ASM_MEDIA_FMT_AMRWB_FS_ENCODE_MODE_MR1585 4
2725
2726/* Enumeration for 18.25 kbps AMR-WB Encoding mode. */
2727#define ASM_MEDIA_FMT_AMRWB_FS_ENCODE_MODE_MR1825 5
2728
2729/* Enumeration for 19.85 kbps AMR-WB Encoding mode. */
2730#define ASM_MEDIA_FMT_AMRWB_FS_ENCODE_MODE_MR1985 6
2731
2732/* Enumeration for 23.05 kbps AMR-WB Encoding mode. */
2733#define ASM_MEDIA_FMT_AMRWB_FS_ENCODE_MODE_MR2305 7
2734
2735/* Enumeration for 23.85 kbps AMR-WB Encoding mode.
2736 */
2737#define ASM_MEDIA_FMT_AMRWB_FS_ENCODE_MODE_MR2385 8
2738
2739struct asm_amrwb_enc_cfg {
2740 struct apr_hdr hdr;
2741 struct asm_stream_cmd_set_encdec_param encdec;
2742 struct asm_enc_cfg_blk_param_v2 encblk;
2743
2744 u16 enc_mode;
2745/* AMR-WB encoding rate.
2746 * Suupported values:
2747 * Use the ASM_MEDIA_FMT_AMRWB_FS_ENCODE_MODE_*
2748 * macros
2749 */
2750
2751 u16 dtx_mode;
2752/* Specifies whether DTX mode is disabled or enabled.
2753 * Supported values:
2754 * - #ASM_MEDIA_FMT_AMRNB_FS_DTX_MODE_OFF
2755 * - #ASM_MEDIA_FMT_AMRNB_FS_DTX_MODE_VAD1
2756 */
2757} __packed;
2758
2759#define ASM_MEDIA_FMT_V13K_FS 0x00010BED
2760
2761/* Enumeration for 14.4 kbps V13K Encoding mode. */
2762#define ASM_MEDIA_FMT_V13K_FS_ENCODE_MODE_MR1440 0
2763
2764/* Enumeration for 12.2 kbps V13K Encoding mode. */
2765#define ASM_MEDIA_FMT_V13K_FS_ENCODE_MODE_MR1220 1
2766
2767/* Enumeration for 11.2 kbps V13K Encoding mode. */
2768#define ASM_MEDIA_FMT_V13K_FS_ENCODE_MODE_MR1120 2
2769
2770/* Enumeration for 9.0 kbps V13K Encoding mode. */
2771#define ASM_MEDIA_FMT_V13K_FS_ENCODE_MODE_MR90 3
2772
2773/* Enumeration for 7.2 kbps V13K eEncoding mode. */
2774#define ASM_MEDIA_FMT_V13K_FS_ENCODE_MODE_MR720 4
2775
2776/* Enumeration for 1/8 vocoder rate.*/
2777#define ASM_MEDIA_FMT_VOC_ONE_EIGHTH_RATE 1
2778
2779/* Enumeration for 1/4 vocoder rate. */
2780#define ASM_MEDIA_FMT_VOC_ONE_FOURTH_RATE 2
2781
2782/* Enumeration for 1/2 vocoder rate. */
2783#define ASM_MEDIA_FMT_VOC_HALF_RATE 3
2784
2785/* Enumeration for full vocoder rate.
2786 */
2787#define ASM_MEDIA_FMT_VOC_FULL_RATE 4
2788
2789struct asm_v13k_enc_cfg {
2790 struct apr_hdr hdr;
2791 struct asm_stream_cmd_set_encdec_param encdec;
2792 struct asm_enc_cfg_blk_param_v2 encblk;
2793 u16 max_rate;
2794/* Maximum allowed encoder frame rate.
2795 * Supported values:
2796 * - #ASM_MEDIA_FMT_VOC_ONE_EIGHTH_RATE
2797 * - #ASM_MEDIA_FMT_VOC_ONE_FOURTH_RATE
2798 * - #ASM_MEDIA_FMT_VOC_HALF_RATE
2799 * - #ASM_MEDIA_FMT_VOC_FULL_RATE
2800 */
2801
2802 u16 min_rate;
2803/* Minimum allowed encoder frame rate.
2804 * Supported values:
2805 * - #ASM_MEDIA_FMT_VOC_ONE_EIGHTH_RATE
2806 * - #ASM_MEDIA_FMT_VOC_ONE_FOURTH_RATE
2807 * - #ASM_MEDIA_FMT_VOC_HALF_RATE
2808 * - #ASM_MEDIA_FMT_VOC_FULL_RATE
2809 */
2810
2811 u16 reduced_rate_cmd;
2812/* Reduced rate command, used to change
2813 * the average bitrate of the V13K
2814 * vocoder.
2815 * Supported values:
2816 * - #ASM_MEDIA_FMT_V13K_FS_ENCODE_MODE_MR1440 (Default)
2817 * - #ASM_MEDIA_FMT_V13K_FS_ENCODE_MODE_MR1220
2818 * - #ASM_MEDIA_FMT_V13K_FS_ENCODE_MODE_MR1120
2819 * - #ASM_MEDIA_FMT_V13K_FS_ENCODE_MODE_MR90
2820 * - #ASM_MEDIA_FMT_V13K_FS_ENCODE_MODE_MR720
2821 */
2822
2823 u16 rate_mod_cmd;
2824/* Rate modulation command. Default = 0.
2825 *- If bit 0=1, rate control is enabled.
2826 *- If bit 1=1, the maximum number of consecutive full rate
2827 * frames is limited with numbers supplied in
2828 * bits 2 to 10.
2829 *- If bit 1=0, the minimum number of non-full rate frames
2830 * in between two full rate frames is forced to
2831 * the number supplied in bits 2 to 10. In both cases, if necessary,
2832 * half rate is used to substitute full rate. - Bits 15 to 10 are
2833 * reserved and must all be set to zero.
2834 */
2835
2836} __packed;
2837
2838#define ASM_MEDIA_FMT_EVRC_FS 0x00010BEE
2839
2840/* EVRC encoder configuration structure used in the
2841 * #ASM_STREAM_CMD_OPEN_READ_V2 command.
2842 */
2843struct asm_evrc_enc_cfg {
2844 struct apr_hdr hdr;
2845 struct asm_stream_cmd_set_encdec_param encdec;
2846 struct asm_enc_cfg_blk_param_v2 encblk;
2847 u16 max_rate;
2848/* Maximum allowed encoder frame rate.
2849 * Supported values:
2850 * - #ASM_MEDIA_FMT_VOC_ONE_EIGHTH_RATE
2851 * - #ASM_MEDIA_FMT_VOC_ONE_FOURTH_RATE
2852 * - #ASM_MEDIA_FMT_VOC_HALF_RATE
2853 * - #ASM_MEDIA_FMT_VOC_FULL_RATE
2854 */
2855
2856 u16 min_rate;
2857/* Minimum allowed encoder frame rate.
2858 * Supported values:
2859 * - #ASM_MEDIA_FMT_VOC_ONE_EIGHTH_RATE
2860 * - #ASM_MEDIA_FMT_VOC_ONE_FOURTH_RATE
2861 * - #ASM_MEDIA_FMT_VOC_HALF_RATE
2862 * - #ASM_MEDIA_FMT_VOC_FULL_RATE
2863 */
2864
2865 u16 rate_mod_cmd;
2866/* Rate modulation command. Default: 0.
2867 * - If bit 0=1, rate control is enabled.
2868 * - If bit 1=1, the maximum number of consecutive full rate frames
2869 * is limited with numbers supplied in bits 2 to 10.
2870 *
2871 * - If bit 1=0, the minimum number of non-full rate frames in
2872 * between two full rate frames is forced to the number supplied in
2873 * bits 2 to 10. In both cases, if necessary, half rate is used to
2874 * substitute full rate.
2875 *
2876 * - Bits 15 to 10 are reserved and must all be set to zero.
2877 */
2878
2879 u16 reserved;
2880 /* Reserved. Clients must set this field to zero. */
2881} __packed;
2882
2883#define ASM_MEDIA_FMT_WMA_V10PRO_V2 0x00010DA7
2884
2885struct asm_wmaprov10_fmt_blk_v2 {
2886 struct apr_hdr hdr;
2887 struct asm_data_cmd_media_fmt_update_v2 fmtblk;
2888
2889 u16 fmtag;
2890/* WMA format type.
2891 * Supported values:
2892 * - 0x162 -- WMA 9 Pro
2893 * - 0x163 -- WMA 9 Pro Lossless
2894 * - 0x166 -- WMA 10 Pro
2895 * - 0x167 -- WMA 10 Pro Lossless
2896 */
2897
2898 u16 num_channels;
2899/* Number of channels encoded in the input stream.
2900 * Supported values: 1 to 8
2901 */
2902
2903 u32 sample_rate;
2904/* Number of samples per second (in Hertz).
2905 * Supported values: 11025, 16000, 22050, 32000, 44100, 48000,
2906 * 88200, 96000
2907 */
2908
2909 u32 avg_bytes_per_sec;
2910/* Bitrate expressed as the average bytes per second.
2911 * Supported values: 2000 to 96000
2912 */
2913
2914 u16 blk_align;
2915/* Size of the bitstream packet size in bytes. WMA Pro files
2916 * have a payload of one block per bitstream packet.
2917 * Supported values: @le 13376
2918 */
2919
2920 u16 bits_per_sample;
2921/* Number of bits per sample in the encoded WMA stream.
2922 * Supported values: 16, 24
2923 */
2924
2925 u32 channel_mask;
2926/* Bit-packed double word (32-bits) that indicates the
2927 * recommended speaker positions for each source channel.
2928 */
2929
2930 u16 enc_options;
2931/* Bit-packed word with values that indicate whether certain
2932 * features of the bitstream are used.
2933 * Supported values: - 0x0001 -- ENCOPT3_PURE_LOSSLESS - 0x0006 --
2934 * ENCOPT3_FRM_SIZE_MOD - 0x0038 -- ENCOPT3_SUBFRM_DIV - 0x0040 --
2935 * ENCOPT3_WRITE_FRAMESIZE_IN_HDR - 0x0080 --
2936 * ENCOPT3_GENERATE_DRC_PARAMS - 0x0100 -- ENCOPT3_RTMBITS
2937 */
2938
2939
2940 u16 usAdvancedEncodeOpt;
2941 /* Advanced encoding option. */
2942
2943 u32 advanced_enc_options2;
2944 /* Advanced encoding option 2. */
2945
2946} __packed;
2947
2948#define ASM_MEDIA_FMT_WMA_V9_V2 0x00010DA8
2949struct asm_wmastdv9_fmt_blk_v2 {
2950 struct apr_hdr hdr;
2951 struct asm_data_cmd_media_fmt_update_v2 fmtblk;
2952 u16 fmtag;
2953/* WMA format tag.
2954 * Supported values: 0x161 (WMA 9 standard)
2955 */
2956
2957 u16 num_channels;
2958/* Number of channels in the stream.
2959 * Supported values: 1, 2
2960 */
2961
2962 u32 sample_rate;
2963/* Number of samples per second (in Hertz).
2964 * Supported values: 48000
2965 */
2966
2967 u32 avg_bytes_per_sec;
2968 /* Bitrate expressed as the average bytes per second. */
2969
2970 u16 blk_align;
2971/* Block align. All WMA files with a maximum packet size of
2972 * 13376 are supported.
2973 */
2974
2975
2976 u16 bits_per_sample;
2977/* Number of bits per sample in the output.
2978 * Supported values: 16
2979 */
2980
2981 u32 channel_mask;
2982/* Channel mask.
2983 * Supported values:
2984 * - 3 -- Stereo (front left/front right)
2985 * - 4 -- Mono (center)
2986 */
2987
2988 u16 enc_options;
2989 /* Options used during encoding. */
2990
Harmandeep Singheaf59b42012-06-05 21:46:02 -07002991 u16 reserved;
2992
Bharath Ramachandramurthy2e3168f2012-05-03 16:29:09 -07002993} __packed;
2994
2995#define ASM_MEDIA_FMT_WMA_V8 0x00010D91
2996
2997struct asm_wmastdv8_enc_cfg {
2998 struct apr_hdr hdr;
2999 struct asm_stream_cmd_set_encdec_param encdec;
3000 struct asm_enc_cfg_blk_param_v2 encblk;
3001 u32 bit_rate;
3002 /* Encoding rate in bits per second. */
3003
3004 u32 sample_rate;
3005/* Number of samples per second.
3006 *
3007 * Supported values:
3008 * - 0 -- Native mode
3009 * - Other Supported values are 22050, 32000, 44100, and 48000.
3010 *
3011 * Native mode indicates that encoding must be performed with the
3012 * sampling rate at the input.
3013 * The sampling rate must not change during encoding.
3014 */
3015
3016 u16 channel_cfg;
3017/* Number of channels to encode.
3018 * Supported values:
3019 * - 0 -- Native mode
3020 * - 1 -- Mono
3021 * - 2 -- Stereo
3022 * - Other values are not supported.
3023 *
3024 * Native mode indicates that encoding must be performed with the
3025 * number of channels at the input.
3026 * The number of channels must not change during encoding.
3027 */
3028
3029 u16 reserved;
3030 /* Reserved. Clients must set this field to zero.*/
3031 } __packed;
3032
3033#define ASM_MEDIA_FMT_AMR_WB_PLUS_V2 0x00010DA9
3034
3035struct asm_amrwbplus_fmt_blk_v2 {
3036 struct apr_hdr hdr;
3037 struct asm_data_cmd_media_fmt_update_v2 fmtblk;
3038 u32 amr_frame_fmt;
3039/* AMR frame format.
3040 * Supported values:
3041 * - 6 -- Transport Interface Format (TIF)
3042 * - Any other value -- File storage format (FSF)
3043 *
3044 * TIF stream contains 2-byte header for each frame within the
3045 * superframe. FSF stream contains one 2-byte header per superframe.
3046 */
3047
3048} __packed;
3049
3050#define ASM_MEDIA_FMT_AC3_DEC 0x00010BF6
3051#define ASM_MEDIA_FMT_EAC3_DEC 0x00010C3C
3052#define ASM_MEDIA_FMT_DTS 0x00010D88
3053
3054/* Media format ID for adaptive transform acoustic coding. This
3055 * ID is used by the #ASM_STREAM_CMD_OPEN_WRITE_COMPRESSED command
3056 * only.
3057 */
3058
3059#define ASM_MEDIA_FMT_ATRAC 0x00010D89
3060
3061/* Media format ID for metadata-enhanced audio transmission.
3062 * This ID is used by the #ASM_STREAM_CMD_OPEN_WRITE_COMPRESSED
3063 * command only.
3064 */
3065
3066#define ASM_MEDIA_FMT_MAT 0x00010D8A
3067
3068/* adsp_media_fmt.h */
3069
3070#define ASM_DATA_CMD_WRITE_V2 0x00010DAB
3071
3072struct asm_data_cmd_write_v2 {
3073 struct apr_hdr hdr;
3074 u32 buf_addr_lsw;
3075/* The 64 bit address msw-lsw should be a valid, mapped address.
3076 * 64 bit address should be a multiple of 32 bytes
3077 */
3078
3079 u32 buf_addr_msw;
3080/* The 64 bit address msw-lsw should be a valid, mapped address.
3081 * 64 bit address should be a multiple of 32 bytes.
3082 * -Address of the buffer containing the data to be decoded.
3083 * The buffer should be aligned to a 32 byte boundary.
3084 * -In the case of 32 bit Shared memory address, msw field must
3085 * -be set to zero.
3086 * -In the case of 36 bit shared memory address, bit 31 to bit 4
3087 * -of msw must be set to zero.
3088 */
3089 u32 mem_map_handle;
3090/* memory map handle returned by DSP through
3091 * ASM_CMD_SHARED_MEM_MAP_REGIONS command
3092 */
3093 u32 buf_size;
3094/* Number of valid bytes available in the buffer for decoding. The
3095 * first byte starts at buf_addr.
3096 */
3097
3098 u32 seq_id;
3099 /* Optional buffer sequence ID. */
3100
3101 u32 timestamp_lsw;
3102/* Lower 32 bits of the 64-bit session time in microseconds of the
3103 * first buffer sample.
3104 */
3105
3106 u32 timestamp_msw;
3107/* Upper 32 bits of the 64-bit session time in microseconds of the
3108 * first buffer sample.
3109 */
3110
3111 u32 flags;
3112/* Bitfield of flags.
3113 * Supported values for bit 31:
3114 * - 1 -- Valid timestamp.
3115 * - 0 -- Invalid timestamp.
3116 * - Use #ASM_BIT_MASKIMESTAMP_VALID_FLAG as the bitmask and
3117 * #ASM_SHIFTIMESTAMP_VALID_FLAG as the shift value to set this bit.
3118 * Supported values for bit 30:
3119 * - 1 -- Last buffer.
3120 * - 0 -- Not the last buffer.
3121 *
3122 * Supported values for bit 29:
3123 * - 1 -- Continue the timestamp from the previous buffer.
3124 * - 0 -- Timestamp of the current buffer is not related
3125 * to the timestamp of the previous buffer.
3126 * - Use #ASM_BIT_MASKS_CONTINUE_FLAG and #ASM_SHIFTS_CONTINUE_FLAG
3127 * to set this bit.
3128 *
3129 * Supported values for bit 4:
3130 * - 1 -- End of the frame.
3131 * - 0 -- Not the end of frame, or this information is not known.
3132 * - Use #ASM_BIT_MASK_EOF_FLAG as the bitmask and #ASM_SHIFT_EOF_FLAG
3133 * as the shift value to set this bit.
3134 *
3135 * All other bits are reserved and must be set to 0.
3136 *
3137 * If bit 31=0 and bit 29=1: The timestamp of the first sample in
3138 * this buffer continues from the timestamp of the last sample in
3139 * the previous buffer. If there is no previous buffer (i.e., this
3140 * is the first buffer sent after opening the stream or after a
3141 * flush operation), or if the previous buffer does not have a valid
3142 * timestamp, the samples in the current buffer also do not have a
3143 * valid timestamp. They are played out as soon as possible.
3144 *
3145 *
3146 * If bit 31=0 and bit 29=0: No timestamp is associated with the
3147 * first sample in this buffer. The samples are played out as soon
3148 * as possible.
3149 *
3150 *
3151 * If bit 31=1 and bit 29 is ignored: The timestamp specified in
3152 * this payload is honored.
3153 *
3154 *
3155 * If bit 30=0: Not the last buffer in the stream. This is useful
3156 * in removing trailing samples.
3157 *
3158 *
3159 * For bit 4: The client can set this flag for every buffer sent in
3160 * which the last byte is the end of a frame. If this flag is set,
3161 * the buffer can contain data from multiple frames, but it should
3162 * always end at a frame boundary. Restrictions allow the aDSP to
3163 * detect an end of frame without requiring additional processing.
3164 */
3165
3166} __packed;
3167
3168#define ASM_DATA_CMD_READ_V2 0x00010DAC
3169
3170struct asm_data_cmd_read_v2 {
3171 struct apr_hdr hdr;
3172 u32 buf_addr_lsw;
3173/* the 64 bit address msw-lsw should be a valid mapped address
3174 * and should be a multiple of 32 bytes
3175 */
3176
3177
3178 u32 buf_addr_msw;
3179/* the 64 bit address msw-lsw should be a valid mapped address
3180 * and should be a multiple of 32 bytes.
3181* - Address of the buffer where the DSP puts the encoded data,
3182* potentially, at an offset specified by the uOffset field in
3183* ASM_DATA_EVENT_READ_DONE structure. The buffer should be aligned
3184* to a 32 byte boundary.
3185*- In the case of 32 bit Shared memory address, msw field must
3186*- be set to zero.
3187*- In the case of 36 bit shared memory address, bit 31 to bit
3188*- 4 of msw must be set to zero.
3189*/
3190 u32 mem_map_handle;
3191/* memory map handle returned by DSP through
3192 * ASM_CMD_SHARED_MEM_MAP_REGIONS command.
3193 */
3194
3195 u32 buf_size;
3196/* Number of bytes available for the aDSP to write. The aDSP
3197 * starts writing from buf_addr.
3198 */
3199
3200 u32 seq_id;
3201 /* Optional buffer sequence ID.
3202 */
3203} __packed;
3204
3205#define ASM_DATA_CMD_EOS 0x00010BDB
3206#define ASM_DATA_EVENT_RENDERED_EOS 0x00010C1C
3207#define ASM_DATA_EVENT_EOS 0x00010BDD
3208
3209#define ASM_DATA_EVENT_WRITE_DONE_V2 0x00010D99
3210struct asm_data_event_write_done_v2 {
3211 u32 buf_addr_lsw;
3212 /* lsw of the 64 bit address */
3213 u32 buf_addr_msw;
3214 /* msw of the 64 bit address. address given by the client in
3215 * ASM_DATA_CMD_WRITE_V2 command.
3216 */
3217 u32 mem_map_handle;
3218 /* memory map handle in the ASM_DATA_CMD_WRITE_V2 */
3219
3220 u32 status;
3221/* Status message (error code) that indicates whether the
3222 * referenced buffer has been successfully consumed.
3223 * Supported values: Refer to @xhyperref{Q3,[Q3]}
3224 */
3225} __packed;
3226
3227#define ASM_DATA_EVENT_READ_DONE_V2 0x00010D9A
3228
3229/* Definition of the frame metadata flag bitmask.*/
3230#define ASM_BIT_MASK_FRAME_METADATA_FLAG (0x40000000UL)
3231
3232/* Definition of the frame metadata flag shift value. */
3233#define ASM_SHIFT_FRAME_METADATA_FLAG 30
3234
3235struct asm_data_event_read_done_v2 {
3236 u32 status;
3237/* Status message (error code).
3238 * Supported values: Refer to @xhyperref{Q3,[Q3]}
3239 */
3240
3241u32 buf_addr_lsw;
3242/* 64 bit address msw-lsw is a valid, mapped address. 64 bit
3243 * address is a multiple of 32 bytes.
3244 */
3245
3246u32 buf_addr_msw;
3247/* 64 bit address msw-lsw is a valid, mapped address. 64 bit
3248* address is a multiple of 32 bytes.
3249*
3250* -Same address provided by the client in ASM_DATA_CMD_READ_V2
3251* -In the case of 32 bit Shared memory address, msw field is set to
3252* zero.
3253* -In the case of 36 bit shared memory address, bit 31 to bit 4
3254* -of msw is set to zero.
3255*/
3256
3257u32 mem_map_handle;
3258/* memory map handle in the ASM_DATA_CMD_READ_V2 */
3259
3260u32 enc_framesotal_size;
3261/* Total size of the encoded frames in bytes.
3262 * Supported values: >0
3263 */
3264
3265u32 offset;
3266/* Offset (from buf_addr) to the first byte of the first encoded
3267 * frame. All encoded frames are consecutive, starting from this
3268 * offset.
3269 * Supported values: > 0
3270 */
3271
3272u32 timestamp_lsw;
3273/* Lower 32 bits of the 64-bit session time in microseconds of
3274 * the first sample in the buffer. If Bit 5 of mode_flags flag of
3275 * ASM_STREAM_CMD_OPEN_READ_V2 is 1 then the 64 bit timestamp is
3276 * absolute capture time otherwise it is relative session time. The
3277 * absolute timestamp doesnt reset unless the system is reset.
3278 */
3279
3280
3281u32 timestamp_msw;
3282/* Upper 32 bits of the 64-bit session time in microseconds of
3283 * the first sample in the buffer.
3284 */
3285
3286
3287u32 flags;
3288/* Bitfield of flags. Bit 30 indicates whether frame metadata is
3289 * present. If frame metadata is present, num_frames consecutive
3290 * instances of @xhyperref{hdr:FrameMetaData,Frame metadata} start
3291 * at the buffer address.
3292 * Supported values for bit 31:
3293 * - 1 -- Timestamp is valid.
3294 * - 0 -- Timestamp is invalid.
3295 * - Use #ASM_BIT_MASKIMESTAMP_VALID_FLAG and
3296 * #ASM_SHIFTIMESTAMP_VALID_FLAG to set this bit.
3297 *
3298 * Supported values for bit 30:
3299 * - 1 -- Frame metadata is present.
3300 * - 0 -- Frame metadata is absent.
3301 * - Use #ASM_BIT_MASK_FRAME_METADATA_FLAG and
3302 * #ASM_SHIFT_FRAME_METADATA_FLAG to set this bit.
3303 *
3304 * All other bits are reserved; the aDSP sets them to 0.
3305 */
3306
3307u32 num_frames;
3308/* Number of encoded frames in the buffer. */
3309
3310u32 seq_id;
3311/* Optional buffer sequence ID. */
3312} __packed;
3313
3314struct asm_data_read_buf_metadata_v2 {
3315 u32 offset;
3316/* Offset from buf_addr in #ASM_DATA_EVENT_READ_DONE_PAYLOAD to
3317 * the frame associated with this metadata.
3318 * Supported values: > 0
3319 */
3320
3321u32 frm_size;
3322/* Size of the encoded frame in bytes.
3323 * Supported values: > 0
3324 */
3325
3326u32 num_encoded_pcm_samples;
3327/* Number of encoded PCM samples (per channel) in the frame
3328 * associated with this metadata.
3329 * Supported values: > 0
3330 */
3331
3332u32 timestamp_lsw;
3333/* Lower 32 bits of the 64-bit session time in microseconds of the
3334 * first sample for this frame.
3335 * If Bit 5 of mode_flags flag of ASM_STREAM_CMD_OPEN_READ_V2 is 1
3336 * then the 64 bit timestamp is absolute capture time otherwise it
3337 * is relative session time. The absolute timestamp doesnt reset
3338 * unless the system is reset.
3339 */
3340
3341
3342u32 timestamp_msw;
3343/* Lower 32 bits of the 64-bit session time in microseconds of the
3344 * first sample for this frame.
3345 */
3346
3347u32 flags;
3348/* Frame flags.
3349 * Supported values for bit 31:
3350 * - 1 -- Time stamp is valid
3351 * - 0 -- Time stamp is not valid
3352 * - All other bits are reserved; the aDSP sets them to 0.
3353*/
3354} __packed;
3355
3356/* Notifies the client of a change in the data sampling rate or
3357 * Channel mode. This event is raised by the decoder service. The
3358 * event is enabled through the mode flags of
3359 * #ASM_STREAM_CMD_OPEN_WRITE_V2 or
3360 * #ASM_STREAM_CMD_OPEN_READWRITE_V2. - The decoder detects a change
3361 * in the output sampling frequency or the number/positioning of
3362 * output channels, or if it is the first frame decoded.The new
3363 * sampling frequency or the new channel configuration is
3364 * communicated back to the client asynchronously.
3365 */
3366
3367#define ASM_DATA_EVENT_SR_CM_CHANGE_NOTIFY 0x00010C65
3368
3369/* Payload of the #ASM_DATA_EVENT_SR_CM_CHANGE_NOTIFY event.
3370 * This event is raised when the following conditions are both true:
3371 * - The event is enabled through the mode_flags of
3372 * #ASM_STREAM_CMD_OPEN_WRITE_V2 or
3373 * #ASM_STREAM_CMD_OPEN_READWRITE_V2. - The decoder detects a change
3374 * in either the output sampling frequency or the number/positioning
3375 * of output channels, or if it is the first frame decoded.
3376 * This event is not raised (even if enabled) if the decoder is
3377 * MIDI, because
3378 */
3379
3380
3381struct asm_data_event_sr_cm_change_notify {
3382 u32 sample_rate;
3383/* New sampling rate (in Hertz) after detecting a change in the
3384 * bitstream.
3385 * Supported values: 2000 to 48000
3386 */
3387
3388 u16 num_channels;
3389/* New number of channels after detecting a change in the
3390 * bitstream.
3391 * Supported values: 1 to 8
3392 */
3393
3394
3395 u16 reserved;
3396 /* Reserved for future use. This field must be set to 0.*/
3397
3398 u8 channel_mapping[8];
3399
3400} __packed;
3401
3402/* Notifies the client of a data sampling rate or channel mode
3403 * change. This event is raised by the encoder service.
3404 * This event is raised when :
3405 * - Native mode encoding was requested in the encoder
3406 * configuration (i.e., the channel number was 0), the sample rate
3407 * was 0, or both were 0.
3408 *
3409 * - The input data frame at the encoder is the first one, or the
3410 * sampling rate/channel mode is different from the previous input
3411 * data frame.
3412 *
3413 */
3414#define ASM_DATA_EVENT_ENC_SR_CM_CHANGE_NOTIFY 0x00010BDE
3415
3416struct asm_data_event_enc_sr_cm_change_notify {
3417 u32 sample_rate;
3418/* New sampling rate (in Hertz) after detecting a change in the
3419 * input data.
3420 * Supported values: 2000 to 48000
3421 */
3422
3423
3424 u16 num_channels;
3425/* New number of channels after detecting a change in the input
3426 * data. Supported values: 1 to 8
3427 */
3428
3429
3430 u16 bits_per_sample;
3431/* New bits per sample after detecting a change in the input
3432 * data.
3433 * Supported values: 16, 24
3434 */
3435
3436
3437 u8 channel_mapping[8];
3438
3439} __packed;
3440#define ASM_DATA_CMD_IEC_60958_FRAME_RATE 0x00010D87
3441
3442
3443/* Payload of the #ASM_DATA_CMD_IEC_60958_FRAME_RATE command,
3444 * which is used to indicate the IEC 60958 frame rate of a given
3445 * packetized audio stream.
3446 */
3447
3448struct asm_data_cmd_iec_60958_frame_rate {
3449 u32 frame_rate;
3450/* IEC 60958 frame rate of the incoming IEC 61937 packetized stream.
3451 * Supported values: Any valid frame rate
3452 */
3453} __packed;
3454
3455/* adsp_asm_data_commands.h*/
3456#define ASM_SVC_CMD_GET_STREAM_HANDLES 0x00010C0B
3457
3458#define ASM_SVC_CMDRSP_GET_STREAM_HANDLES 0x00010C1B
3459
3460/* Definition of the stream ID bitmask.*/
3461#define ASM_BIT_MASK_STREAM_ID (0x000000FFUL)
3462
3463/* Definition of the stream ID shift value.*/
3464#define ASM_SHIFT_STREAM_ID 0
3465
3466/* Definition of the session ID bitmask.*/
3467#define ASM_BIT_MASK_SESSION_ID (0x0000FF00UL)
3468
3469/* Definition of the session ID shift value.*/
3470#define ASM_SHIFT_SESSION_ID 8
3471
3472/* Definition of the service ID bitmask.*/
3473#define ASM_BIT_MASK_SERVICE_ID (0x00FF0000UL)
3474
3475/* Definition of the service ID shift value.*/
3476#define ASM_SHIFT_SERVICE_ID 16
3477
3478/* Definition of the domain ID bitmask.*/
3479#define ASM_BIT_MASK_DOMAIN_ID (0xFF000000UL)
3480
3481/* Definition of the domain ID shift value.*/
3482#define ASM_SHIFT_DOMAIN_ID 24
3483
3484/* Payload of the #ASM_SVC_CMDRSP_GET_STREAM_HANDLES message,
3485 * which returns a list of currently active stream handles.
3486 * Immediately following this structure are num_handles of uint32
3487 * stream handles.
3488 */
3489
3490
3491struct asm_svc_cmdrsp_get_stream_handles {
3492 u32 num_handles;
3493 /* Number of active stream handles. */
3494} __packed;
3495
3496#define ASM_CMD_SHARED_MEM_MAP_REGIONS 0x00010D92
3497#define ASM_CMDRSP_SHARED_MEM_MAP_REGIONS 0x00010D93
3498#define ASM_CMD_SHARED_MEM_UNMAP_REGIONS 0x00010D94
3499
3500/* adsp_asm_service_commands.h */
3501
3502#define ASM_MAX_SESSION_ID (8)
3503
3504/* Maximum number of sessions.*/
3505#define ASM_MAX_NUM_SESSIONS ASM_MAX_SESSION_ID
3506
3507/* Maximum number of streams per session.*/
3508#define ASM_MAX_STREAMS_PER_SESSION (8)
3509#define ASM_SESSION_CMD_RUN_V2 0x00010DAA
3510#define ASM_SESSION_CMD_RUN_STARTIME_RUN_IMMEDIATE 0
3511#define ASM_SESSION_CMD_RUN_STARTIME_RUN_AT_ABSOLUTEIME 1
3512#define ASM_SESSION_CMD_RUN_STARTIME_RUN_AT_RELATIVEIME 2
3513#define ASM_SESSION_CMD_RUN_STARTIME_RUN_WITH_DELAY 3
3514
3515#define ASM_BIT_MASK_RUN_STARTIME (0x00000003UL)
3516
3517/* Bit shift value used to specify the start time for the
3518 * ASM_SESSION_CMD_RUN_V2 command.
3519 */
3520#define ASM_SHIFT_RUN_STARTIME 0
3521struct asm_session_cmd_run_v2 {
3522 struct apr_hdr hdr;
3523 u32 flags;
3524/* Specifies whether to run immediately or at a specific
3525 * rendering time or with a specified delay. Run with delay is
3526 * useful for delaying in case of ASM loopback opened through
3527 * ASM_STREAM_CMD_OPEN_LOOPBACK_V2. Use #ASM_BIT_MASK_RUN_STARTIME
3528 * and #ASM_SHIFT_RUN_STARTIME to set this 2-bit flag.
3529 *
3530 *
3531 *Bits 0 and 1 can take one of four possible values:
3532 *
3533 *- #ASM_SESSION_CMD_RUN_STARTIME_RUN_IMMEDIATE
3534 *- #ASM_SESSION_CMD_RUN_STARTIME_RUN_AT_ABSOLUTEIME
3535 *- #ASM_SESSION_CMD_RUN_STARTIME_RUN_AT_RELATIVEIME
3536 *- #ASM_SESSION_CMD_RUN_STARTIME_RUN_WITH_DELAY
3537 *
3538 *All other bits are reserved; clients must set them to zero.
3539 */
3540
3541 u32 time_lsw;
3542/* Lower 32 bits of the time in microseconds used to align the
3543 * session origin time. When bits 0-1 of flags is
3544 * ASM_SESSION_CMD_RUN_START_RUN_WITH_DELAY, time lsw is the lsw of
3545 * the delay in us. For ASM_SESSION_CMD_RUN_START_RUN_WITH_DELAY,
3546 * maximum value of the 64 bit delay is 150 ms.
3547 */
3548
3549 u32 time_msw;
3550/* Upper 32 bits of the time in microseconds used to align the
3551 * session origin time. When bits 0-1 of flags is
3552 * ASM_SESSION_CMD_RUN_START_RUN_WITH_DELAY, time msw is the msw of
3553 * the delay in us. For ASM_SESSION_CMD_RUN_START_RUN_WITH_DELAY,
3554 * maximum value of the 64 bit delay is 150 ms.
3555 */
3556
3557} __packed;
3558
3559#define ASM_SESSION_CMD_PAUSE 0x00010BD3
3560#define ASM_SESSION_CMD_GET_SESSIONTIME_V3 0x00010D9D
3561#define ASM_SESSION_CMD_REGISTER_FOR_RX_UNDERFLOW_EVENTS 0x00010BD5
3562
3563struct asm_session_cmd_rgstr_rx_underflow {
3564 struct apr_hdr hdr;
3565 u16 enable_flag;
3566/* Specifies whether a client is to receive events when an Rx
3567 * session underflows.
3568 * Supported values:
3569 * - 0 -- Do not send underflow events
3570 * - 1 -- Send underflow events
3571 */
3572 u16 reserved;
3573 /* Reserved. This field must be set to zero.*/
3574} __packed;
3575
3576#define ASM_SESSION_CMD_REGISTER_FORX_OVERFLOW_EVENTS 0x00010BD6
3577
3578struct asm_session_cmd_regx_overflow {
3579 struct apr_hdr hdr;
3580 u16 enable_flag;
3581/* Specifies whether a client is to receive events when a Tx
3582* session overflows.
3583 * Supported values:
3584 * - 0 -- Do not send overflow events
3585 * - 1 -- Send overflow events
3586 */
3587
3588 u16 reserved;
3589 /* Reserved. This field must be set to zero.*/
3590} __packed;
3591
3592#define ASM_SESSION_EVENT_RX_UNDERFLOW 0x00010C17
3593#define ASM_SESSION_EVENTX_OVERFLOW 0x00010C18
3594#define ASM_SESSION_CMDRSP_GET_SESSIONTIME_V3 0x00010D9E
3595
3596struct asm_session_cmdrsp_get_sessiontime_v3 {
3597 u32 status;
3598 /* Status message (error code).
3599 * Supported values: Refer to @xhyperref{Q3,[Q3]}
3600 */
3601
3602 u32 sessiontime_lsw;
3603 /* Lower 32 bits of the current session time in microseconds.*/
3604
3605 u32 sessiontime_msw;
3606 /* Upper 32 bits of the current session time in microseconds.*/
3607
3608 u32 absolutetime_lsw;
3609/* Lower 32 bits in micro seconds of the absolute time at which
3610 * the * sample corresponding to the above session time gets
3611 * rendered * to hardware. This absolute time may be slightly in the
3612 * future or past.
3613 */
3614
3615
3616 u32 absolutetime_msw;
3617/* Upper 32 bits in micro seconds of the absolute time at which
3618 * the * sample corresponding to the above session time gets
3619 * rendered to * hardware. This absolute time may be slightly in the
3620 * future or past.
3621 */
3622
3623} __packed;
3624
3625#define ASM_SESSION_CMD_ADJUST_SESSION_CLOCK_V2 0x00010D9F
3626
3627struct asm_session_cmd_adjust_session_clock_v2 {
3628 struct apr_hdr hdr;
3629u32 adjustime_lsw;
3630/* Lower 32 bits of the signed 64-bit quantity that specifies the
3631 * adjustment time in microseconds to the session clock.
3632 *
3633 * Positive values indicate advancement of the session clock.
3634 * Negative values indicate delay of the session clock.
3635 */
3636
3637
3638 u32 adjustime_msw;
3639/* Upper 32 bits of the signed 64-bit quantity that specifies
3640 * the adjustment time in microseconds to the session clock.
3641 * Positive values indicate advancement of the session clock.
3642 * Negative values indicate delay of the session clock.
3643 */
3644
3645} __packed;
3646
3647#define ASM_SESSION_CMDRSP_ADJUST_SESSION_CLOCK_V2 0x00010DA0
3648
3649struct asm_session_cmdrsp_adjust_session_clock_v2 {
3650 u32 status;
3651/* Status message (error code).
3652 * Supported values: Refer to @xhyperref{Q3,[Q3]}
3653 * An error means the session clock is not adjusted. In this case,
3654 * the next two fields are irrelevant.
3655 */
3656
3657
3658 u32 actual_adjustime_lsw;
3659/* Lower 32 bits of the signed 64-bit quantity that specifies
3660 * the actual adjustment in microseconds performed by the aDSP.
3661 * A positive value indicates advancement of the session clock. A
3662 * negative value indicates delay of the session clock.
3663 */
3664
3665
3666 u32 actual_adjustime_msw;
3667/* Upper 32 bits of the signed 64-bit quantity that specifies
3668 * the actual adjustment in microseconds performed by the aDSP.
3669 * A positive value indicates advancement of the session clock. A
3670 * negative value indicates delay of the session clock.
3671 */
3672
3673
3674 u32 cmd_latency_lsw;
3675/* Lower 32 bits of the unsigned 64-bit quantity that specifies
3676 * the amount of time in microseconds taken to perform the session
3677 * clock adjustment.
3678 */
3679
3680
3681 u32 cmd_latency_msw;
3682/* Upper 32 bits of the unsigned 64-bit quantity that specifies
3683 * the amount of time in microseconds taken to perform the session
3684 * clock adjustment.
3685 */
3686
3687} __packed;
3688
3689#define ASM_SESSION_CMD_GET_PATH_DELAY_V2 0x00010DAF
3690#define ASM_SESSION_CMDRSP_GET_PATH_DELAY_V2 0x00010DB0
3691
3692struct asm_session_cmdrsp_get_path_delay_v2 {
3693 u32 status;
3694/* Status message (error code). Whether this get delay operation
3695 * is successful or not. Delay value is valid only if status is
3696 * success.
3697 * Supported values: Refer to @xhyperref{Q5,[Q5]}
3698 */
3699
3700 u32 audio_delay_lsw;
3701 /* Upper 32 bits of the aDSP delay in microseconds. */
3702
3703 u32 audio_delay_msw;
3704 /* Lower 32 bits of the aDSP delay in microseconds. */
3705
3706} __packed;
3707
3708/* adsp_asm_session_command.h*/
3709#define ASM_STREAM_CMD_OPEN_WRITE_V2 0x00010D8F
3710
3711struct asm_stream_cmd_open_write_v2 {
3712 struct apr_hdr hdr;
3713 uint32_t mode_flags;
3714/* Mode flags that configure the stream to notify the client
3715 * whenever it detects an SR/CM change at the input to its POPP.
3716 * Supported values for bits 0 to 1:
3717 * - Reserved; clients must set them to zero.
3718 * Supported values for bit 2:
3719 * - 0 -- SR/CM change notification event is disabled.
3720 * - 1 -- SR/CM change notification event is enabled.
3721 * - Use #ASM_BIT_MASK_SR_CM_CHANGE_NOTIFY_FLAG and
3722 * #ASM_SHIFT_SR_CM_CHANGE_NOTIFY_FLAG to set or get this bit.
3723 *
3724 * Supported values for bit 31:
3725 * - 0 -- Stream to be opened in on-Gapless mode.
3726 * - 1 -- Stream to be opened in Gapless mode. In Gapless mode,
3727 * successive streams must be opened with same session ID but
3728 * different stream IDs.
3729 *
3730 * - Use #ASM_BIT_MASK_GAPLESS_MODE_FLAG and
3731 * #ASM_SHIFT_GAPLESS_MODE_FLAG to set or get this bit.
3732 *
3733 *
3734 * @note1hang MIDI and DTMF streams cannot be opened in Gapless mode.
3735 */
3736
3737 uint16_t sink_endpointype;
3738/*< Sink point type.
3739 * Supported values:
3740 * - 0 -- Device matrix
3741 * - Other values are reserved.
3742 *
3743 * The device matrix is the gateway to the hardware ports.
3744 */
3745
3746 uint16_t bits_per_sample;
3747/*< Number of bits per sample processed by ASM modules.
3748 * Supported values: 16 and 24 bits per sample
3749 */
3750
3751 uint32_t postprocopo_id;
3752/*< Specifies the topology (order of processing) of
3753 * postprocessing algorithms. <i>None</i> means no postprocessing.
3754 * Supported values:
3755 * - #ASM_STREAM_POSTPROCOPO_ID_DEFAULT
3756 * - #ASM_STREAM_POSTPROCOPO_ID_MCH_PEAK_VOL
3757 * - #ASM_STREAM_POSTPROCOPO_ID_NONE
3758 *
3759 * This field can also be enabled through SetParams flags.
3760 */
3761
3762 uint32_t dec_fmt_id;
3763/*< Configuration ID of the decoder media format.
3764 *
3765 * Supported values:
3766 * - #ASM_MEDIA_FMT_MULTI_CHANNEL_PCM_V2
3767 * - #ASM_MEDIA_FMT_ADPCM
3768 * - #ASM_MEDIA_FMT_MP3
3769 * - #ASM_MEDIA_FMT_AAC_V2
3770 * - #ASM_MEDIA_FMT_DOLBY_AAC
3771 * - #ASM_MEDIA_FMT_AMRNB_FS
3772 * - #ASM_MEDIA_FMT_AMRWB_FS
3773 * - #ASM_MEDIA_FMT_AMR_WB_PLUS_V2
3774 * - #ASM_MEDIA_FMT_V13K_FS
3775 * - #ASM_MEDIA_FMT_EVRC_FS
3776 * - #ASM_MEDIA_FMT_EVRCB_FS
3777 * - #ASM_MEDIA_FMT_EVRCWB_FS
3778 * - #ASM_MEDIA_FMT_SBC
3779 * - #ASM_MEDIA_FMT_WMA_V10PRO_V2
3780 * - #ASM_MEDIA_FMT_WMA_V9_V2
3781 * - #ASM_MEDIA_FMT_AC3_DEC
3782 * - #ASM_MEDIA_FMT_EAC3_DEC
3783 * - #ASM_MEDIA_FMT_G711_ALAW_FS
3784 * - #ASM_MEDIA_FMT_G711_MLAW_FS
3785 * - #ASM_MEDIA_FMT_G729A_FS
3786 * - #ASM_MEDIA_FMT_FR_FS
3787 * - #ASM_MEDIA_FMT_VORBIS
3788 * - #ASM_MEDIA_FMT_FLAC
3789 * - #ASM_MEDIA_FMT_EXAMPLE
3790 */
3791} __packed;
3792
3793#define ASM_STREAM_CMD_OPEN_READ_V2 0x00010D8C
3794/* Definition of the timestamp type flag bitmask */
3795#define ASM_BIT_MASKIMESTAMPYPE_FLAG (0x00000020UL)
3796
3797/* Definition of the timestamp type flag shift value. */
3798#define ASM_SHIFTIMESTAMPYPE_FLAG 5
3799
3800/* Relative timestamp is identified by this value.*/
3801#define ASM_RELATIVEIMESTAMP 0
3802
3803/* Absolute timestamp is identified by this value.*/
3804#define ASM_ABSOLUTEIMESTAMP 1
3805
3806
3807struct asm_stream_cmd_open_read_v2 {
3808 struct apr_hdr hdr;
3809 u32 mode_flags;
3810/* Mode flags that indicate whether meta information per encoded
3811 * frame is to be provided.
3812 * Supported values for bit 4:
3813 *
3814 * - 0 -- Return data buffer contains all encoded frames only; it
3815 * does not contain frame metadata.
3816 *
3817 * - 1 -- Return data buffer contains an array of metadata and
3818 * encoded frames.
3819 *
3820 * - Use #ASM_BIT_MASK_META_INFO_FLAG as the bitmask and
3821 * #ASM_SHIFT_META_INFO_FLAG as the shift value for this bit.
3822 *
3823 *
3824 * Supported values for bit 5:
3825 *
3826 * - ASM_RELATIVEIMESTAMP -- ASM_DATA_EVENT_READ_DONE_V2 will have
3827 * - relative time-stamp.
3828 * - ASM_ABSOLUTEIMESTAMP -- ASM_DATA_EVENT_READ_DONE_V2 will
3829 * - have absolute time-stamp.
3830 *
3831 * - Use #ASM_BIT_MASKIMESTAMPYPE_FLAG as the bitmask and
3832 * #ASM_SHIFTIMESTAMPYPE_FLAG as the shift value for this bit.
3833 *
3834 * All other bits are reserved; clients must set them to zero.
3835 */
3836
3837 u32 src_endpointype;
3838/* Specifies the endpoint providing the input samples.
3839 * Supported values:
3840 * - 0 -- Device matrix
3841 * - All other values are reserved; clients must set them to zero.
3842 * Otherwise, an error is returned.
3843 * The device matrix is the gateway from the tunneled Tx ports.
3844 */
3845
3846 u32 preprocopo_id;
3847/* Specifies the topology (order of processing) of preprocessing
3848 * algorithms. <i>None</i> means no preprocessing.
3849 * Supported values:
3850 * - #ASM_STREAM_PREPROCOPO_ID_DEFAULT
3851 * - #ASM_STREAM_PREPROCOPO_ID_NONE
3852 *
3853 * This field can also be enabled through SetParams flags.
3854 */
3855
3856 u32 enc_cfg_id;
3857/* Media configuration ID for encoded output.
3858 * Supported values:
3859 * - #ASM_MEDIA_FMT_MULTI_CHANNEL_PCM_V2
3860 * - #ASM_MEDIA_FMT_AAC_V2
3861 * - #ASM_MEDIA_FMT_AMRNB_FS
3862 * - #ASM_MEDIA_FMT_AMRWB_FS
3863 * - #ASM_MEDIA_FMT_V13K_FS
3864 * - #ASM_MEDIA_FMT_EVRC_FS
3865 * - #ASM_MEDIA_FMT_EVRCB_FS
3866 * - #ASM_MEDIA_FMT_EVRCWB_FS
3867 * - #ASM_MEDIA_FMT_SBC
3868 * - #ASM_MEDIA_FMT_G711_ALAW_FS
3869 * - #ASM_MEDIA_FMT_G711_MLAW_FS
3870 * - #ASM_MEDIA_FMT_G729A_FS
3871 * - #ASM_MEDIA_FMT_EXAMPLE
3872 * - #ASM_MEDIA_FMT_WMA_V8
3873 */
3874
3875 u16 bits_per_sample;
3876/* Number of bits per sample processed by ASM modules.
3877 * Supported values: 16 and 24 bits per sample
3878 */
3879
3880 u16 reserved;
3881/* Reserved for future use. This field must be set to zero.*/
3882} __packed;
3883
3884#define ASM_POPP_OUTPUT_SR_NATIVE_RATE 0
3885
3886/* Enumeration for the maximum sampling rate at the POPP output.*/
3887#define ASM_POPP_OUTPUT_SR_MAX_RATE 48000
3888
3889#define ASM_STREAM_CMD_OPEN_READWRITE_V2 0x00010D8D
3890#define ASM_STREAM_CMD_OPEN_READWRITE_V2 0x00010D8D
3891#define ASM_STREAM_CMD_OPEN_READ_V2 0x00010D8C
3892
3893struct asm_stream_cmd_open_readwrite_v2 {
3894 struct apr_hdr hdr;
3895 u32 mode_flags;
3896/* Mode flags.
3897 * Supported values for bit 2:
3898 * - 0 -- SR/CM change notification event is disabled.
3899 * - 1 -- SR/CM change notification event is enabled. Use
3900 * #ASM_BIT_MASK_SR_CM_CHANGE_NOTIFY_FLAG and
3901 * #ASM_SHIFT_SR_CM_CHANGE_NOTIFY_FLAG to set or
3902 * getting this flag.
3903 *
3904 * Supported values for bit 4:
3905 * - 0 -- Return read data buffer contains all encoded frames only; it
3906 * does not contain frame metadata.
3907 * - 1 -- Return read data buffer contains an array of metadata and
3908 * encoded frames.
3909 *
3910 * All other bits are reserved; clients must set them to zero.
3911 */
3912
3913 u32 postprocopo_id;
3914/* Specifies the topology (order of processing) of postprocessing
3915 * algorithms. <i>None</i> means no postprocessing.
3916 *
3917 * Supported values:
3918 * - #ASM_STREAM_POSTPROCOPO_ID_DEFAULT
3919 * - #ASM_STREAM_POSTPROCOPO_ID_MCH_PEAK_VOL
3920 * - #ASM_STREAM_POSTPROCOPO_ID_NONE
3921 */
3922
3923 u32 dec_fmt_id;
3924/* Specifies the media type of the input data. PCM indicates that
3925 * no decoding must be performed, e.g., this is an NT encoder
3926 * session.
3927 * Supported values:
3928 * - #ASM_MEDIA_FMT_MULTI_CHANNEL_PCM_V2
3929 * - #ASM_MEDIA_FMT_ADPCM
3930 * - #ASM_MEDIA_FMT_MP3
3931 * - #ASM_MEDIA_FMT_AAC_V2
3932 * - #ASM_MEDIA_FMT_DOLBY_AAC
3933 * - #ASM_MEDIA_FMT_AMRNB_FS
3934 * - #ASM_MEDIA_FMT_AMRWB_FS
3935 * - #ASM_MEDIA_FMT_V13K_FS
3936 * - #ASM_MEDIA_FMT_EVRC_FS
3937 * - #ASM_MEDIA_FMT_EVRCB_FS
3938 * - #ASM_MEDIA_FMT_EVRCWB_FS
3939 * - #ASM_MEDIA_FMT_SBC
3940 * - #ASM_MEDIA_FMT_WMA_V10PRO_V2
3941 * - #ASM_MEDIA_FMT_WMA_V9_V2
3942 * - #ASM_MEDIA_FMT_AMR_WB_PLUS_V2
3943 * - #ASM_MEDIA_FMT_AC3_DEC
3944 * - #ASM_MEDIA_FMT_G711_ALAW_FS
3945 * - #ASM_MEDIA_FMT_G711_MLAW_FS
3946 * - #ASM_MEDIA_FMT_G729A_FS
3947 * - #ASM_MEDIA_FMT_EXAMPLE
3948 */
3949
3950 u32 enc_cfg_id;
3951/* Specifies the media type for the output of the stream. PCM
3952 * indicates that no encoding must be performed, e.g., this is an NT
3953 * decoder session.
3954 * Supported values:
3955 * - #ASM_MEDIA_FMT_MULTI_CHANNEL_PCM_V2
3956 * - #ASM_MEDIA_FMT_AAC_V2
3957 * - #ASM_MEDIA_FMT_AMRNB_FS
3958 * - #ASM_MEDIA_FMT_AMRWB_FS
3959 * - #ASM_MEDIA_FMT_V13K_FS
3960 * - #ASM_MEDIA_FMT_EVRC_FS
3961 * - #ASM_MEDIA_FMT_EVRCB_FS
3962 * - #ASM_MEDIA_FMT_EVRCWB_FS
3963 * - #ASM_MEDIA_FMT_SBC
3964 * - #ASM_MEDIA_FMT_G711_ALAW_FS
3965 * - #ASM_MEDIA_FMT_G711_MLAW_FS
3966 * - #ASM_MEDIA_FMT_G729A_FS
3967 * - #ASM_MEDIA_FMT_EXAMPLE
3968 * - #ASM_MEDIA_FMT_WMA_V8
3969 */
3970
3971 u16 bits_per_sample;
3972/* Number of bits per sample processed by ASM modules.
3973 * Supported values: 16 and 24 bits per sample
3974 */
3975
3976 u16 reserved;
3977/* Reserved for future use. This field must be set to zero.*/
3978
3979} __packed;
3980
3981#define ASM_STREAM_CMD_OPEN_LOOPBACK_V2 0x00010D8E
3982struct asm_stream_cmd_open_loopback_v2 {
3983 struct apr_hdr hdr;
3984 u32 mode_flags;
3985/* Mode flags.
3986 * Bit 0-31: reserved; client should set these bits to 0
3987 */
3988 u16 src_endpointype;
3989 /* Endpoint type. 0 = Tx Matrix */
3990 u16 sink_endpointype;
3991 /* Endpoint type. 0 = Rx Matrix */
3992 u32 postprocopo_id;
3993/* Postprocessor topology ID. Specifies the topology of
3994 * postprocessing algorithms.
3995 */
3996
3997 u16 bits_per_sample;
3998/* The number of bits per sample processed by ASM modules
3999 * Supported values: 16 and 24 bits per sample
4000 */
4001 u16 reserved;
4002/* Reserved for future use. This field must be set to zero. */
4003} __packed;
4004
4005#define ASM_STREAM_CMD_CLOSE 0x00010BCD
4006#define ASM_STREAM_CMD_FLUSH 0x00010BCE
4007
4008
4009#define ASM_STREAM_CMD_FLUSH_READBUFS 0x00010C09
4010#define ASM_STREAM_CMD_SET_PP_PARAMS_V2 0x00010DA1
4011
4012struct asm_stream_cmd_set_pp_params_v2 {
4013 u32 data_payload_addr_lsw;
4014/* LSW of parameter data payload address. Supported values: any. */
4015 u32 data_payload_addr_msw;
4016/* MSW of Parameter data payload address. Supported values: any.
4017 * - Must be set to zero for in-band data.
4018 * - In the case of 32 bit Shared memory address, msw field must be
4019 * - set to zero.
4020 * - In the case of 36 bit shared memory address, bit 31 to bit 4 of
4021 * msw
4022 *
4023 * - must be set to zero.
4024 */
4025 u32 mem_map_handle;
4026/* Supported Values: Any.
4027* memory map handle returned by DSP through
4028* ASM_CMD_SHARED_MEM_MAP_REGIONS
4029* command.
4030* if mmhandle is NULL, the ParamData payloads are within the
4031* message payload (in-band).
4032* If mmhandle is non-NULL, the ParamData payloads begin at the
4033* address specified in the address msw and lsw (out-of-band).
4034*/
4035
4036 u32 data_payload_size;
4037/* Size in bytes of the variable payload accompanying the
4038message, or in shared memory. This field is used for parsing the
4039parameter payload. */
4040
4041} __packed;
4042
4043
4044struct asm_stream_param_data_v2 {
4045 u32 module_id;
4046 /* Unique module ID. */
4047
4048 u32 param_id;
4049 /* Unique parameter ID. */
4050
4051 u16 param_size;
4052/* Data size of the param_id/module_id combination. This is
4053 * a multiple of 4 bytes.
4054 */
4055
4056 u16 reserved;
4057/* Reserved for future enhancements. This field must be set to
4058 * zero.
4059 */
4060
4061} __packed;
4062
4063#define ASM_STREAM_CMD_GET_PP_PARAMS_V2 0x00010DA2
4064
4065struct asm_stream_cmd_get_pp_params_v2 {
4066 u32 data_payload_addr_lsw;
4067 /* LSW of the parameter data payload address. */
4068 u32 data_payload_addr_msw;
4069/* MSW of the parameter data payload address.
4070 * - Size of the shared memory, if specified, shall be large enough
4071 * to contain the whole ParamData payload, including Module ID,
4072 * Param ID, Param Size, and Param Values
4073 * - Must be set to zero for in-band data
4074 * - In the case of 32 bit Shared memory address, msw field must be
4075 * set to zero.
4076 * - In the case of 36 bit shared memory address, bit 31 to bit 4 of
4077 * msw must be set to zero.
4078 */
4079
4080 u32 mem_map_handle;
4081/* Supported Values: Any.
4082* memory map handle returned by DSP through ASM_CMD_SHARED_MEM_MAP_REGIONS
4083* command.
4084* if mmhandle is NULL, the ParamData payloads in the ACK are within the
4085* message payload (in-band).
4086* If mmhandle is non-NULL, the ParamData payloads in the ACK begin at the
4087* address specified in the address msw and lsw.
4088* (out-of-band).
4089*/
4090
4091 u32 module_id;
4092 /* Unique module ID. */
4093
4094 u32 param_id;
4095 /* Unique parameter ID. */
4096
4097 u16 param_max_size;
4098/* Maximum data size of the module_id/param_id combination. This
4099 * is a multiple of 4 bytes.
4100 */
4101
4102
4103 u16 reserved;
4104/* Reserved for backward compatibility. Clients must set this
4105* field to zero.
4106*/
4107
4108} __packed;
4109
4110#define ASM_STREAM_CMD_SET_ENCDEC_PARAM 0x00010C10
4111
4112#define ASM_PARAM_ID_ENCDEC_BITRATE 0x00010C13
4113
4114struct asm_bitrate_param {
4115 u32 bitrate;
4116/* Maximum supported bitrate. Only the AAC encoder is supported.*/
4117
4118} __packed;
4119
4120#define ASM_PARAM_ID_ENCDEC_ENC_CFG_BLK_V2 0x00010DA3
4121#define ASM_PARAM_ID_AAC_SBR_PS_FLAG 0x00010C63
4122
4123/* Flag to turn off both SBR and PS processing, if they are
4124 * present in the bitstream.
4125 */
4126
4127#define ASM_AAC_SBR_OFF_PS_OFF (2)
4128
4129/* Flag to turn on SBR but turn off PS processing,if they are
4130 * present in the bitstream.
4131 */
4132
4133#define ASM_AAC_SBR_ON_PS_OFF (1)
4134
4135/* Flag to turn on both SBR and PS processing, if they are
4136 * present in the bitstream (default behavior).
4137 */
4138
4139
4140#define ASM_AAC_SBR_ON_PS_ON (0)
4141
4142/* Structure for an AAC SBR PS processing flag. */
4143
4144/* Payload of the #ASM_PARAM_ID_AAC_SBR_PS_FLAG parameter in the
4145 * #ASM_STREAM_CMD_SET_ENCDEC_PARAM command.
4146 */
4147struct asm_aac_sbr_ps_flag_param {
4148 struct apr_hdr hdr;
4149 struct asm_stream_cmd_set_encdec_param encdec;
4150 struct asm_enc_cfg_blk_param_v2 encblk;
4151
4152 u32 sbr_ps_flag;
4153/* Control parameter to enable or disable SBR/PS processing in
4154 * the AAC bitstream. Use the following macros to set this field:
4155 * - #ASM_AAC_SBR_OFF_PS_OFF -- Turn off both SBR and PS
4156 * processing, if they are present in the bitstream.
4157 * - #ASM_AAC_SBR_ON_PS_OFF -- Turn on SBR processing, but not PS
4158 * processing, if they are present in the bitstream.
4159 * - #ASM_AAC_SBR_ON_PS_ON -- Turn on both SBR and PS processing,
4160 * if they are present in the bitstream (default behavior).
4161 * - All other values are invalid.
4162 * Changes are applied to the next decoded frame.
4163 */
4164} __packed;
4165
4166#define ASM_PARAM_ID_AAC_DUAL_MONO_MAPPING 0x00010C64
4167
4168/* First single channel element in a dual mono bitstream.*/
4169#define ASM_AAC_DUAL_MONO_MAP_SCE_1 (1)
4170
4171/* Second single channel element in a dual mono bitstream.*/
4172#define ASM_AAC_DUAL_MONO_MAP_SCE_2 (2)
4173
4174/* Structure for AAC decoder dual mono channel mapping. */
4175
4176
4177struct asm_aac_dual_mono_mapping_param {
4178 struct apr_hdr hdr;
4179 struct asm_stream_cmd_set_encdec_param encdec;
4180 struct asm_enc_cfg_blk_param_v2 encblk;
4181 u16 left_channel_sce;
4182 u16 right_channel_sce;
4183
4184} __packed;
4185
4186#define ASM_STREAM_CMDRSP_GET_PP_PARAMS_V2 0x00010DA4
4187
4188struct asm_stream_cmdrsp_get_pp_params_v2 {
4189 u32 status;
4190} __packed;
4191
4192#define ASM_PARAM_ID_AC3_KARAOKE_MODE 0x00010D73
4193
4194/* Enumeration for both vocals in a karaoke stream.*/
4195#define AC3_KARAOKE_MODE_NO_VOCAL (0)
4196
4197/* Enumeration for only the left vocal in a karaoke stream.*/
4198#define AC3_KARAOKE_MODE_LEFT_VOCAL (1)
4199
4200/* Enumeration for only the right vocal in a karaoke stream.*/
4201#define AC3_KARAOKE_MODE_RIGHT_VOCAL (2)
4202
4203/* Enumeration for both vocal channels in a karaoke stream.*/
4204#define AC3_KARAOKE_MODE_BOTH_VOCAL (3)
4205#define ASM_PARAM_ID_AC3_DRC_MODE 0x00010D74
4206/* Enumeration for the Custom Analog mode.*/
4207#define AC3_DRC_MODE_CUSTOM_ANALOG (0)
4208
4209/* Enumeration for the Custom Digital mode.*/
4210#define AC3_DRC_MODE_CUSTOM_DIGITAL (1)
4211/* Enumeration for the Line Out mode (light compression).*/
4212#define AC3_DRC_MODE_LINE_OUT (2)
4213
4214/* Enumeration for the RF remodulation mode (heavy compression).*/
4215#define AC3_DRC_MODE_RF_REMOD (3)
4216#define ASM_PARAM_ID_AC3_DUAL_MONO_MODE 0x00010D75
4217
4218/* Enumeration for playing dual mono in stereo mode.*/
4219#define AC3_DUAL_MONO_MODE_STEREO (0)
4220
4221/* Enumeration for playing left mono.*/
4222#define AC3_DUAL_MONO_MODE_LEFT_MONO (1)
4223
4224/* Enumeration for playing right mono.*/
4225#define AC3_DUAL_MONO_MODE_RIGHT_MONO (2)
4226
4227/* Enumeration for mixing both dual mono channels and playing them.*/
4228#define AC3_DUAL_MONO_MODE_MIXED_MONO (3)
4229#define ASM_PARAM_ID_AC3_STEREO_DOWNMIX_MODE 0x00010D76
4230
4231/* Enumeration for using the Downmix mode indicated in the bitstream. */
4232
4233#define AC3_STEREO_DOWNMIX_MODE_AUTO_DETECT (0)
4234
4235/* Enumeration for Surround Compatible mode (preserves the
4236 * surround information).
4237 */
4238
4239#define AC3_STEREO_DOWNMIX_MODE_LT_RT (1)
4240/* Enumeration for Mono Compatible mode (if the output is to be
4241 * further downmixed to mono).
4242 */
4243
4244#define AC3_STEREO_DOWNMIX_MODE_LO_RO (2)
4245
4246/* ID of the AC3 PCM scale factor parameter in the
4247 * #ASM_STREAM_CMD_SET_ENCDEC_PARAM command.
4248 */
4249#define ASM_PARAM_ID_AC3_PCM_SCALEFACTOR 0x00010D78
4250
4251/* ID of the AC3 DRC boost scale factor parameter in the
4252 * #ASM_STREAM_CMD_SET_ENCDEC_PARAM command.
4253 */
4254#define ASM_PARAM_ID_AC3_DRC_BOOST_SCALEFACTOR 0x00010D79
4255
4256/* ID of the AC3 DRC cut scale factor parameter in the
4257 * #ASM_STREAM_CMD_SET_ENCDEC_PARAM command.
4258 */
4259#define ASM_PARAM_ID_AC3_DRC_CUT_SCALEFACTOR 0x00010D7A
4260
4261/* Structure for AC3 Generic Parameter. */
4262
4263/* Payload of the AC3 parameters in the
4264 * #ASM_STREAM_CMD_SET_ENCDEC_PARAM command.
4265 */
4266struct asm_ac3_generic_param {
4267 struct apr_hdr hdr;
4268 struct asm_stream_cmd_set_encdec_param encdec;
4269 struct asm_enc_cfg_blk_param_v2 encblk;
4270 u32 generic_parameter;
4271/* AC3 generic parameter. Select from one of the following
4272 * possible values.
4273 *
4274 * For #ASM_PARAM_ID_AC3_KARAOKE_MODE, supported values are:
4275 * - AC3_KARAOKE_MODE_NO_VOCAL
4276 * - AC3_KARAOKE_MODE_LEFT_VOCAL
4277 * - AC3_KARAOKE_MODE_RIGHT_VOCAL
4278 * - AC3_KARAOKE_MODE_BOTH_VOCAL
4279 *
4280 * For #ASM_PARAM_ID_AC3_DRC_MODE, supported values are:
4281 * - AC3_DRC_MODE_CUSTOM_ANALOG
4282 * - AC3_DRC_MODE_CUSTOM_DIGITAL
4283 * - AC3_DRC_MODE_LINE_OUT
4284 * - AC3_DRC_MODE_RF_REMOD
4285 *
4286 * For #ASM_PARAM_ID_AC3_DUAL_MONO_MODE, supported values are:
4287 * - AC3_DUAL_MONO_MODE_STEREO
4288 * - AC3_DUAL_MONO_MODE_LEFT_MONO
4289 * - AC3_DUAL_MONO_MODE_RIGHT_MONO
4290 * - AC3_DUAL_MONO_MODE_MIXED_MONO
4291 *
4292 * For #ASM_PARAM_ID_AC3_STEREO_DOWNMIX_MODE, supported values are:
4293 * - AC3_STEREO_DOWNMIX_MODE_AUTO_DETECT
4294 * - AC3_STEREO_DOWNMIX_MODE_LT_RT
4295 * - AC3_STEREO_DOWNMIX_MODE_LO_RO
4296 *
4297 * For #ASM_PARAM_ID_AC3_PCM_SCALEFACTOR, supported values are
4298 * 0 to 1 in Q31 format.
4299 *
4300 * For #ASM_PARAM_ID_AC3_DRC_BOOST_SCALEFACTOR, supported values are
4301 * 0 to 1 in Q31 format.
4302 *
4303 * For #ASM_PARAM_ID_AC3_DRC_CUT_SCALEFACTOR, supported values are
4304 * 0 to 1 in Q31 format.
4305 */
4306} __packed;
4307
4308/* Enumeration for Raw mode (no downmixing), which specifies
4309 * that all channels in the bitstream are to be played out as is
4310 * without any downmixing. (Default)
4311 */
4312
4313#define WMAPRO_CHANNEL_MASK_RAW (-1)
4314
4315/* Enumeration for setting the channel mask to 0. The 7.1 mode
4316 * (Home Theater) is assigned.
4317 */
4318
4319
4320#define WMAPRO_CHANNEL_MASK_ZERO 0x0000
4321
4322/* Speaker layout mask for one channel (Home Theater, mono).
4323 * - Speaker front center
4324 */
4325#define WMAPRO_CHANNEL_MASK_1_C 0x0004
4326
4327/* Speaker layout mask for two channels (Home Theater, stereo).
4328 * - Speaker front left
4329 * - Speaker front right
4330 */
4331#define WMAPRO_CHANNEL_MASK_2_L_R 0x0003
4332
4333/* Speaker layout mask for three channels (Home Theater).
4334 * - Speaker front left
4335 * - Speaker front right
4336 * - Speaker front center
4337 */
4338#define WMAPRO_CHANNEL_MASK_3_L_C_R 0x0007
4339
4340/* Speaker layout mask for two channels (stereo).
4341 * - Speaker back left
4342 * - Speaker back right
4343 */
4344#define WMAPRO_CHANNEL_MASK_2_Bl_Br 0x0030
4345
4346/* Speaker layout mask for four channels.
4347 * - Speaker front left
4348 * - Speaker front right
4349 * - Speaker back left
4350 * - Speaker back right
4351*/
4352#define WMAPRO_CHANNEL_MASK_4_L_R_Bl_Br 0x0033
4353
4354/* Speaker layout mask for four channels (Home Theater).
4355 * - Speaker front left
4356 * - Speaker front right
4357 * - Speaker front center
4358 * - Speaker back center
4359*/
4360#define WMAPRO_CHANNEL_MASK_4_L_R_C_Bc_HT 0x0107
4361/* Speaker layout mask for five channels.
4362 * - Speaker front left
4363 * - Speaker front right
4364 * - Speaker front center
4365 * - Speaker back left
4366 * - Speaker back right
4367 */
4368#define WMAPRO_CHANNEL_MASK_5_L_C_R_Bl_Br 0x0037
4369
4370/* Speaker layout mask for five channels (5 mode, Home Theater).
4371 * - Speaker front left
4372 * - Speaker front right
4373 * - Speaker front center
4374 * - Speaker side left
4375 * - Speaker side right
4376 */
4377#define WMAPRO_CHANNEL_MASK_5_L_C_R_Sl_Sr_HT 0x0607
4378/* Speaker layout mask for six channels (5.1 mode).
4379 * - Speaker front left
4380 * - Speaker front right
4381 * - Speaker front center
4382 * - Speaker low frequency
4383 * - Speaker back left
4384 * - Speaker back right
4385 */
4386#define WMAPRO_CHANNEL_MASK_5DOT1_L_C_R_Bl_Br_SLF 0x003F
4387/* Speaker layout mask for six channels (5.1 mode, Home Theater).
4388 * - Speaker front left
4389 * - Speaker front right
4390 * - Speaker front center
4391 * - Speaker low frequency
4392 * - Speaker side left
4393 * - Speaker side right
4394 */
4395#define WMAPRO_CHANNEL_MASK_5DOT1_L_C_R_Sl_Sr_SLF_HT 0x060F
4396/* Speaker layout mask for six channels (5.1 mode, no LFE).
4397 * - Speaker front left
4398 * - Speaker front right
4399 * - Speaker front center
4400 * - Speaker back left
4401 * - Speaker back right
4402 * - Speaker back center
4403 */
4404#define WMAPRO_CHANNEL_MASK_5DOT1_L_C_R_Bl_Br_Bc 0x0137
4405/* Speaker layout mask for six channels (5.1 mode, Home Theater,
4406 * no LFE).
4407 * - Speaker front left
4408 * - Speaker front right
4409 * - Speaker front center
4410 * - Speaker back center
4411 * - Speaker side left
4412 * - Speaker side right
4413 */
4414#define WMAPRO_CHANNEL_MASK_5DOT1_L_C_R_Sl_Sr_Bc_HT 0x0707
4415
4416/* Speaker layout mask for seven channels (6.1 mode).
4417 * - Speaker front left
4418 * - Speaker front right
4419 * - Speaker front center
4420 * - Speaker low frequency
4421 * - Speaker back left
4422 * - Speaker back right
4423 * - Speaker back center
4424 */
4425#define WMAPRO_CHANNEL_MASK_6DOT1_L_C_R_Bl_Br_Bc_SLF 0x013F
4426
4427/* Speaker layout mask for seven channels (6.1 mode, Home
4428 * Theater).
4429 * - Speaker front left
4430 * - Speaker front right
4431 * - Speaker front center
4432 * - Speaker low frequency
4433 * - Speaker back center
4434 * - Speaker side left
4435 * - Speaker side right
4436*/
4437#define WMAPRO_CHANNEL_MASK_6DOT1_L_C_R_Sl_Sr_Bc_SLF_HT 0x070F
4438
4439/* Speaker layout mask for seven channels (6.1 mode, no LFE).
4440 * - Speaker front left
4441 * - Speaker front right
4442 * - Speaker front center
4443 * - Speaker back left
4444 * - Speaker back right
4445 * - Speaker front left of center
4446 * - Speaker front right of center
4447*/
4448#define WMAPRO_CHANNEL_MASK_6DOT1_L_C_R_Bl_Br_SFLOC_SFROC 0x00F7
4449
4450/* Speaker layout mask for seven channels (6.1 mode, Home
4451 * Theater, no LFE).
4452 * - Speaker front left
4453 * - Speaker front right
4454 * - Speaker front center
4455 * - Speaker side left
4456 * - Speaker side right
4457 * - Speaker front left of center
4458 * - Speaker front right of center
4459*/
4460#define WMAPRO_CHANNEL_MASK_6DOT1_L_C_R_Sl_Sr_SFLOC_SFROC_HT 0x0637
4461
4462/* Speaker layout mask for eight channels (7.1 mode).
4463 * - Speaker front left
4464 * - Speaker front right
4465 * - Speaker front center
4466 * - Speaker back left
4467 * - Speaker back right
4468 * - Speaker low frequency
4469 * - Speaker front left of center
4470 * - Speaker front right of center
4471 */
4472#define WMAPRO_CHANNEL_MASK_7DOT1_L_C_R_Bl_Br_SLF_SFLOC_SFROC \
4473 0x00FF
4474
4475/* Speaker layout mask for eight channels (7.1 mode, Home Theater).
4476 * - Speaker front left
4477 * - Speaker front right
4478 * - Speaker front center
4479 * - Speaker side left
4480 * - Speaker side right
4481 * - Speaker low frequency
4482 * - Speaker front left of center
4483 * - Speaker front right of center
4484 *
4485*/
4486#define WMAPRO_CHANNEL_MASK_7DOT1_L_C_R_Sl_Sr_SLF_SFLOC_SFROC_HT \
4487 0x063F
4488
4489#define ASM_PARAM_ID_DEC_OUTPUT_CHAN_MAP 0x00010D82
4490
4491/* Maximum number of decoder output channels.*/
4492#define MAX_CHAN_MAP_CHANNELS 16
4493
4494/* Structure for decoder output channel mapping. */
4495
4496/* Payload of the #ASM_PARAM_ID_DEC_OUTPUT_CHAN_MAP parameter in the
4497 * #ASM_STREAM_CMD_SET_ENCDEC_PARAM command.
4498 */
4499struct asm_dec_out_chan_map_param {
4500 struct apr_hdr hdr;
4501 struct asm_stream_cmd_set_encdec_param encdec;
Bharath Ramachandramurthy2e3168f2012-05-03 16:29:09 -07004502 u32 num_channels;
4503/* Number of decoder output channels.
4504 * Supported values: 0 to #MAX_CHAN_MAP_CHANNELS
4505 *
4506 * A value of 0 indicates native channel mapping, which is valid
4507 * only for NT mode. This means the output of the decoder is to be
4508 * preserved as is.
4509 */
4510 u8 channel_mapping[MAX_CHAN_MAP_CHANNELS];
4511} __packed;
4512
4513#define ASM_STREAM_CMD_OPEN_WRITE_COMPRESSED 0x00010D84
4514
4515/* Bitmask for the IEC 61937 enable flag.*/
4516#define ASM_BIT_MASK_IEC_61937_STREAM_FLAG (0x00000001UL)
4517
4518/* Shift value for the IEC 61937 enable flag.*/
4519#define ASM_SHIFT_IEC_61937_STREAM_FLAG 0
4520
4521/* Bitmask for the IEC 60958 enable flag.*/
4522#define ASM_BIT_MASK_IEC_60958_STREAM_FLAG (0x00000002UL)
4523
4524/* Shift value for the IEC 60958 enable flag.*/
4525#define ASM_SHIFT_IEC_60958_STREAM_FLAG 1
4526
4527/* Payload format for open write compressed comand */
4528
4529/* Payload format for the #ASM_STREAM_CMD_OPEN_WRITE_COMPRESSED
4530 * comand, which opens a stream for a given session ID and stream ID
4531 * to be rendered in the compressed format.
4532 */
4533
4534struct asm_stream_cmd_open_write_compressed {
4535 struct apr_hdr hdr;
4536 u32 flags;
4537/* Mode flags that configure the stream for a specific format.
4538 * Supported values:
4539 * - Bit 0 -- IEC 61937 compatibility
4540 * - 0 -- Stream is not in IEC 61937 format
4541 * - 1 -- Stream is in IEC 61937 format
4542 * - Bit 1 -- IEC 60958 compatibility
4543 * - 0 -- Stream is not in IEC 60958 format
4544 * - 1 -- Stream is in IEC 60958 format
4545 * - Bits 2 to 31 -- 0 (Reserved)
4546 *
4547 * For the same stream, bit 0 cannot be set to 0 and bit 1 cannot
4548 * be set to 1. A compressed stream connot have IEC 60958
4549 * packetization applied without IEC 61937 packetization.
4550 * @note1hang Currently, IEC 60958 packetized input streams are not
4551 * supported.
4552 */
4553
4554
4555 u32 fmt_id;
4556/* Specifies the media type of the HDMI stream to be opened.
4557 * Supported values:
4558 * - #ASM_MEDIA_FMT_AC3_DEC
4559 * - #ASM_MEDIA_FMT_EAC3_DEC
4560 * - #ASM_MEDIA_FMT_DTS
4561 * - #ASM_MEDIA_FMT_ATRAC
4562 * - #ASM_MEDIA_FMT_MAT
4563 *
4564 * @note1hang This field must be set to a valid media type even if
4565 * IEC 61937 packetization is not performed by the aDSP.
4566 */
4567
4568} __packed;
4569
4570#define ASM_STREAM_CMD_OPEN_READ_COMPRESSED 0x00010D95
4571
4572struct asm_stream_cmd_open_read_compressed {
4573 struct apr_hdr hdr;
4574 u32 mode_flags;
4575/* Mode flags that indicate whether meta information per encoded
4576 * frame is to be provided.
4577 * Supported values for bit 4:
4578 * - 0 -- Return data buffer contains all encoded frames only; it does
4579 * not contain frame metadata.
4580 * - 1 -- Return data buffer contains an array of metadata and encoded
4581 * frames.
4582 * - Use #ASM_BIT_MASK_META_INFO_FLAG to set the bitmask and
4583 * #ASM_SHIFT_META_INFO_FLAG to set the shift value for this bit.
4584 * All other bits are reserved; clients must set them to zero.
4585 */
4586
4587 u32 frames_per_buf;
4588/* Indicates the number of frames that need to be returned per
4589 * read buffer
4590 * Supported values: should be greater than 0
4591 */
4592
4593} __packed;
4594
4595/* adsp_asm_stream_commands.h*/
4596
4597
4598/* adsp_asm_api.h (no changes)*/
4599#define ASM_STREAM_POSTPROCOPO_ID_DEFAULT \
4600 0x00010BE4
4601#define ASM_STREAM_POSTPROCOPO_ID_PEAKMETER \
4602 0x00010D83
4603#define ASM_STREAM_POSTPROCOPO_ID_NONE \
4604 0x00010C68
4605#define ASM_STREAM_POSTPROCOPO_ID_MCH_PEAK_VOL \
4606 0x00010D8B
4607#define ASM_STREAM_PREPROCOPO_ID_DEFAULT \
4608 ASM_STREAM_POSTPROCOPO_ID_DEFAULT
4609#define ASM_STREAM_PREPROCOPO_ID_NONE \
4610 ASM_STREAM_POSTPROCOPO_ID_NONE
4611#define ADM_CMD_COPP_OPENOPOLOGY_ID_NONE_AUDIO_COPP \
4612 0x00010312
4613#define ADM_CMD_COPP_OPENOPOLOGY_ID_SPEAKER_MONO_AUDIO_COPP \
4614 0x00010313
4615#define ADM_CMD_COPP_OPENOPOLOGY_ID_SPEAKER_STEREO_AUDIO_COPP \
4616 0x00010314
4617#define ADM_CMD_COPP_OPENOPOLOGY_ID_SPEAKER_STEREO_IIR_AUDIO_COPP\
4618 0x00010704
4619#define ADM_CMD_COPP_OPENOPOLOGY_ID_SPEAKER_MONO_AUDIO_COPP_MBDRCV2\
4620 0x0001070D
4621#define ADM_CMD_COPP_OPENOPOLOGY_ID_SPEAKER_STEREO_AUDIO_COPP_MBDRCV2\
4622 0x0001070E
4623#define ADM_CMD_COPP_OPENOPOLOGY_ID_SPEAKER_STEREO_IIR_AUDIO_COPP_MBDRCV2\
4624 0x0001070F
4625#define ADM_CMD_COPP_OPENOPOLOGY_ID_SPEAKER_MCH_PEAK_VOL \
4626 0x0001031B
4627#define ADM_CMD_COPP_OPENOPOLOGY_ID_MIC_MONO_AUDIO_COPP 0x00010315
4628#define ADM_CMD_COPP_OPENOPOLOGY_ID_MIC_STEREO_AUDIO_COPP 0x00010316
4629#define AUDPROC_COPPOPOLOGY_ID_MCHAN_IIR_AUDIO 0x00010715
4630#define ADM_CMD_COPP_OPENOPOLOGY_ID_DEFAULT_AUDIO_COPP 0x00010BE3
4631#define ADM_CMD_COPP_OPENOPOLOGY_ID_PEAKMETER_AUDIO_COPP 0x00010317
4632#define AUDPROC_MODULE_ID_AIG 0x00010716
4633#define AUDPROC_PARAM_ID_AIG_ENABLE 0x00010717
4634#define AUDPROC_PARAM_ID_AIG_CONFIG 0x00010718
4635
4636struct Audio_AigParam {
4637 uint16_t mode;
4638/*< Mode word for enabling AIG/SIG mode .
4639 * Byte offset: 0
4640 */
4641 int16_t staticGainL16Q12;
4642/*< Static input gain when aigMode is set to 1.
4643 * Byte offset: 2
4644 */
4645 int16_t initialGainDBL16Q7;
4646/*<Initial value that the adaptive gain update starts from dB
4647 * Q7 Byte offset: 4
4648 */
4649 int16_t idealRMSDBL16Q7;
4650/*<Average RMS level that AIG attempts to achieve Q8.7
4651 * Byte offset: 6
4652 */
4653 int32_t noiseGateL32;
4654/*Threshold below which signal is considered as noise and AIG
4655 * Byte offset: 8
4656 */
4657 int32_t minGainL32Q15;
4658/*Minimum gain that can be provided by AIG Q16.15
4659 * Byte offset: 12
4660 */
4661 int32_t maxGainL32Q15;
4662/*Maximum gain that can be provided by AIG Q16.15
4663 * Byte offset: 16
4664 */
4665 uint32_t gainAtRtUL32Q31;
4666/*Attack/release time for AIG update Q1.31
4667 * Byte offset: 20
4668 */
4669 uint32_t longGainAtRtUL32Q31;
4670/*Long attack/release time while updating gain for
4671 * noise/silence Q1.31 Byte offset: 24
4672 */
4673
4674 uint32_t rmsTavUL32Q32;
4675/* RMS smoothing time constant used for long-term RMS estimate
4676 * Q0.32 Byte offset: 28
4677 */
4678
4679 uint32_t gainUpdateStartTimMsUL32Q0;
4680/* The waiting time before which AIG starts to apply adaptive
4681 * gain update Q32.0 Byte offset: 32
4682 */
4683
4684} __packed;
4685
4686
4687#define ADM_MODULE_ID_EANS 0x00010C4A
4688#define ADM_PARAM_ID_EANS_ENABLE 0x00010C4B
4689#define ADM_PARAM_ID_EANS_PARAMS 0x00010C4C
4690
4691struct adm_eans_enable {
4692
4693 uint32_t enable_flag;
4694/*< Specifies whether EANS is disabled (0) or enabled
4695 * (nonzero).
4696 * This is supported only for sampling rates of 8, 12, 16, 24, 32,
4697 * and 48 kHz. It is not supported for sampling rates of 11.025,
4698 * 22.05, or 44.1 kHz.
4699 */
4700
4701} __packed;
4702
4703
4704struct adm_eans_params {
4705 int16_t eans_mode;
4706/*< Mode word for enabling/disabling submodules.
4707 * Byte offset: 0
4708 */
4709
4710 int16_t eans_input_gain;
4711/*< Q2.13 input gain to the EANS module.
4712 * Byte offset: 2
4713 */
4714
4715 int16_t eans_output_gain;
4716/*< Q2.13 output gain to the EANS module.
4717 * Byte offset: 4
4718 */
4719
4720 int16_t eansarget_ns;
4721/*< Target noise suppression level in dB.
4722 * Byte offset: 6
4723 */
4724
4725 int16_t eans_s_alpha;
4726/*< Q3.12 over-subtraction factor for stationary noise
4727 * suppression.
4728 * Byte offset: 8
4729 */
4730
4731 int16_t eans_n_alpha;
4732/* < Q3.12 over-subtraction factor for nonstationary noise
4733 * suppression.
4734 * Byte offset: 10
4735 */
4736
4737 int16_t eans_n_alphamax;
4738/*< Q3.12 maximum over-subtraction factor for nonstationary
4739 * noise suppression.
4740 * Byte offset: 12
4741 */
4742 int16_t eans_e_alpha;
4743/*< Q15 scaling factor for excess noise suppression.
4744 * Byte offset: 14
4745 */
4746
4747 int16_t eans_ns_snrmax;
4748/*< Upper boundary in dB for SNR estimation.
4749 * Byte offset: 16
4750 */
4751
4752 int16_t eans_sns_block;
4753/*< Quarter block size for stationary noise suppression.
4754 * Byte offset: 18
4755 */
4756
4757 int16_t eans_ns_i;
4758/*< Initialization block size for noise suppression.
4759 * Byte offset: 20
4760 */
4761 int16_t eans_np_scale;
4762/*< Power scale factor for nonstationary noise update.
4763 * Byte offset: 22
4764 */
4765
4766 int16_t eans_n_lambda;
4767/*< Smoothing factor for higher level nonstationary noise
4768 * update.
4769 * Byte offset: 24
4770 */
4771
4772 int16_t eans_n_lambdaf;
4773/*< Medium averaging factor for noise update.
4774 * Byte offset: 26
4775 */
4776
4777 int16_t eans_gs_bias;
4778/*< Bias factor in dB for gain calculation.
4779 * Byte offset: 28
4780 */
4781
4782 int16_t eans_gs_max;
4783/*< SNR lower boundary in dB for aggressive gain calculation.
4784 * Byte offset: 30
4785 */
4786
4787 int16_t eans_s_alpha_hb;
4788/*< Q3.12 over-subtraction factor for high-band stationary
4789 * noise suppression.
4790 * Byte offset: 32
4791 */
4792
4793 int16_t eans_n_alphamax_hb;
4794/*< Q3.12 maximum over-subtraction factor for high-band
4795 * nonstationary noise suppression.
4796 * Byte offset: 34
4797 */
4798
4799 int16_t eans_e_alpha_hb;
4800/*< Q15 scaling factor for high-band excess noise suppression.
4801 * Byte offset: 36
4802 */
4803
4804 int16_t eans_n_lambda0;
4805/*< Smoothing factor for nonstationary noise update during
4806 * speech activity.
4807 * Byte offset: 38
4808 */
4809
4810 int16_t thresh;
4811/*< Threshold for generating a binary VAD decision.
4812 * Byte offset: 40
4813 */
4814
4815 int16_t pwr_scale;
4816/*< Indirect lower boundary of the noise level estimate.
4817 * Byte offset: 42
4818 */
4819
4820 int16_t hangover_max;
4821/*< Avoids mid-speech clipping and reliably detects weak speech
4822 * bursts at the end of speech activity.
4823 * Byte offset: 44
4824 */
4825
4826 int16_t alpha_snr;
4827/*< Controls responsiveness of the VAD.
4828 * Byte offset: 46
4829 */
4830
4831 int16_t snr_diff_max;
4832/*< Maximum SNR difference. Decreasing this parameter value may
4833 * help in making correct decisions during abrupt changes; however,
4834 * decreasing too much may increase false alarms during long
4835 * pauses/silences.
4836 * Byte offset: 48
4837 */
4838
4839 int16_t snr_diff_min;
4840/*< Minimum SNR difference. Decreasing this parameter value may
4841 * help in making correct decisions during abrupt changes; however,
4842 * decreasing too much may increase false alarms during long
4843 * pauses/silences.
4844 * Byte offset: 50
4845 */
4846
4847 int16_t init_length;
4848/*< Defines the number of frames for which a noise level
4849 * estimate is set to a fixed value.
4850 * Byte offset: 52
4851 */
4852
4853 int16_t max_val;
4854/*< Defines the upper limit of the noise level.
4855 * Byte offset: 54
4856 */
4857
4858 int16_t init_bound;
4859/*< Defines the initial bounding value for the noise level
4860 * estimate. This is used during the initial segment defined by the
4861 * init_length parameter.
4862 * Byte offset: 56
4863 */
4864
4865 int16_t reset_bound;
4866/*< Reset boundary for noise tracking.
4867 * Byte offset: 58
4868 */
4869
4870 int16_t avar_scale;
4871/*< Defines the bias factor in noise estimation.
4872 * Byte offset: 60
4873 */
4874
4875 int16_t sub_nc;
4876/*< Defines the window length for noise estimation.
4877 * Byte offset: 62
4878 */
4879
4880 int16_t spow_min;
4881/*< Defines the minimum signal power required to update the
4882 * boundaries for the noise floor estimate.
4883 * Byte offset: 64
4884 */
4885
4886 int16_t eans_gs_fast;
4887/*< Fast smoothing factor for postprocessor gain.
4888 * Byte offset: 66
4889 */
4890
4891 int16_t eans_gs_med;
4892/*< Medium smoothing factor for postprocessor gain.
4893 * Byte offset: 68
4894 */
4895
4896 int16_t eans_gs_slow;
4897/*< Slow smoothing factor for postprocessor gain.
4898 * Byte offset: 70
4899 */
4900
4901 int16_t eans_swb_salpha;
4902/*< Q3.12 super wideband aggressiveness factor for stationary
4903 * noise suppression.
4904 * Byte offset: 72
4905 */
4906
4907 int16_t eans_swb_nalpha;
4908/*< Q3.12 super wideband aggressiveness factor for
4909 * nonstationary noise suppression.
4910 * Byte offset: 74
4911 */
4912} __packed;
4913#define ADM_MODULE_IDX_MIC_GAIN_CTRL 0x00010C35
4914
4915/* @addtogroup audio_pp_param_ids
4916 * ID of the Tx mic gain control parameter used by the
4917 * #ADM_MODULE_IDX_MIC_GAIN_CTRL module.
4918 * @messagepayload
4919 * @structure{admx_mic_gain}
4920 * @tablespace
4921 * @inputtable{Audio_Postproc_ADM_PARAM_IDX_MIC_GAIN.tex}
4922 */
4923#define ADM_PARAM_IDX_MIC_GAIN 0x00010C36
4924
4925/* Structure for a Tx mic gain parameter for the mic gain
4926 * control module.
4927 */
4928
4929
4930/* @brief Payload of the #ADM_PARAM_IDX_MIC_GAIN parameter in the
4931 * Tx Mic Gain Control module.
4932 */
4933struct admx_mic_gain {
4934 uint16_t tx_mic_gain;
4935 /*< Linear gain in Q13 format. */
4936
4937 uint16_t reserved;
4938 /*< Clients must set this field to zero. */
4939} __packed;
4940
4941/* end_addtogroup audio_pp_param_ids */
4942
4943/* @ingroup audio_pp_module_ids
4944 * ID of the Rx Codec Gain Control module.
4945 *
4946 * This module supports the following parameter ID:
4947 * - #ADM_PARAM_ID_RX_CODEC_GAIN
4948 */
4949#define ADM_MODULE_ID_RX_CODEC_GAIN_CTRL 0x00010C37
4950
4951/* @addtogroup audio_pp_param_ids
4952 * ID of the Rx codec gain control parameter used by the
4953 * #ADM_MODULE_ID_RX_CODEC_GAIN_CTRL module.
4954 *
4955 * @messagepayload
4956 * @structure{adm_rx_codec_gain}
4957 * @tablespace
4958 * @inputtable{Audio_Postproc_ADM_PARAM_ID_RX_CODEC_GAIN.tex}
4959*/
4960#define ADM_PARAM_ID_RX_CODEC_GAIN 0x00010C38
4961
4962/* Structure for the Rx common codec gain control module. */
4963
4964
4965/* @brief Payload of the #ADM_PARAM_ID_RX_CODEC_GAIN parameter
4966 * in the Rx Codec Gain Control module.
4967 */
4968
4969
4970struct adm_rx_codec_gain {
4971 uint16_t rx_codec_gain;
4972 /*< Linear gain in Q13 format. */
4973
4974 uint16_t reserved;
4975 /*< Clients must set this field to zero.*/
4976} __packed;
4977
4978/* end_addtogroup audio_pp_param_ids */
4979
4980/* @ingroup audio_pp_module_ids
4981 * ID of the HPF Tuning Filter module on the Tx path.
4982 * This module supports the following parameter IDs:
4983 * - #ADM_PARAM_ID_HPF_IIRX_FILTER_ENABLE_CONFIG
4984 * - #ADM_PARAM_ID_HPF_IIRX_FILTER_PRE_GAIN
4985 * - #ADM_PARAM_ID_HPF_IIRX_FILTER_CONFIG_PARAMS
4986 */
4987#define ADM_MODULE_ID_HPF_IIRX_FILTER 0x00010C3D
4988
4989/* @addtogroup audio_pp_param_ids */
4990/* ID of the Tx HPF IIR filter enable parameter used by the
4991 * #ADM_MODULE_ID_HPF_IIRX_FILTER module.
4992 * @parspace Message payload
4993 * @structure{adm_hpfx_iir_filter_enable_cfg}
4994 * @tablespace
4995 * @inputtable{Audio_Postproc_ADM_PARAM_ID_HPF_IIRX_FILTER_ENABLE_CONFIG.tex}
4996 */
4997#define ADM_PARAM_ID_HPF_IIRX_FILTER_ENABLE_CONFIG 0x00010C3E
4998
4999/* ID of the Tx HPF IIR filter pregain parameter used by the
5000 * #ADM_MODULE_ID_HPF_IIRX_FILTER module.
5001 * @parspace Message payload
5002 * @structure{adm_hpfx_iir_filter_pre_gain}
5003 * @tablespace
5004 * @inputtable{Audio_Postproc_ADM_PARAM_ID_HPF_IIRX_FILTER_PRE_GAIN.tex}
5005 */
5006#define ADM_PARAM_ID_HPF_IIRX_FILTER_PRE_GAIN 0x00010C3F
5007
5008/* ID of the Tx HPF IIR filter configuration parameters used by the
5009 * #ADM_MODULE_ID_HPF_IIRX_FILTER module.
5010 * @parspace Message payload
5011 * @structure{adm_hpfx_iir_filter_cfg_params}
5012 * @tablespace
5013 * @inputtable{Audio_Postproc_ADM_PARAM_ID_HPF_IIRX_FILTER_CONFIG_PA
5014 * RAMS.tex}
5015 */
5016#define ADM_PARAM_ID_HPF_IIRX_FILTER_CONFIG_PARAMS 0x00010C40
5017
5018/* Structure for enabling a configuration parameter for
5019 * the HPF IIR tuning filter module on the Tx path.
5020 */
5021
5022/* @brief Payload of the #ADM_PARAM_ID_HPF_IIRX_FILTER_ENABLE_CONFIG
5023 * parameter in the Tx path HPF Tuning Filter module.
5024 */
5025struct adm_hpfx_iir_filter_enable_cfg {
5026 uint32_t enable_flag;
5027/*< Specifies whether the HPF tuning filter is disabled (0) or
5028 * enabled (nonzero).
5029 */
5030} __packed;
5031
5032
5033/* Structure for the pregain parameter for the HPF
5034 IIR tuning filter module on the Tx path. */
5035
5036
5037/* @brief Payload of the #ADM_PARAM_ID_HPF_IIRX_FILTER_PRE_GAIN parameter
5038 * in the Tx path HPF Tuning Filter module.
5039 */
5040struct adm_hpfx_iir_filter_pre_gain {
5041 uint16_t pre_gain;
5042 /*< Linear gain in Q13 format. */
5043
5044 uint16_t reserved;
5045 /*< Clients must set this field to zero.*/
5046} __packed;
5047
5048
5049/* Structure for the configuration parameter for the
5050 HPF IIR tuning filter module on the Tx path. */
5051
5052
5053/* @brief Payload of the #ADM_PARAM_ID_HPF_IIRX_FILTER_CONFIG_PARAMS
5054 * parameters in the Tx path HPF Tuning Filter module. \n
5055 * \n
5056 * This structure is followed by tuning filter coefficients as follows: \n
5057 * - Sequence of int32_t FilterCoeffs.
5058 * Each band has five coefficients, each in int32_t format in the order of
5059 * b0, b1, b2, a1, a2.
5060 * - Sequence of int16_t NumShiftFactor.
5061 * One int16_t per band. The numerator shift factor is related to the Q
5062 * factor of the filter coefficients.
5063 * - Sequence of uint16_t PanSetting.
5064 * One uint16_t for each band to indicate application of the filter to
5065 * left (0), right (1), or both (2) channels.
5066 */
5067struct adm_hpfx_iir_filter_cfg_params {
5068 uint16_t num_biquad_stages;
5069/*< Number of bands.
5070 * Supported values: 0 to 20
5071 */
5072
5073 uint16_t reserved;
5074 /*< Clients must set this field to zero.*/
5075} __packed;
5076
5077/* end_addtogroup audio_pp_module_ids */
5078
5079/* @addtogroup audio_pp_module_ids */
5080/* ID of the Tx path IIR Tuning Filter module.
5081 * This module supports the following parameter IDs:
5082 * - #ADM_PARAM_IDX_IIR_FILTER_ENABLE_CONFIG
5083 */
5084#define ADM_MODULE_IDX_IIR_FILTER 0x00010C41
5085
5086/* ID of the Rx path IIR Tuning Filter module for the left channel.
5087 * The parameter IDs of the IIR tuning filter module
5088 * (#ASM_MODULE_ID_IIRUNING_FILTER) are used for the left IIR Rx tuning
5089 * filter.
5090 *
5091 * Pan parameters are not required for this per-channel IIR filter; the pan
5092 * parameters are ignored by this module.
5093 */
5094#define ADM_MODULE_ID_LEFT_IIRUNING_FILTER 0x00010705
5095
5096/* ID of the the Rx path IIR Tuning Filter module for the right
5097 * channel.
5098 * The parameter IDs of the IIR tuning filter module
5099 * (#ASM_MODULE_ID_IIRUNING_FILTER) are used for the right IIR Rx
5100 * tuning filter.
5101 *
5102 * Pan parameters are not required for this per-channel IIR filter;
5103 * the pan parameters are ignored by this module.
5104 */
5105#define ADM_MODULE_ID_RIGHT_IIRUNING_FILTER 0x00010706
5106
5107/* end_addtogroup audio_pp_module_ids */
5108
5109/* @addtogroup audio_pp_param_ids */
5110
5111/* ID of the Tx IIR filter enable parameter used by the
5112 * #ADM_MODULE_IDX_IIR_FILTER module.
5113 * @parspace Message payload
5114 * @structure{admx_iir_filter_enable_cfg}
5115 * @tablespace
5116 * @inputtable{Audio_Postproc_ADM_PARAM_IDX_IIR_FILTER_ENABLE_CONFIG.tex}
5117 */
5118#define ADM_PARAM_IDX_IIR_FILTER_ENABLE_CONFIG 0x00010C42
5119
5120/* ID of the Tx IIR filter pregain parameter used by the
5121 * #ADM_MODULE_IDX_IIR_FILTER module.
5122 * @parspace Message payload
5123 * @structure{admx_iir_filter_pre_gain}
5124 * @tablespace
5125 * @inputtable{Audio_Postproc_ADM_PARAM_IDX_IIR_FILTER_PRE_GAIN.tex}
5126 */
5127#define ADM_PARAM_IDX_IIR_FILTER_PRE_GAIN 0x00010C43
5128
5129/* ID of the Tx IIR filter configuration parameters used by the
5130 * #ADM_MODULE_IDX_IIR_FILTER module.
5131 * @parspace Message payload
5132 * @structure{admx_iir_filter_cfg_params}
5133 * @tablespace
5134 * @inputtable{Audio_Postproc_ADM_PARAM_IDX_IIR_FILTER_CONFIG_PARAMS.tex}
5135 */
5136#define ADM_PARAM_IDX_IIR_FILTER_CONFIG_PARAMS 0x00010C44
5137
5138/* Structure for enabling the configuration parameter for the
5139 * IIR filter module on the Tx path.
5140 */
5141
5142/* @brief Payload of the #ADM_PARAM_IDX_IIR_FILTER_ENABLE_CONFIG
5143 * parameter in the Tx Path IIR Tuning Filter module.
5144 */
5145
5146struct admx_iir_filter_enable_cfg {
5147 uint32_t enable_flag;
5148/*< Specifies whether the IIR tuning filter is disabled (0) or
5149 * enabled (nonzero).
5150 */
5151
5152} __packed;
5153
5154
5155/* Structure for the pregain parameter for the
5156 * IIR filter module on the Tx path.
5157 */
5158
5159
5160/* @brief Payload of the #ADM_PARAM_IDX_IIR_FILTER_PRE_GAIN
5161 * parameter in the Tx Path IIR Tuning Filter module.
5162 */
5163
5164struct admx_iir_filter_pre_gain {
5165 uint16_t pre_gain;
5166 /*< Linear gain in Q13 format. */
5167
5168 uint16_t reserved;
5169 /*< Clients must set this field to zero.*/
5170} __packed;
5171
5172
5173/* Structure for the configuration parameter for the
5174 * IIR filter module on the Tx path.
5175 */
5176
5177
5178/* @brief Payload of the #ADM_PARAM_IDX_IIR_FILTER_CONFIG_PARAMS
5179 * parameter in the Tx Path IIR Tuning Filter module. \n
5180 * \n
5181 * This structure is followed by the HPF IIR filter coefficients on
5182 * the Tx path as follows: \n
5183 * - Sequence of int32_t ulFilterCoeffs. Each band has five
5184 * coefficients, each in int32_t format in the order of b0, b1, b2,
5185 * a1, a2.
5186 * - Sequence of int16_t sNumShiftFactor. One int16_t per band. The
5187 * numerator shift factor is related to the Q factor of the filter
5188 * coefficients.
5189 * - Sequence of uint16_t usPanSetting. One uint16_t for each band
5190 * to indicate if the filter is applied to left (0), right (1), or
5191 * both (2) channels.
5192 */
5193struct admx_iir_filter_cfg_params {
5194 uint16_t num_biquad_stages;
5195/*< Number of bands.
5196 * Supported values: 0 to 20
5197 */
5198
5199 uint16_t reserved;
5200 /*< Clients must set this field to zero.*/
5201} __packed;
5202
5203/* end_addtogroup audio_pp_module_ids */
5204
5205/* @ingroup audio_pp_module_ids
5206 * ID of the QEnsemble module.
5207 * This module supports the following parameter IDs:
5208 * - #ADM_PARAM_ID_QENSEMBLE_ENABLE
5209 * - #ADM_PARAM_ID_QENSEMBLE_BACKGAIN
5210 * - #ADM_PARAM_ID_QENSEMBLE_SET_NEW_ANGLE
5211 */
5212#define ADM_MODULE_ID_QENSEMBLE 0x00010C59
5213
5214/* @addtogroup audio_pp_param_ids */
5215/* ID of the QEnsemble enable parameter used by the
5216 * #ADM_MODULE_ID_QENSEMBLE module.
5217 * @messagepayload
5218 * @structure{adm_qensemble_enable}
5219 * @tablespace
5220 * @inputtable{Audio_Postproc_ADM_PARAM_ID_QENSEMBLE_ENABLE.tex}
5221 */
5222#define ADM_PARAM_ID_QENSEMBLE_ENABLE 0x00010C60
5223
5224/* ID of the QEnsemble back gain parameter used by the
5225 * #ADM_MODULE_ID_QENSEMBLE module.
5226 * @messagepayload
5227 * @structure{adm_qensemble_param_backgain}
5228 * @tablespace
5229 * @inputtable{Audio_Postproc_ADM_PARAM_ID_QENSEMBLE_BACKGAIN.tex}
5230 */
5231#define ADM_PARAM_ID_QENSEMBLE_BACKGAIN 0x00010C61
5232
5233/* ID of the QEnsemble new angle parameter used by the
5234 * #ADM_MODULE_ID_QENSEMBLE module.
5235 * @messagepayload
5236 * @structure{adm_qensemble_param_set_new_angle}
5237 * @tablespace
5238 * @inputtable{Audio_Postproc_ADM_PARAM_ID_QENSEMBLE_SET_NEW_ANGLE.tex}
5239 */
5240#define ADM_PARAM_ID_QENSEMBLE_SET_NEW_ANGLE 0x00010C62
5241
5242/* Structure for enabling the configuration parameter for the
5243 * QEnsemble module.
5244 */
5245
5246
5247/* @brief Payload of the #ADM_PARAM_ID_QENSEMBLE_ENABLE
5248 * parameter used by the QEnsemble module.
5249 */
5250struct adm_qensemble_enable {
5251 uint32_t enable_flag;
5252/*< Specifies whether the QEnsemble module is disabled (0) or enabled
5253 * (nonzero).
5254 */
5255} __packed;
5256
5257
5258/* Structure for the background gain for the QEnsemble module. */
5259
5260
5261/* @brief Payload of the #ADM_PARAM_ID_QENSEMBLE_BACKGAIN
5262 * parameter used by
5263 * the QEnsemble module.
5264 */
5265struct adm_qensemble_param_backgain {
5266 int16_t back_gain;
5267/*< Linear gain in Q15 format.
5268 * Supported values: 0 to 32767
5269 */
5270
5271 uint16_t reserved;
5272 /*< Clients must set this field to zero.*/
5273} __packed;
5274/* Structure for setting a new angle for the QEnsemble module. */
5275
5276
5277/* @brief Payload of the #ADM_PARAM_ID_QENSEMBLE_SET_NEW_ANGLE
5278 * parameter used
5279 * by the QEnsemble module.
5280 */
5281struct adm_qensemble_param_set_new_angle {
5282 int16_t new_angle;
5283/*< New angle in degrees.
5284 * Supported values: 0 to 359
5285 */
5286
5287 int16_t time_ms;
5288/*< Transition time in milliseconds to set the new angle.
5289 * Supported values: 0 to 32767
5290 */
5291} __packed;
5292
5293/* end_addtogroup audio_pp_module_ids */
5294
5295/* @ingroup audio_pp_module_ids
5296 * ID of the Volume Control module pre/postprocessing block.
5297 * This module supports the following parameter IDs:
5298 * - #ASM_PARAM_ID_VOL_CTRL_MASTER_GAIN
5299 * - #ASM_PARAM_ID_VOL_CTRL_LR_CHANNEL_GAIN
5300 * - #ASM_PARAM_ID_VOL_CTRL_MUTE_CONFIG
5301 * - #ASM_PARAM_ID_SOFT_VOL_STEPPING_PARAMETERS
5302 * - #ASM_PARAM_ID_SOFT_PAUSE_PARAMETERS
5303 * - #ASM_PARAM_ID_MULTICHANNEL_GAIN
5304 * - #ASM_PARAM_ID_MULTICHANNEL_MUTE
5305 */
5306#define ASM_MODULE_ID_VOL_CTRL 0x00010BFE
5307
5308/* @addtogroup audio_pp_param_ids */
5309/* ID of the master gain parameter used by the #ASM_MODULE_ID_VOL_CTRL
5310 * module.
5311 * @messagepayload
5312 * @structure{asm_volume_ctrl_master_gain}
5313 * @tablespace
5314 * @inputtable{Audio_Postproc_ASM_PARAM_ID_VOL_CTRL_MASTER_GAIN.tex}
5315 */
5316#define ASM_PARAM_ID_VOL_CTRL_MASTER_GAIN 0x00010BFF
5317
5318/* ID of the left/right channel gain parameter used by the
5319 * #ASM_MODULE_ID_VOL_CTRL module.
5320 * @messagepayload
5321 * @structure{asm_volume_ctrl_lr_chan_gain}
5322 * @tablespace
5323 * @inputtable{Audio_Postproc_ASM_PARAM_ID_VOL_CTRL_LR_CHANNEL_GAIN.tex}
5324 */
5325#define ASM_PARAM_ID_VOL_CTRL_LR_CHANNEL_GAIN 0x00010C00
5326
5327/* ID of the mute configuration parameter used by the
5328 * #ASM_MODULE_ID_VOL_CTRL module.
5329 * @messagepayload
5330 * @structure{asm_volume_ctrl_mute_config}
5331 * @tablespace
5332 * @inputtable{Audio_Postproc_ASM_PARAM_ID_VOL_CTRL_MUTE_CONFIG.tex}
5333 */
5334#define ASM_PARAM_ID_VOL_CTRL_MUTE_CONFIG 0x00010C01
5335
5336/* ID of the soft stepping volume parameters used by the
5337 * #ASM_MODULE_ID_VOL_CTRL module.
5338 * @messagepayload
5339 * @structure{asm_soft_step_volume_params}
5340 * @tablespace
5341 * @inputtable{Audio_Postproc_ASM_PARAM_ID_SOFT_VOL_STEPPING_PARAMET
5342 * ERS.tex}
5343 */
5344#define ASM_PARAM_ID_SOFT_VOL_STEPPING_PARAMETERS 0x00010C29
5345
5346/* ID of the soft pause parameters used by the #ASM_MODULE_ID_VOL_CTRL
5347 * module.
5348 */
5349#define ASM_PARAM_ID_SOFT_PAUSE_PARAMETERS 0x00010D6A
5350
5351/* ID of the multiple-channel volume control parameters used by the
5352 * #ASM_MODULE_ID_VOL_CTRL module.
5353 */
5354#define ASM_PARAM_ID_MULTICHANNEL_GAIN 0x00010713
5355
5356/* ID of the multiple-channel mute configuration parameters used by the
5357 * #ASM_MODULE_ID_VOL_CTRL module.
5358 */
5359
5360#define ASM_PARAM_ID_MULTICHANNEL_MUTE 0x00010714
5361
5362/* Structure for the master gain parameter for a volume control
5363 * module.
5364 */
5365
5366
5367/* @brief Payload of the #ASM_PARAM_ID_VOL_CTRL_MASTER_GAIN
5368 * parameter used by the Volume Control module.
5369 */
5370
5371
5372
5373struct asm_volume_ctrl_master_gain {
5374 struct apr_hdr hdr;
5375 struct asm_stream_cmd_set_pp_params_v2 param;
5376 struct asm_stream_param_data_v2 data;
5377 uint16_t master_gain;
5378 /*< Linear gain in Q13 format. */
5379
5380 uint16_t reserved;
5381 /*< Clients must set this field to zero.
5382 */
5383} __packed;
5384
5385
5386/* Structure for the left/right channel gain parameter for a
5387 * volume control module.
5388 */
5389
5390
5391/* @brief Payload of the #ASM_PARAM_ID_VOL_CTRL_LR_CHANNEL_GAIN
5392 * parameters used by the Volume Control module.
5393 */
5394
5395
5396
5397struct asm_volume_ctrl_lr_chan_gain {
5398 struct apr_hdr hdr;
5399 struct asm_stream_cmd_set_pp_params_v2 param;
5400 struct asm_stream_param_data_v2 data;
5401
5402 uint16_t l_chan_gain;
5403 /*< Linear gain in Q13 format for the left channel. */
5404
5405 uint16_t r_chan_gain;
5406 /*< Linear gain in Q13 format for the right channel.*/
5407} __packed;
5408
5409
5410/* Structure for the mute configuration parameter for a
5411 volume control module. */
5412
5413
5414/* @brief Payload of the #ASM_PARAM_ID_VOL_CTRL_MUTE_CONFIG
5415 * parameter used by the Volume Control module.
5416 */
5417
5418
5419struct asm_volume_ctrl_mute_config {
5420 struct apr_hdr hdr;
5421 struct asm_stream_cmd_set_pp_params_v2 param;
5422 struct asm_stream_param_data_v2 data;
5423 uint32_t mute_flag;
5424/*< Specifies whether mute is disabled (0) or enabled (nonzero).*/
5425
5426} __packed;
5427
5428/*
5429 * Supported parameters for a soft stepping linear ramping curve.
5430 */
5431#define ASM_PARAM_SVC_RAMPINGCURVE_LINEAR 0
5432
5433/*
5434 * Exponential ramping curve.
5435 */
5436#define ASM_PARAM_SVC_RAMPINGCURVE_EXP 1
5437
5438/*
5439 * Logarithmic ramping curve.
5440 */
5441#define ASM_PARAM_SVC_RAMPINGCURVE_LOG 2
5442
5443/* Structure for holding soft stepping volume parameters. */
5444
5445
5446/* Payload of the #ASM_PARAM_ID_SOFT_VOL_STEPPING_PARAMETERS
5447 * parameters used by the Volume Control module.
5448 */
5449struct asm_soft_step_volume_params {
5450 struct apr_hdr hdr;
5451 struct asm_stream_cmd_set_pp_params_v2 param;
5452 struct asm_stream_param_data_v2 data;
5453 uint32_t period;
5454/*< Period in milliseconds.
5455 * Supported values: 0 to 15000
5456 */
5457
5458 uint32_t step;
5459/*< Step in microseconds.
5460 * Supported values: 0 to 15000000
5461 */
5462
5463 uint32_t ramping_curve;
5464/*< Ramping curve type.
5465 * Supported values:
5466 * - #ASM_PARAM_SVC_RAMPINGCURVE_LINEAR
5467 * - #ASM_PARAM_SVC_RAMPINGCURVE_EXP
5468 * - #ASM_PARAM_SVC_RAMPINGCURVE_LOG
5469 */
5470} __packed;
5471
5472
5473/* Structure for holding soft pause parameters. */
5474
5475
5476/* Payload of the #ASM_PARAM_ID_SOFT_PAUSE_PARAMETERS
5477 * parameters used by the Volume Control module.
5478 */
5479
5480
5481struct asm_soft_pause_params {
5482 struct apr_hdr hdr;
5483 struct asm_stream_cmd_set_pp_params_v2 param;
5484 struct asm_stream_param_data_v2 data;
5485 uint32_t enable_flag;
5486/*< Specifies whether soft pause is disabled (0) or enabled
5487 * (nonzero).
5488 */
5489
5490
5491
5492 uint32_t period;
5493/*< Period in milliseconds.
5494 * Supported values: 0 to 15000
5495 */
5496
5497 uint32_t step;
5498/*< Step in microseconds.
5499 * Supported values: 0 to 15000000
5500 */
5501
5502 uint32_t ramping_curve;
5503/*< Ramping curve.
5504 * Supported values:
5505 * - #ASM_PARAM_SVC_RAMPINGCURVE_LINEAR
5506 * - #ASM_PARAM_SVC_RAMPINGCURVE_EXP
5507 * - #ASM_PARAM_SVC_RAMPINGCURVE_LOG
5508 */
5509} __packed;
5510
5511
5512/* Maximum number of channels.*/
5513#define VOLUME_CONTROL_MAX_CHANNELS 8
5514
5515/* Structure for holding one channel type - gain pair. */
5516
5517
5518/* Payload of the #ASM_PARAM_ID_MULTICHANNEL_GAIN channel
5519 * type/gain pairs used by the Volume Control module. \n \n This
5520 * structure immediately follows the
5521 * asm_volume_ctrl_multichannel_gain structure.
5522 */
5523
5524
5525struct asm_volume_ctrl_channelype_gain_pair {
5526 struct apr_hdr hdr;
5527 struct asm_stream_cmd_set_pp_params_v2 param;
5528 struct asm_stream_param_data_v2 data;
5529 uint8_t channelype;
5530/*< Channel type for which the gain setting is to be applied.
5531 * Supported values:
5532 * - #PCM_CHANNEL_L
5533 * - #PCM_CHANNEL_R
5534 * - #PCM_CHANNEL_C
5535 * - #PCM_CHANNEL_LS
5536 * - #PCM_CHANNEL_RS
5537 * - #PCM_CHANNEL_LFE
5538 * - #PCM_CHANNEL_CS
5539 * - #PCM_CHANNEL_LB
5540 * - #PCM_CHANNEL_RB
5541 * - #PCM_CHANNELS
5542 * - #PCM_CHANNEL_CVH
5543 * - #PCM_CHANNEL_MS
5544 * - #PCM_CHANNEL_FLC
5545 * - #PCM_CHANNEL_FRC
5546 * - #PCM_CHANNEL_RLC
5547 * - #PCM_CHANNEL_RRC
5548 */
5549
5550 uint8_t reserved1;
5551 /*< Clients must set this field to zero. */
5552
5553 uint8_t reserved2;
5554 /*< Clients must set this field to zero. */
5555
5556 uint8_t reserved3;
5557 /*< Clients must set this field to zero. */
5558
5559 uint32_t gain;
5560/*< Gain value for this channel in Q28 format.
5561 * Supported values: Any
5562 */
5563} __packed;
5564
5565
5566/* Structure for the multichannel gain command */
5567
5568
5569/* Payload of the #ASM_PARAM_ID_MULTICHANNEL_GAIN
5570 * parameters used by the Volume Control module.
5571 */
5572
5573
5574struct asm_volume_ctrl_multichannel_gain {
5575 struct apr_hdr hdr;
5576 struct asm_stream_cmd_set_pp_params_v2 param;
5577 struct asm_stream_param_data_v2 data;
5578 uint32_t num_channels;
5579/*< Number of channels for which gain values are provided. Any
5580 * channels present in the data for which gain is not provided are
5581 * set to unity gain.
5582 * Supported values: 1 to 8
5583 */
5584
5585
5586 struct asm_volume_ctrl_channelype_gain_pair
5587 gain_data[VOLUME_CONTROL_MAX_CHANNELS];
5588 /*< Array of channel type/gain pairs.*/
5589} __packed;
5590
5591
5592/* Structure for holding one channel type - mute pair. */
5593
5594
5595/* Payload of the #ASM_PARAM_ID_MULTICHANNEL_MUTE channel
5596 * type/mute setting pairs used by the Volume Control module. \n \n
5597 * This structure immediately follows the
5598 * asm_volume_ctrl_multichannel_mute structure.
5599 */
5600
5601
5602struct asm_volume_ctrl_channelype_mute_pair {
5603 struct apr_hdr hdr;
5604 struct asm_stream_cmd_set_pp_params_v2 param;
5605 struct asm_stream_param_data_v2 data;
5606 uint8_t channelype;
5607/*< Channel type for which the mute setting is to be applied.
5608 * Supported values:
5609 * - #PCM_CHANNEL_L
5610 * - #PCM_CHANNEL_R
5611 * - #PCM_CHANNEL_C
5612 * - #PCM_CHANNEL_LS
5613 * - #PCM_CHANNEL_RS
5614 * - #PCM_CHANNEL_LFE
5615 * - #PCM_CHANNEL_CS
5616 * - #PCM_CHANNEL_LB
5617 * - #PCM_CHANNEL_RB
5618 * - #PCM_CHANNELS
5619 * - #PCM_CHANNEL_CVH
5620 * - #PCM_CHANNEL_MS
5621 * - #PCM_CHANNEL_FLC
5622 * - #PCM_CHANNEL_FRC
5623 * - #PCM_CHANNEL_RLC
5624 * - #PCM_CHANNEL_RRC
5625 */
5626
5627 uint8_t reserved1;
5628 /*< Clients must set this field to zero. */
5629
5630 uint8_t reserved2;
5631 /*< Clients must set this field to zero. */
5632
5633 uint8_t reserved3;
5634 /*< Clients must set this field to zero. */
5635
5636 uint32_t mute;
5637/*< Mute setting for this channel.
5638 * Supported values:
5639 * - 0 = Unmute
5640 * - Nonzero = Mute
5641 */
5642} __packed;
5643
5644
5645/* Structure for the multichannel mute command */
5646
5647
5648/* @brief Payload of the #ASM_PARAM_ID_MULTICHANNEL_MUTE
5649 * parameters used by the Volume Control module.
5650 */
5651
5652
5653struct asm_volume_ctrl_multichannel_mute {
5654 struct apr_hdr hdr;
5655 struct asm_stream_cmd_set_pp_params_v2 param;
5656 struct asm_stream_param_data_v2 data;
5657 uint32_t num_channels;
5658/*< Number of channels for which mute configuration is
5659 * provided. Any channels present in the data for which mute
5660 * configuration is not provided are set to unmute.
5661 * Supported values: 1 to 8
5662 */
5663
5664struct asm_volume_ctrl_channelype_mute_pair
5665 mute_data[VOLUME_CONTROL_MAX_CHANNELS];
5666 /*< Array of channel type/mute setting pairs.*/
5667} __packed;
5668/* end_addtogroup audio_pp_param_ids */
5669
5670/* audio_pp_module_ids
5671 * ID of the IIR Tuning Filter module.
5672 * This module supports the following parameter IDs:
5673 * - #ASM_PARAM_ID_IIRUNING_FILTER_ENABLE_CONFIG
5674 * - #ASM_PARAM_ID_IIRUNING_FILTER_PRE_GAIN
5675 * - #ASM_PARAM_ID_IIRUNING_FILTER_CONFIG_PARAMS
5676 */
5677#define ASM_MODULE_ID_IIRUNING_FILTER 0x00010C02
5678
5679/* @addtogroup audio_pp_param_ids */
5680/* ID of the IIR tuning filter enable parameter used by the
5681 * #ASM_MODULE_ID_IIRUNING_FILTER module.
5682 * @messagepayload
5683 * @structure{asm_iiruning_filter_enable}
5684 * @tablespace
5685 * @inputtable{Audio_Postproc_ASM_PARAM_ID_IIRUNING_FILTER_ENABLE_CO
5686 * NFIG.tex}
5687 */
5688#define ASM_PARAM_ID_IIRUNING_FILTER_ENABLE_CONFIG 0x00010C03
5689
5690/* ID of the IIR tuning filter pregain parameter used by the
5691 * #ASM_MODULE_ID_IIRUNING_FILTER module.
5692 */
5693#define ASM_PARAM_ID_IIRUNING_FILTER_PRE_GAIN 0x00010C04
5694
5695/* ID of the IIR tuning filter configuration parameters used by the
5696 * #ASM_MODULE_ID_IIRUNING_FILTER module.
5697 */
5698#define ASM_PARAM_ID_IIRUNING_FILTER_CONFIG_PARAMS 0x00010C05
5699
5700/* Structure for an enable configuration parameter for an
5701 * IIR tuning filter module.
5702 */
5703
5704
5705/* @brief Payload of the #ASM_PARAM_ID_IIRUNING_FILTER_ENABLE_CONFIG
5706 * parameter used by the IIR Tuning Filter module.
5707 */
5708struct asm_iiruning_filter_enable {
5709 uint32_t enable_flag;
5710/*< Specifies whether the IIR tuning filter is disabled (0) or
5711 * enabled (1).
5712 */
5713} __packed;
5714
5715/* Structure for the pregain parameter for an IIR tuning filter module. */
5716
5717
5718/* Payload of the #ASM_PARAM_ID_IIRUNING_FILTER_PRE_GAIN
5719 * parameters used by the IIR Tuning Filter module.
5720 */
5721struct asm_iiruning_filter_pregain {
5722 uint16_t pregain;
5723 /*< Linear gain in Q13 format. */
5724
5725 uint16_t reserved;
5726 /*< Clients must set this field to zero.*/
5727} __packed;
5728
5729/* Structure for the configuration parameter for an IIR tuning filter
5730 * module.
5731 */
5732
5733
5734/* @brief Payload of the #ASM_PARAM_ID_IIRUNING_FILTER_CONFIG_PARAMS
5735 * parameters used by the IIR Tuning Filter module. \n
5736 * \n
5737 * This structure is followed by the IIR filter coefficients: \n
5738 * - Sequence of int32_t FilterCoeffs \n
5739 * Five coefficients for each band. Each coefficient is in int32_t format, in
5740 * the order of b0, b1, b2, a1, a2.
5741 * - Sequence of int16_t NumShiftFactor \n
5742 * One int16_t per band. The numerator shift factor is related to the Q
5743 * factor of the filter coefficients.
5744 * - Sequence of uint16_t PanSetting \n
5745 * One uint16_t per band, indicating if the filter is applied to left (0),
5746 * right (1), or both (2) channels.
5747 */
5748struct asm_iir_filter_config_params {
5749 uint16_t num_biquad_stages;
5750/*< Number of bands.
5751 * Supported values: 0 to 20
5752 */
5753
5754 uint16_t reserved;
5755 /*< Clients must set this field to zero.*/
5756} __packed;
5757
5758/* audio_pp_module_ids
5759 * ID of the Multiband Dynamic Range Control (MBDRC) module on the Tx/Rx
5760 * paths.
5761 * This module supports the following parameter IDs:
5762 * - #ASM_PARAM_ID_MBDRC_ENABLE
5763 * - #ASM_PARAM_ID_MBDRC_CONFIG_PARAMS
5764 */
5765#define ASM_MODULE_ID_MBDRC 0x00010C06
5766
5767/* audio_pp_param_ids */
5768/* ID of the MBDRC enable parameter used by the #ASM_MODULE_ID_MBDRC module.
5769 * @messagepayload
5770 * @structure{asm_mbdrc_enable}
5771 * @tablespace
5772 * @inputtable{Audio_Postproc_ASM_PARAM_ID_MBDRC_ENABLE.tex}
5773 */
5774#define ASM_PARAM_ID_MBDRC_ENABLE 0x00010C07
5775
5776/* ID of the MBDRC configuration parameters used by the
5777 * #ASM_MODULE_ID_MBDRC module.
5778 * @messagepayload
5779 * @structure{asm_mbdrc_config_params}
5780 * @tablespace
5781 * @inputtable{Audio_Postproc_ASM_PARAM_ID_MBDRC_CONFIG_PARAMS.tex}
5782 *
5783 * @parspace Sub-band DRC configuration parameters
5784 * @structure{asm_subband_drc_config_params}
5785 * @tablespace
5786 * @inputtable{Audio_Postproc_ASM_PARAM_ID_MBDRC_CONFIG_PARAMS_subband_DRC.tex}
5787 *
5788 * @keep{6}
5789 * To obtain legacy ADRC from MBDRC, use the calibration tool to:
5790 *
5791 * - Enable MBDRC (EnableFlag = TRUE)
5792 * - Set number of bands to 1 (uiNumBands = 1)
5793 * - Enable the first MBDRC band (DrcMode[0] = DRC_ENABLED = 1)
5794 * - Clear the first band mute flag (MuteFlag[0] = 0)
5795 * - Set the first band makeup gain to unity (compMakeUpGain[0] = 0x2000)
5796 * - Use the legacy ADRC parameters to calibrate the rest of the MBDRC
5797 * parameters.
5798 */
5799#define ASM_PARAM_ID_MBDRC_CONFIG_PARAMS 0x00010C08
5800
5801/* end_addtogroup audio_pp_param_ids */
5802
5803/* audio_pp_module_ids
5804 * ID of the MMBDRC module version 2 pre/postprocessing block.
5805 * This module differs from the original MBDRC (#ASM_MODULE_ID_MBDRC) in
5806 * the length of the filters used in each sub-band.
5807 * This module supports the following parameter ID:
5808 * - #ASM_PARAM_ID_MBDRC_CONFIG_PARAMS_IMPROVED_FILTBANK_V2
5809 */
5810#define ASM_MODULE_ID_MBDRCV2 0x0001070B
5811
5812/* @addtogroup audio_pp_param_ids */
5813/* ID of the configuration parameters used by the
5814 * #ASM_MODULE_ID_MBDRCV2 module for the improved filter structure
5815 * of the MBDRC v2 pre/postprocessing block.
5816 * The update to this configuration structure from the original
5817 * MBDRC is the number of filter coefficients in the filter
5818 * structure. The sequence for is as follows:
5819 * - 1 band = 0 FIR coefficient + 1 mute flag + uint16_t padding
5820 * - 2 bands = 141 FIR coefficients + 2 mute flags + uint16_t padding
5821 * - 3 bands = 141+81 FIR coefficients + 3 mute flags + uint16_t padding
5822 * - 4 bands = 141+81+61 FIR coefficients + 4 mute flags + uint16_t
5823 * padding
5824 * - 5 bands = 141+81+61+61 FIR coefficients + 5 mute flags +
5825 * uint16_t padding
5826 * This block uses the same parameter structure as
5827 * #ASM_PARAM_ID_MBDRC_CONFIG_PARAMS.
5828 */
5829#define ASM_PARAM_ID_MBDRC_CONFIG_PARAMS_IMPROVED_FILTBANK_V2 \
5830 0x0001070C
5831
5832/* Structure for the enable parameter for an MBDRC module. */
5833
5834
5835/* Payload of the #ASM_PARAM_ID_MBDRC_ENABLE parameter used by the
5836 * MBDRC module.
5837 */
5838struct asm_mbdrc_enable {
5839 uint32_t enable_flag;
5840/*< Specifies whether MBDRC is disabled (0) or enabled (nonzero).*/
5841} __packed;
5842
5843/* Structure for the configuration parameters for an MBDRC module. */
5844
5845
5846/* Payload of the #ASM_PARAM_ID_MBDRC_CONFIG_PARAMS
5847 * parameters used by the MBDRC module. \n \n Following this
5848 * structure is the payload for sub-band DRC configuration
5849 * parameters (asm_subband_drc_config_params). This sub-band
5850 * structure must be repeated for each band.
5851 */
5852
5853
5854struct asm_mbdrc_config_params {
5855 uint16_t num_bands;
5856/*< Number of bands.
5857 * Supported values: 1 to 5
5858 */
5859
5860 int16_t limiterhreshold;
5861/*< Threshold in decibels for the limiter output.
5862 * Supported values: -72 to 18 \n
5863 * Recommended value: 3994 (-0.22 db in Q3.12 format)
5864 */
5865
5866 int16_t limiter_makeup_gain;
5867/*< Makeup gain in decibels for the limiter output.
5868 * Supported values: -42 to 42 \n
5869 * Recommended value: 256 (0 dB in Q7.8 format)
5870 */
5871
5872 int16_t limiter_gc;
5873/*< Limiter gain recovery coefficient.
5874 * Supported values: 0.5 to 0.99 \n
5875 * Recommended value: 32440 (0.99 in Q15 format)
5876 */
5877
5878 int16_t limiter_delay;
5879/*< Limiter delay in samples.
5880 * Supported values: 0 to 10 \n
5881 * Recommended value: 262 (0.008 samples in Q15 format)
5882 */
5883
5884 int16_t limiter_max_wait;
5885/*< Maximum limiter waiting time in samples.
5886 * Supported values: 0 to 10 \n
5887 * Recommended value: 262 (0.008 samples in Q15 format)
5888 */
5889} __packed;
5890
5891/* DRC configuration structure for each sub-band of an MBDRC module. */
5892
5893
5894/* Payload of the #ASM_PARAM_ID_MBDRC_CONFIG_PARAMS DRC
5895 * configuration parameters for each sub-band in the MBDRC module.
5896 * After this DRC structure is configured for valid bands, the next
5897 * MBDRC setparams expects the sequence of sub-band MBDRC filter
5898 * coefficients (the length depends on the number of bands) plus the
5899 * mute flag for that band plus uint16_t padding.
5900 *
5901 * @keep{10}
5902 * The filter coefficient and mute flag are of type int16_t:
5903 * - FIR coefficient = int16_t firFilter
5904 * - Mute flag = int16_t fMuteFlag
5905 *
5906 * The sequence is as follows:
5907 * - 1 band = 0 FIR coefficient + 1 mute flag + uint16_t padding
5908 * - 2 bands = 97 FIR coefficients + 2 mute flags + uint16_t padding
5909 * - 3 bands = 97+33 FIR coefficients + 3 mute flags + uint16_t padding
5910 * - 4 bands = 97+33+33 FIR coefficients + 4 mute flags + uint16_t padding
5911 * - 5 bands = 97+33+33+33 FIR coefficients + 5 mute flags + uint16_t padding
5912 *
5913 * For improved filterbank, the sequence is as follows:
5914 * - 1 band = 0 FIR coefficient + 1 mute flag + uint16_t padding
5915 * - 2 bands = 141 FIR coefficients + 2 mute flags + uint16_t padding
5916 * - 3 bands = 141+81 FIR coefficients + 3 mute flags + uint16_t padding
5917 * - 4 bands = 141+81+61 FIR coefficients + 4 mute flags + uint16_t padding
5918 * - 5 bands = 141+81+61+61 FIR coefficients + 5 mute flags + uint16_t padding
5919 */
5920struct asm_subband_drc_config_params {
5921 int16_t drc_stereo_linked_flag;
5922/*< Specifies whether all stereo channels have the same applied
5923 * dynamics (1) or if they process their dynamics independently (0).
5924 * Supported values:
5925 * - 0 -- Not linked
5926 * - 1 -- Linked
5927 */
5928
5929 int16_t drc_mode;
5930/*< Specifies whether DRC mode is bypassed for sub-bands.
5931 * Supported values:
5932 * - 0 -- Disabled
5933 * - 1 -- Enabled
5934 */
5935
5936 int16_t drc_down_sample_level;
5937/*< DRC down sample level.
5938 * Supported values: @ge 1
5939 */
5940
5941 int16_t drc_delay;
5942/*< DRC delay in samples.
5943 * Supported values: 0 to 1200
5944 */
5945
5946 uint16_t drc_rmsime_avg_const;
5947/*< RMS signal energy time-averaging constant.
5948 * Supported values: 0 to 2^16-1
5949 */
5950
5951 uint16_t drc_makeup_gain;
5952/*< DRC makeup gain in decibels.
5953 * Supported values: 258 to 64917
5954 */
5955 /* Down expander settings */
5956 int16_t down_expdrhreshold;
5957/*< Down expander threshold.
5958 * Supported Q7 format values: 1320 to up_cmpsrhreshold
5959 */
5960
5961 int16_t down_expdr_slope;
5962/*< Down expander slope.
5963 * Supported Q8 format values: -32768 to 0.
5964 */
5965
5966 uint32_t down_expdr_attack;
5967/*< Down expander attack constant.
5968 * Supported Q31 format values: 196844 to 2^31.
5969 */
5970
5971 uint32_t down_expdr_release;
5972/*< Down expander release constant.
5973 * Supported Q31 format values: 19685 to 2^31
5974 */
5975
5976 uint16_t down_expdr_hysteresis;
5977/*< Down expander hysteresis constant.
5978 * Supported Q14 format values: 1 to 32690
5979 */
5980
5981 uint16_t reserved;
5982 /*< Clients must set this field to zero. */
5983
5984 int32_t down_expdr_min_gain_db;
5985/*< Down expander minimum gain.
5986 * Supported Q23 format values: -805306368 to 0.
5987 */
5988
5989 /* Up compressor settings */
5990
5991 int16_t up_cmpsrhreshold;
5992/*< Up compressor threshold.
5993 * Supported Q7 format values: down_expdrhreshold to
5994 * down_cmpsrhreshold.
5995 */
5996
5997 uint16_t up_cmpsr_slope;
5998/*< Up compressor slope.
5999 * Supported Q16 format values: 0 to 64881.
6000 */
6001
6002 uint32_t up_cmpsr_attack;
6003/*< Up compressor attack constant.
6004 * Supported Q31 format values: 196844 to 2^31.
6005 */
6006
6007 uint32_t up_cmpsr_release;
6008/*< Up compressor release constant.
6009 * Supported Q31 format values: 19685 to 2^31.
6010 */
6011
6012 uint16_t up_cmpsr_hysteresis;
6013/*< Up compressor hysteresis constant.
6014 * Supported Q14 format values: 1 to 32690.
6015 */
6016
6017 /* Down compressor settings */
6018
6019 int16_t down_cmpsrhreshold;
6020/*< Down compressor threshold.
6021 * Supported Q7 format values: up_cmpsrhreshold to 11560.
6022 */
6023
6024 uint16_t down_cmpsr_slope;
6025/*< Down compressor slope.
6026 * Supported Q16 format values: 0 to 64881.
6027 */
6028
6029 uint16_t reserved1;
6030/*< Clients must set this field to zero. */
6031
6032 uint32_t down_cmpsr_attack;
6033/*< Down compressor attack constant.
6034 * Supported Q31 format values: 196844 to 2^31.
6035 */
6036
6037 uint32_t down_cmpsr_release;
6038/*< Down compressor release constant.
6039 * Supported Q31 format values: 19685 to 2^31.
6040 */
6041
6042 uint16_t down_cmpsr_hysteresis;
6043/*< Down compressor hysteresis constant.
6044 * Supported Q14 values: 1 to 32690.
6045 */
6046
6047 uint16_t reserved2;
6048/*< Clients must set this field to zero.*/
6049} __packed;
6050
6051#define ASM_MODULE_ID_EQUALIZER 0x00010C27
6052#define ASM_PARAM_ID_EQUALIZER_PARAMETERS 0x00010C28
6053
6054#define ASM_MAX_EQ_BANDS 12
6055
6056struct asm_eq_per_band_params {
6057 uint32_t band_idx;
6058/*< Band index.
6059 * Supported values: 0 to 11
6060 */
6061
6062 uint32_t filterype;
6063/*< Type of filter.
6064 * Supported values:
6065 * - #ASM_PARAM_EQYPE_NONE
6066 * - #ASM_PARAM_EQ_BASS_BOOST
6067 * - #ASM_PARAM_EQ_BASS_CUT
6068 * - #ASM_PARAM_EQREBLE_BOOST
6069 * - #ASM_PARAM_EQREBLE_CUT
6070 * - #ASM_PARAM_EQ_BAND_BOOST
6071 * - #ASM_PARAM_EQ_BAND_CUT
6072 */
6073
6074 uint32_t center_freq_hz;
6075 /*< Filter band center frequency in Hertz. */
6076
6077 int32_t filter_gain;
6078/*< Filter band initial gain.
6079 * Supported values: +12 to -12 dB in 1 dB increments
6080 */
6081
6082 int32_t q_factor;
6083/*< Filter band quality factor expressed as a Q8 number, i.e., a
6084 * fixed-point number with q factor of 8. For example, 3000/(2^8).
6085 */
6086} __packed;
6087
6088struct asm_eq_params {
6089 struct apr_hdr hdr;
6090 struct asm_stream_cmd_set_pp_params_v2 param;
6091 struct asm_stream_param_data_v2 data;
6092 uint32_t enable_flag;
6093/*< Specifies whether the equalizer module is disabled (0) or enabled
6094 * (nonzero).
6095 */
6096
6097 uint32_t num_bands;
6098/*< Number of bands.
6099 * Supported values: 1 to 12
6100 */
6101 struct asm_eq_per_band_params eq_bands[ASM_MAX_EQ_BANDS];
6102
6103} __packed;
6104
6105/* No equalizer effect.*/
6106#define ASM_PARAM_EQYPE_NONE 0
6107
6108/* Bass boost equalizer effect.*/
6109#define ASM_PARAM_EQ_BASS_BOOST 1
6110
6111/*Bass cut equalizer effect.*/
6112#define ASM_PARAM_EQ_BASS_CUT 2
6113
6114/* Treble boost equalizer effect */
6115#define ASM_PARAM_EQREBLE_BOOST 3
6116
6117/* Treble cut equalizer effect.*/
6118#define ASM_PARAM_EQREBLE_CUT 4
6119
6120/* Band boost equalizer effect.*/
6121#define ASM_PARAM_EQ_BAND_BOOST 5
6122
6123/* Band cut equalizer effect.*/
6124#define ASM_PARAM_EQ_BAND_CUT 6
6125
6126
6127/* ERROR CODES */
6128/* Success. The operation completed with no errors. */
6129#define ADSP_EOK 0x00000000
6130/* General failure. */
6131#define ADSP_EFAILED 0x00000001
6132/* Bad operation parameter. */
6133#define ADSP_EBADPARAM 0x00000002
6134/* Unsupported routine or operation. */
6135#define ADSP_EUNSUPPORTED 0x00000003
6136/* Unsupported version. */
6137#define ADSP_EVERSION 0x00000004
6138/* Unexpected problem encountered. */
6139#define ADSP_EUNEXPECTED 0x00000005
6140/* Unhandled problem occurred. */
6141#define ADSP_EPANIC 0x00000006
6142/* Unable to allocate resource. */
6143#define ADSP_ENORESOURCE 0x00000007
6144/* Invalid handle. */
6145#define ADSP_EHANDLE 0x00000008
6146/* Operation is already processed. */
6147#define ADSP_EALREADY 0x00000009
6148/* Operation is not ready to be processed. */
6149#define ADSP_ENOTREADY 0x0000000A
6150/* Operation is pending completion. */
6151#define ADSP_EPENDING 0x0000000B
6152/* Operation could not be accepted or processed. */
6153#define ADSP_EBUSY 0x0000000C
6154/* Operation aborted due to an error. */
6155#define ADSP_EABORTED 0x0000000D
6156/* Operation preempted by a higher priority. */
6157#define ADSP_EPREEMPTED 0x0000000E
6158/* Operation requests intervention to complete. */
6159#define ADSP_ECONTINUE 0x0000000F
6160/* Operation requests immediate intervention to complete. */
6161#define ADSP_EIMMEDIATE 0x00000010
6162/* Operation is not implemented. */
6163#define ADSP_ENOTIMPL 0x00000011
6164/* Operation needs more data or resources. */
6165#define ADSP_ENEEDMORE 0x00000012
6166/* Operation does not have memory. */
6167#define ADSP_ENOMEMORY 0x00000014
6168/* Item does not exist. */
6169#define ADSP_ENOTEXIST 0x00000015
6170/* Operation is finished. */
6171#define ADSP_ETERMINATED 0x00011174
6172
6173/*bharath, adsp_error_codes.h */
6174
6175#endif /*_APR_AUDIO_V2_H_ */