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