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