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