blob: f88c8176f51c3c95f0238624ca2139ddae39e25e [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
2421struct asm_softpause_params {
2422 u32 enable;
2423 u32 period;
2424 u32 step;
2425 u32 rampingcurve;
2426} __packed;
2427
2428struct asm_softvolume_params {
2429 u32 period;
2430 u32 step;
2431 u32 rampingcurve;
2432} __packed;
2433
2434#define ASM_END_POINT_DEVICE_MATRIX 0
Harmandeep Singheaf59b42012-06-05 21:46:02 -07002435
2436#define PCM_CHANNEL_NULL 0
2437
Bharath Ramachandramurthy2e3168f2012-05-03 16:29:09 -07002438/* Front left channel. */
2439#define PCM_CHANNEL_FL 1
2440
2441/* Front right channel. */
2442#define PCM_CHANNEL_FR 2
2443
2444/* Front center channel. */
2445#define PCM_CHANNEL_FC 3
2446
2447/* Left surround channel.*/
2448#define PCM_CHANNEL_LS 4
2449
2450/* Right surround channel.*/
2451#define PCM_CHANNEL_RS 5
2452
2453/* Low frequency effect channel. */
2454#define PCM_CHANNEL_LFE 6
2455
2456/* Center surround channel; Rear center channel. */
2457#define PCM_CHANNEL_CS 7
2458
2459/* Left back channel; Rear left channel. */
2460#define PCM_CHANNEL_LB 8
2461
2462/* Right back channel; Rear right channel. */
2463#define PCM_CHANNEL_RB 9
2464
2465/* Top surround channel. */
2466#define PCM_CHANNELS 10
2467
2468/* Center vertical height channel.*/
2469#define PCM_CHANNEL_CVH 11
2470
2471/* Mono surround channel.*/
2472#define PCM_CHANNEL_MS 12
2473
2474/* Front left of center. */
2475#define PCM_CHANNEL_FLC 13
2476
2477/* Front right of center. */
2478#define PCM_CHANNEL_FRC 14
2479
2480/* Rear left of center. */
2481#define PCM_CHANNEL_RLC 15
2482
2483/* Rear right of center. */
2484#define PCM_CHANNEL_RRC 16
2485
2486#define PCM_FORMAT_MAX_NUM_CHANNEL 8
2487
2488#define ASM_MEDIA_FMT_MULTI_CHANNEL_PCM_V2 0x00010DA5
2489
2490#define ASM_STREAM_POSTPROC_TOPO_ID_DEFAULT 0x00010BE4
2491
2492#define ASM_MEDIA_FMT_EVRCB_FS 0x00010BEF
2493
2494#define ASM_MEDIA_FMT_EVRCWB_FS 0x00010BF0
2495
2496#define ASM_MAX_EQ_BANDS 12
2497
2498#define ASM_DATA_CMD_MEDIA_FMT_UPDATE_V2 0x00010D98
2499
2500struct asm_data_cmd_media_fmt_update_v2 {
2501u32 fmt_blk_size;
2502 /* Media format block size in bytes.*/
2503} __packed;
2504
2505struct asm_multi_channel_pcm_fmt_blk_v2 {
2506 struct apr_hdr hdr;
2507 struct asm_data_cmd_media_fmt_update_v2 fmt_blk;
2508
2509 u16 num_channels;
2510 /* Number of channels. Supported values: 1 to 8 */
2511 u16 bits_per_sample;
2512/* Number of bits per sample per channel. * Supported values:
2513 * 16, 24 * When used for playback, the client must send 24-bit
2514 * samples packed in 32-bit words. The 24-bit samples must be placed
2515 * in the most significant 24 bits of the 32-bit word. When used for
2516 * recording, the aDSP sends 24-bit samples packed in 32-bit words.
2517 * The 24-bit samples are placed in the most significant 24 bits of
2518 * the 32-bit word.
2519 */
2520
2521
2522 u32 sample_rate;
2523/* Number of samples per second (in Hertz).
2524 * Supported values: 2000 to 48000
2525 */
2526
2527 u16 is_signed;
2528 /* Flag that indicates the samples are signed (1). */
2529
2530 u16 reserved;
2531 /* reserved field for 32 bit alignment. must be set to zero. */
2532
2533 u8 channel_mapping[8];
2534/* Channel array of size 8.
2535 * Supported values:
2536 * - #PCM_CHANNEL_L
2537 * - #PCM_CHANNEL_R
2538 * - #PCM_CHANNEL_C
2539 * - #PCM_CHANNEL_LS
2540 * - #PCM_CHANNEL_RS
2541 * - #PCM_CHANNEL_LFE
2542 * - #PCM_CHANNEL_CS
2543 * - #PCM_CHANNEL_LB
2544 * - #PCM_CHANNEL_RB
2545 * - #PCM_CHANNELS
2546 * - #PCM_CHANNEL_CVH
2547 * - #PCM_CHANNEL_MS
2548 * - #PCM_CHANNEL_FLC
2549 * - #PCM_CHANNEL_FRC
2550 * - #PCM_CHANNEL_RLC
2551 * - #PCM_CHANNEL_RRC
2552 *
2553 * Channel[i] mapping describes channel I. Each element i of the
2554 * array describes channel I inside the buffer where 0 @le I <
2555 * num_channels. An unused channel is set to zero.
2556 */
2557} __packed;
2558
2559struct asm_stream_cmd_set_encdec_param {
Harmandeep Singheaf59b42012-06-05 21:46:02 -07002560 u32 param_id;
Bharath Ramachandramurthy2e3168f2012-05-03 16:29:09 -07002561 /* ID of the parameter. */
2562
2563 u32 param_size;
2564/* Data size of this parameter, in bytes. The size is a multiple
2565 * of 4 bytes.
2566 */
2567
2568} __packed;
2569
2570struct asm_enc_cfg_blk_param_v2 {
2571 u32 frames_per_buf;
2572/* Number of encoded frames to pack into each buffer.
2573 *
2574 * @note1hang This is only guidance information for the aDSP. The
2575 * number of encoded frames put into each buffer (specified by the
2576 * client) is less than or equal to this number.
2577 */
2578
2579 u32 enc_cfg_blk_size;
2580/* Size in bytes of the encoder configuration block that follows
2581 * this member.
2582 */
2583
2584} __packed;
2585
2586/* @brief Multichannel PCM encoder configuration structure used
2587 * in the #ASM_STREAM_CMD_OPEN_READ_V2 command.
2588 */
2589
2590struct asm_multi_channel_pcm_enc_cfg_v2 {
2591 struct apr_hdr hdr;
2592 struct asm_stream_cmd_set_encdec_param encdec;
2593 struct asm_enc_cfg_blk_param_v2 encblk;
2594 uint16_t num_channels;
2595/*< Number of PCM channels.
2596 *
2597 * Supported values: - 0 -- Native mode - 1 -- 8 Native mode
2598 * indicates that encoding must be performed with the number of
2599 * channels at the input.
2600 */
2601
2602 uint16_t bits_per_sample;
2603/*< Number of bits per sample per channel.
2604 * Supported values: 16, 24
2605 */
2606
2607 uint32_t sample_rate;
2608/*< Number of samples per second (in Hertz).
2609 *
2610 * Supported values: 0, 8000 to 48000 A value of 0 indicates the
2611 * native sampling rate. Encoding is performed at the input sampling
2612 * rate.
2613 */
2614
2615 uint16_t is_signed;
2616/*< Specifies whether the samples are signed (1). Currently,
2617 * only signed samples are supported.
2618 */
2619
2620 uint16_t reserved;
2621/*< reserved field for 32 bit alignment. must be set to zero.*/
2622
2623
2624 uint8_t channel_mapping[8];
2625} __packed;
2626
2627#define ASM_MEDIA_FMT_MP3 0x00010BE9
2628#define ASM_MEDIA_FMT_AAC_V2 0x00010DA6
2629
2630/* @xreflabel
2631 * {hdr:AsmMediaFmtDolbyAac} Media format ID for the
2632 * Dolby AAC decoder. This format ID is be used if the client wants
2633 * to use the Dolby AAC decoder to decode MPEG2 and MPEG4 AAC
2634 * contents.
2635 */
2636
2637#define ASM_MEDIA_FMT_DOLBY_AAC 0x00010D86
2638
2639/* Enumeration for the audio data transport stream AAC format. */
2640#define ASM_MEDIA_FMT_AAC_FORMAT_FLAG_ADTS 0
2641
2642/* Enumeration for low overhead audio stream AAC format. */
2643#define ASM_MEDIA_FMT_AAC_FORMAT_FLAG_LOAS 1
2644
2645/* Enumeration for the audio data interchange format
2646 * AAC format.
2647 */
2648#define ASM_MEDIA_FMT_AAC_FORMAT_FLAG_ADIF 2
2649
2650/* Enumeration for the raw AAC format. */
2651#define ASM_MEDIA_FMT_AAC_FORMAT_FLAG_RAW 3
2652
2653#define ASM_MEDIA_FMT_AAC_AOT_LC 2
2654#define ASM_MEDIA_FMT_AAC_AOT_SBR 5
2655#define ASM_MEDIA_FMT_AAC_AOT_PS 29
2656#define ASM_MEDIA_FMT_AAC_AOT_BSAC 22
2657
2658struct asm_aac_fmt_blk_v2 {
2659 struct apr_hdr hdr;
2660 struct asm_data_cmd_media_fmt_update_v2 fmt_blk;
2661
2662 u16 aac_fmt_flag;
2663/* Bitstream format option.
2664 * Supported values:
2665 * - #ASM_MEDIA_FMT_AAC_FORMAT_FLAG_ADTS
2666 * - #ASM_MEDIA_FMT_AAC_FORMAT_FLAG_LOAS
2667 * - #ASM_MEDIA_FMT_AAC_FORMAT_FLAG_ADIF
2668 * - #ASM_MEDIA_FMT_AAC_FORMAT_FLAG_RAW
2669 */
2670
2671 u16 audio_objype;
2672/* Audio Object Type (AOT) present in the AAC stream.
2673 * Supported values:
2674 * - #ASM_MEDIA_FMT_AAC_AOT_LC
2675 * - #ASM_MEDIA_FMT_AAC_AOT_SBR
2676 * - #ASM_MEDIA_FMT_AAC_AOT_BSAC
2677 * - #ASM_MEDIA_FMT_AAC_AOT_PS
2678 * - Otherwise -- Not supported
2679 */
2680
2681 u16 channel_config;
2682/* Number of channels present in the AAC stream.
2683 * Supported values:
2684 * - 1 -- Mono
2685 * - 2 -- Stereo
2686 * - 6 -- 5.1 content
2687 */
2688
Bharath Ramachandramurthy2e3168f2012-05-03 16:29:09 -07002689 u16 total_size_of_PCE_bits;
2690/* greater or equal to zero. * -In case of RAW formats and
2691 * channel config = 0 (PCE), client can send * the bit stream
2692 * containing PCE immediately following this structure * (in-band).
2693 * -This number does not include bits included for 32 bit alignment.
2694 * -If zero, then the PCE info is assumed to be available in the
2695 * audio -bit stream & not in-band.
2696 */
2697
2698 u32 sample_rate;
2699/* Number of samples per second (in Hertz).
2700 *
2701 * Supported values: 8000, 11025, 12000, 16000, 22050, 24000, 32000,
2702 * 44100, 48000
2703 *
2704 * This field must be equal to the sample rate of the AAC-LC
2705 * decoder's output. - For MP4 or 3GP containers, this is indicated
2706 * by the samplingFrequencyIndex field in the AudioSpecificConfig
2707 * element. - For ADTS format, this is indicated by the
2708 * samplingFrequencyIndex in the ADTS fixed header. - For ADIF
2709 * format, this is indicated by the samplingFrequencyIndex in the
2710 * program_config_element present in the ADIF header.
2711 */
2712
2713} __packed;
2714
2715struct asm_aac_enc_cfg_v2 {
2716 struct apr_hdr hdr;
2717 struct asm_stream_cmd_set_encdec_param encdec;
2718 struct asm_enc_cfg_blk_param_v2 encblk;
2719
2720 u32 bit_rate;
2721 /* Encoding rate in bits per second. */
2722 u32 enc_mode;
2723/* Encoding mode.
2724 * Supported values:
2725 * - #ASM_MEDIA_FMT_AAC_AOT_LC
2726 * - #ASM_MEDIA_FMT_AAC_AOT_SBR
2727 * - #ASM_MEDIA_FMT_AAC_AOT_PS
2728 */
2729 u16 aac_fmt_flag;
2730/* AAC format flag.
2731 * Supported values:
2732 * - #ASM_MEDIA_FMT_AAC_FORMAT_FLAG_ADTS
2733 * - #ASM_MEDIA_FMT_AAC_FORMAT_FLAG_RAW
2734 */
2735 u16 channel_cfg;
2736/* Number of channels to encode.
2737 * Supported values:
2738 * - 0 -- Native mode
2739 * - 1 -- Mono
2740 * - 2 -- Stereo
2741 * - Other values are not supported.
2742 * @note1hang The eAAC+ encoder mode supports only stereo.
2743 * Native mode indicates that encoding must be performed with the
2744 * number of channels at the input.
2745 * The number of channels must not change during encoding.
2746 */
2747
2748 u32 sample_rate;
2749/* Number of samples per second.
2750 * Supported values: - 0 -- Native mode - For other values,
2751 * Native mode indicates that encoding must be performed with the
2752 * sampling rate at the input.
2753 * The sampling rate must not change during encoding.
2754 */
2755
2756} __packed;
2757
2758#define ASM_MEDIA_FMT_AMRNB_FS 0x00010BEB
2759
2760/* Enumeration for 4.75 kbps AMR-NB Encoding mode. */
2761#define ASM_MEDIA_FMT_AMRNB_FS_ENCODE_MODE_MR475 0
2762
2763/* Enumeration for 5.15 kbps AMR-NB Encoding mode. */
2764#define ASM_MEDIA_FMT_AMRNB_FS_ENCODE_MODE_MR515 1
2765
2766/* Enumeration for 5.90 kbps AMR-NB Encoding mode. */
2767#define ASM_MEDIA_FMT_AMRNB_FS_ENCODE_MODE_MMR59 2
2768
2769/* Enumeration for 6.70 kbps AMR-NB Encoding mode. */
2770#define ASM_MEDIA_FMT_AMRNB_FS_ENCODE_MODE_MMR67 3
2771
2772/* Enumeration for 7.40 kbps AMR-NB Encoding mode. */
2773#define ASM_MEDIA_FMT_AMRNB_FS_ENCODE_MODE_MMR74 4
2774
2775/* Enumeration for 7.95 kbps AMR-NB Encoding mode. */
2776#define ASM_MEDIA_FMT_AMRNB_FS_ENCODE_MODE_MMR795 5
2777
2778/* Enumeration for 10.20 kbps AMR-NB Encoding mode. */
2779#define ASM_MEDIA_FMT_AMRNB_FS_ENCODE_MODE_MMR102 6
2780
2781/* Enumeration for 12.20 kbps AMR-NB Encoding mode. */
2782#define ASM_MEDIA_FMT_AMRNB_FS_ENCODE_MODE_MMR122 7
2783
2784/* Enumeration for AMR-NB Discontinuous Transmission mode off. */
2785#define ASM_MEDIA_FMT_AMRNB_FS_DTX_MODE_OFF 0
2786
2787/* Enumeration for AMR-NB DTX mode VAD1. */
2788#define ASM_MEDIA_FMT_AMRNB_FS_DTX_MODE_VAD1 1
2789
2790/* Enumeration for AMR-NB DTX mode VAD2. */
2791#define ASM_MEDIA_FMT_AMRNB_FS_DTX_MODE_VAD2 2
2792
2793/* Enumeration for AMR-NB DTX mode auto.
2794 */
2795#define ASM_MEDIA_FMT_AMRNB_FS_DTX_MODE_AUTO 3
2796
2797struct asm_amrnb_enc_cfg {
2798 struct apr_hdr hdr;
2799 struct asm_stream_cmd_set_encdec_param encdec;
2800 struct asm_enc_cfg_blk_param_v2 encblk;
2801
2802 u16 enc_mode;
2803/* AMR-NB encoding rate.
2804 * Supported values:
2805 * Use the ASM_MEDIA_FMT_AMRNB_FS_ENCODE_MODE_*
2806 * macros
2807 */
2808
2809 u16 dtx_mode;
2810/* Specifies whether DTX mode is disabled or enabled.
2811 * Supported values:
2812 * - #ASM_MEDIA_FMT_AMRNB_FS_DTX_MODE_OFF
2813 * - #ASM_MEDIA_FMT_AMRNB_FS_DTX_MODE_VAD1
2814 */
2815} __packed;
2816
2817#define ASM_MEDIA_FMT_AMRWB_FS 0x00010BEC
2818
2819/* Enumeration for 6.6 kbps AMR-WB Encoding mode. */
2820#define ASM_MEDIA_FMT_AMRWB_FS_ENCODE_MODE_MR66 0
2821
2822/* Enumeration for 8.85 kbps AMR-WB Encoding mode. */
2823#define ASM_MEDIA_FMT_AMRWB_FS_ENCODE_MODE_MR885 1
2824
2825/* Enumeration for 12.65 kbps AMR-WB Encoding mode. */
2826#define ASM_MEDIA_FMT_AMRWB_FS_ENCODE_MODE_MR1265 2
2827
2828/* Enumeration for 14.25 kbps AMR-WB Encoding mode. */
2829#define ASM_MEDIA_FMT_AMRWB_FS_ENCODE_MODE_MR1425 3
2830
2831/* Enumeration for 15.85 kbps AMR-WB Encoding mode. */
2832#define ASM_MEDIA_FMT_AMRWB_FS_ENCODE_MODE_MR1585 4
2833
2834/* Enumeration for 18.25 kbps AMR-WB Encoding mode. */
2835#define ASM_MEDIA_FMT_AMRWB_FS_ENCODE_MODE_MR1825 5
2836
2837/* Enumeration for 19.85 kbps AMR-WB Encoding mode. */
2838#define ASM_MEDIA_FMT_AMRWB_FS_ENCODE_MODE_MR1985 6
2839
2840/* Enumeration for 23.05 kbps AMR-WB Encoding mode. */
2841#define ASM_MEDIA_FMT_AMRWB_FS_ENCODE_MODE_MR2305 7
2842
2843/* Enumeration for 23.85 kbps AMR-WB Encoding mode.
2844 */
2845#define ASM_MEDIA_FMT_AMRWB_FS_ENCODE_MODE_MR2385 8
2846
2847struct asm_amrwb_enc_cfg {
2848 struct apr_hdr hdr;
2849 struct asm_stream_cmd_set_encdec_param encdec;
2850 struct asm_enc_cfg_blk_param_v2 encblk;
2851
2852 u16 enc_mode;
2853/* AMR-WB encoding rate.
2854 * Suupported values:
2855 * Use the ASM_MEDIA_FMT_AMRWB_FS_ENCODE_MODE_*
2856 * macros
2857 */
2858
2859 u16 dtx_mode;
2860/* Specifies whether DTX mode is disabled or enabled.
2861 * Supported values:
2862 * - #ASM_MEDIA_FMT_AMRNB_FS_DTX_MODE_OFF
2863 * - #ASM_MEDIA_FMT_AMRNB_FS_DTX_MODE_VAD1
2864 */
2865} __packed;
2866
2867#define ASM_MEDIA_FMT_V13K_FS 0x00010BED
2868
2869/* Enumeration for 14.4 kbps V13K Encoding mode. */
2870#define ASM_MEDIA_FMT_V13K_FS_ENCODE_MODE_MR1440 0
2871
2872/* Enumeration for 12.2 kbps V13K Encoding mode. */
2873#define ASM_MEDIA_FMT_V13K_FS_ENCODE_MODE_MR1220 1
2874
2875/* Enumeration for 11.2 kbps V13K Encoding mode. */
2876#define ASM_MEDIA_FMT_V13K_FS_ENCODE_MODE_MR1120 2
2877
2878/* Enumeration for 9.0 kbps V13K Encoding mode. */
2879#define ASM_MEDIA_FMT_V13K_FS_ENCODE_MODE_MR90 3
2880
2881/* Enumeration for 7.2 kbps V13K eEncoding mode. */
2882#define ASM_MEDIA_FMT_V13K_FS_ENCODE_MODE_MR720 4
2883
2884/* Enumeration for 1/8 vocoder rate.*/
2885#define ASM_MEDIA_FMT_VOC_ONE_EIGHTH_RATE 1
2886
2887/* Enumeration for 1/4 vocoder rate. */
2888#define ASM_MEDIA_FMT_VOC_ONE_FOURTH_RATE 2
2889
2890/* Enumeration for 1/2 vocoder rate. */
2891#define ASM_MEDIA_FMT_VOC_HALF_RATE 3
2892
2893/* Enumeration for full vocoder rate.
2894 */
2895#define ASM_MEDIA_FMT_VOC_FULL_RATE 4
2896
2897struct asm_v13k_enc_cfg {
2898 struct apr_hdr hdr;
2899 struct asm_stream_cmd_set_encdec_param encdec;
2900 struct asm_enc_cfg_blk_param_v2 encblk;
2901 u16 max_rate;
2902/* Maximum allowed encoder frame rate.
2903 * Supported values:
2904 * - #ASM_MEDIA_FMT_VOC_ONE_EIGHTH_RATE
2905 * - #ASM_MEDIA_FMT_VOC_ONE_FOURTH_RATE
2906 * - #ASM_MEDIA_FMT_VOC_HALF_RATE
2907 * - #ASM_MEDIA_FMT_VOC_FULL_RATE
2908 */
2909
2910 u16 min_rate;
2911/* Minimum allowed encoder frame rate.
2912 * Supported values:
2913 * - #ASM_MEDIA_FMT_VOC_ONE_EIGHTH_RATE
2914 * - #ASM_MEDIA_FMT_VOC_ONE_FOURTH_RATE
2915 * - #ASM_MEDIA_FMT_VOC_HALF_RATE
2916 * - #ASM_MEDIA_FMT_VOC_FULL_RATE
2917 */
2918
2919 u16 reduced_rate_cmd;
2920/* Reduced rate command, used to change
2921 * the average bitrate of the V13K
2922 * vocoder.
2923 * Supported values:
2924 * - #ASM_MEDIA_FMT_V13K_FS_ENCODE_MODE_MR1440 (Default)
2925 * - #ASM_MEDIA_FMT_V13K_FS_ENCODE_MODE_MR1220
2926 * - #ASM_MEDIA_FMT_V13K_FS_ENCODE_MODE_MR1120
2927 * - #ASM_MEDIA_FMT_V13K_FS_ENCODE_MODE_MR90
2928 * - #ASM_MEDIA_FMT_V13K_FS_ENCODE_MODE_MR720
2929 */
2930
2931 u16 rate_mod_cmd;
2932/* Rate modulation command. Default = 0.
2933 *- If bit 0=1, rate control is enabled.
2934 *- If bit 1=1, the maximum number of consecutive full rate
2935 * frames is limited with numbers supplied in
2936 * bits 2 to 10.
2937 *- If bit 1=0, the minimum number of non-full rate frames
2938 * in between two full rate frames is forced to
2939 * the number supplied in bits 2 to 10. In both cases, if necessary,
2940 * half rate is used to substitute full rate. - Bits 15 to 10 are
2941 * reserved and must all be set to zero.
2942 */
2943
2944} __packed;
2945
2946#define ASM_MEDIA_FMT_EVRC_FS 0x00010BEE
2947
2948/* EVRC encoder configuration structure used in the
2949 * #ASM_STREAM_CMD_OPEN_READ_V2 command.
2950 */
2951struct asm_evrc_enc_cfg {
2952 struct apr_hdr hdr;
2953 struct asm_stream_cmd_set_encdec_param encdec;
2954 struct asm_enc_cfg_blk_param_v2 encblk;
2955 u16 max_rate;
2956/* Maximum allowed encoder frame rate.
2957 * Supported values:
2958 * - #ASM_MEDIA_FMT_VOC_ONE_EIGHTH_RATE
2959 * - #ASM_MEDIA_FMT_VOC_ONE_FOURTH_RATE
2960 * - #ASM_MEDIA_FMT_VOC_HALF_RATE
2961 * - #ASM_MEDIA_FMT_VOC_FULL_RATE
2962 */
2963
2964 u16 min_rate;
2965/* Minimum allowed encoder frame rate.
2966 * Supported values:
2967 * - #ASM_MEDIA_FMT_VOC_ONE_EIGHTH_RATE
2968 * - #ASM_MEDIA_FMT_VOC_ONE_FOURTH_RATE
2969 * - #ASM_MEDIA_FMT_VOC_HALF_RATE
2970 * - #ASM_MEDIA_FMT_VOC_FULL_RATE
2971 */
2972
2973 u16 rate_mod_cmd;
2974/* Rate modulation command. Default: 0.
2975 * - If bit 0=1, rate control is enabled.
2976 * - If bit 1=1, the maximum number of consecutive full rate frames
2977 * is limited with numbers supplied in bits 2 to 10.
2978 *
2979 * - If bit 1=0, the minimum number of non-full rate frames in
2980 * between two full rate frames is forced to the number supplied in
2981 * bits 2 to 10. In both cases, if necessary, half rate is used to
2982 * substitute full rate.
2983 *
2984 * - Bits 15 to 10 are reserved and must all be set to zero.
2985 */
2986
2987 u16 reserved;
2988 /* Reserved. Clients must set this field to zero. */
2989} __packed;
2990
2991#define ASM_MEDIA_FMT_WMA_V10PRO_V2 0x00010DA7
2992
2993struct asm_wmaprov10_fmt_blk_v2 {
2994 struct apr_hdr hdr;
2995 struct asm_data_cmd_media_fmt_update_v2 fmtblk;
2996
2997 u16 fmtag;
2998/* WMA format type.
2999 * Supported values:
3000 * - 0x162 -- WMA 9 Pro
3001 * - 0x163 -- WMA 9 Pro Lossless
3002 * - 0x166 -- WMA 10 Pro
3003 * - 0x167 -- WMA 10 Pro Lossless
3004 */
3005
3006 u16 num_channels;
3007/* Number of channels encoded in the input stream.
3008 * Supported values: 1 to 8
3009 */
3010
3011 u32 sample_rate;
3012/* Number of samples per second (in Hertz).
3013 * Supported values: 11025, 16000, 22050, 32000, 44100, 48000,
3014 * 88200, 96000
3015 */
3016
3017 u32 avg_bytes_per_sec;
3018/* Bitrate expressed as the average bytes per second.
3019 * Supported values: 2000 to 96000
3020 */
3021
3022 u16 blk_align;
3023/* Size of the bitstream packet size in bytes. WMA Pro files
3024 * have a payload of one block per bitstream packet.
3025 * Supported values: @le 13376
3026 */
3027
3028 u16 bits_per_sample;
3029/* Number of bits per sample in the encoded WMA stream.
3030 * Supported values: 16, 24
3031 */
3032
3033 u32 channel_mask;
3034/* Bit-packed double word (32-bits) that indicates the
3035 * recommended speaker positions for each source channel.
3036 */
3037
3038 u16 enc_options;
3039/* Bit-packed word with values that indicate whether certain
3040 * features of the bitstream are used.
3041 * Supported values: - 0x0001 -- ENCOPT3_PURE_LOSSLESS - 0x0006 --
3042 * ENCOPT3_FRM_SIZE_MOD - 0x0038 -- ENCOPT3_SUBFRM_DIV - 0x0040 --
3043 * ENCOPT3_WRITE_FRAMESIZE_IN_HDR - 0x0080 --
3044 * ENCOPT3_GENERATE_DRC_PARAMS - 0x0100 -- ENCOPT3_RTMBITS
3045 */
3046
3047
3048 u16 usAdvancedEncodeOpt;
3049 /* Advanced encoding option. */
3050
3051 u32 advanced_enc_options2;
3052 /* Advanced encoding option 2. */
3053
3054} __packed;
3055
3056#define ASM_MEDIA_FMT_WMA_V9_V2 0x00010DA8
3057struct asm_wmastdv9_fmt_blk_v2 {
3058 struct apr_hdr hdr;
3059 struct asm_data_cmd_media_fmt_update_v2 fmtblk;
3060 u16 fmtag;
3061/* WMA format tag.
3062 * Supported values: 0x161 (WMA 9 standard)
3063 */
3064
3065 u16 num_channels;
3066/* Number of channels in the stream.
3067 * Supported values: 1, 2
3068 */
3069
3070 u32 sample_rate;
3071/* Number of samples per second (in Hertz).
3072 * Supported values: 48000
3073 */
3074
3075 u32 avg_bytes_per_sec;
3076 /* Bitrate expressed as the average bytes per second. */
3077
3078 u16 blk_align;
3079/* Block align. All WMA files with a maximum packet size of
3080 * 13376 are supported.
3081 */
3082
3083
3084 u16 bits_per_sample;
3085/* Number of bits per sample in the output.
3086 * Supported values: 16
3087 */
3088
3089 u32 channel_mask;
3090/* Channel mask.
3091 * Supported values:
3092 * - 3 -- Stereo (front left/front right)
3093 * - 4 -- Mono (center)
3094 */
3095
3096 u16 enc_options;
3097 /* Options used during encoding. */
3098
Harmandeep Singheaf59b42012-06-05 21:46:02 -07003099 u16 reserved;
3100
Bharath Ramachandramurthy2e3168f2012-05-03 16:29:09 -07003101} __packed;
3102
3103#define ASM_MEDIA_FMT_WMA_V8 0x00010D91
3104
3105struct asm_wmastdv8_enc_cfg {
3106 struct apr_hdr hdr;
3107 struct asm_stream_cmd_set_encdec_param encdec;
3108 struct asm_enc_cfg_blk_param_v2 encblk;
3109 u32 bit_rate;
3110 /* Encoding rate in bits per second. */
3111
3112 u32 sample_rate;
3113/* Number of samples per second.
3114 *
3115 * Supported values:
3116 * - 0 -- Native mode
3117 * - Other Supported values are 22050, 32000, 44100, and 48000.
3118 *
3119 * Native mode indicates that encoding must be performed with the
3120 * sampling rate at the input.
3121 * The sampling rate must not change during encoding.
3122 */
3123
3124 u16 channel_cfg;
3125/* Number of channels to encode.
3126 * Supported values:
3127 * - 0 -- Native mode
3128 * - 1 -- Mono
3129 * - 2 -- Stereo
3130 * - Other values are not supported.
3131 *
3132 * Native mode indicates that encoding must be performed with the
3133 * number of channels at the input.
3134 * The number of channels must not change during encoding.
3135 */
3136
3137 u16 reserved;
3138 /* Reserved. Clients must set this field to zero.*/
3139 } __packed;
3140
3141#define ASM_MEDIA_FMT_AMR_WB_PLUS_V2 0x00010DA9
3142
3143struct asm_amrwbplus_fmt_blk_v2 {
3144 struct apr_hdr hdr;
3145 struct asm_data_cmd_media_fmt_update_v2 fmtblk;
3146 u32 amr_frame_fmt;
3147/* AMR frame format.
3148 * Supported values:
3149 * - 6 -- Transport Interface Format (TIF)
3150 * - Any other value -- File storage format (FSF)
3151 *
3152 * TIF stream contains 2-byte header for each frame within the
3153 * superframe. FSF stream contains one 2-byte header per superframe.
3154 */
3155
3156} __packed;
3157
3158#define ASM_MEDIA_FMT_AC3_DEC 0x00010BF6
3159#define ASM_MEDIA_FMT_EAC3_DEC 0x00010C3C
3160#define ASM_MEDIA_FMT_DTS 0x00010D88
3161
3162/* Media format ID for adaptive transform acoustic coding. This
3163 * ID is used by the #ASM_STREAM_CMD_OPEN_WRITE_COMPRESSED command
3164 * only.
3165 */
3166
3167#define ASM_MEDIA_FMT_ATRAC 0x00010D89
3168
3169/* Media format ID for metadata-enhanced audio transmission.
3170 * This ID is used by the #ASM_STREAM_CMD_OPEN_WRITE_COMPRESSED
3171 * command only.
3172 */
3173
3174#define ASM_MEDIA_FMT_MAT 0x00010D8A
3175
3176/* adsp_media_fmt.h */
3177
3178#define ASM_DATA_CMD_WRITE_V2 0x00010DAB
3179
3180struct asm_data_cmd_write_v2 {
3181 struct apr_hdr hdr;
3182 u32 buf_addr_lsw;
3183/* The 64 bit address msw-lsw should be a valid, mapped address.
3184 * 64 bit address should be a multiple of 32 bytes
3185 */
3186
3187 u32 buf_addr_msw;
3188/* The 64 bit address msw-lsw should be a valid, mapped address.
3189 * 64 bit address should be a multiple of 32 bytes.
3190 * -Address of the buffer containing the data to be decoded.
3191 * The buffer should be aligned to a 32 byte boundary.
3192 * -In the case of 32 bit Shared memory address, msw field must
3193 * -be set to zero.
3194 * -In the case of 36 bit shared memory address, bit 31 to bit 4
3195 * -of msw must be set to zero.
3196 */
3197 u32 mem_map_handle;
3198/* memory map handle returned by DSP through
3199 * ASM_CMD_SHARED_MEM_MAP_REGIONS command
3200 */
3201 u32 buf_size;
3202/* Number of valid bytes available in the buffer for decoding. The
3203 * first byte starts at buf_addr.
3204 */
3205
3206 u32 seq_id;
3207 /* Optional buffer sequence ID. */
3208
3209 u32 timestamp_lsw;
3210/* Lower 32 bits of the 64-bit session time in microseconds of the
3211 * first buffer sample.
3212 */
3213
3214 u32 timestamp_msw;
3215/* Upper 32 bits of the 64-bit session time in microseconds of the
3216 * first buffer sample.
3217 */
3218
3219 u32 flags;
3220/* Bitfield of flags.
3221 * Supported values for bit 31:
3222 * - 1 -- Valid timestamp.
3223 * - 0 -- Invalid timestamp.
3224 * - Use #ASM_BIT_MASKIMESTAMP_VALID_FLAG as the bitmask and
3225 * #ASM_SHIFTIMESTAMP_VALID_FLAG as the shift value to set this bit.
3226 * Supported values for bit 30:
3227 * - 1 -- Last buffer.
3228 * - 0 -- Not the last buffer.
3229 *
3230 * Supported values for bit 29:
3231 * - 1 -- Continue the timestamp from the previous buffer.
3232 * - 0 -- Timestamp of the current buffer is not related
3233 * to the timestamp of the previous buffer.
3234 * - Use #ASM_BIT_MASKS_CONTINUE_FLAG and #ASM_SHIFTS_CONTINUE_FLAG
3235 * to set this bit.
3236 *
3237 * Supported values for bit 4:
3238 * - 1 -- End of the frame.
3239 * - 0 -- Not the end of frame, or this information is not known.
3240 * - Use #ASM_BIT_MASK_EOF_FLAG as the bitmask and #ASM_SHIFT_EOF_FLAG
3241 * as the shift value to set this bit.
3242 *
3243 * All other bits are reserved and must be set to 0.
3244 *
3245 * If bit 31=0 and bit 29=1: The timestamp of the first sample in
3246 * this buffer continues from the timestamp of the last sample in
3247 * the previous buffer. If there is no previous buffer (i.e., this
3248 * is the first buffer sent after opening the stream or after a
3249 * flush operation), or if the previous buffer does not have a valid
3250 * timestamp, the samples in the current buffer also do not have a
3251 * valid timestamp. They are played out as soon as possible.
3252 *
3253 *
3254 * If bit 31=0 and bit 29=0: No timestamp is associated with the
3255 * first sample in this buffer. The samples are played out as soon
3256 * as possible.
3257 *
3258 *
3259 * If bit 31=1 and bit 29 is ignored: The timestamp specified in
3260 * this payload is honored.
3261 *
3262 *
3263 * If bit 30=0: Not the last buffer in the stream. This is useful
3264 * in removing trailing samples.
3265 *
3266 *
3267 * For bit 4: The client can set this flag for every buffer sent in
3268 * which the last byte is the end of a frame. If this flag is set,
3269 * the buffer can contain data from multiple frames, but it should
3270 * always end at a frame boundary. Restrictions allow the aDSP to
3271 * detect an end of frame without requiring additional processing.
3272 */
3273
3274} __packed;
3275
3276#define ASM_DATA_CMD_READ_V2 0x00010DAC
3277
3278struct asm_data_cmd_read_v2 {
3279 struct apr_hdr hdr;
3280 u32 buf_addr_lsw;
3281/* the 64 bit address msw-lsw should be a valid mapped address
3282 * and should be a multiple of 32 bytes
3283 */
3284
3285
3286 u32 buf_addr_msw;
3287/* the 64 bit address msw-lsw should be a valid mapped address
3288 * and should be a multiple of 32 bytes.
3289* - Address of the buffer where the DSP puts the encoded data,
3290* potentially, at an offset specified by the uOffset field in
3291* ASM_DATA_EVENT_READ_DONE structure. The buffer should be aligned
3292* to a 32 byte boundary.
3293*- In the case of 32 bit Shared memory address, msw field must
3294*- be set to zero.
3295*- In the case of 36 bit shared memory address, bit 31 to bit
3296*- 4 of msw must be set to zero.
3297*/
3298 u32 mem_map_handle;
3299/* memory map handle returned by DSP through
3300 * ASM_CMD_SHARED_MEM_MAP_REGIONS command.
3301 */
3302
3303 u32 buf_size;
3304/* Number of bytes available for the aDSP to write. The aDSP
3305 * starts writing from buf_addr.
3306 */
3307
3308 u32 seq_id;
3309 /* Optional buffer sequence ID.
3310 */
3311} __packed;
3312
3313#define ASM_DATA_CMD_EOS 0x00010BDB
3314#define ASM_DATA_EVENT_RENDERED_EOS 0x00010C1C
3315#define ASM_DATA_EVENT_EOS 0x00010BDD
3316
3317#define ASM_DATA_EVENT_WRITE_DONE_V2 0x00010D99
3318struct asm_data_event_write_done_v2 {
3319 u32 buf_addr_lsw;
3320 /* lsw of the 64 bit address */
3321 u32 buf_addr_msw;
3322 /* msw of the 64 bit address. address given by the client in
3323 * ASM_DATA_CMD_WRITE_V2 command.
3324 */
3325 u32 mem_map_handle;
3326 /* memory map handle in the ASM_DATA_CMD_WRITE_V2 */
3327
3328 u32 status;
3329/* Status message (error code) that indicates whether the
3330 * referenced buffer has been successfully consumed.
3331 * Supported values: Refer to @xhyperref{Q3,[Q3]}
3332 */
3333} __packed;
3334
3335#define ASM_DATA_EVENT_READ_DONE_V2 0x00010D9A
3336
3337/* Definition of the frame metadata flag bitmask.*/
3338#define ASM_BIT_MASK_FRAME_METADATA_FLAG (0x40000000UL)
3339
3340/* Definition of the frame metadata flag shift value. */
3341#define ASM_SHIFT_FRAME_METADATA_FLAG 30
3342
3343struct asm_data_event_read_done_v2 {
3344 u32 status;
3345/* Status message (error code).
3346 * Supported values: Refer to @xhyperref{Q3,[Q3]}
3347 */
3348
3349u32 buf_addr_lsw;
3350/* 64 bit address msw-lsw is a valid, mapped address. 64 bit
3351 * address is a multiple of 32 bytes.
3352 */
3353
3354u32 buf_addr_msw;
3355/* 64 bit address msw-lsw is a valid, mapped address. 64 bit
3356* address is a multiple of 32 bytes.
3357*
3358* -Same address provided by the client in ASM_DATA_CMD_READ_V2
3359* -In the case of 32 bit Shared memory address, msw field is set to
3360* zero.
3361* -In the case of 36 bit shared memory address, bit 31 to bit 4
3362* -of msw is set to zero.
3363*/
3364
3365u32 mem_map_handle;
3366/* memory map handle in the ASM_DATA_CMD_READ_V2 */
3367
3368u32 enc_framesotal_size;
3369/* Total size of the encoded frames in bytes.
3370 * Supported values: >0
3371 */
3372
3373u32 offset;
3374/* Offset (from buf_addr) to the first byte of the first encoded
3375 * frame. All encoded frames are consecutive, starting from this
3376 * offset.
3377 * Supported values: > 0
3378 */
3379
3380u32 timestamp_lsw;
3381/* Lower 32 bits of the 64-bit session time in microseconds of
3382 * the first sample in the buffer. If Bit 5 of mode_flags flag of
3383 * ASM_STREAM_CMD_OPEN_READ_V2 is 1 then the 64 bit timestamp is
3384 * absolute capture time otherwise it is relative session time. The
3385 * absolute timestamp doesnt reset unless the system is reset.
3386 */
3387
3388
3389u32 timestamp_msw;
3390/* Upper 32 bits of the 64-bit session time in microseconds of
3391 * the first sample in the buffer.
3392 */
3393
3394
3395u32 flags;
3396/* Bitfield of flags. Bit 30 indicates whether frame metadata is
3397 * present. If frame metadata is present, num_frames consecutive
3398 * instances of @xhyperref{hdr:FrameMetaData,Frame metadata} start
3399 * at the buffer address.
3400 * Supported values for bit 31:
3401 * - 1 -- Timestamp is valid.
3402 * - 0 -- Timestamp is invalid.
3403 * - Use #ASM_BIT_MASKIMESTAMP_VALID_FLAG and
3404 * #ASM_SHIFTIMESTAMP_VALID_FLAG to set this bit.
3405 *
3406 * Supported values for bit 30:
3407 * - 1 -- Frame metadata is present.
3408 * - 0 -- Frame metadata is absent.
3409 * - Use #ASM_BIT_MASK_FRAME_METADATA_FLAG and
3410 * #ASM_SHIFT_FRAME_METADATA_FLAG to set this bit.
3411 *
3412 * All other bits are reserved; the aDSP sets them to 0.
3413 */
3414
3415u32 num_frames;
3416/* Number of encoded frames in the buffer. */
3417
3418u32 seq_id;
3419/* Optional buffer sequence ID. */
3420} __packed;
3421
3422struct asm_data_read_buf_metadata_v2 {
3423 u32 offset;
3424/* Offset from buf_addr in #ASM_DATA_EVENT_READ_DONE_PAYLOAD to
3425 * the frame associated with this metadata.
3426 * Supported values: > 0
3427 */
3428
3429u32 frm_size;
3430/* Size of the encoded frame in bytes.
3431 * Supported values: > 0
3432 */
3433
3434u32 num_encoded_pcm_samples;
3435/* Number of encoded PCM samples (per channel) in the frame
3436 * associated with this metadata.
3437 * Supported values: > 0
3438 */
3439
3440u32 timestamp_lsw;
3441/* Lower 32 bits of the 64-bit session time in microseconds of the
3442 * first sample for this frame.
3443 * If Bit 5 of mode_flags flag of ASM_STREAM_CMD_OPEN_READ_V2 is 1
3444 * then the 64 bit timestamp is absolute capture time otherwise it
3445 * is relative session time. The absolute timestamp doesnt reset
3446 * unless the system is reset.
3447 */
3448
3449
3450u32 timestamp_msw;
3451/* Lower 32 bits of the 64-bit session time in microseconds of the
3452 * first sample for this frame.
3453 */
3454
3455u32 flags;
3456/* Frame flags.
3457 * Supported values for bit 31:
3458 * - 1 -- Time stamp is valid
3459 * - 0 -- Time stamp is not valid
3460 * - All other bits are reserved; the aDSP sets them to 0.
3461*/
3462} __packed;
3463
3464/* Notifies the client of a change in the data sampling rate or
3465 * Channel mode. This event is raised by the decoder service. The
3466 * event is enabled through the mode flags of
3467 * #ASM_STREAM_CMD_OPEN_WRITE_V2 or
3468 * #ASM_STREAM_CMD_OPEN_READWRITE_V2. - The decoder detects a change
3469 * in the output sampling frequency or the number/positioning of
3470 * output channels, or if it is the first frame decoded.The new
3471 * sampling frequency or the new channel configuration is
3472 * communicated back to the client asynchronously.
3473 */
3474
3475#define ASM_DATA_EVENT_SR_CM_CHANGE_NOTIFY 0x00010C65
3476
3477/* Payload of the #ASM_DATA_EVENT_SR_CM_CHANGE_NOTIFY event.
3478 * This event is raised when the following conditions are both true:
3479 * - The event is enabled through the mode_flags of
3480 * #ASM_STREAM_CMD_OPEN_WRITE_V2 or
3481 * #ASM_STREAM_CMD_OPEN_READWRITE_V2. - The decoder detects a change
3482 * in either the output sampling frequency or the number/positioning
3483 * of output channels, or if it is the first frame decoded.
3484 * This event is not raised (even if enabled) if the decoder is
3485 * MIDI, because
3486 */
3487
3488
3489struct asm_data_event_sr_cm_change_notify {
3490 u32 sample_rate;
3491/* New sampling rate (in Hertz) after detecting a change in the
3492 * bitstream.
3493 * Supported values: 2000 to 48000
3494 */
3495
3496 u16 num_channels;
3497/* New number of channels after detecting a change in the
3498 * bitstream.
3499 * Supported values: 1 to 8
3500 */
3501
3502
3503 u16 reserved;
3504 /* Reserved for future use. This field must be set to 0.*/
3505
3506 u8 channel_mapping[8];
3507
3508} __packed;
3509
3510/* Notifies the client of a data sampling rate or channel mode
3511 * change. This event is raised by the encoder service.
3512 * This event is raised when :
3513 * - Native mode encoding was requested in the encoder
3514 * configuration (i.e., the channel number was 0), the sample rate
3515 * was 0, or both were 0.
3516 *
3517 * - The input data frame at the encoder is the first one, or the
3518 * sampling rate/channel mode is different from the previous input
3519 * data frame.
3520 *
3521 */
3522#define ASM_DATA_EVENT_ENC_SR_CM_CHANGE_NOTIFY 0x00010BDE
3523
3524struct asm_data_event_enc_sr_cm_change_notify {
3525 u32 sample_rate;
3526/* New sampling rate (in Hertz) after detecting a change in the
3527 * input data.
3528 * Supported values: 2000 to 48000
3529 */
3530
3531
3532 u16 num_channels;
3533/* New number of channels after detecting a change in the input
3534 * data. Supported values: 1 to 8
3535 */
3536
3537
3538 u16 bits_per_sample;
3539/* New bits per sample after detecting a change in the input
3540 * data.
3541 * Supported values: 16, 24
3542 */
3543
3544
3545 u8 channel_mapping[8];
3546
3547} __packed;
3548#define ASM_DATA_CMD_IEC_60958_FRAME_RATE 0x00010D87
3549
3550
3551/* Payload of the #ASM_DATA_CMD_IEC_60958_FRAME_RATE command,
3552 * which is used to indicate the IEC 60958 frame rate of a given
3553 * packetized audio stream.
3554 */
3555
3556struct asm_data_cmd_iec_60958_frame_rate {
3557 u32 frame_rate;
3558/* IEC 60958 frame rate of the incoming IEC 61937 packetized stream.
3559 * Supported values: Any valid frame rate
3560 */
3561} __packed;
3562
3563/* adsp_asm_data_commands.h*/
3564#define ASM_SVC_CMD_GET_STREAM_HANDLES 0x00010C0B
3565
3566#define ASM_SVC_CMDRSP_GET_STREAM_HANDLES 0x00010C1B
3567
3568/* Definition of the stream ID bitmask.*/
3569#define ASM_BIT_MASK_STREAM_ID (0x000000FFUL)
3570
3571/* Definition of the stream ID shift value.*/
3572#define ASM_SHIFT_STREAM_ID 0
3573
3574/* Definition of the session ID bitmask.*/
3575#define ASM_BIT_MASK_SESSION_ID (0x0000FF00UL)
3576
3577/* Definition of the session ID shift value.*/
3578#define ASM_SHIFT_SESSION_ID 8
3579
3580/* Definition of the service ID bitmask.*/
3581#define ASM_BIT_MASK_SERVICE_ID (0x00FF0000UL)
3582
3583/* Definition of the service ID shift value.*/
3584#define ASM_SHIFT_SERVICE_ID 16
3585
3586/* Definition of the domain ID bitmask.*/
3587#define ASM_BIT_MASK_DOMAIN_ID (0xFF000000UL)
3588
3589/* Definition of the domain ID shift value.*/
3590#define ASM_SHIFT_DOMAIN_ID 24
3591
3592/* Payload of the #ASM_SVC_CMDRSP_GET_STREAM_HANDLES message,
3593 * which returns a list of currently active stream handles.
3594 * Immediately following this structure are num_handles of uint32
3595 * stream handles.
3596 */
3597
3598
3599struct asm_svc_cmdrsp_get_stream_handles {
3600 u32 num_handles;
3601 /* Number of active stream handles. */
3602} __packed;
3603
3604#define ASM_CMD_SHARED_MEM_MAP_REGIONS 0x00010D92
3605#define ASM_CMDRSP_SHARED_MEM_MAP_REGIONS 0x00010D93
3606#define ASM_CMD_SHARED_MEM_UNMAP_REGIONS 0x00010D94
3607
3608/* adsp_asm_service_commands.h */
3609
3610#define ASM_MAX_SESSION_ID (8)
3611
3612/* Maximum number of sessions.*/
3613#define ASM_MAX_NUM_SESSIONS ASM_MAX_SESSION_ID
3614
3615/* Maximum number of streams per session.*/
3616#define ASM_MAX_STREAMS_PER_SESSION (8)
3617#define ASM_SESSION_CMD_RUN_V2 0x00010DAA
3618#define ASM_SESSION_CMD_RUN_STARTIME_RUN_IMMEDIATE 0
3619#define ASM_SESSION_CMD_RUN_STARTIME_RUN_AT_ABSOLUTEIME 1
3620#define ASM_SESSION_CMD_RUN_STARTIME_RUN_AT_RELATIVEIME 2
3621#define ASM_SESSION_CMD_RUN_STARTIME_RUN_WITH_DELAY 3
3622
3623#define ASM_BIT_MASK_RUN_STARTIME (0x00000003UL)
3624
3625/* Bit shift value used to specify the start time for the
3626 * ASM_SESSION_CMD_RUN_V2 command.
3627 */
3628#define ASM_SHIFT_RUN_STARTIME 0
3629struct asm_session_cmd_run_v2 {
3630 struct apr_hdr hdr;
3631 u32 flags;
3632/* Specifies whether to run immediately or at a specific
3633 * rendering time or with a specified delay. Run with delay is
3634 * useful for delaying in case of ASM loopback opened through
3635 * ASM_STREAM_CMD_OPEN_LOOPBACK_V2. Use #ASM_BIT_MASK_RUN_STARTIME
3636 * and #ASM_SHIFT_RUN_STARTIME to set this 2-bit flag.
3637 *
3638 *
3639 *Bits 0 and 1 can take one of four possible values:
3640 *
3641 *- #ASM_SESSION_CMD_RUN_STARTIME_RUN_IMMEDIATE
3642 *- #ASM_SESSION_CMD_RUN_STARTIME_RUN_AT_ABSOLUTEIME
3643 *- #ASM_SESSION_CMD_RUN_STARTIME_RUN_AT_RELATIVEIME
3644 *- #ASM_SESSION_CMD_RUN_STARTIME_RUN_WITH_DELAY
3645 *
3646 *All other bits are reserved; clients must set them to zero.
3647 */
3648
3649 u32 time_lsw;
3650/* Lower 32 bits of the time in microseconds used to align the
3651 * session origin time. When bits 0-1 of flags is
3652 * ASM_SESSION_CMD_RUN_START_RUN_WITH_DELAY, time lsw is the lsw of
3653 * the delay in us. For ASM_SESSION_CMD_RUN_START_RUN_WITH_DELAY,
3654 * maximum value of the 64 bit delay is 150 ms.
3655 */
3656
3657 u32 time_msw;
3658/* Upper 32 bits of the time in microseconds used to align the
3659 * session origin time. When bits 0-1 of flags is
3660 * ASM_SESSION_CMD_RUN_START_RUN_WITH_DELAY, time msw is the msw of
3661 * the delay in us. For ASM_SESSION_CMD_RUN_START_RUN_WITH_DELAY,
3662 * maximum value of the 64 bit delay is 150 ms.
3663 */
3664
3665} __packed;
3666
3667#define ASM_SESSION_CMD_PAUSE 0x00010BD3
3668#define ASM_SESSION_CMD_GET_SESSIONTIME_V3 0x00010D9D
3669#define ASM_SESSION_CMD_REGISTER_FOR_RX_UNDERFLOW_EVENTS 0x00010BD5
3670
3671struct asm_session_cmd_rgstr_rx_underflow {
3672 struct apr_hdr hdr;
3673 u16 enable_flag;
3674/* Specifies whether a client is to receive events when an Rx
3675 * session underflows.
3676 * Supported values:
3677 * - 0 -- Do not send underflow events
3678 * - 1 -- Send underflow events
3679 */
3680 u16 reserved;
3681 /* Reserved. This field must be set to zero.*/
3682} __packed;
3683
3684#define ASM_SESSION_CMD_REGISTER_FORX_OVERFLOW_EVENTS 0x00010BD6
3685
3686struct asm_session_cmd_regx_overflow {
3687 struct apr_hdr hdr;
3688 u16 enable_flag;
3689/* Specifies whether a client is to receive events when a Tx
3690* session overflows.
3691 * Supported values:
3692 * - 0 -- Do not send overflow events
3693 * - 1 -- Send overflow events
3694 */
3695
3696 u16 reserved;
3697 /* Reserved. This field must be set to zero.*/
3698} __packed;
3699
3700#define ASM_SESSION_EVENT_RX_UNDERFLOW 0x00010C17
3701#define ASM_SESSION_EVENTX_OVERFLOW 0x00010C18
3702#define ASM_SESSION_CMDRSP_GET_SESSIONTIME_V3 0x00010D9E
3703
3704struct asm_session_cmdrsp_get_sessiontime_v3 {
3705 u32 status;
3706 /* Status message (error code).
3707 * Supported values: Refer to @xhyperref{Q3,[Q3]}
3708 */
3709
3710 u32 sessiontime_lsw;
3711 /* Lower 32 bits of the current session time in microseconds.*/
3712
3713 u32 sessiontime_msw;
3714 /* Upper 32 bits of the current session time in microseconds.*/
3715
3716 u32 absolutetime_lsw;
3717/* Lower 32 bits in micro seconds of the absolute time at which
3718 * the * sample corresponding to the above session time gets
3719 * rendered * to hardware. This absolute time may be slightly in the
3720 * future or past.
3721 */
3722
3723
3724 u32 absolutetime_msw;
3725/* Upper 32 bits in micro seconds of the absolute time at which
3726 * the * sample corresponding to the above session time gets
3727 * rendered to * hardware. This absolute time may be slightly in the
3728 * future or past.
3729 */
3730
3731} __packed;
3732
3733#define ASM_SESSION_CMD_ADJUST_SESSION_CLOCK_V2 0x00010D9F
3734
3735struct asm_session_cmd_adjust_session_clock_v2 {
3736 struct apr_hdr hdr;
3737u32 adjustime_lsw;
3738/* Lower 32 bits of the signed 64-bit quantity that specifies the
3739 * adjustment time in microseconds to the session clock.
3740 *
3741 * Positive values indicate advancement of the session clock.
3742 * Negative values indicate delay of the session clock.
3743 */
3744
3745
3746 u32 adjustime_msw;
3747/* Upper 32 bits of the signed 64-bit quantity that specifies
3748 * the adjustment time in microseconds to the session clock.
3749 * Positive values indicate advancement of the session clock.
3750 * Negative values indicate delay of the session clock.
3751 */
3752
3753} __packed;
3754
3755#define ASM_SESSION_CMDRSP_ADJUST_SESSION_CLOCK_V2 0x00010DA0
3756
3757struct asm_session_cmdrsp_adjust_session_clock_v2 {
3758 u32 status;
3759/* Status message (error code).
3760 * Supported values: Refer to @xhyperref{Q3,[Q3]}
3761 * An error means the session clock is not adjusted. In this case,
3762 * the next two fields are irrelevant.
3763 */
3764
3765
3766 u32 actual_adjustime_lsw;
3767/* Lower 32 bits of the signed 64-bit quantity that specifies
3768 * the actual adjustment in microseconds performed by the aDSP.
3769 * A positive value indicates advancement of the session clock. A
3770 * negative value indicates delay of the session clock.
3771 */
3772
3773
3774 u32 actual_adjustime_msw;
3775/* Upper 32 bits of the signed 64-bit quantity that specifies
3776 * the actual adjustment in microseconds performed by the aDSP.
3777 * A positive value indicates advancement of the session clock. A
3778 * negative value indicates delay of the session clock.
3779 */
3780
3781
3782 u32 cmd_latency_lsw;
3783/* Lower 32 bits of the unsigned 64-bit quantity that specifies
3784 * the amount of time in microseconds taken to perform the session
3785 * clock adjustment.
3786 */
3787
3788
3789 u32 cmd_latency_msw;
3790/* Upper 32 bits of the unsigned 64-bit quantity that specifies
3791 * the amount of time in microseconds taken to perform the session
3792 * clock adjustment.
3793 */
3794
3795} __packed;
3796
3797#define ASM_SESSION_CMD_GET_PATH_DELAY_V2 0x00010DAF
3798#define ASM_SESSION_CMDRSP_GET_PATH_DELAY_V2 0x00010DB0
3799
3800struct asm_session_cmdrsp_get_path_delay_v2 {
3801 u32 status;
3802/* Status message (error code). Whether this get delay operation
3803 * is successful or not. Delay value is valid only if status is
3804 * success.
3805 * Supported values: Refer to @xhyperref{Q5,[Q5]}
3806 */
3807
3808 u32 audio_delay_lsw;
3809 /* Upper 32 bits of the aDSP delay in microseconds. */
3810
3811 u32 audio_delay_msw;
3812 /* Lower 32 bits of the aDSP delay in microseconds. */
3813
3814} __packed;
3815
3816/* adsp_asm_session_command.h*/
3817#define ASM_STREAM_CMD_OPEN_WRITE_V2 0x00010D8F
Phani Kumar Uppalapati85b7c9b2013-02-19 09:59:47 -08003818#define ASM_STREAM_CMD_OPEN_WRITE_V3 0x00010DB3
Bharath Ramachandramurthy2e3168f2012-05-03 16:29:09 -07003819
Phani Kumar Uppalapati85b7c9b2013-02-19 09:59:47 -08003820#define ASM_SHIFT_STREAM_PERF_MODE_FLAG_IN_OPEN_WRITE 28
3821
3822#define ASM_LEGACY_STREAM_SESSION 0
3823
3824#define ASM_LOW_LATENCY_STREAM_SESSION 1
3825
3826struct asm_stream_cmd_open_write_v3 {
Bharath Ramachandramurthy2e3168f2012-05-03 16:29:09 -07003827 struct apr_hdr hdr;
3828 uint32_t mode_flags;
3829/* Mode flags that configure the stream to notify the client
3830 * whenever it detects an SR/CM change at the input to its POPP.
3831 * Supported values for bits 0 to 1:
3832 * - Reserved; clients must set them to zero.
3833 * Supported values for bit 2:
3834 * - 0 -- SR/CM change notification event is disabled.
3835 * - 1 -- SR/CM change notification event is enabled.
3836 * - Use #ASM_BIT_MASK_SR_CM_CHANGE_NOTIFY_FLAG and
3837 * #ASM_SHIFT_SR_CM_CHANGE_NOTIFY_FLAG to set or get this bit.
3838 *
3839 * Supported values for bit 31:
3840 * - 0 -- Stream to be opened in on-Gapless mode.
3841 * - 1 -- Stream to be opened in Gapless mode. In Gapless mode,
3842 * successive streams must be opened with same session ID but
3843 * different stream IDs.
3844 *
3845 * - Use #ASM_BIT_MASK_GAPLESS_MODE_FLAG and
3846 * #ASM_SHIFT_GAPLESS_MODE_FLAG to set or get this bit.
3847 *
3848 *
3849 * @note1hang MIDI and DTMF streams cannot be opened in Gapless mode.
3850 */
3851
3852 uint16_t sink_endpointype;
3853/*< Sink point type.
3854 * Supported values:
3855 * - 0 -- Device matrix
3856 * - Other values are reserved.
3857 *
3858 * The device matrix is the gateway to the hardware ports.
3859 */
3860
3861 uint16_t bits_per_sample;
3862/*< Number of bits per sample processed by ASM modules.
3863 * Supported values: 16 and 24 bits per sample
3864 */
3865
3866 uint32_t postprocopo_id;
3867/*< Specifies the topology (order of processing) of
3868 * postprocessing algorithms. <i>None</i> means no postprocessing.
3869 * Supported values:
3870 * - #ASM_STREAM_POSTPROCOPO_ID_DEFAULT
3871 * - #ASM_STREAM_POSTPROCOPO_ID_MCH_PEAK_VOL
3872 * - #ASM_STREAM_POSTPROCOPO_ID_NONE
3873 *
3874 * This field can also be enabled through SetParams flags.
3875 */
3876
3877 uint32_t dec_fmt_id;
3878/*< Configuration ID of the decoder media format.
3879 *
3880 * Supported values:
3881 * - #ASM_MEDIA_FMT_MULTI_CHANNEL_PCM_V2
3882 * - #ASM_MEDIA_FMT_ADPCM
3883 * - #ASM_MEDIA_FMT_MP3
3884 * - #ASM_MEDIA_FMT_AAC_V2
3885 * - #ASM_MEDIA_FMT_DOLBY_AAC
3886 * - #ASM_MEDIA_FMT_AMRNB_FS
3887 * - #ASM_MEDIA_FMT_AMRWB_FS
3888 * - #ASM_MEDIA_FMT_AMR_WB_PLUS_V2
3889 * - #ASM_MEDIA_FMT_V13K_FS
3890 * - #ASM_MEDIA_FMT_EVRC_FS
3891 * - #ASM_MEDIA_FMT_EVRCB_FS
3892 * - #ASM_MEDIA_FMT_EVRCWB_FS
3893 * - #ASM_MEDIA_FMT_SBC
3894 * - #ASM_MEDIA_FMT_WMA_V10PRO_V2
3895 * - #ASM_MEDIA_FMT_WMA_V9_V2
3896 * - #ASM_MEDIA_FMT_AC3_DEC
3897 * - #ASM_MEDIA_FMT_EAC3_DEC
3898 * - #ASM_MEDIA_FMT_G711_ALAW_FS
3899 * - #ASM_MEDIA_FMT_G711_MLAW_FS
3900 * - #ASM_MEDIA_FMT_G729A_FS
3901 * - #ASM_MEDIA_FMT_FR_FS
3902 * - #ASM_MEDIA_FMT_VORBIS
3903 * - #ASM_MEDIA_FMT_FLAC
3904 * - #ASM_MEDIA_FMT_EXAMPLE
3905 */
3906} __packed;
3907
3908#define ASM_STREAM_CMD_OPEN_READ_V2 0x00010D8C
Phani Kumar Uppalapati85b7c9b2013-02-19 09:59:47 -08003909
3910#define ASM_STREAM_CMD_OPEN_READ_V3 0x00010DB4
3911
Bharath Ramachandramurthy2e3168f2012-05-03 16:29:09 -07003912/* Definition of the timestamp type flag bitmask */
3913#define ASM_BIT_MASKIMESTAMPYPE_FLAG (0x00000020UL)
3914
3915/* Definition of the timestamp type flag shift value. */
3916#define ASM_SHIFTIMESTAMPYPE_FLAG 5
3917
3918/* Relative timestamp is identified by this value.*/
3919#define ASM_RELATIVEIMESTAMP 0
3920
3921/* Absolute timestamp is identified by this value.*/
3922#define ASM_ABSOLUTEIMESTAMP 1
3923
Phani Kumar Uppalapati85b7c9b2013-02-19 09:59:47 -08003924/* Bit shift for the stream_perf_mode subfield. */
3925#define ASM_SHIFT_STREAM_PERF_MODE_FLAG_IN_OPEN_READ 29
Bharath Ramachandramurthy2e3168f2012-05-03 16:29:09 -07003926
Phani Kumar Uppalapati85b7c9b2013-02-19 09:59:47 -08003927struct asm_stream_cmd_open_read_v3 {
Bharath Ramachandramurthy2e3168f2012-05-03 16:29:09 -07003928 struct apr_hdr hdr;
3929 u32 mode_flags;
3930/* Mode flags that indicate whether meta information per encoded
3931 * frame is to be provided.
3932 * Supported values for bit 4:
3933 *
3934 * - 0 -- Return data buffer contains all encoded frames only; it
3935 * does not contain frame metadata.
3936 *
3937 * - 1 -- Return data buffer contains an array of metadata and
3938 * encoded frames.
3939 *
3940 * - Use #ASM_BIT_MASK_META_INFO_FLAG as the bitmask and
3941 * #ASM_SHIFT_META_INFO_FLAG as the shift value for this bit.
3942 *
3943 *
3944 * Supported values for bit 5:
3945 *
3946 * - ASM_RELATIVEIMESTAMP -- ASM_DATA_EVENT_READ_DONE_V2 will have
3947 * - relative time-stamp.
3948 * - ASM_ABSOLUTEIMESTAMP -- ASM_DATA_EVENT_READ_DONE_V2 will
3949 * - have absolute time-stamp.
3950 *
3951 * - Use #ASM_BIT_MASKIMESTAMPYPE_FLAG as the bitmask and
3952 * #ASM_SHIFTIMESTAMPYPE_FLAG as the shift value for this bit.
3953 *
3954 * All other bits are reserved; clients must set them to zero.
3955 */
3956
3957 u32 src_endpointype;
3958/* Specifies the endpoint providing the input samples.
3959 * Supported values:
3960 * - 0 -- Device matrix
3961 * - All other values are reserved; clients must set them to zero.
3962 * Otherwise, an error is returned.
3963 * The device matrix is the gateway from the tunneled Tx ports.
3964 */
3965
3966 u32 preprocopo_id;
3967/* Specifies the topology (order of processing) of preprocessing
3968 * algorithms. <i>None</i> means no preprocessing.
3969 * Supported values:
3970 * - #ASM_STREAM_PREPROCOPO_ID_DEFAULT
3971 * - #ASM_STREAM_PREPROCOPO_ID_NONE
3972 *
3973 * This field can also be enabled through SetParams flags.
3974 */
3975
3976 u32 enc_cfg_id;
3977/* Media configuration ID for encoded output.
3978 * Supported values:
3979 * - #ASM_MEDIA_FMT_MULTI_CHANNEL_PCM_V2
3980 * - #ASM_MEDIA_FMT_AAC_V2
3981 * - #ASM_MEDIA_FMT_AMRNB_FS
3982 * - #ASM_MEDIA_FMT_AMRWB_FS
3983 * - #ASM_MEDIA_FMT_V13K_FS
3984 * - #ASM_MEDIA_FMT_EVRC_FS
3985 * - #ASM_MEDIA_FMT_EVRCB_FS
3986 * - #ASM_MEDIA_FMT_EVRCWB_FS
3987 * - #ASM_MEDIA_FMT_SBC
3988 * - #ASM_MEDIA_FMT_G711_ALAW_FS
3989 * - #ASM_MEDIA_FMT_G711_MLAW_FS
3990 * - #ASM_MEDIA_FMT_G729A_FS
3991 * - #ASM_MEDIA_FMT_EXAMPLE
3992 * - #ASM_MEDIA_FMT_WMA_V8
3993 */
3994
3995 u16 bits_per_sample;
3996/* Number of bits per sample processed by ASM modules.
3997 * Supported values: 16 and 24 bits per sample
3998 */
3999
4000 u16 reserved;
4001/* Reserved for future use. This field must be set to zero.*/
4002} __packed;
4003
4004#define ASM_POPP_OUTPUT_SR_NATIVE_RATE 0
4005
4006/* Enumeration for the maximum sampling rate at the POPP output.*/
4007#define ASM_POPP_OUTPUT_SR_MAX_RATE 48000
4008
4009#define ASM_STREAM_CMD_OPEN_READWRITE_V2 0x00010D8D
4010#define ASM_STREAM_CMD_OPEN_READWRITE_V2 0x00010D8D
4011#define ASM_STREAM_CMD_OPEN_READ_V2 0x00010D8C
4012
4013struct asm_stream_cmd_open_readwrite_v2 {
4014 struct apr_hdr hdr;
4015 u32 mode_flags;
4016/* Mode flags.
4017 * Supported values for bit 2:
4018 * - 0 -- SR/CM change notification event is disabled.
4019 * - 1 -- SR/CM change notification event is enabled. Use
4020 * #ASM_BIT_MASK_SR_CM_CHANGE_NOTIFY_FLAG and
4021 * #ASM_SHIFT_SR_CM_CHANGE_NOTIFY_FLAG to set or
4022 * getting this flag.
4023 *
4024 * Supported values for bit 4:
4025 * - 0 -- Return read data buffer contains all encoded frames only; it
4026 * does not contain frame metadata.
4027 * - 1 -- Return read data buffer contains an array of metadata and
4028 * encoded frames.
4029 *
4030 * All other bits are reserved; clients must set them to zero.
4031 */
4032
4033 u32 postprocopo_id;
4034/* Specifies the topology (order of processing) of postprocessing
4035 * algorithms. <i>None</i> means no postprocessing.
4036 *
4037 * Supported values:
4038 * - #ASM_STREAM_POSTPROCOPO_ID_DEFAULT
4039 * - #ASM_STREAM_POSTPROCOPO_ID_MCH_PEAK_VOL
4040 * - #ASM_STREAM_POSTPROCOPO_ID_NONE
4041 */
4042
4043 u32 dec_fmt_id;
4044/* Specifies the media type of the input data. PCM indicates that
4045 * no decoding must be performed, e.g., this is an NT encoder
4046 * session.
4047 * Supported values:
4048 * - #ASM_MEDIA_FMT_MULTI_CHANNEL_PCM_V2
4049 * - #ASM_MEDIA_FMT_ADPCM
4050 * - #ASM_MEDIA_FMT_MP3
4051 * - #ASM_MEDIA_FMT_AAC_V2
4052 * - #ASM_MEDIA_FMT_DOLBY_AAC
4053 * - #ASM_MEDIA_FMT_AMRNB_FS
4054 * - #ASM_MEDIA_FMT_AMRWB_FS
4055 * - #ASM_MEDIA_FMT_V13K_FS
4056 * - #ASM_MEDIA_FMT_EVRC_FS
4057 * - #ASM_MEDIA_FMT_EVRCB_FS
4058 * - #ASM_MEDIA_FMT_EVRCWB_FS
4059 * - #ASM_MEDIA_FMT_SBC
4060 * - #ASM_MEDIA_FMT_WMA_V10PRO_V2
4061 * - #ASM_MEDIA_FMT_WMA_V9_V2
4062 * - #ASM_MEDIA_FMT_AMR_WB_PLUS_V2
4063 * - #ASM_MEDIA_FMT_AC3_DEC
4064 * - #ASM_MEDIA_FMT_G711_ALAW_FS
4065 * - #ASM_MEDIA_FMT_G711_MLAW_FS
4066 * - #ASM_MEDIA_FMT_G729A_FS
4067 * - #ASM_MEDIA_FMT_EXAMPLE
4068 */
4069
4070 u32 enc_cfg_id;
4071/* Specifies the media type for the output of the stream. PCM
4072 * indicates that no encoding must be performed, e.g., this is an NT
4073 * decoder session.
4074 * Supported values:
4075 * - #ASM_MEDIA_FMT_MULTI_CHANNEL_PCM_V2
4076 * - #ASM_MEDIA_FMT_AAC_V2
4077 * - #ASM_MEDIA_FMT_AMRNB_FS
4078 * - #ASM_MEDIA_FMT_AMRWB_FS
4079 * - #ASM_MEDIA_FMT_V13K_FS
4080 * - #ASM_MEDIA_FMT_EVRC_FS
4081 * - #ASM_MEDIA_FMT_EVRCB_FS
4082 * - #ASM_MEDIA_FMT_EVRCWB_FS
4083 * - #ASM_MEDIA_FMT_SBC
4084 * - #ASM_MEDIA_FMT_G711_ALAW_FS
4085 * - #ASM_MEDIA_FMT_G711_MLAW_FS
4086 * - #ASM_MEDIA_FMT_G729A_FS
4087 * - #ASM_MEDIA_FMT_EXAMPLE
4088 * - #ASM_MEDIA_FMT_WMA_V8
4089 */
4090
4091 u16 bits_per_sample;
4092/* Number of bits per sample processed by ASM modules.
4093 * Supported values: 16 and 24 bits per sample
4094 */
4095
4096 u16 reserved;
4097/* Reserved for future use. This field must be set to zero.*/
4098
4099} __packed;
4100
4101#define ASM_STREAM_CMD_OPEN_LOOPBACK_V2 0x00010D8E
4102struct asm_stream_cmd_open_loopback_v2 {
4103 struct apr_hdr hdr;
4104 u32 mode_flags;
4105/* Mode flags.
4106 * Bit 0-31: reserved; client should set these bits to 0
4107 */
4108 u16 src_endpointype;
4109 /* Endpoint type. 0 = Tx Matrix */
4110 u16 sink_endpointype;
4111 /* Endpoint type. 0 = Rx Matrix */
4112 u32 postprocopo_id;
4113/* Postprocessor topology ID. Specifies the topology of
4114 * postprocessing algorithms.
4115 */
4116
4117 u16 bits_per_sample;
4118/* The number of bits per sample processed by ASM modules
4119 * Supported values: 16 and 24 bits per sample
4120 */
4121 u16 reserved;
4122/* Reserved for future use. This field must be set to zero. */
4123} __packed;
4124
4125#define ASM_STREAM_CMD_CLOSE 0x00010BCD
4126#define ASM_STREAM_CMD_FLUSH 0x00010BCE
4127
4128
4129#define ASM_STREAM_CMD_FLUSH_READBUFS 0x00010C09
4130#define ASM_STREAM_CMD_SET_PP_PARAMS_V2 0x00010DA1
4131
4132struct asm_stream_cmd_set_pp_params_v2 {
4133 u32 data_payload_addr_lsw;
4134/* LSW of parameter data payload address. Supported values: any. */
4135 u32 data_payload_addr_msw;
4136/* MSW of Parameter data payload address. Supported values: any.
4137 * - Must be set to zero for in-band data.
4138 * - In the case of 32 bit Shared memory address, msw field must be
4139 * - set to zero.
4140 * - In the case of 36 bit shared memory address, bit 31 to bit 4 of
4141 * msw
4142 *
4143 * - must be set to zero.
4144 */
4145 u32 mem_map_handle;
4146/* Supported Values: Any.
4147* memory map handle returned by DSP through
4148* ASM_CMD_SHARED_MEM_MAP_REGIONS
4149* command.
4150* if mmhandle is NULL, the ParamData payloads are within the
4151* message payload (in-band).
4152* If mmhandle is non-NULL, the ParamData payloads begin at the
4153* address specified in the address msw and lsw (out-of-band).
4154*/
4155
4156 u32 data_payload_size;
4157/* Size in bytes of the variable payload accompanying the
4158message, or in shared memory. This field is used for parsing the
4159parameter payload. */
4160
4161} __packed;
4162
4163
4164struct asm_stream_param_data_v2 {
4165 u32 module_id;
4166 /* Unique module ID. */
4167
4168 u32 param_id;
4169 /* Unique parameter ID. */
4170
4171 u16 param_size;
4172/* Data size of the param_id/module_id combination. This is
4173 * a multiple of 4 bytes.
4174 */
4175
4176 u16 reserved;
4177/* Reserved for future enhancements. This field must be set to
4178 * zero.
4179 */
4180
4181} __packed;
4182
4183#define ASM_STREAM_CMD_GET_PP_PARAMS_V2 0x00010DA2
4184
4185struct asm_stream_cmd_get_pp_params_v2 {
4186 u32 data_payload_addr_lsw;
4187 /* LSW of the parameter data payload address. */
4188 u32 data_payload_addr_msw;
4189/* MSW of the parameter data payload address.
4190 * - Size of the shared memory, if specified, shall be large enough
4191 * to contain the whole ParamData payload, including Module ID,
4192 * Param ID, Param Size, and Param Values
4193 * - Must be set to zero for in-band data
4194 * - In the case of 32 bit Shared memory address, msw field must be
4195 * set to zero.
4196 * - In the case of 36 bit shared memory address, bit 31 to bit 4 of
4197 * msw must be set to zero.
4198 */
4199
4200 u32 mem_map_handle;
4201/* Supported Values: Any.
4202* memory map handle returned by DSP through ASM_CMD_SHARED_MEM_MAP_REGIONS
4203* command.
4204* if mmhandle is NULL, the ParamData payloads in the ACK are within the
4205* message payload (in-band).
4206* If mmhandle is non-NULL, the ParamData payloads in the ACK begin at the
4207* address specified in the address msw and lsw.
4208* (out-of-band).
4209*/
4210
4211 u32 module_id;
4212 /* Unique module ID. */
4213
4214 u32 param_id;
4215 /* Unique parameter ID. */
4216
4217 u16 param_max_size;
4218/* Maximum data size of the module_id/param_id combination. This
4219 * is a multiple of 4 bytes.
4220 */
4221
4222
4223 u16 reserved;
4224/* Reserved for backward compatibility. Clients must set this
4225* field to zero.
4226*/
4227
4228} __packed;
4229
4230#define ASM_STREAM_CMD_SET_ENCDEC_PARAM 0x00010C10
4231
4232#define ASM_PARAM_ID_ENCDEC_BITRATE 0x00010C13
4233
4234struct asm_bitrate_param {
4235 u32 bitrate;
4236/* Maximum supported bitrate. Only the AAC encoder is supported.*/
4237
4238} __packed;
4239
4240#define ASM_PARAM_ID_ENCDEC_ENC_CFG_BLK_V2 0x00010DA3
4241#define ASM_PARAM_ID_AAC_SBR_PS_FLAG 0x00010C63
4242
4243/* Flag to turn off both SBR and PS processing, if they are
4244 * present in the bitstream.
4245 */
4246
4247#define ASM_AAC_SBR_OFF_PS_OFF (2)
4248
4249/* Flag to turn on SBR but turn off PS processing,if they are
4250 * present in the bitstream.
4251 */
4252
4253#define ASM_AAC_SBR_ON_PS_OFF (1)
4254
4255/* Flag to turn on both SBR and PS processing, if they are
4256 * present in the bitstream (default behavior).
4257 */
4258
4259
4260#define ASM_AAC_SBR_ON_PS_ON (0)
4261
4262/* Structure for an AAC SBR PS processing flag. */
4263
4264/* Payload of the #ASM_PARAM_ID_AAC_SBR_PS_FLAG parameter in the
4265 * #ASM_STREAM_CMD_SET_ENCDEC_PARAM command.
4266 */
4267struct asm_aac_sbr_ps_flag_param {
4268 struct apr_hdr hdr;
4269 struct asm_stream_cmd_set_encdec_param encdec;
4270 struct asm_enc_cfg_blk_param_v2 encblk;
4271
4272 u32 sbr_ps_flag;
4273/* Control parameter to enable or disable SBR/PS processing in
4274 * the AAC bitstream. Use the following macros to set this field:
4275 * - #ASM_AAC_SBR_OFF_PS_OFF -- Turn off both SBR and PS
4276 * processing, if they are present in the bitstream.
4277 * - #ASM_AAC_SBR_ON_PS_OFF -- Turn on SBR processing, but not PS
4278 * processing, if they are present in the bitstream.
4279 * - #ASM_AAC_SBR_ON_PS_ON -- Turn on both SBR and PS processing,
4280 * if they are present in the bitstream (default behavior).
4281 * - All other values are invalid.
4282 * Changes are applied to the next decoded frame.
4283 */
4284} __packed;
4285
4286#define ASM_PARAM_ID_AAC_DUAL_MONO_MAPPING 0x00010C64
4287
4288/* First single channel element in a dual mono bitstream.*/
4289#define ASM_AAC_DUAL_MONO_MAP_SCE_1 (1)
4290
4291/* Second single channel element in a dual mono bitstream.*/
4292#define ASM_AAC_DUAL_MONO_MAP_SCE_2 (2)
4293
4294/* Structure for AAC decoder dual mono channel mapping. */
4295
4296
4297struct asm_aac_dual_mono_mapping_param {
4298 struct apr_hdr hdr;
4299 struct asm_stream_cmd_set_encdec_param encdec;
4300 struct asm_enc_cfg_blk_param_v2 encblk;
4301 u16 left_channel_sce;
4302 u16 right_channel_sce;
4303
4304} __packed;
4305
4306#define ASM_STREAM_CMDRSP_GET_PP_PARAMS_V2 0x00010DA4
4307
4308struct asm_stream_cmdrsp_get_pp_params_v2 {
4309 u32 status;
4310} __packed;
4311
4312#define ASM_PARAM_ID_AC3_KARAOKE_MODE 0x00010D73
4313
4314/* Enumeration for both vocals in a karaoke stream.*/
4315#define AC3_KARAOKE_MODE_NO_VOCAL (0)
4316
4317/* Enumeration for only the left vocal in a karaoke stream.*/
4318#define AC3_KARAOKE_MODE_LEFT_VOCAL (1)
4319
4320/* Enumeration for only the right vocal in a karaoke stream.*/
4321#define AC3_KARAOKE_MODE_RIGHT_VOCAL (2)
4322
4323/* Enumeration for both vocal channels in a karaoke stream.*/
4324#define AC3_KARAOKE_MODE_BOTH_VOCAL (3)
4325#define ASM_PARAM_ID_AC3_DRC_MODE 0x00010D74
4326/* Enumeration for the Custom Analog mode.*/
4327#define AC3_DRC_MODE_CUSTOM_ANALOG (0)
4328
4329/* Enumeration for the Custom Digital mode.*/
4330#define AC3_DRC_MODE_CUSTOM_DIGITAL (1)
4331/* Enumeration for the Line Out mode (light compression).*/
4332#define AC3_DRC_MODE_LINE_OUT (2)
4333
4334/* Enumeration for the RF remodulation mode (heavy compression).*/
4335#define AC3_DRC_MODE_RF_REMOD (3)
4336#define ASM_PARAM_ID_AC3_DUAL_MONO_MODE 0x00010D75
4337
4338/* Enumeration for playing dual mono in stereo mode.*/
4339#define AC3_DUAL_MONO_MODE_STEREO (0)
4340
4341/* Enumeration for playing left mono.*/
4342#define AC3_DUAL_MONO_MODE_LEFT_MONO (1)
4343
4344/* Enumeration for playing right mono.*/
4345#define AC3_DUAL_MONO_MODE_RIGHT_MONO (2)
4346
4347/* Enumeration for mixing both dual mono channels and playing them.*/
4348#define AC3_DUAL_MONO_MODE_MIXED_MONO (3)
4349#define ASM_PARAM_ID_AC3_STEREO_DOWNMIX_MODE 0x00010D76
4350
4351/* Enumeration for using the Downmix mode indicated in the bitstream. */
4352
4353#define AC3_STEREO_DOWNMIX_MODE_AUTO_DETECT (0)
4354
4355/* Enumeration for Surround Compatible mode (preserves the
4356 * surround information).
4357 */
4358
4359#define AC3_STEREO_DOWNMIX_MODE_LT_RT (1)
4360/* Enumeration for Mono Compatible mode (if the output is to be
4361 * further downmixed to mono).
4362 */
4363
4364#define AC3_STEREO_DOWNMIX_MODE_LO_RO (2)
4365
4366/* ID of the AC3 PCM scale factor parameter in the
4367 * #ASM_STREAM_CMD_SET_ENCDEC_PARAM command.
4368 */
4369#define ASM_PARAM_ID_AC3_PCM_SCALEFACTOR 0x00010D78
4370
4371/* ID of the AC3 DRC boost scale factor parameter in the
4372 * #ASM_STREAM_CMD_SET_ENCDEC_PARAM command.
4373 */
4374#define ASM_PARAM_ID_AC3_DRC_BOOST_SCALEFACTOR 0x00010D79
4375
4376/* ID of the AC3 DRC cut scale factor parameter in the
4377 * #ASM_STREAM_CMD_SET_ENCDEC_PARAM command.
4378 */
4379#define ASM_PARAM_ID_AC3_DRC_CUT_SCALEFACTOR 0x00010D7A
4380
4381/* Structure for AC3 Generic Parameter. */
4382
4383/* Payload of the AC3 parameters in the
4384 * #ASM_STREAM_CMD_SET_ENCDEC_PARAM command.
4385 */
4386struct asm_ac3_generic_param {
4387 struct apr_hdr hdr;
4388 struct asm_stream_cmd_set_encdec_param encdec;
4389 struct asm_enc_cfg_blk_param_v2 encblk;
4390 u32 generic_parameter;
4391/* AC3 generic parameter. Select from one of the following
4392 * possible values.
4393 *
4394 * For #ASM_PARAM_ID_AC3_KARAOKE_MODE, supported values are:
4395 * - AC3_KARAOKE_MODE_NO_VOCAL
4396 * - AC3_KARAOKE_MODE_LEFT_VOCAL
4397 * - AC3_KARAOKE_MODE_RIGHT_VOCAL
4398 * - AC3_KARAOKE_MODE_BOTH_VOCAL
4399 *
4400 * For #ASM_PARAM_ID_AC3_DRC_MODE, supported values are:
4401 * - AC3_DRC_MODE_CUSTOM_ANALOG
4402 * - AC3_DRC_MODE_CUSTOM_DIGITAL
4403 * - AC3_DRC_MODE_LINE_OUT
4404 * - AC3_DRC_MODE_RF_REMOD
4405 *
4406 * For #ASM_PARAM_ID_AC3_DUAL_MONO_MODE, supported values are:
4407 * - AC3_DUAL_MONO_MODE_STEREO
4408 * - AC3_DUAL_MONO_MODE_LEFT_MONO
4409 * - AC3_DUAL_MONO_MODE_RIGHT_MONO
4410 * - AC3_DUAL_MONO_MODE_MIXED_MONO
4411 *
4412 * For #ASM_PARAM_ID_AC3_STEREO_DOWNMIX_MODE, supported values are:
4413 * - AC3_STEREO_DOWNMIX_MODE_AUTO_DETECT
4414 * - AC3_STEREO_DOWNMIX_MODE_LT_RT
4415 * - AC3_STEREO_DOWNMIX_MODE_LO_RO
4416 *
4417 * For #ASM_PARAM_ID_AC3_PCM_SCALEFACTOR, supported values are
4418 * 0 to 1 in Q31 format.
4419 *
4420 * For #ASM_PARAM_ID_AC3_DRC_BOOST_SCALEFACTOR, supported values are
4421 * 0 to 1 in Q31 format.
4422 *
4423 * For #ASM_PARAM_ID_AC3_DRC_CUT_SCALEFACTOR, supported values are
4424 * 0 to 1 in Q31 format.
4425 */
4426} __packed;
4427
4428/* Enumeration for Raw mode (no downmixing), which specifies
4429 * that all channels in the bitstream are to be played out as is
4430 * without any downmixing. (Default)
4431 */
4432
4433#define WMAPRO_CHANNEL_MASK_RAW (-1)
4434
4435/* Enumeration for setting the channel mask to 0. The 7.1 mode
4436 * (Home Theater) is assigned.
4437 */
4438
4439
4440#define WMAPRO_CHANNEL_MASK_ZERO 0x0000
4441
4442/* Speaker layout mask for one channel (Home Theater, mono).
4443 * - Speaker front center
4444 */
4445#define WMAPRO_CHANNEL_MASK_1_C 0x0004
4446
4447/* Speaker layout mask for two channels (Home Theater, stereo).
4448 * - Speaker front left
4449 * - Speaker front right
4450 */
4451#define WMAPRO_CHANNEL_MASK_2_L_R 0x0003
4452
4453/* Speaker layout mask for three channels (Home Theater).
4454 * - Speaker front left
4455 * - Speaker front right
4456 * - Speaker front center
4457 */
4458#define WMAPRO_CHANNEL_MASK_3_L_C_R 0x0007
4459
4460/* Speaker layout mask for two channels (stereo).
4461 * - Speaker back left
4462 * - Speaker back right
4463 */
4464#define WMAPRO_CHANNEL_MASK_2_Bl_Br 0x0030
4465
4466/* Speaker layout mask for four channels.
4467 * - Speaker front left
4468 * - Speaker front right
4469 * - Speaker back left
4470 * - Speaker back right
4471*/
4472#define WMAPRO_CHANNEL_MASK_4_L_R_Bl_Br 0x0033
4473
4474/* Speaker layout mask for four channels (Home Theater).
4475 * - Speaker front left
4476 * - Speaker front right
4477 * - Speaker front center
4478 * - Speaker back center
4479*/
4480#define WMAPRO_CHANNEL_MASK_4_L_R_C_Bc_HT 0x0107
4481/* Speaker layout mask for five channels.
4482 * - Speaker front left
4483 * - Speaker front right
4484 * - Speaker front center
4485 * - Speaker back left
4486 * - Speaker back right
4487 */
4488#define WMAPRO_CHANNEL_MASK_5_L_C_R_Bl_Br 0x0037
4489
4490/* Speaker layout mask for five channels (5 mode, Home Theater).
4491 * - Speaker front left
4492 * - Speaker front right
4493 * - Speaker front center
4494 * - Speaker side left
4495 * - Speaker side right
4496 */
4497#define WMAPRO_CHANNEL_MASK_5_L_C_R_Sl_Sr_HT 0x0607
4498/* Speaker layout mask for six channels (5.1 mode).
4499 * - Speaker front left
4500 * - Speaker front right
4501 * - Speaker front center
4502 * - Speaker low frequency
4503 * - Speaker back left
4504 * - Speaker back right
4505 */
4506#define WMAPRO_CHANNEL_MASK_5DOT1_L_C_R_Bl_Br_SLF 0x003F
4507/* Speaker layout mask for six channels (5.1 mode, Home Theater).
4508 * - Speaker front left
4509 * - Speaker front right
4510 * - Speaker front center
4511 * - Speaker low frequency
4512 * - Speaker side left
4513 * - Speaker side right
4514 */
4515#define WMAPRO_CHANNEL_MASK_5DOT1_L_C_R_Sl_Sr_SLF_HT 0x060F
4516/* Speaker layout mask for six channels (5.1 mode, no LFE).
4517 * - Speaker front left
4518 * - Speaker front right
4519 * - Speaker front center
4520 * - Speaker back left
4521 * - Speaker back right
4522 * - Speaker back center
4523 */
4524#define WMAPRO_CHANNEL_MASK_5DOT1_L_C_R_Bl_Br_Bc 0x0137
4525/* Speaker layout mask for six channels (5.1 mode, Home Theater,
4526 * no LFE).
4527 * - Speaker front left
4528 * - Speaker front right
4529 * - Speaker front center
4530 * - Speaker back center
4531 * - Speaker side left
4532 * - Speaker side right
4533 */
4534#define WMAPRO_CHANNEL_MASK_5DOT1_L_C_R_Sl_Sr_Bc_HT 0x0707
4535
4536/* Speaker layout mask for seven channels (6.1 mode).
4537 * - Speaker front left
4538 * - Speaker front right
4539 * - Speaker front center
4540 * - Speaker low frequency
4541 * - Speaker back left
4542 * - Speaker back right
4543 * - Speaker back center
4544 */
4545#define WMAPRO_CHANNEL_MASK_6DOT1_L_C_R_Bl_Br_Bc_SLF 0x013F
4546
4547/* Speaker layout mask for seven channels (6.1 mode, Home
4548 * Theater).
4549 * - Speaker front left
4550 * - Speaker front right
4551 * - Speaker front center
4552 * - Speaker low frequency
4553 * - Speaker back center
4554 * - Speaker side left
4555 * - Speaker side right
4556*/
4557#define WMAPRO_CHANNEL_MASK_6DOT1_L_C_R_Sl_Sr_Bc_SLF_HT 0x070F
4558
4559/* Speaker layout mask for seven channels (6.1 mode, no LFE).
4560 * - Speaker front left
4561 * - Speaker front right
4562 * - Speaker front center
4563 * - Speaker back left
4564 * - Speaker back right
4565 * - Speaker front left of center
4566 * - Speaker front right of center
4567*/
4568#define WMAPRO_CHANNEL_MASK_6DOT1_L_C_R_Bl_Br_SFLOC_SFROC 0x00F7
4569
4570/* Speaker layout mask for seven channels (6.1 mode, Home
4571 * Theater, no LFE).
4572 * - Speaker front left
4573 * - Speaker front right
4574 * - Speaker front center
4575 * - Speaker side left
4576 * - Speaker side right
4577 * - Speaker front left of center
4578 * - Speaker front right of center
4579*/
4580#define WMAPRO_CHANNEL_MASK_6DOT1_L_C_R_Sl_Sr_SFLOC_SFROC_HT 0x0637
4581
4582/* Speaker layout mask for eight channels (7.1 mode).
4583 * - Speaker front left
4584 * - Speaker front right
4585 * - Speaker front center
4586 * - Speaker back left
4587 * - Speaker back right
4588 * - Speaker low frequency
4589 * - Speaker front left of center
4590 * - Speaker front right of center
4591 */
4592#define WMAPRO_CHANNEL_MASK_7DOT1_L_C_R_Bl_Br_SLF_SFLOC_SFROC \
4593 0x00FF
4594
4595/* Speaker layout mask for eight channels (7.1 mode, Home Theater).
4596 * - Speaker front left
4597 * - Speaker front right
4598 * - Speaker front center
4599 * - Speaker side left
4600 * - Speaker side right
4601 * - Speaker low frequency
4602 * - Speaker front left of center
4603 * - Speaker front right of center
4604 *
4605*/
4606#define WMAPRO_CHANNEL_MASK_7DOT1_L_C_R_Sl_Sr_SLF_SFLOC_SFROC_HT \
4607 0x063F
4608
4609#define ASM_PARAM_ID_DEC_OUTPUT_CHAN_MAP 0x00010D82
4610
4611/* Maximum number of decoder output channels.*/
4612#define MAX_CHAN_MAP_CHANNELS 16
4613
4614/* Structure for decoder output channel mapping. */
4615
4616/* Payload of the #ASM_PARAM_ID_DEC_OUTPUT_CHAN_MAP parameter in the
4617 * #ASM_STREAM_CMD_SET_ENCDEC_PARAM command.
4618 */
4619struct asm_dec_out_chan_map_param {
4620 struct apr_hdr hdr;
4621 struct asm_stream_cmd_set_encdec_param encdec;
Bharath Ramachandramurthy2e3168f2012-05-03 16:29:09 -07004622 u32 num_channels;
4623/* Number of decoder output channels.
4624 * Supported values: 0 to #MAX_CHAN_MAP_CHANNELS
4625 *
4626 * A value of 0 indicates native channel mapping, which is valid
4627 * only for NT mode. This means the output of the decoder is to be
4628 * preserved as is.
4629 */
4630 u8 channel_mapping[MAX_CHAN_MAP_CHANNELS];
4631} __packed;
4632
4633#define ASM_STREAM_CMD_OPEN_WRITE_COMPRESSED 0x00010D84
4634
4635/* Bitmask for the IEC 61937 enable flag.*/
4636#define ASM_BIT_MASK_IEC_61937_STREAM_FLAG (0x00000001UL)
4637
4638/* Shift value for the IEC 61937 enable flag.*/
4639#define ASM_SHIFT_IEC_61937_STREAM_FLAG 0
4640
4641/* Bitmask for the IEC 60958 enable flag.*/
4642#define ASM_BIT_MASK_IEC_60958_STREAM_FLAG (0x00000002UL)
4643
4644/* Shift value for the IEC 60958 enable flag.*/
4645#define ASM_SHIFT_IEC_60958_STREAM_FLAG 1
4646
4647/* Payload format for open write compressed comand */
4648
4649/* Payload format for the #ASM_STREAM_CMD_OPEN_WRITE_COMPRESSED
4650 * comand, which opens a stream for a given session ID and stream ID
4651 * to be rendered in the compressed format.
4652 */
4653
4654struct asm_stream_cmd_open_write_compressed {
4655 struct apr_hdr hdr;
4656 u32 flags;
4657/* Mode flags that configure the stream for a specific format.
4658 * Supported values:
4659 * - Bit 0 -- IEC 61937 compatibility
4660 * - 0 -- Stream is not in IEC 61937 format
4661 * - 1 -- Stream is in IEC 61937 format
4662 * - Bit 1 -- IEC 60958 compatibility
4663 * - 0 -- Stream is not in IEC 60958 format
4664 * - 1 -- Stream is in IEC 60958 format
4665 * - Bits 2 to 31 -- 0 (Reserved)
4666 *
4667 * For the same stream, bit 0 cannot be set to 0 and bit 1 cannot
4668 * be set to 1. A compressed stream connot have IEC 60958
4669 * packetization applied without IEC 61937 packetization.
4670 * @note1hang Currently, IEC 60958 packetized input streams are not
4671 * supported.
4672 */
4673
4674
4675 u32 fmt_id;
4676/* Specifies the media type of the HDMI stream to be opened.
4677 * Supported values:
4678 * - #ASM_MEDIA_FMT_AC3_DEC
4679 * - #ASM_MEDIA_FMT_EAC3_DEC
4680 * - #ASM_MEDIA_FMT_DTS
4681 * - #ASM_MEDIA_FMT_ATRAC
4682 * - #ASM_MEDIA_FMT_MAT
4683 *
4684 * @note1hang This field must be set to a valid media type even if
4685 * IEC 61937 packetization is not performed by the aDSP.
4686 */
4687
4688} __packed;
4689
4690#define ASM_STREAM_CMD_OPEN_READ_COMPRESSED 0x00010D95
4691
4692struct asm_stream_cmd_open_read_compressed {
4693 struct apr_hdr hdr;
4694 u32 mode_flags;
4695/* Mode flags that indicate whether meta information per encoded
4696 * frame is to be provided.
4697 * Supported values for bit 4:
4698 * - 0 -- Return data buffer contains all encoded frames only; it does
4699 * not contain frame metadata.
4700 * - 1 -- Return data buffer contains an array of metadata and encoded
4701 * frames.
4702 * - Use #ASM_BIT_MASK_META_INFO_FLAG to set the bitmask and
4703 * #ASM_SHIFT_META_INFO_FLAG to set the shift value for this bit.
4704 * All other bits are reserved; clients must set them to zero.
4705 */
4706
4707 u32 frames_per_buf;
4708/* Indicates the number of frames that need to be returned per
4709 * read buffer
4710 * Supported values: should be greater than 0
4711 */
4712
4713} __packed;
4714
4715/* adsp_asm_stream_commands.h*/
4716
4717
4718/* adsp_asm_api.h (no changes)*/
4719#define ASM_STREAM_POSTPROCOPO_ID_DEFAULT \
4720 0x00010BE4
4721#define ASM_STREAM_POSTPROCOPO_ID_PEAKMETER \
4722 0x00010D83
4723#define ASM_STREAM_POSTPROCOPO_ID_NONE \
4724 0x00010C68
4725#define ASM_STREAM_POSTPROCOPO_ID_MCH_PEAK_VOL \
4726 0x00010D8B
4727#define ASM_STREAM_PREPROCOPO_ID_DEFAULT \
4728 ASM_STREAM_POSTPROCOPO_ID_DEFAULT
4729#define ASM_STREAM_PREPROCOPO_ID_NONE \
4730 ASM_STREAM_POSTPROCOPO_ID_NONE
4731#define ADM_CMD_COPP_OPENOPOLOGY_ID_NONE_AUDIO_COPP \
4732 0x00010312
4733#define ADM_CMD_COPP_OPENOPOLOGY_ID_SPEAKER_MONO_AUDIO_COPP \
4734 0x00010313
4735#define ADM_CMD_COPP_OPENOPOLOGY_ID_SPEAKER_STEREO_AUDIO_COPP \
4736 0x00010314
4737#define ADM_CMD_COPP_OPENOPOLOGY_ID_SPEAKER_STEREO_IIR_AUDIO_COPP\
4738 0x00010704
4739#define ADM_CMD_COPP_OPENOPOLOGY_ID_SPEAKER_MONO_AUDIO_COPP_MBDRCV2\
4740 0x0001070D
4741#define ADM_CMD_COPP_OPENOPOLOGY_ID_SPEAKER_STEREO_AUDIO_COPP_MBDRCV2\
4742 0x0001070E
4743#define ADM_CMD_COPP_OPENOPOLOGY_ID_SPEAKER_STEREO_IIR_AUDIO_COPP_MBDRCV2\
4744 0x0001070F
4745#define ADM_CMD_COPP_OPENOPOLOGY_ID_SPEAKER_MCH_PEAK_VOL \
4746 0x0001031B
4747#define ADM_CMD_COPP_OPENOPOLOGY_ID_MIC_MONO_AUDIO_COPP 0x00010315
4748#define ADM_CMD_COPP_OPENOPOLOGY_ID_MIC_STEREO_AUDIO_COPP 0x00010316
4749#define AUDPROC_COPPOPOLOGY_ID_MCHAN_IIR_AUDIO 0x00010715
4750#define ADM_CMD_COPP_OPENOPOLOGY_ID_DEFAULT_AUDIO_COPP 0x00010BE3
4751#define ADM_CMD_COPP_OPENOPOLOGY_ID_PEAKMETER_AUDIO_COPP 0x00010317
4752#define AUDPROC_MODULE_ID_AIG 0x00010716
4753#define AUDPROC_PARAM_ID_AIG_ENABLE 0x00010717
4754#define AUDPROC_PARAM_ID_AIG_CONFIG 0x00010718
4755
4756struct Audio_AigParam {
4757 uint16_t mode;
4758/*< Mode word for enabling AIG/SIG mode .
4759 * Byte offset: 0
4760 */
4761 int16_t staticGainL16Q12;
4762/*< Static input gain when aigMode is set to 1.
4763 * Byte offset: 2
4764 */
4765 int16_t initialGainDBL16Q7;
4766/*<Initial value that the adaptive gain update starts from dB
4767 * Q7 Byte offset: 4
4768 */
4769 int16_t idealRMSDBL16Q7;
4770/*<Average RMS level that AIG attempts to achieve Q8.7
4771 * Byte offset: 6
4772 */
4773 int32_t noiseGateL32;
4774/*Threshold below which signal is considered as noise and AIG
4775 * Byte offset: 8
4776 */
4777 int32_t minGainL32Q15;
4778/*Minimum gain that can be provided by AIG Q16.15
4779 * Byte offset: 12
4780 */
4781 int32_t maxGainL32Q15;
4782/*Maximum gain that can be provided by AIG Q16.15
4783 * Byte offset: 16
4784 */
4785 uint32_t gainAtRtUL32Q31;
4786/*Attack/release time for AIG update Q1.31
4787 * Byte offset: 20
4788 */
4789 uint32_t longGainAtRtUL32Q31;
4790/*Long attack/release time while updating gain for
4791 * noise/silence Q1.31 Byte offset: 24
4792 */
4793
4794 uint32_t rmsTavUL32Q32;
4795/* RMS smoothing time constant used for long-term RMS estimate
4796 * Q0.32 Byte offset: 28
4797 */
4798
4799 uint32_t gainUpdateStartTimMsUL32Q0;
4800/* The waiting time before which AIG starts to apply adaptive
4801 * gain update Q32.0 Byte offset: 32
4802 */
4803
4804} __packed;
4805
4806
4807#define ADM_MODULE_ID_EANS 0x00010C4A
4808#define ADM_PARAM_ID_EANS_ENABLE 0x00010C4B
4809#define ADM_PARAM_ID_EANS_PARAMS 0x00010C4C
4810
4811struct adm_eans_enable {
4812
4813 uint32_t enable_flag;
4814/*< Specifies whether EANS is disabled (0) or enabled
4815 * (nonzero).
4816 * This is supported only for sampling rates of 8, 12, 16, 24, 32,
4817 * and 48 kHz. It is not supported for sampling rates of 11.025,
4818 * 22.05, or 44.1 kHz.
4819 */
4820
4821} __packed;
4822
4823
4824struct adm_eans_params {
4825 int16_t eans_mode;
4826/*< Mode word for enabling/disabling submodules.
4827 * Byte offset: 0
4828 */
4829
4830 int16_t eans_input_gain;
4831/*< Q2.13 input gain to the EANS module.
4832 * Byte offset: 2
4833 */
4834
4835 int16_t eans_output_gain;
4836/*< Q2.13 output gain to the EANS module.
4837 * Byte offset: 4
4838 */
4839
4840 int16_t eansarget_ns;
4841/*< Target noise suppression level in dB.
4842 * Byte offset: 6
4843 */
4844
4845 int16_t eans_s_alpha;
4846/*< Q3.12 over-subtraction factor for stationary noise
4847 * suppression.
4848 * Byte offset: 8
4849 */
4850
4851 int16_t eans_n_alpha;
4852/* < Q3.12 over-subtraction factor for nonstationary noise
4853 * suppression.
4854 * Byte offset: 10
4855 */
4856
4857 int16_t eans_n_alphamax;
4858/*< Q3.12 maximum over-subtraction factor for nonstationary
4859 * noise suppression.
4860 * Byte offset: 12
4861 */
4862 int16_t eans_e_alpha;
4863/*< Q15 scaling factor for excess noise suppression.
4864 * Byte offset: 14
4865 */
4866
4867 int16_t eans_ns_snrmax;
4868/*< Upper boundary in dB for SNR estimation.
4869 * Byte offset: 16
4870 */
4871
4872 int16_t eans_sns_block;
4873/*< Quarter block size for stationary noise suppression.
4874 * Byte offset: 18
4875 */
4876
4877 int16_t eans_ns_i;
4878/*< Initialization block size for noise suppression.
4879 * Byte offset: 20
4880 */
4881 int16_t eans_np_scale;
4882/*< Power scale factor for nonstationary noise update.
4883 * Byte offset: 22
4884 */
4885
4886 int16_t eans_n_lambda;
4887/*< Smoothing factor for higher level nonstationary noise
4888 * update.
4889 * Byte offset: 24
4890 */
4891
4892 int16_t eans_n_lambdaf;
4893/*< Medium averaging factor for noise update.
4894 * Byte offset: 26
4895 */
4896
4897 int16_t eans_gs_bias;
4898/*< Bias factor in dB for gain calculation.
4899 * Byte offset: 28
4900 */
4901
4902 int16_t eans_gs_max;
4903/*< SNR lower boundary in dB for aggressive gain calculation.
4904 * Byte offset: 30
4905 */
4906
4907 int16_t eans_s_alpha_hb;
4908/*< Q3.12 over-subtraction factor for high-band stationary
4909 * noise suppression.
4910 * Byte offset: 32
4911 */
4912
4913 int16_t eans_n_alphamax_hb;
4914/*< Q3.12 maximum over-subtraction factor for high-band
4915 * nonstationary noise suppression.
4916 * Byte offset: 34
4917 */
4918
4919 int16_t eans_e_alpha_hb;
4920/*< Q15 scaling factor for high-band excess noise suppression.
4921 * Byte offset: 36
4922 */
4923
4924 int16_t eans_n_lambda0;
4925/*< Smoothing factor for nonstationary noise update during
4926 * speech activity.
4927 * Byte offset: 38
4928 */
4929
4930 int16_t thresh;
4931/*< Threshold for generating a binary VAD decision.
4932 * Byte offset: 40
4933 */
4934
4935 int16_t pwr_scale;
4936/*< Indirect lower boundary of the noise level estimate.
4937 * Byte offset: 42
4938 */
4939
4940 int16_t hangover_max;
4941/*< Avoids mid-speech clipping and reliably detects weak speech
4942 * bursts at the end of speech activity.
4943 * Byte offset: 44
4944 */
4945
4946 int16_t alpha_snr;
4947/*< Controls responsiveness of the VAD.
4948 * Byte offset: 46
4949 */
4950
4951 int16_t snr_diff_max;
4952/*< Maximum SNR difference. Decreasing this parameter value may
4953 * help in making correct decisions during abrupt changes; however,
4954 * decreasing too much may increase false alarms during long
4955 * pauses/silences.
4956 * Byte offset: 48
4957 */
4958
4959 int16_t snr_diff_min;
4960/*< Minimum SNR difference. Decreasing this parameter value may
4961 * help in making correct decisions during abrupt changes; however,
4962 * decreasing too much may increase false alarms during long
4963 * pauses/silences.
4964 * Byte offset: 50
4965 */
4966
4967 int16_t init_length;
4968/*< Defines the number of frames for which a noise level
4969 * estimate is set to a fixed value.
4970 * Byte offset: 52
4971 */
4972
4973 int16_t max_val;
4974/*< Defines the upper limit of the noise level.
4975 * Byte offset: 54
4976 */
4977
4978 int16_t init_bound;
4979/*< Defines the initial bounding value for the noise level
4980 * estimate. This is used during the initial segment defined by the
4981 * init_length parameter.
4982 * Byte offset: 56
4983 */
4984
4985 int16_t reset_bound;
4986/*< Reset boundary for noise tracking.
4987 * Byte offset: 58
4988 */
4989
4990 int16_t avar_scale;
4991/*< Defines the bias factor in noise estimation.
4992 * Byte offset: 60
4993 */
4994
4995 int16_t sub_nc;
4996/*< Defines the window length for noise estimation.
4997 * Byte offset: 62
4998 */
4999
5000 int16_t spow_min;
5001/*< Defines the minimum signal power required to update the
5002 * boundaries for the noise floor estimate.
5003 * Byte offset: 64
5004 */
5005
5006 int16_t eans_gs_fast;
5007/*< Fast smoothing factor for postprocessor gain.
5008 * Byte offset: 66
5009 */
5010
5011 int16_t eans_gs_med;
5012/*< Medium smoothing factor for postprocessor gain.
5013 * Byte offset: 68
5014 */
5015
5016 int16_t eans_gs_slow;
5017/*< Slow smoothing factor for postprocessor gain.
5018 * Byte offset: 70
5019 */
5020
5021 int16_t eans_swb_salpha;
5022/*< Q3.12 super wideband aggressiveness factor for stationary
5023 * noise suppression.
5024 * Byte offset: 72
5025 */
5026
5027 int16_t eans_swb_nalpha;
5028/*< Q3.12 super wideband aggressiveness factor for
5029 * nonstationary noise suppression.
5030 * Byte offset: 74
5031 */
5032} __packed;
5033#define ADM_MODULE_IDX_MIC_GAIN_CTRL 0x00010C35
5034
5035/* @addtogroup audio_pp_param_ids
5036 * ID of the Tx mic gain control parameter used by the
5037 * #ADM_MODULE_IDX_MIC_GAIN_CTRL module.
5038 * @messagepayload
5039 * @structure{admx_mic_gain}
5040 * @tablespace
5041 * @inputtable{Audio_Postproc_ADM_PARAM_IDX_MIC_GAIN.tex}
5042 */
5043#define ADM_PARAM_IDX_MIC_GAIN 0x00010C36
5044
5045/* Structure for a Tx mic gain parameter for the mic gain
5046 * control module.
5047 */
5048
5049
5050/* @brief Payload of the #ADM_PARAM_IDX_MIC_GAIN parameter in the
5051 * Tx Mic Gain Control module.
5052 */
5053struct admx_mic_gain {
5054 uint16_t tx_mic_gain;
5055 /*< Linear gain in Q13 format. */
5056
5057 uint16_t reserved;
5058 /*< Clients must set this field to zero. */
5059} __packed;
5060
5061/* end_addtogroup audio_pp_param_ids */
5062
5063/* @ingroup audio_pp_module_ids
5064 * ID of the Rx Codec Gain Control module.
5065 *
5066 * This module supports the following parameter ID:
5067 * - #ADM_PARAM_ID_RX_CODEC_GAIN
5068 */
5069#define ADM_MODULE_ID_RX_CODEC_GAIN_CTRL 0x00010C37
5070
5071/* @addtogroup audio_pp_param_ids
5072 * ID of the Rx codec gain control parameter used by the
5073 * #ADM_MODULE_ID_RX_CODEC_GAIN_CTRL module.
5074 *
5075 * @messagepayload
5076 * @structure{adm_rx_codec_gain}
5077 * @tablespace
5078 * @inputtable{Audio_Postproc_ADM_PARAM_ID_RX_CODEC_GAIN.tex}
5079*/
5080#define ADM_PARAM_ID_RX_CODEC_GAIN 0x00010C38
5081
5082/* Structure for the Rx common codec gain control module. */
5083
5084
5085/* @brief Payload of the #ADM_PARAM_ID_RX_CODEC_GAIN parameter
5086 * in the Rx Codec Gain Control module.
5087 */
5088
5089
5090struct adm_rx_codec_gain {
5091 uint16_t rx_codec_gain;
5092 /*< Linear gain in Q13 format. */
5093
5094 uint16_t reserved;
5095 /*< Clients must set this field to zero.*/
5096} __packed;
5097
5098/* end_addtogroup audio_pp_param_ids */
5099
5100/* @ingroup audio_pp_module_ids
5101 * ID of the HPF Tuning Filter module on the Tx path.
5102 * This module supports the following parameter IDs:
5103 * - #ADM_PARAM_ID_HPF_IIRX_FILTER_ENABLE_CONFIG
5104 * - #ADM_PARAM_ID_HPF_IIRX_FILTER_PRE_GAIN
5105 * - #ADM_PARAM_ID_HPF_IIRX_FILTER_CONFIG_PARAMS
5106 */
5107#define ADM_MODULE_ID_HPF_IIRX_FILTER 0x00010C3D
5108
5109/* @addtogroup audio_pp_param_ids */
5110/* ID of the Tx HPF IIR filter enable parameter used by the
5111 * #ADM_MODULE_ID_HPF_IIRX_FILTER module.
5112 * @parspace Message payload
5113 * @structure{adm_hpfx_iir_filter_enable_cfg}
5114 * @tablespace
5115 * @inputtable{Audio_Postproc_ADM_PARAM_ID_HPF_IIRX_FILTER_ENABLE_CONFIG.tex}
5116 */
5117#define ADM_PARAM_ID_HPF_IIRX_FILTER_ENABLE_CONFIG 0x00010C3E
5118
5119/* ID of the Tx HPF IIR filter pregain parameter used by the
5120 * #ADM_MODULE_ID_HPF_IIRX_FILTER module.
5121 * @parspace Message payload
5122 * @structure{adm_hpfx_iir_filter_pre_gain}
5123 * @tablespace
5124 * @inputtable{Audio_Postproc_ADM_PARAM_ID_HPF_IIRX_FILTER_PRE_GAIN.tex}
5125 */
5126#define ADM_PARAM_ID_HPF_IIRX_FILTER_PRE_GAIN 0x00010C3F
5127
5128/* ID of the Tx HPF IIR filter configuration parameters used by the
5129 * #ADM_MODULE_ID_HPF_IIRX_FILTER module.
5130 * @parspace Message payload
5131 * @structure{adm_hpfx_iir_filter_cfg_params}
5132 * @tablespace
5133 * @inputtable{Audio_Postproc_ADM_PARAM_ID_HPF_IIRX_FILTER_CONFIG_PA
5134 * RAMS.tex}
5135 */
5136#define ADM_PARAM_ID_HPF_IIRX_FILTER_CONFIG_PARAMS 0x00010C40
5137
5138/* Structure for enabling a configuration parameter for
5139 * the HPF IIR tuning filter module on the Tx path.
5140 */
5141
5142/* @brief Payload of the #ADM_PARAM_ID_HPF_IIRX_FILTER_ENABLE_CONFIG
5143 * parameter in the Tx path HPF Tuning Filter module.
5144 */
5145struct adm_hpfx_iir_filter_enable_cfg {
5146 uint32_t enable_flag;
5147/*< Specifies whether the HPF tuning filter is disabled (0) or
5148 * enabled (nonzero).
5149 */
5150} __packed;
5151
5152
5153/* Structure for the pregain parameter for the HPF
5154 IIR tuning filter module on the Tx path. */
5155
5156
5157/* @brief Payload of the #ADM_PARAM_ID_HPF_IIRX_FILTER_PRE_GAIN parameter
5158 * in the Tx path HPF Tuning Filter module.
5159 */
5160struct adm_hpfx_iir_filter_pre_gain {
5161 uint16_t pre_gain;
5162 /*< Linear gain in Q13 format. */
5163
5164 uint16_t reserved;
5165 /*< Clients must set this field to zero.*/
5166} __packed;
5167
5168
5169/* Structure for the configuration parameter for the
5170 HPF IIR tuning filter module on the Tx path. */
5171
5172
5173/* @brief Payload of the #ADM_PARAM_ID_HPF_IIRX_FILTER_CONFIG_PARAMS
5174 * parameters in the Tx path HPF Tuning Filter module. \n
5175 * \n
5176 * This structure is followed by tuning filter coefficients as follows: \n
5177 * - Sequence of int32_t FilterCoeffs.
5178 * Each band has five coefficients, each in int32_t format in the order of
5179 * b0, b1, b2, a1, a2.
5180 * - Sequence of int16_t NumShiftFactor.
5181 * One int16_t per band. The numerator shift factor is related to the Q
5182 * factor of the filter coefficients.
5183 * - Sequence of uint16_t PanSetting.
5184 * One uint16_t for each band to indicate application of the filter to
5185 * left (0), right (1), or both (2) channels.
5186 */
5187struct adm_hpfx_iir_filter_cfg_params {
5188 uint16_t num_biquad_stages;
5189/*< Number of bands.
5190 * Supported values: 0 to 20
5191 */
5192
5193 uint16_t reserved;
5194 /*< Clients must set this field to zero.*/
5195} __packed;
5196
5197/* end_addtogroup audio_pp_module_ids */
5198
5199/* @addtogroup audio_pp_module_ids */
5200/* ID of the Tx path IIR Tuning Filter module.
5201 * This module supports the following parameter IDs:
5202 * - #ADM_PARAM_IDX_IIR_FILTER_ENABLE_CONFIG
5203 */
5204#define ADM_MODULE_IDX_IIR_FILTER 0x00010C41
5205
5206/* ID of the Rx path IIR Tuning Filter module for the left channel.
5207 * The parameter IDs of the IIR tuning filter module
5208 * (#ASM_MODULE_ID_IIRUNING_FILTER) are used for the left IIR Rx tuning
5209 * filter.
5210 *
5211 * Pan parameters are not required for this per-channel IIR filter; the pan
5212 * parameters are ignored by this module.
5213 */
5214#define ADM_MODULE_ID_LEFT_IIRUNING_FILTER 0x00010705
5215
5216/* ID of the the Rx path IIR Tuning Filter module for the right
5217 * channel.
5218 * The parameter IDs of the IIR tuning filter module
5219 * (#ASM_MODULE_ID_IIRUNING_FILTER) are used for the right IIR Rx
5220 * tuning filter.
5221 *
5222 * Pan parameters are not required for this per-channel IIR filter;
5223 * the pan parameters are ignored by this module.
5224 */
5225#define ADM_MODULE_ID_RIGHT_IIRUNING_FILTER 0x00010706
5226
5227/* end_addtogroup audio_pp_module_ids */
5228
5229/* @addtogroup audio_pp_param_ids */
5230
5231/* ID of the Tx IIR filter enable parameter used by the
5232 * #ADM_MODULE_IDX_IIR_FILTER module.
5233 * @parspace Message payload
5234 * @structure{admx_iir_filter_enable_cfg}
5235 * @tablespace
5236 * @inputtable{Audio_Postproc_ADM_PARAM_IDX_IIR_FILTER_ENABLE_CONFIG.tex}
5237 */
5238#define ADM_PARAM_IDX_IIR_FILTER_ENABLE_CONFIG 0x00010C42
5239
5240/* ID of the Tx IIR filter pregain parameter used by the
5241 * #ADM_MODULE_IDX_IIR_FILTER module.
5242 * @parspace Message payload
5243 * @structure{admx_iir_filter_pre_gain}
5244 * @tablespace
5245 * @inputtable{Audio_Postproc_ADM_PARAM_IDX_IIR_FILTER_PRE_GAIN.tex}
5246 */
5247#define ADM_PARAM_IDX_IIR_FILTER_PRE_GAIN 0x00010C43
5248
5249/* ID of the Tx IIR filter configuration parameters used by the
5250 * #ADM_MODULE_IDX_IIR_FILTER module.
5251 * @parspace Message payload
5252 * @structure{admx_iir_filter_cfg_params}
5253 * @tablespace
5254 * @inputtable{Audio_Postproc_ADM_PARAM_IDX_IIR_FILTER_CONFIG_PARAMS.tex}
5255 */
5256#define ADM_PARAM_IDX_IIR_FILTER_CONFIG_PARAMS 0x00010C44
5257
5258/* Structure for enabling the configuration parameter for the
5259 * IIR filter module on the Tx path.
5260 */
5261
5262/* @brief Payload of the #ADM_PARAM_IDX_IIR_FILTER_ENABLE_CONFIG
5263 * parameter in the Tx Path IIR Tuning Filter module.
5264 */
5265
5266struct admx_iir_filter_enable_cfg {
5267 uint32_t enable_flag;
5268/*< Specifies whether the IIR tuning filter is disabled (0) or
5269 * enabled (nonzero).
5270 */
5271
5272} __packed;
5273
5274
5275/* Structure for the pregain parameter for the
5276 * IIR filter module on the Tx path.
5277 */
5278
5279
5280/* @brief Payload of the #ADM_PARAM_IDX_IIR_FILTER_PRE_GAIN
5281 * parameter in the Tx Path IIR Tuning Filter module.
5282 */
5283
5284struct admx_iir_filter_pre_gain {
5285 uint16_t pre_gain;
5286 /*< Linear gain in Q13 format. */
5287
5288 uint16_t reserved;
5289 /*< Clients must set this field to zero.*/
5290} __packed;
5291
5292
5293/* Structure for the configuration parameter for the
5294 * IIR filter module on the Tx path.
5295 */
5296
5297
5298/* @brief Payload of the #ADM_PARAM_IDX_IIR_FILTER_CONFIG_PARAMS
5299 * parameter in the Tx Path IIR Tuning Filter module. \n
5300 * \n
5301 * This structure is followed by the HPF IIR filter coefficients on
5302 * the Tx path as follows: \n
5303 * - Sequence of int32_t ulFilterCoeffs. Each band has five
5304 * coefficients, each in int32_t format in the order of b0, b1, b2,
5305 * a1, a2.
5306 * - Sequence of int16_t sNumShiftFactor. One int16_t per band. The
5307 * numerator shift factor is related to the Q factor of the filter
5308 * coefficients.
5309 * - Sequence of uint16_t usPanSetting. One uint16_t for each band
5310 * to indicate if the filter is applied to left (0), right (1), or
5311 * both (2) channels.
5312 */
5313struct admx_iir_filter_cfg_params {
5314 uint16_t num_biquad_stages;
5315/*< Number of bands.
5316 * Supported values: 0 to 20
5317 */
5318
5319 uint16_t reserved;
5320 /*< Clients must set this field to zero.*/
5321} __packed;
5322
5323/* end_addtogroup audio_pp_module_ids */
5324
5325/* @ingroup audio_pp_module_ids
5326 * ID of the QEnsemble module.
5327 * This module supports the following parameter IDs:
5328 * - #ADM_PARAM_ID_QENSEMBLE_ENABLE
5329 * - #ADM_PARAM_ID_QENSEMBLE_BACKGAIN
5330 * - #ADM_PARAM_ID_QENSEMBLE_SET_NEW_ANGLE
5331 */
5332#define ADM_MODULE_ID_QENSEMBLE 0x00010C59
5333
5334/* @addtogroup audio_pp_param_ids */
5335/* ID of the QEnsemble enable parameter used by the
5336 * #ADM_MODULE_ID_QENSEMBLE module.
5337 * @messagepayload
5338 * @structure{adm_qensemble_enable}
5339 * @tablespace
5340 * @inputtable{Audio_Postproc_ADM_PARAM_ID_QENSEMBLE_ENABLE.tex}
5341 */
5342#define ADM_PARAM_ID_QENSEMBLE_ENABLE 0x00010C60
5343
5344/* ID of the QEnsemble back gain parameter used by the
5345 * #ADM_MODULE_ID_QENSEMBLE module.
5346 * @messagepayload
5347 * @structure{adm_qensemble_param_backgain}
5348 * @tablespace
5349 * @inputtable{Audio_Postproc_ADM_PARAM_ID_QENSEMBLE_BACKGAIN.tex}
5350 */
5351#define ADM_PARAM_ID_QENSEMBLE_BACKGAIN 0x00010C61
5352
5353/* ID of the QEnsemble new angle parameter used by the
5354 * #ADM_MODULE_ID_QENSEMBLE module.
5355 * @messagepayload
5356 * @structure{adm_qensemble_param_set_new_angle}
5357 * @tablespace
5358 * @inputtable{Audio_Postproc_ADM_PARAM_ID_QENSEMBLE_SET_NEW_ANGLE.tex}
5359 */
5360#define ADM_PARAM_ID_QENSEMBLE_SET_NEW_ANGLE 0x00010C62
5361
5362/* Structure for enabling the configuration parameter for the
5363 * QEnsemble module.
5364 */
5365
5366
5367/* @brief Payload of the #ADM_PARAM_ID_QENSEMBLE_ENABLE
5368 * parameter used by the QEnsemble module.
5369 */
5370struct adm_qensemble_enable {
5371 uint32_t enable_flag;
5372/*< Specifies whether the QEnsemble module is disabled (0) or enabled
5373 * (nonzero).
5374 */
5375} __packed;
5376
5377
5378/* Structure for the background gain for the QEnsemble module. */
5379
5380
5381/* @brief Payload of the #ADM_PARAM_ID_QENSEMBLE_BACKGAIN
5382 * parameter used by
5383 * the QEnsemble module.
5384 */
5385struct adm_qensemble_param_backgain {
5386 int16_t back_gain;
5387/*< Linear gain in Q15 format.
5388 * Supported values: 0 to 32767
5389 */
5390
5391 uint16_t reserved;
5392 /*< Clients must set this field to zero.*/
5393} __packed;
5394/* Structure for setting a new angle for the QEnsemble module. */
5395
5396
5397/* @brief Payload of the #ADM_PARAM_ID_QENSEMBLE_SET_NEW_ANGLE
5398 * parameter used
5399 * by the QEnsemble module.
5400 */
5401struct adm_qensemble_param_set_new_angle {
5402 int16_t new_angle;
5403/*< New angle in degrees.
5404 * Supported values: 0 to 359
5405 */
5406
5407 int16_t time_ms;
5408/*< Transition time in milliseconds to set the new angle.
5409 * Supported values: 0 to 32767
5410 */
5411} __packed;
5412
5413/* end_addtogroup audio_pp_module_ids */
5414
5415/* @ingroup audio_pp_module_ids
5416 * ID of the Volume Control module pre/postprocessing block.
5417 * This module supports the following parameter IDs:
5418 * - #ASM_PARAM_ID_VOL_CTRL_MASTER_GAIN
5419 * - #ASM_PARAM_ID_VOL_CTRL_LR_CHANNEL_GAIN
5420 * - #ASM_PARAM_ID_VOL_CTRL_MUTE_CONFIG
5421 * - #ASM_PARAM_ID_SOFT_VOL_STEPPING_PARAMETERS
5422 * - #ASM_PARAM_ID_SOFT_PAUSE_PARAMETERS
5423 * - #ASM_PARAM_ID_MULTICHANNEL_GAIN
5424 * - #ASM_PARAM_ID_MULTICHANNEL_MUTE
5425 */
5426#define ASM_MODULE_ID_VOL_CTRL 0x00010BFE
5427
5428/* @addtogroup audio_pp_param_ids */
5429/* ID of the master gain parameter used by the #ASM_MODULE_ID_VOL_CTRL
5430 * module.
5431 * @messagepayload
5432 * @structure{asm_volume_ctrl_master_gain}
5433 * @tablespace
5434 * @inputtable{Audio_Postproc_ASM_PARAM_ID_VOL_CTRL_MASTER_GAIN.tex}
5435 */
5436#define ASM_PARAM_ID_VOL_CTRL_MASTER_GAIN 0x00010BFF
5437
5438/* ID of the left/right channel gain parameter used by the
5439 * #ASM_MODULE_ID_VOL_CTRL module.
5440 * @messagepayload
5441 * @structure{asm_volume_ctrl_lr_chan_gain}
5442 * @tablespace
5443 * @inputtable{Audio_Postproc_ASM_PARAM_ID_VOL_CTRL_LR_CHANNEL_GAIN.tex}
5444 */
5445#define ASM_PARAM_ID_VOL_CTRL_LR_CHANNEL_GAIN 0x00010C00
5446
5447/* ID of the mute configuration parameter used by the
5448 * #ASM_MODULE_ID_VOL_CTRL module.
5449 * @messagepayload
5450 * @structure{asm_volume_ctrl_mute_config}
5451 * @tablespace
5452 * @inputtable{Audio_Postproc_ASM_PARAM_ID_VOL_CTRL_MUTE_CONFIG.tex}
5453 */
5454#define ASM_PARAM_ID_VOL_CTRL_MUTE_CONFIG 0x00010C01
5455
5456/* ID of the soft stepping volume parameters used by the
5457 * #ASM_MODULE_ID_VOL_CTRL module.
5458 * @messagepayload
5459 * @structure{asm_soft_step_volume_params}
5460 * @tablespace
5461 * @inputtable{Audio_Postproc_ASM_PARAM_ID_SOFT_VOL_STEPPING_PARAMET
5462 * ERS.tex}
5463 */
5464#define ASM_PARAM_ID_SOFT_VOL_STEPPING_PARAMETERS 0x00010C29
5465
5466/* ID of the soft pause parameters used by the #ASM_MODULE_ID_VOL_CTRL
5467 * module.
5468 */
5469#define ASM_PARAM_ID_SOFT_PAUSE_PARAMETERS 0x00010D6A
5470
5471/* ID of the multiple-channel volume control parameters used by the
5472 * #ASM_MODULE_ID_VOL_CTRL module.
5473 */
5474#define ASM_PARAM_ID_MULTICHANNEL_GAIN 0x00010713
5475
5476/* ID of the multiple-channel mute configuration parameters used by the
5477 * #ASM_MODULE_ID_VOL_CTRL module.
5478 */
5479
5480#define ASM_PARAM_ID_MULTICHANNEL_MUTE 0x00010714
5481
5482/* Structure for the master gain parameter for a volume control
5483 * module.
5484 */
5485
5486
5487/* @brief Payload of the #ASM_PARAM_ID_VOL_CTRL_MASTER_GAIN
5488 * parameter used by the Volume Control module.
5489 */
5490
5491
5492
5493struct asm_volume_ctrl_master_gain {
5494 struct apr_hdr hdr;
5495 struct asm_stream_cmd_set_pp_params_v2 param;
5496 struct asm_stream_param_data_v2 data;
5497 uint16_t master_gain;
5498 /*< Linear gain in Q13 format. */
5499
5500 uint16_t reserved;
5501 /*< Clients must set this field to zero.
5502 */
5503} __packed;
5504
5505
5506/* Structure for the left/right channel gain parameter for a
5507 * volume control module.
5508 */
5509
5510
5511/* @brief Payload of the #ASM_PARAM_ID_VOL_CTRL_LR_CHANNEL_GAIN
5512 * parameters used by the Volume Control module.
5513 */
5514
5515
5516
5517struct asm_volume_ctrl_lr_chan_gain {
5518 struct apr_hdr hdr;
5519 struct asm_stream_cmd_set_pp_params_v2 param;
5520 struct asm_stream_param_data_v2 data;
5521
5522 uint16_t l_chan_gain;
5523 /*< Linear gain in Q13 format for the left channel. */
5524
5525 uint16_t r_chan_gain;
5526 /*< Linear gain in Q13 format for the right channel.*/
5527} __packed;
5528
5529
5530/* Structure for the mute configuration parameter for a
5531 volume control module. */
5532
5533
5534/* @brief Payload of the #ASM_PARAM_ID_VOL_CTRL_MUTE_CONFIG
5535 * parameter used by the Volume Control module.
5536 */
5537
5538
5539struct asm_volume_ctrl_mute_config {
5540 struct apr_hdr hdr;
5541 struct asm_stream_cmd_set_pp_params_v2 param;
5542 struct asm_stream_param_data_v2 data;
5543 uint32_t mute_flag;
5544/*< Specifies whether mute is disabled (0) or enabled (nonzero).*/
5545
5546} __packed;
5547
5548/*
5549 * Supported parameters for a soft stepping linear ramping curve.
5550 */
5551#define ASM_PARAM_SVC_RAMPINGCURVE_LINEAR 0
5552
5553/*
5554 * Exponential ramping curve.
5555 */
5556#define ASM_PARAM_SVC_RAMPINGCURVE_EXP 1
5557
5558/*
5559 * Logarithmic ramping curve.
5560 */
5561#define ASM_PARAM_SVC_RAMPINGCURVE_LOG 2
5562
5563/* Structure for holding soft stepping volume parameters. */
5564
5565
5566/* Payload of the #ASM_PARAM_ID_SOFT_VOL_STEPPING_PARAMETERS
5567 * parameters used by the Volume Control module.
5568 */
5569struct asm_soft_step_volume_params {
5570 struct apr_hdr hdr;
5571 struct asm_stream_cmd_set_pp_params_v2 param;
5572 struct asm_stream_param_data_v2 data;
5573 uint32_t period;
5574/*< Period in milliseconds.
5575 * Supported values: 0 to 15000
5576 */
5577
5578 uint32_t step;
5579/*< Step in microseconds.
5580 * Supported values: 0 to 15000000
5581 */
5582
5583 uint32_t ramping_curve;
5584/*< Ramping curve type.
5585 * Supported values:
5586 * - #ASM_PARAM_SVC_RAMPINGCURVE_LINEAR
5587 * - #ASM_PARAM_SVC_RAMPINGCURVE_EXP
5588 * - #ASM_PARAM_SVC_RAMPINGCURVE_LOG
5589 */
5590} __packed;
5591
5592
5593/* Structure for holding soft pause parameters. */
5594
5595
5596/* Payload of the #ASM_PARAM_ID_SOFT_PAUSE_PARAMETERS
5597 * parameters used by the Volume Control module.
5598 */
5599
5600
5601struct asm_soft_pause_params {
5602 struct apr_hdr hdr;
5603 struct asm_stream_cmd_set_pp_params_v2 param;
5604 struct asm_stream_param_data_v2 data;
5605 uint32_t enable_flag;
5606/*< Specifies whether soft pause is disabled (0) or enabled
5607 * (nonzero).
5608 */
5609
5610
5611
5612 uint32_t period;
5613/*< Period in milliseconds.
5614 * Supported values: 0 to 15000
5615 */
5616
5617 uint32_t step;
5618/*< Step in microseconds.
5619 * Supported values: 0 to 15000000
5620 */
5621
5622 uint32_t ramping_curve;
5623/*< Ramping curve.
5624 * Supported values:
5625 * - #ASM_PARAM_SVC_RAMPINGCURVE_LINEAR
5626 * - #ASM_PARAM_SVC_RAMPINGCURVE_EXP
5627 * - #ASM_PARAM_SVC_RAMPINGCURVE_LOG
5628 */
5629} __packed;
5630
5631
5632/* Maximum number of channels.*/
5633#define VOLUME_CONTROL_MAX_CHANNELS 8
5634
5635/* Structure for holding one channel type - gain pair. */
5636
5637
5638/* Payload of the #ASM_PARAM_ID_MULTICHANNEL_GAIN channel
5639 * type/gain pairs used by the Volume Control module. \n \n This
5640 * structure immediately follows the
5641 * asm_volume_ctrl_multichannel_gain structure.
5642 */
5643
5644
5645struct asm_volume_ctrl_channelype_gain_pair {
5646 struct apr_hdr hdr;
5647 struct asm_stream_cmd_set_pp_params_v2 param;
5648 struct asm_stream_param_data_v2 data;
5649 uint8_t channelype;
5650/*< Channel type for which the gain setting is to be applied.
5651 * Supported values:
5652 * - #PCM_CHANNEL_L
5653 * - #PCM_CHANNEL_R
5654 * - #PCM_CHANNEL_C
5655 * - #PCM_CHANNEL_LS
5656 * - #PCM_CHANNEL_RS
5657 * - #PCM_CHANNEL_LFE
5658 * - #PCM_CHANNEL_CS
5659 * - #PCM_CHANNEL_LB
5660 * - #PCM_CHANNEL_RB
5661 * - #PCM_CHANNELS
5662 * - #PCM_CHANNEL_CVH
5663 * - #PCM_CHANNEL_MS
5664 * - #PCM_CHANNEL_FLC
5665 * - #PCM_CHANNEL_FRC
5666 * - #PCM_CHANNEL_RLC
5667 * - #PCM_CHANNEL_RRC
5668 */
5669
5670 uint8_t reserved1;
5671 /*< Clients must set this field to zero. */
5672
5673 uint8_t reserved2;
5674 /*< Clients must set this field to zero. */
5675
5676 uint8_t reserved3;
5677 /*< Clients must set this field to zero. */
5678
5679 uint32_t gain;
5680/*< Gain value for this channel in Q28 format.
5681 * Supported values: Any
5682 */
5683} __packed;
5684
5685
5686/* Structure for the multichannel gain command */
5687
5688
5689/* Payload of the #ASM_PARAM_ID_MULTICHANNEL_GAIN
5690 * parameters used by the Volume Control module.
5691 */
5692
5693
5694struct asm_volume_ctrl_multichannel_gain {
5695 struct apr_hdr hdr;
5696 struct asm_stream_cmd_set_pp_params_v2 param;
5697 struct asm_stream_param_data_v2 data;
5698 uint32_t num_channels;
5699/*< Number of channels for which gain values are provided. Any
5700 * channels present in the data for which gain is not provided are
5701 * set to unity gain.
5702 * Supported values: 1 to 8
5703 */
5704
5705
5706 struct asm_volume_ctrl_channelype_gain_pair
5707 gain_data[VOLUME_CONTROL_MAX_CHANNELS];
5708 /*< Array of channel type/gain pairs.*/
5709} __packed;
5710
5711
5712/* Structure for holding one channel type - mute pair. */
5713
5714
5715/* Payload of the #ASM_PARAM_ID_MULTICHANNEL_MUTE channel
5716 * type/mute setting pairs used by the Volume Control module. \n \n
5717 * This structure immediately follows the
5718 * asm_volume_ctrl_multichannel_mute structure.
5719 */
5720
5721
5722struct asm_volume_ctrl_channelype_mute_pair {
5723 struct apr_hdr hdr;
5724 struct asm_stream_cmd_set_pp_params_v2 param;
5725 struct asm_stream_param_data_v2 data;
5726 uint8_t channelype;
5727/*< Channel type for which the mute setting is to be applied.
5728 * Supported values:
5729 * - #PCM_CHANNEL_L
5730 * - #PCM_CHANNEL_R
5731 * - #PCM_CHANNEL_C
5732 * - #PCM_CHANNEL_LS
5733 * - #PCM_CHANNEL_RS
5734 * - #PCM_CHANNEL_LFE
5735 * - #PCM_CHANNEL_CS
5736 * - #PCM_CHANNEL_LB
5737 * - #PCM_CHANNEL_RB
5738 * - #PCM_CHANNELS
5739 * - #PCM_CHANNEL_CVH
5740 * - #PCM_CHANNEL_MS
5741 * - #PCM_CHANNEL_FLC
5742 * - #PCM_CHANNEL_FRC
5743 * - #PCM_CHANNEL_RLC
5744 * - #PCM_CHANNEL_RRC
5745 */
5746
5747 uint8_t reserved1;
5748 /*< Clients must set this field to zero. */
5749
5750 uint8_t reserved2;
5751 /*< Clients must set this field to zero. */
5752
5753 uint8_t reserved3;
5754 /*< Clients must set this field to zero. */
5755
5756 uint32_t mute;
5757/*< Mute setting for this channel.
5758 * Supported values:
5759 * - 0 = Unmute
5760 * - Nonzero = Mute
5761 */
5762} __packed;
5763
5764
5765/* Structure for the multichannel mute command */
5766
5767
5768/* @brief Payload of the #ASM_PARAM_ID_MULTICHANNEL_MUTE
5769 * parameters used by the Volume Control module.
5770 */
5771
5772
5773struct asm_volume_ctrl_multichannel_mute {
5774 struct apr_hdr hdr;
5775 struct asm_stream_cmd_set_pp_params_v2 param;
5776 struct asm_stream_param_data_v2 data;
5777 uint32_t num_channels;
5778/*< Number of channels for which mute configuration is
5779 * provided. Any channels present in the data for which mute
5780 * configuration is not provided are set to unmute.
5781 * Supported values: 1 to 8
5782 */
5783
5784struct asm_volume_ctrl_channelype_mute_pair
5785 mute_data[VOLUME_CONTROL_MAX_CHANNELS];
5786 /*< Array of channel type/mute setting pairs.*/
5787} __packed;
5788/* end_addtogroup audio_pp_param_ids */
5789
5790/* audio_pp_module_ids
5791 * ID of the IIR Tuning Filter module.
5792 * This module supports the following parameter IDs:
5793 * - #ASM_PARAM_ID_IIRUNING_FILTER_ENABLE_CONFIG
5794 * - #ASM_PARAM_ID_IIRUNING_FILTER_PRE_GAIN
5795 * - #ASM_PARAM_ID_IIRUNING_FILTER_CONFIG_PARAMS
5796 */
5797#define ASM_MODULE_ID_IIRUNING_FILTER 0x00010C02
5798
5799/* @addtogroup audio_pp_param_ids */
5800/* ID of the IIR tuning filter enable parameter used by the
5801 * #ASM_MODULE_ID_IIRUNING_FILTER module.
5802 * @messagepayload
5803 * @structure{asm_iiruning_filter_enable}
5804 * @tablespace
5805 * @inputtable{Audio_Postproc_ASM_PARAM_ID_IIRUNING_FILTER_ENABLE_CO
5806 * NFIG.tex}
5807 */
5808#define ASM_PARAM_ID_IIRUNING_FILTER_ENABLE_CONFIG 0x00010C03
5809
5810/* ID of the IIR tuning filter pregain parameter used by the
5811 * #ASM_MODULE_ID_IIRUNING_FILTER module.
5812 */
5813#define ASM_PARAM_ID_IIRUNING_FILTER_PRE_GAIN 0x00010C04
5814
5815/* ID of the IIR tuning filter configuration parameters used by the
5816 * #ASM_MODULE_ID_IIRUNING_FILTER module.
5817 */
5818#define ASM_PARAM_ID_IIRUNING_FILTER_CONFIG_PARAMS 0x00010C05
5819
5820/* Structure for an enable configuration parameter for an
5821 * IIR tuning filter module.
5822 */
5823
5824
5825/* @brief Payload of the #ASM_PARAM_ID_IIRUNING_FILTER_ENABLE_CONFIG
5826 * parameter used by the IIR Tuning Filter module.
5827 */
5828struct asm_iiruning_filter_enable {
5829 uint32_t enable_flag;
5830/*< Specifies whether the IIR tuning filter is disabled (0) or
5831 * enabled (1).
5832 */
5833} __packed;
5834
5835/* Structure for the pregain parameter for an IIR tuning filter module. */
5836
5837
5838/* Payload of the #ASM_PARAM_ID_IIRUNING_FILTER_PRE_GAIN
5839 * parameters used by the IIR Tuning Filter module.
5840 */
5841struct asm_iiruning_filter_pregain {
5842 uint16_t pregain;
5843 /*< Linear gain in Q13 format. */
5844
5845 uint16_t reserved;
5846 /*< Clients must set this field to zero.*/
5847} __packed;
5848
5849/* Structure for the configuration parameter for an IIR tuning filter
5850 * module.
5851 */
5852
5853
5854/* @brief Payload of the #ASM_PARAM_ID_IIRUNING_FILTER_CONFIG_PARAMS
5855 * parameters used by the IIR Tuning Filter module. \n
5856 * \n
5857 * This structure is followed by the IIR filter coefficients: \n
5858 * - Sequence of int32_t FilterCoeffs \n
5859 * Five coefficients for each band. Each coefficient is in int32_t format, in
5860 * the order of b0, b1, b2, a1, a2.
5861 * - Sequence of int16_t NumShiftFactor \n
5862 * One int16_t per band. The numerator shift factor is related to the Q
5863 * factor of the filter coefficients.
5864 * - Sequence of uint16_t PanSetting \n
5865 * One uint16_t per band, indicating if the filter is applied to left (0),
5866 * right (1), or both (2) channels.
5867 */
5868struct asm_iir_filter_config_params {
5869 uint16_t num_biquad_stages;
5870/*< Number of bands.
5871 * Supported values: 0 to 20
5872 */
5873
5874 uint16_t reserved;
5875 /*< Clients must set this field to zero.*/
5876} __packed;
5877
5878/* audio_pp_module_ids
5879 * ID of the Multiband Dynamic Range Control (MBDRC) module on the Tx/Rx
5880 * paths.
5881 * This module supports the following parameter IDs:
5882 * - #ASM_PARAM_ID_MBDRC_ENABLE
5883 * - #ASM_PARAM_ID_MBDRC_CONFIG_PARAMS
5884 */
5885#define ASM_MODULE_ID_MBDRC 0x00010C06
5886
5887/* audio_pp_param_ids */
5888/* ID of the MBDRC enable parameter used by the #ASM_MODULE_ID_MBDRC module.
5889 * @messagepayload
5890 * @structure{asm_mbdrc_enable}
5891 * @tablespace
5892 * @inputtable{Audio_Postproc_ASM_PARAM_ID_MBDRC_ENABLE.tex}
5893 */
5894#define ASM_PARAM_ID_MBDRC_ENABLE 0x00010C07
5895
5896/* ID of the MBDRC configuration parameters used by the
5897 * #ASM_MODULE_ID_MBDRC module.
5898 * @messagepayload
5899 * @structure{asm_mbdrc_config_params}
5900 * @tablespace
5901 * @inputtable{Audio_Postproc_ASM_PARAM_ID_MBDRC_CONFIG_PARAMS.tex}
5902 *
5903 * @parspace Sub-band DRC configuration parameters
5904 * @structure{asm_subband_drc_config_params}
5905 * @tablespace
5906 * @inputtable{Audio_Postproc_ASM_PARAM_ID_MBDRC_CONFIG_PARAMS_subband_DRC.tex}
5907 *
5908 * @keep{6}
5909 * To obtain legacy ADRC from MBDRC, use the calibration tool to:
5910 *
5911 * - Enable MBDRC (EnableFlag = TRUE)
5912 * - Set number of bands to 1 (uiNumBands = 1)
5913 * - Enable the first MBDRC band (DrcMode[0] = DRC_ENABLED = 1)
5914 * - Clear the first band mute flag (MuteFlag[0] = 0)
5915 * - Set the first band makeup gain to unity (compMakeUpGain[0] = 0x2000)
5916 * - Use the legacy ADRC parameters to calibrate the rest of the MBDRC
5917 * parameters.
5918 */
5919#define ASM_PARAM_ID_MBDRC_CONFIG_PARAMS 0x00010C08
5920
5921/* end_addtogroup audio_pp_param_ids */
5922
5923/* audio_pp_module_ids
5924 * ID of the MMBDRC module version 2 pre/postprocessing block.
5925 * This module differs from the original MBDRC (#ASM_MODULE_ID_MBDRC) in
5926 * the length of the filters used in each sub-band.
5927 * This module supports the following parameter ID:
5928 * - #ASM_PARAM_ID_MBDRC_CONFIG_PARAMS_IMPROVED_FILTBANK_V2
5929 */
5930#define ASM_MODULE_ID_MBDRCV2 0x0001070B
5931
5932/* @addtogroup audio_pp_param_ids */
5933/* ID of the configuration parameters used by the
5934 * #ASM_MODULE_ID_MBDRCV2 module for the improved filter structure
5935 * of the MBDRC v2 pre/postprocessing block.
5936 * The update to this configuration structure from the original
5937 * MBDRC is the number of filter coefficients in the filter
5938 * structure. The sequence for is as follows:
5939 * - 1 band = 0 FIR coefficient + 1 mute flag + uint16_t padding
5940 * - 2 bands = 141 FIR coefficients + 2 mute flags + uint16_t padding
5941 * - 3 bands = 141+81 FIR coefficients + 3 mute flags + uint16_t padding
5942 * - 4 bands = 141+81+61 FIR coefficients + 4 mute flags + uint16_t
5943 * padding
5944 * - 5 bands = 141+81+61+61 FIR coefficients + 5 mute flags +
5945 * uint16_t padding
5946 * This block uses the same parameter structure as
5947 * #ASM_PARAM_ID_MBDRC_CONFIG_PARAMS.
5948 */
5949#define ASM_PARAM_ID_MBDRC_CONFIG_PARAMS_IMPROVED_FILTBANK_V2 \
5950 0x0001070C
5951
5952/* Structure for the enable parameter for an MBDRC module. */
5953
5954
5955/* Payload of the #ASM_PARAM_ID_MBDRC_ENABLE parameter used by the
5956 * MBDRC module.
5957 */
5958struct asm_mbdrc_enable {
5959 uint32_t enable_flag;
5960/*< Specifies whether MBDRC is disabled (0) or enabled (nonzero).*/
5961} __packed;
5962
5963/* Structure for the configuration parameters for an MBDRC module. */
5964
5965
5966/* Payload of the #ASM_PARAM_ID_MBDRC_CONFIG_PARAMS
5967 * parameters used by the MBDRC module. \n \n Following this
5968 * structure is the payload for sub-band DRC configuration
5969 * parameters (asm_subband_drc_config_params). This sub-band
5970 * structure must be repeated for each band.
5971 */
5972
5973
5974struct asm_mbdrc_config_params {
5975 uint16_t num_bands;
5976/*< Number of bands.
5977 * Supported values: 1 to 5
5978 */
5979
5980 int16_t limiterhreshold;
5981/*< Threshold in decibels for the limiter output.
5982 * Supported values: -72 to 18 \n
5983 * Recommended value: 3994 (-0.22 db in Q3.12 format)
5984 */
5985
5986 int16_t limiter_makeup_gain;
5987/*< Makeup gain in decibels for the limiter output.
5988 * Supported values: -42 to 42 \n
5989 * Recommended value: 256 (0 dB in Q7.8 format)
5990 */
5991
5992 int16_t limiter_gc;
5993/*< Limiter gain recovery coefficient.
5994 * Supported values: 0.5 to 0.99 \n
5995 * Recommended value: 32440 (0.99 in Q15 format)
5996 */
5997
5998 int16_t limiter_delay;
5999/*< Limiter delay in samples.
6000 * Supported values: 0 to 10 \n
6001 * Recommended value: 262 (0.008 samples in Q15 format)
6002 */
6003
6004 int16_t limiter_max_wait;
6005/*< Maximum limiter waiting time in samples.
6006 * Supported values: 0 to 10 \n
6007 * Recommended value: 262 (0.008 samples in Q15 format)
6008 */
6009} __packed;
6010
6011/* DRC configuration structure for each sub-band of an MBDRC module. */
6012
6013
6014/* Payload of the #ASM_PARAM_ID_MBDRC_CONFIG_PARAMS DRC
6015 * configuration parameters for each sub-band in the MBDRC module.
6016 * After this DRC structure is configured for valid bands, the next
6017 * MBDRC setparams expects the sequence of sub-band MBDRC filter
6018 * coefficients (the length depends on the number of bands) plus the
6019 * mute flag for that band plus uint16_t padding.
6020 *
6021 * @keep{10}
6022 * The filter coefficient and mute flag are of type int16_t:
6023 * - FIR coefficient = int16_t firFilter
6024 * - Mute flag = int16_t fMuteFlag
6025 *
6026 * The sequence is as follows:
6027 * - 1 band = 0 FIR coefficient + 1 mute flag + uint16_t padding
6028 * - 2 bands = 97 FIR coefficients + 2 mute flags + uint16_t padding
6029 * - 3 bands = 97+33 FIR coefficients + 3 mute flags + uint16_t padding
6030 * - 4 bands = 97+33+33 FIR coefficients + 4 mute flags + uint16_t padding
6031 * - 5 bands = 97+33+33+33 FIR coefficients + 5 mute flags + uint16_t padding
6032 *
6033 * For improved filterbank, the sequence is as follows:
6034 * - 1 band = 0 FIR coefficient + 1 mute flag + uint16_t padding
6035 * - 2 bands = 141 FIR coefficients + 2 mute flags + uint16_t padding
6036 * - 3 bands = 141+81 FIR coefficients + 3 mute flags + uint16_t padding
6037 * - 4 bands = 141+81+61 FIR coefficients + 4 mute flags + uint16_t padding
6038 * - 5 bands = 141+81+61+61 FIR coefficients + 5 mute flags + uint16_t padding
6039 */
6040struct asm_subband_drc_config_params {
6041 int16_t drc_stereo_linked_flag;
6042/*< Specifies whether all stereo channels have the same applied
6043 * dynamics (1) or if they process their dynamics independently (0).
6044 * Supported values:
6045 * - 0 -- Not linked
6046 * - 1 -- Linked
6047 */
6048
6049 int16_t drc_mode;
6050/*< Specifies whether DRC mode is bypassed for sub-bands.
6051 * Supported values:
6052 * - 0 -- Disabled
6053 * - 1 -- Enabled
6054 */
6055
6056 int16_t drc_down_sample_level;
6057/*< DRC down sample level.
6058 * Supported values: @ge 1
6059 */
6060
6061 int16_t drc_delay;
6062/*< DRC delay in samples.
6063 * Supported values: 0 to 1200
6064 */
6065
6066 uint16_t drc_rmsime_avg_const;
6067/*< RMS signal energy time-averaging constant.
6068 * Supported values: 0 to 2^16-1
6069 */
6070
6071 uint16_t drc_makeup_gain;
6072/*< DRC makeup gain in decibels.
6073 * Supported values: 258 to 64917
6074 */
6075 /* Down expander settings */
6076 int16_t down_expdrhreshold;
6077/*< Down expander threshold.
6078 * Supported Q7 format values: 1320 to up_cmpsrhreshold
6079 */
6080
6081 int16_t down_expdr_slope;
6082/*< Down expander slope.
6083 * Supported Q8 format values: -32768 to 0.
6084 */
6085
6086 uint32_t down_expdr_attack;
6087/*< Down expander attack constant.
6088 * Supported Q31 format values: 196844 to 2^31.
6089 */
6090
6091 uint32_t down_expdr_release;
6092/*< Down expander release constant.
6093 * Supported Q31 format values: 19685 to 2^31
6094 */
6095
6096 uint16_t down_expdr_hysteresis;
6097/*< Down expander hysteresis constant.
6098 * Supported Q14 format values: 1 to 32690
6099 */
6100
6101 uint16_t reserved;
6102 /*< Clients must set this field to zero. */
6103
6104 int32_t down_expdr_min_gain_db;
6105/*< Down expander minimum gain.
6106 * Supported Q23 format values: -805306368 to 0.
6107 */
6108
6109 /* Up compressor settings */
6110
6111 int16_t up_cmpsrhreshold;
6112/*< Up compressor threshold.
6113 * Supported Q7 format values: down_expdrhreshold to
6114 * down_cmpsrhreshold.
6115 */
6116
6117 uint16_t up_cmpsr_slope;
6118/*< Up compressor slope.
6119 * Supported Q16 format values: 0 to 64881.
6120 */
6121
6122 uint32_t up_cmpsr_attack;
6123/*< Up compressor attack constant.
6124 * Supported Q31 format values: 196844 to 2^31.
6125 */
6126
6127 uint32_t up_cmpsr_release;
6128/*< Up compressor release constant.
6129 * Supported Q31 format values: 19685 to 2^31.
6130 */
6131
6132 uint16_t up_cmpsr_hysteresis;
6133/*< Up compressor hysteresis constant.
6134 * Supported Q14 format values: 1 to 32690.
6135 */
6136
6137 /* Down compressor settings */
6138
6139 int16_t down_cmpsrhreshold;
6140/*< Down compressor threshold.
6141 * Supported Q7 format values: up_cmpsrhreshold to 11560.
6142 */
6143
6144 uint16_t down_cmpsr_slope;
6145/*< Down compressor slope.
6146 * Supported Q16 format values: 0 to 64881.
6147 */
6148
6149 uint16_t reserved1;
6150/*< Clients must set this field to zero. */
6151
6152 uint32_t down_cmpsr_attack;
6153/*< Down compressor attack constant.
6154 * Supported Q31 format values: 196844 to 2^31.
6155 */
6156
6157 uint32_t down_cmpsr_release;
6158/*< Down compressor release constant.
6159 * Supported Q31 format values: 19685 to 2^31.
6160 */
6161
6162 uint16_t down_cmpsr_hysteresis;
6163/*< Down compressor hysteresis constant.
6164 * Supported Q14 values: 1 to 32690.
6165 */
6166
6167 uint16_t reserved2;
6168/*< Clients must set this field to zero.*/
6169} __packed;
6170
6171#define ASM_MODULE_ID_EQUALIZER 0x00010C27
6172#define ASM_PARAM_ID_EQUALIZER_PARAMETERS 0x00010C28
6173
6174#define ASM_MAX_EQ_BANDS 12
6175
6176struct asm_eq_per_band_params {
6177 uint32_t band_idx;
6178/*< Band index.
6179 * Supported values: 0 to 11
6180 */
6181
6182 uint32_t filterype;
6183/*< Type of filter.
6184 * Supported values:
6185 * - #ASM_PARAM_EQYPE_NONE
6186 * - #ASM_PARAM_EQ_BASS_BOOST
6187 * - #ASM_PARAM_EQ_BASS_CUT
6188 * - #ASM_PARAM_EQREBLE_BOOST
6189 * - #ASM_PARAM_EQREBLE_CUT
6190 * - #ASM_PARAM_EQ_BAND_BOOST
6191 * - #ASM_PARAM_EQ_BAND_CUT
6192 */
6193
6194 uint32_t center_freq_hz;
6195 /*< Filter band center frequency in Hertz. */
6196
6197 int32_t filter_gain;
6198/*< Filter band initial gain.
6199 * Supported values: +12 to -12 dB in 1 dB increments
6200 */
6201
6202 int32_t q_factor;
6203/*< Filter band quality factor expressed as a Q8 number, i.e., a
6204 * fixed-point number with q factor of 8. For example, 3000/(2^8).
6205 */
6206} __packed;
6207
6208struct asm_eq_params {
6209 struct apr_hdr hdr;
6210 struct asm_stream_cmd_set_pp_params_v2 param;
6211 struct asm_stream_param_data_v2 data;
6212 uint32_t enable_flag;
6213/*< Specifies whether the equalizer module is disabled (0) or enabled
6214 * (nonzero).
6215 */
6216
6217 uint32_t num_bands;
6218/*< Number of bands.
6219 * Supported values: 1 to 12
6220 */
6221 struct asm_eq_per_band_params eq_bands[ASM_MAX_EQ_BANDS];
6222
6223} __packed;
6224
6225/* No equalizer effect.*/
6226#define ASM_PARAM_EQYPE_NONE 0
6227
6228/* Bass boost equalizer effect.*/
6229#define ASM_PARAM_EQ_BASS_BOOST 1
6230
6231/*Bass cut equalizer effect.*/
6232#define ASM_PARAM_EQ_BASS_CUT 2
6233
6234/* Treble boost equalizer effect */
6235#define ASM_PARAM_EQREBLE_BOOST 3
6236
6237/* Treble cut equalizer effect.*/
6238#define ASM_PARAM_EQREBLE_CUT 4
6239
6240/* Band boost equalizer effect.*/
6241#define ASM_PARAM_EQ_BAND_BOOST 5
6242
6243/* Band cut equalizer effect.*/
6244#define ASM_PARAM_EQ_BAND_CUT 6
6245
Ben Rombergera64e5282012-11-12 21:49:06 -08006246/* Voice get & set params */
6247#define VOICE_CMD_SET_PARAM 0x0001133D
6248#define VOICE_CMD_GET_PARAM 0x0001133E
6249#define VOICE_EVT_GET_PARAM_ACK 0x00011008
6250
Ben Romberger39fae342013-02-19 12:12:44 -08006251/* Set Q6 topologies */
6252#define ASM_CMD_ADD_TOPOLOGIES 0x00010DBE
6253#define ADM_CMD_ADD_TOPOLOGIES 0x00010335
6254
6255/* structure used for both ioctls */
6256struct cmd_set_topologies {
6257 struct apr_hdr hdr;
6258 u32 payload_addr_lsw;
6259 /* LSW of parameter data payload address.*/
6260 u32 payload_addr_msw;
6261 /* MSW of parameter data payload address.*/
6262 u32 mem_map_handle;
6263 /* Memory map handle returned by mem map command */
6264 u32 payload_size;
6265 /* Size in bytes of the variable payload in shared memory */
6266} __packed;
Bharath Ramachandramurthy2e3168f2012-05-03 16:29:09 -07006267
Gopikrishnaiah Anandand8663ff2012-12-07 18:12:42 -05006268/* This module represents the Rx processing of Feedback speaker protection.
6269 * It contains the excursion control, thermal protection,
6270 * analog clip manager features in it.
6271 * This module id will support following param ids.
6272 * - AFE_PARAM_ID_FBSP_MODE_RX_CFG
6273 */
6274
6275#define AFE_MODULE_FB_SPKR_PROT_RX 0x0001021C
6276
6277#define AFE_PARAM_ID_FBSP_MODE_RX_CFG 0x0001021D
6278
6279struct asm_fbsp_mode_rx_cfg {
6280 uint32_t minor_version;
6281 uint32_t mode;
6282} __packed;
6283
6284/* This module represents the VI processing of feedback speaker protection.
6285 * It will receive Vsens and Isens from codec and generates necessary
6286 * parameters needed by Rx processing.
6287 * This module id will support following param ids.
6288 * - AFE_PARAM_ID_SPKR_CALIB_VI_PROC_CFG
6289 * - AFE_PARAM_ID_CALIB_RES_CFG
6290 * - AFE_PARAM_ID_FEEDBACK_PATH_CFG
6291 */
6292
6293#define AFE_MODULE_FB_SPKR_PROT_VI_PROC 0x00010226
6294
6295#define AFE_PARAM_ID_SPKR_CALIB_VI_PROC_CFG 0x0001022A
6296
6297struct asm_spkr_calib_vi_proc_cfg {
6298 uint32_t minor_version;
6299 int32_t r0_cali_q24;
6300 int16_t t0_cali_q6;
6301 int16_t reserved;
6302} __packed;
6303
6304#define AFE_PARAM_ID_CALIB_RES_CFG 0x0001022B
6305
6306struct asm_calib_res_cfg {
6307 uint32_t minor_version;
6308 int32_t r0_cali_q24;
6309 uint32_t th_vi_ca_state;
6310} __packed;
6311
6312#define AFE_PARAM_ID_FEEDBACK_PATH_CFG 0x0001022C
6313
6314struct asm_feedback_path_cfg {
6315 uint32_t minor_version;
6316 int32_t dst_portid;
6317 int32_t num_channels;
6318 int32_t chan_info[4];
6319} __packed;
6320
6321#define AFE_PARAM_ID_MODE_VI_PROC_CFG 0x00010227
6322
6323struct asm_mode_vi_proc_cfg {
6324 uint32_t minor_version;
6325 uint32_t cal_mode;
6326} __packed;
6327
6328union afe_spkr_prot_config {
6329 struct asm_fbsp_mode_rx_cfg mode_rx_cfg;
6330 struct asm_spkr_calib_vi_proc_cfg vi_proc_cfg;
6331 struct asm_feedback_path_cfg feedback_path_cfg;
6332 struct asm_mode_vi_proc_cfg mode_vi_proc_cfg;
6333} __packed;
6334
6335struct afe_spkr_prot_config_command {
6336 struct apr_hdr hdr;
6337 struct afe_port_cmd_set_param_v2 param;
6338 struct afe_port_param_data_v2 pdata;
6339 union afe_spkr_prot_config prot_config;
6340} __packed;
6341
6342struct afe_spkr_prot_get_vi_calib {
6343 struct afe_port_cmd_get_param_v2 get_param;
6344 struct afe_port_param_data_v2 pdata;
6345 struct asm_calib_res_cfg res_cfg;
6346} __packed;
6347
6348struct afe_spkr_prot_calib_get_resp {
6349 uint32_t status;
6350 struct afe_port_param_data_v2 pdata;
6351 struct asm_calib_res_cfg res_cfg;
6352} __packed;
6353
6354
Ben Romberger564493d2012-12-04 20:48:28 -08006355/* SRS TRUMEDIA start */
6356/* topology */
6357#define SRS_TRUMEDIA_TOPOLOGY_ID 0x00010D90
6358/* module */
6359#define SRS_TRUMEDIA_MODULE_ID 0x10005010
6360/* parameters */
6361#define SRS_TRUMEDIA_PARAMS 0x10005011
6362#define SRS_TRUMEDIA_PARAMS_WOWHD 0x10005012
6363#define SRS_TRUMEDIA_PARAMS_CSHP 0x10005013
6364#define SRS_TRUMEDIA_PARAMS_HPF 0x10005014
6365#define SRS_TRUMEDIA_PARAMS_PEQ 0x10005015
6366#define SRS_TRUMEDIA_PARAMS_HL 0x10005016
6367
6368#define SRS_ID_GLOBAL 0x00000001
6369#define SRS_ID_WOWHD 0x00000002
6370#define SRS_ID_CSHP 0x00000003
6371#define SRS_ID_HPF 0x00000004
6372#define SRS_ID_PEQ 0x00000005
6373#define SRS_ID_HL 0x00000006
6374
6375#define SRS_CMD_UPLOAD 0x7FFF0000
6376#define SRS_PARAM_INDEX_MASK 0x80000000
6377#define SRS_PARAM_OFFSET_MASK 0x3FFF0000
6378#define SRS_PARAM_VALUE_MASK 0x0000FFFF
6379
6380struct srs_trumedia_params_GLOBAL {
6381 uint8_t v1;
6382 uint8_t v2;
6383 uint8_t v3;
6384 uint8_t v4;
6385 uint8_t v5;
6386 uint8_t v6;
6387 uint8_t v7;
6388 uint8_t v8;
6389} __packed;
6390
6391struct srs_trumedia_params_WOWHD {
6392 uint32_t v1;
6393 uint16_t v2;
6394 uint16_t v3;
6395 uint16_t v4;
6396 uint16_t v5;
6397 uint16_t v6;
6398 uint16_t v7;
6399 uint16_t v8;
6400 uint16_t v____A1;
6401 uint32_t v9;
6402 uint16_t v10;
6403 uint16_t v11;
6404 uint32_t v12[16];
6405} __packed;
6406
6407struct srs_trumedia_params_CSHP {
6408 uint32_t v1;
6409 uint16_t v2;
6410 uint16_t v3;
6411 uint16_t v4;
6412 uint16_t v5;
6413 uint16_t v6;
6414 uint16_t v____A1;
6415 uint32_t v7;
6416 uint16_t v8;
6417 uint16_t v9;
6418 uint32_t v10[16];
6419} __packed;
6420
6421struct srs_trumedia_params_HPF {
6422 uint32_t v1;
6423 uint32_t v2[26];
6424} __packed;
6425
6426struct srs_trumedia_params_PEQ {
6427 uint32_t v1;
6428 uint16_t v2;
6429 uint16_t v3;
6430 uint16_t v4;
6431 uint16_t v____A1;
6432 uint32_t v5[26];
6433 uint32_t v6[26];
6434} __packed;
6435
6436struct srs_trumedia_params_HL {
6437 uint16_t v1;
6438 uint16_t v2;
6439 uint16_t v3;
6440 uint16_t v____A1;
6441 int32_t v4;
6442 uint32_t v5;
6443 uint16_t v6;
6444 uint16_t v____A2;
6445 uint32_t v7;
6446} __packed;
6447
6448struct srs_trumedia_params {
6449 struct srs_trumedia_params_GLOBAL global;
6450 struct srs_trumedia_params_WOWHD wowhd;
6451 struct srs_trumedia_params_CSHP cshp;
6452 struct srs_trumedia_params_HPF hpf;
6453 struct srs_trumedia_params_PEQ peq;
6454 struct srs_trumedia_params_HL hl;
6455} __packed;
6456/* SRS TruMedia end */
6457
Joonwoo Parkb91e48e2013-02-21 10:24:56 -08006458/* LSM Specific */
6459#define VW_FEAT_DIM (39)
6460
6461#define APRV2_IDS_SERVICE_ID_ADSP_LSM_V (0xD)
6462#define APRV2_IDS_DOMAIN_ID_ADSP_V (0x4)
6463#define APRV2_IDS_DOMAIN_ID_APPS_V (0x5)
6464
6465#define LSM_SESSION_CMD_SHARED_MEM_MAP_REGIONS (0x00012A7F)
6466#define LSM_SESSION_CMDRSP_SHARED_MEM_MAP_REGIONS (0x00012A80)
6467#define LSM_SESSION_CMD_SHARED_MEM_UNMAP_REGIONS (0x00012A81)
6468#define LSM_SESSION_CMD_OPEN_TX (0x00012A82)
6469#define LSM_SESSION_CMD_CLOSE_TX (0x00012A88)
6470#define LSM_SESSION_CMD_SET_PARAMS (0x00012A83)
6471#define LSM_SESSION_CMD_REGISTER_SOUND_MODEL (0x00012A84)
6472#define LSM_SESSION_CMD_DEREGISTER_SOUND_MODEL (0x00012A85)
6473#define LSM_SESSION_CMD_START (0x00012A86)
6474#define LSM_SESSION_CMD_STOP (0x00012A87)
6475
6476#define LSM_SESSION_EVENT_DETECTION_STATUS (0x00012B00)
6477
6478#define LSM_MODULE_ID_VOICE_WAKEUP (0x00012C00)
6479#define LSM_PARAM_ID_ENDPOINT_DETECT_THRESHOLD (0x00012C01)
6480#define LSM_PARAM_ID_OPERATION_MODE (0x00012C02)
6481#define LSM_PARAM_ID_GAIN (0x00012C03)
6482#define LSM_PARAM_ID_CONNECT_TO_PORT (0x00012C04)
6483#define LSM_PARAM_ID_KEYWORD_DETECT_SENSITIVITY (0x00012C05)
6484#define LSM_PARAM_ID_USER_DETECT_SENSITIVITY (0x00012C06)
6485#define LSM_PARAM_ID_FEATURE_COMPENSATION_DATA (0x00012C07)
6486
6487
6488/* HW MAD specific */
6489#define AFE_MODULE_HW_MAD (0x00010230)
6490#define AFE_PARAM_ID_HW_MAD_CFG (0x00010231)
6491#define AFE_PARAM_ID_HW_MAD_CTRL (0x00010232)
6492#define AFE_PARAM_ID_SLIMBUS_SLAVE_PORT_CFG (0x00010233)
6493
6494/* SW MAD specific */
6495#define AFE_MODULE_SW_MAD (0x0001022D)
6496#define AFE_PARAM_ID_SW_MAD_CFG (0x0001022E)
6497#define AFE_PARAM_ID_SVM_MODEL (0x0001022F)
6498
6499/* Commands/Params to pass the codec/slimbus data to DSP */
6500#define AFE_SVC_CMD_SET_PARAM (0x000100f3)
6501#define AFE_MODULE_CDC_DEV_CFG (0x00010234)
6502#define AFE_PARAM_ID_CDC_SLIMBUS_SLAVE_CFG (0x00010235)
6503#define AFE_PARAM_ID_CDC_REG_CFG (0x00010236)
6504#define AFE_PARAM_ID_CDC_REG_CFG_INIT (0x00010237)
6505
Joonwoo Parkd3865092013-03-12 18:31:56 -07006506#define AFE_MAX_CDC_REGISTERS_TO_CONFIG (20)
6507
Bharath Ramachandramurthy2e3168f2012-05-03 16:29:09 -07006508/* ERROR CODES */
6509/* Success. The operation completed with no errors. */
6510#define ADSP_EOK 0x00000000
6511/* General failure. */
6512#define ADSP_EFAILED 0x00000001
6513/* Bad operation parameter. */
6514#define ADSP_EBADPARAM 0x00000002
6515/* Unsupported routine or operation. */
6516#define ADSP_EUNSUPPORTED 0x00000003
6517/* Unsupported version. */
6518#define ADSP_EVERSION 0x00000004
6519/* Unexpected problem encountered. */
6520#define ADSP_EUNEXPECTED 0x00000005
6521/* Unhandled problem occurred. */
6522#define ADSP_EPANIC 0x00000006
6523/* Unable to allocate resource. */
6524#define ADSP_ENORESOURCE 0x00000007
6525/* Invalid handle. */
6526#define ADSP_EHANDLE 0x00000008
6527/* Operation is already processed. */
6528#define ADSP_EALREADY 0x00000009
6529/* Operation is not ready to be processed. */
6530#define ADSP_ENOTREADY 0x0000000A
6531/* Operation is pending completion. */
6532#define ADSP_EPENDING 0x0000000B
6533/* Operation could not be accepted or processed. */
6534#define ADSP_EBUSY 0x0000000C
6535/* Operation aborted due to an error. */
6536#define ADSP_EABORTED 0x0000000D
6537/* Operation preempted by a higher priority. */
6538#define ADSP_EPREEMPTED 0x0000000E
6539/* Operation requests intervention to complete. */
6540#define ADSP_ECONTINUE 0x0000000F
6541/* Operation requests immediate intervention to complete. */
6542#define ADSP_EIMMEDIATE 0x00000010
6543/* Operation is not implemented. */
6544#define ADSP_ENOTIMPL 0x00000011
6545/* Operation needs more data or resources. */
6546#define ADSP_ENEEDMORE 0x00000012
6547/* Operation does not have memory. */
6548#define ADSP_ENOMEMORY 0x00000014
6549/* Item does not exist. */
6550#define ADSP_ENOTEXIST 0x00000015
6551/* Operation is finished. */
6552#define ADSP_ETERMINATED 0x00011174
6553
6554/*bharath, adsp_error_codes.h */
6555
Venkat Sudhir42a06e12012-12-13 16:16:05 -08006556/* LPASS clock for I2S Interface */
6557
6558/* Supported OSR clock values */
6559#define Q6AFE_LPASS_OSR_CLK_12_P288_MHZ 0xBB8000
6560#define Q6AFE_LPASS_OSR_CLK_8_P192_MHZ 0x7D0000
6561#define Q6AFE_LPASS_OSR_CLK_6_P144_MHZ 0x5DC000
6562#define Q6AFE_LPASS_OSR_CLK_4_P096_MHZ 0x3E8000
6563#define Q6AFE_LPASS_OSR_CLK_3_P072_MHZ 0x2EE000
6564#define Q6AFE_LPASS_OSR_CLK_2_P048_MHZ 0x1F4000
6565#define Q6AFE_LPASS_OSR_CLK_1_P536_MHZ 0x177000
6566#define Q6AFE_LPASS_OSR_CLK_1_P024_MHZ 0xFA000
6567#define Q6AFE_LPASS_OSR_CLK_768_kHZ 0xBB800
6568#define Q6AFE_LPASS_OSR_CLK_512_kHZ 0x7D000
6569#define Q6AFE_LPASS_OSR_CLK_DISABLE 0x0
6570
6571/* Supported Bit clock values */
6572#define Q6AFE_LPASS_IBIT_CLK_8_P192_MHZ 0x7D0000
6573#define Q6AFE_LPASS_IBIT_CLK_6_P144_MHZ 0x5DC000
6574#define Q6AFE_LPASS_IBIT_CLK_4_P096_MHZ 0x3E8000
6575#define Q6AFE_LPASS_IBIT_CLK_3_P072_MHZ 0x2EE000
6576#define Q6AFE_LPASS_IBIT_CLK_2_P048_MHZ 0x1F4000
6577#define Q6AFE_LPASS_IBIT_CLK_1_P536_MHZ 0x177000
6578#define Q6AFE_LPASS_IBIT_CLK_1_P024_MHZ 0xFA000
6579#define Q6AFE_LPASS_IBIT_CLK_768_KHZ 0xBB800
6580#define Q6AFE_LPASS_IBIT_CLK_512_KHZ 0x7D000
6581#define Q6AFE_LPASS_IBIT_CLK_DISABLE 0x0
6582
6583/* Supported LPASS CLK sources */
6584#define Q6AFE_LPASS_CLK_SRC_EXTERNAL 0
6585#define Q6AFE_LPASS_CLK_SRC_INTERNAL 1
6586
6587/* Supported LPASS CLK root*/
6588#define Q6AFE_LPASS_CLK_ROOT_DEFAULT 0
6589
6590enum afe_lpass_clk_mode {
6591 Q6AFE_LPASS_MODE_BOTH_INVALID,
6592 Q6AFE_LPASS_MODE_CLK1_VALID,
6593 Q6AFE_LPASS_MODE_CLK2_VALID,
6594 Q6AFE_LPASS_MODE_BOTH_VALID,
6595} __packed;
6596
6597struct afe_clk_cfg {
6598/* Minor version used for tracking the version of the I2S
6599 * configuration interface.
6600 * Supported values: #AFE_API_VERSION_I2S_CONFIG
6601 */
6602 u32 i2s_cfg_minor_version;
6603
6604/* clk value 1 in MHz. */
6605 u32 clk_val1;
6606
6607/* clk value 2 in MHz. */
6608 u32 clk_val2;
6609
6610/* clk_src
6611 * #Q6AFE_LPASS_CLK_SRC_EXTERNAL
6612 * #Q6AFE_LPASS_CLK_SRC_INTERNAL
6613 */
6614
6615 u16 clk_src;
6616
6617/* clk_root -0 for default */
6618 u16 clk_root;
6619
6620/* clk_set_mode
6621 * #Q6AFE_LPASS_MODE_BOTH_INVALID
6622 * #Q6AFE_LPASS_MODE_CLK1_VALID
6623 * #Q6AFE_LPASS_MODE_CLK2_VALID
6624 * #Q6AFE_LPASS_MODE_BOTH_VALID
6625 */
6626 u16 clk_set_mode;
6627
6628/* This param id is used to configure I2S clk */
6629 u16 reserved;
6630} __packed;
6631
6632/* This param id is used to configure I2S clk */
6633#define AFE_PARAM_ID_LPAIF_CLK_CONFIG 0x00010238
6634
6635
6636struct afe_lpass_clk_config_command {
6637 struct apr_hdr hdr;
6638 struct afe_port_cmd_set_param_v2 param;
6639 struct afe_port_param_data_v2 pdata;
6640 struct afe_clk_cfg clk_cfg;
6641} __packed;
6642
6643enum afe_lpass_digital_clk_src {
6644 Q6AFE_LPASS_DIGITAL_ROOT_INVALID,
6645 Q6AFE_LPASS_DIGITAL_ROOT_PRI_MI2S_OSR,
6646 Q6AFE_LPASS_DIGITAL_ROOT_SEC_MI2S_OSR,
6647 Q6AFE_LPASS_DIGITAL_ROOT_TER_MI2S_OSR,
6648 Q6AFE_LPASS_DIGITAL_ROOT_QUAD_MI2S_OSR,
6649 Q6AFE_LPASS_DIGITAL_ROOT_CDC_ROOT_CLK,
6650} __packed;
6651
6652/* This param id is used to configure internal clk */
6653#define AFE_PARAM_ID_INTERNAL_DIGIATL_CDC_CLK_CONFIG 0x00010239
6654
6655struct afe_digital_clk_cfg {
6656/* Minor version used for tracking the version of the I2S
6657 * configuration interface.
6658 * Supported values: #AFE_API_VERSION_I2S_CONFIG
6659 */
6660 u32 i2s_cfg_minor_version;
6661
6662/* clk value in MHz. */
6663 u32 clk_val;
6664
6665/* INVALID
6666 * PRI_MI2S_OSR
6667 * SEC_MI2S_OSR
6668 * TER_MI2S_OSR
6669 * QUAD_MI2S_OSR
6670 * DIGT_CDC_ROOT
6671 */
6672 u16 clk_root;
6673
6674/* This field must be set to zero. */
6675 u16 reserved;
6676} __packed;
6677
6678
6679struct afe_lpass_digital_clk_config_command {
6680 struct apr_hdr hdr;
6681 struct afe_port_cmd_set_param_v2 param;
6682 struct afe_port_param_data_v2 pdata;
6683 struct afe_digital_clk_cfg clk_cfg;
6684} __packed;
6685
Venkat Sudhir6edf9632013-01-14 15:08:13 -08006686/*
6687 * Opcode for AFE to start DTMF.
6688 */
6689#define AFE_PORTS_CMD_DTMF_CTL 0x00010102
6690
6691/** DTMF payload.*/
6692struct afe_dtmf_generation_command {
6693 struct apr_hdr hdr;
6694
6695 /*
6696 * Duration of the DTMF tone in ms.
6697 * -1 -> continuous,
6698 * 0 -> disable
6699 */
6700 int64_t duration_in_ms;
6701
6702 /*
6703 * The DTMF high tone frequency.
6704 */
6705 uint16_t high_freq;
6706
6707 /*
6708 * The DTMF low tone frequency.
6709 */
6710 uint16_t low_freq;
6711
6712 /*
6713 * The DTMF volume setting
6714 */
6715 uint16_t gain;
6716
6717 /*
6718 * The number of ports to enable/disable on.
6719 */
6720 uint16_t num_ports;
6721
6722 /*
6723 * The Destination ports - array .
6724 * For DTMF on multiple ports, portIds needs to
6725 * be populated numPorts times.
6726 */
6727 uint16_t port_ids;
6728
6729 /*
6730 * variable for 32 bit alignment of APR packet.
6731 */
6732 uint16_t reserved;
6733} __packed;
Venkat Sudhir42a06e12012-12-13 16:16:05 -08006734
Joonwoo Parkd3865092013-03-12 18:31:56 -07006735enum afe_config_type {
6736 AFE_SLIMBUS_SLAVE_PORT_CONFIG,
6737 AFE_SLIMBUS_SLAVE_CONFIG,
6738 AFE_CDC_REGISTERS_CONFIG,
6739 AFE_MAX_CONFIG_TYPES,
6740};
6741
6742struct afe_param_slimbus_slave_port_cfg {
6743 uint32_t minor_version;
6744 uint16_t slimbus_dev_id;
6745 uint16_t slave_dev_pgd_la;
6746 uint16_t slave_dev_intfdev_la;
6747 uint16_t bit_width;
6748 uint16_t data_format;
6749 uint16_t num_channels;
6750 uint16_t slave_port_mapping[AFE_PORT_MAX_AUDIO_CHAN_CNT];
6751} __packed;
6752
6753struct afe_param_cdc_slimbus_slave_cfg {
6754 uint32_t minor_version;
6755 uint32_t device_enum_addr_lsw;
6756 uint32_t device_enum_addr_msw;
6757 uint16_t tx_slave_port_offset;
6758 uint16_t rx_slave_port_offset;
6759} __packed;
6760
6761struct afe_param_cdc_reg_cfg {
6762 uint32_t minor_version;
6763 uint32_t reg_logical_addr;
6764 uint32_t reg_field_type;
6765 uint32_t reg_field_bit_mask;
6766 uint16_t reg_bit_width;
6767 uint16_t reg_offset_scale;
6768} __packed;
6769
6770struct afe_param_cdc_reg_cfg_data {
6771 uint32_t num_registers;
6772 struct afe_param_cdc_reg_cfg *reg_data;
6773} __packed;
6774
6775struct afe_svc_cmd_set_param {
6776 uint32_t payload_size;
6777 uint32_t payload_address_lsw;
6778 uint32_t payload_address_msw;
6779 uint32_t mem_map_handle;
6780} __packed;
6781
6782struct afe_param_hw_mad_ctrl {
6783 uint32_t minor_version;
6784 uint16_t mad_type;
6785 uint16_t mad_enable;
6786} __packed;
6787
6788struct afe_cmd_hw_mad_ctrl {
6789 struct apr_hdr hdr;
6790 struct afe_port_cmd_set_param_v2 param;
6791 struct afe_port_param_data_v2 pdata;
6792 struct afe_param_hw_mad_ctrl payload;
6793} __packed;
6794
6795struct afe_cmd_hw_mad_slimbus_slave_port_cfg {
6796 struct apr_hdr hdr;
6797 struct afe_port_cmd_set_param_v2 param;
6798 struct afe_port_param_data_v2 pdata;
6799 struct afe_param_slimbus_slave_port_cfg sb_port_cfg;
6800} __packed;
6801
6802struct afe_cmd_sw_mad_enable {
6803 struct apr_hdr hdr;
6804 struct afe_port_cmd_set_param_v2 param;
6805 struct afe_port_param_data_v2 pdata;
6806} __packed;
6807
6808struct afe_param_cdc_reg_cfg_payload {
6809 struct afe_port_param_data_v2 common;
6810 struct afe_param_cdc_reg_cfg reg_cfg;
6811} __packed;
6812
6813/*
6814 * reg_data's size can be up to AFE_MAX_CDC_REGISTERS_TO_CONFIG
6815 */
6816struct afe_svc_cmd_cdc_reg_cfg {
6817 struct apr_hdr hdr;
6818 struct afe_svc_cmd_set_param param;
6819 struct afe_param_cdc_reg_cfg_payload reg_data[0];
6820} __packed;
6821
6822struct afe_svc_cmd_init_cdc_reg_cfg {
6823 struct apr_hdr hdr;
6824 struct afe_svc_cmd_set_param param;
6825 struct afe_port_param_data_v2 init;
6826} __packed;
6827
6828struct afe_svc_cmd_sb_slave_cfg {
6829 struct apr_hdr hdr;
6830 struct afe_svc_cmd_set_param param;
6831 struct afe_port_param_data_v2 pdata;
6832 struct afe_param_cdc_slimbus_slave_cfg sb_slave_cfg;
6833} __packed;
6834
Bharath Ramachandramurthy2e3168f2012-05-03 16:29:09 -07006835#endif /*_APR_AUDIO_V2_H_ */