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