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