blob: 097ba3982afeb66457273f6ace6edddf26b91fb9 [file] [log] [blame]
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001/*
2 *
Ben Rombergerb7603232011-11-23 17:16:27 -08003 * Copyright (c) 2010-2012, Code Aurora Forum. All rights reserved.
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 and
7 * only version 2 as published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 */
15
16#ifndef _APR_AUDIO_H_
17#define _APR_AUDIO_H_
18
19/* ASM opcodes without APR payloads*/
20#include <mach/qdsp6v2/apr.h>
21
22/*
23 * Audio Front End (AFE)
24 */
25
26/* Port ID. Update afe_get_port_index when a new port is added here. */
27#define PRIMARY_I2S_RX 0 /* index = 0 */
28#define PRIMARY_I2S_TX 1 /* index = 1 */
29#define PCM_RX 2 /* index = 2 */
30#define PCM_TX 3 /* index = 3 */
31#define SECONDARY_I2S_RX 4 /* index = 4 */
32#define SECONDARY_I2S_TX 5 /* index = 5 */
33#define MI2S_RX 6 /* index = 6 */
34#define MI2S_TX 7 /* index = 7 */
35#define HDMI_RX 8 /* index = 8 */
36#define RSVD_2 9 /* index = 9 */
37#define RSVD_3 10 /* index = 10 */
38#define DIGI_MIC_TX 11 /* index = 11 */
39#define VOICE_RECORD_RX 0x8003 /* index = 12 */
40#define VOICE_RECORD_TX 0x8004 /* index = 13 */
41#define VOICE_PLAYBACK_TX 0x8005 /* index = 14 */
42
43/* Slimbus Multi channel port id pool */
44#define SLIMBUS_0_RX 0x4000 /* index = 15 */
45#define SLIMBUS_0_TX 0x4001 /* index = 16 */
46#define SLIMBUS_1_RX 0x4002 /* index = 17 */
47#define SLIMBUS_1_TX 0x4003 /* index = 18 */
48#define SLIMBUS_2_RX 0x4004
49#define SLIMBUS_2_TX 0x4005
50#define SLIMBUS_3_RX 0x4006
51#define SLIMBUS_3_TX 0x4007
52#define SLIMBUS_4_RX 0x4008
53#define SLIMBUS_4_TX 0x4009 /* index = 24 */
54
55#define INT_BT_SCO_RX 0x3000 /* index = 25 */
56#define INT_BT_SCO_TX 0x3001 /* index = 26 */
57#define INT_BT_A2DP_RX 0x3002 /* index = 27 */
58#define INT_FM_RX 0x3004 /* index = 28 */
59#define INT_FM_TX 0x3005 /* index = 29 */
Laxminath Kasam32657ec2011-08-01 19:26:57 +053060#define RT_PROXY_PORT_001_RX 0x2000 /* index = 30 */
61#define RT_PROXY_PORT_001_TX 0x2001 /* index = 31 */
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070062
63#define AFE_PORT_INVALID 0xFFFF
64
65#define AFE_PORT_CMD_START 0x000100ca
Laxminath Kasam32657ec2011-08-01 19:26:57 +053066
67#define AFE_EVENT_RTPORT_START 0
68#define AFE_EVENT_RTPORT_STOP 1
69#define AFE_EVENT_RTPORT_LOW_WM 2
70#define AFE_EVENT_RTPORT_HI_WM 3
71
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070072struct afe_port_start_command {
73 struct apr_hdr hdr;
74 u16 port_id;
75 u16 gain; /* Q13 */
76 u32 sample_rate; /* 8 , 16, 48khz */
77} __attribute__ ((packed));
78
79#define AFE_PORT_CMD_STOP 0x000100cb
80struct afe_port_stop_command {
81 struct apr_hdr hdr;
82 u16 port_id;
83 u16 reserved;
84} __attribute__ ((packed));
85
86#define AFE_PORT_CMD_APPLY_GAIN 0x000100cc
87struct afe_port_gain_command {
88 struct apr_hdr hdr;
89 u16 port_id;
90 u16 gain;/* Q13 */
91} __attribute__ ((packed));
92
93#define AFE_PORT_CMD_SIDETONE_CTL 0x000100cd
94struct afe_port_sidetone_command {
95 struct apr_hdr hdr;
96 u16 rx_port_id; /* Primary i2s tx = 1 */
97 /* PCM tx = 3 */
98 /* Secondary i2s tx = 5 */
99 /* Mi2s tx = 7 */
100 /* Digital mic tx = 11 */
101 u16 tx_port_id; /* Primary i2s rx = 0 */
102 /* PCM rx = 2 */
103 /* Secondary i2s rx = 4 */
104 /* Mi2S rx = 6 */
105 /* HDMI rx = 8 */
106 u16 gain; /* Q13 */
107 u16 enable; /* 1 = enable, 0 = disable */
108} __attribute__ ((packed));
109
110#define AFE_PORT_CMD_LOOPBACK 0x000100ce
111struct afe_loopback_command {
112 struct apr_hdr hdr;
113 u16 tx_port_id; /* Primary i2s rx = 0 */
114 /* PCM rx = 2 */
115 /* Secondary i2s rx = 4 */
116 /* Mi2S rx = 6 */
117 /* HDMI rx = 8 */
118 u16 rx_port_id; /* Primary i2s tx = 1 */
119 /* PCM tx = 3 */
120 /* Secondary i2s tx = 5 */
121 /* Mi2s tx = 7 */
122 /* Digital mic tx = 11 */
123 u16 mode; /* Default -1, DSP will conver
124 the tx to rx format */
125 u16 enable; /* 1 = enable, 0 = disable */
126} __attribute__ ((packed));
127
128#define AFE_PSEUDOPORT_CMD_START 0x000100cf
129struct afe_pseudoport_start_command {
130 struct apr_hdr hdr;
131 u16 port_id; /* Pseudo Port 1 = 0x8000 */
132 /* Pseudo Port 2 = 0x8001 */
133 /* Pseudo Port 3 = 0x8002 */
134 u16 timing; /* FTRT = 0 , AVTimer = 1, */
135} __attribute__ ((packed));
136
137#define AFE_PSEUDOPORT_CMD_STOP 0x000100d0
138struct afe_pseudoport_stop_command {
139 struct apr_hdr hdr;
140 u16 port_id; /* Pseudo Port 1 = 0x8000 */
141 /* Pseudo Port 2 = 0x8001 */
142 /* Pseudo Port 3 = 0x8002 */
143 u16 reserved;
144} __attribute__ ((packed));
145
146#define AFE_CMD_GET_ACTIVE_PORTS 0x000100d1
147
148
149#define AFE_CMD_GET_ACTIVE_HANDLES_FOR_PORT 0x000100d2
150struct afe_get_active_handles_command {
151 struct apr_hdr hdr;
152 u16 port_id;
153 u16 reserved;
154} __attribute__ ((packed));
155
156#define AFE_PCM_CFG_MODE_PCM 0x0
157#define AFE_PCM_CFG_MODE_AUX 0x1
158#define AFE_PCM_CFG_SYNC_EXT 0x0
159#define AFE_PCM_CFG_SYNC_INT 0x1
160#define AFE_PCM_CFG_FRM_8BPF 0x0
161#define AFE_PCM_CFG_FRM_16BPF 0x1
162#define AFE_PCM_CFG_FRM_32BPF 0x2
163#define AFE_PCM_CFG_FRM_64BPF 0x3
164#define AFE_PCM_CFG_FRM_128BPF 0x4
165#define AFE_PCM_CFG_FRM_256BPF 0x5
166#define AFE_PCM_CFG_QUANT_ALAW_NOPAD 0x0
167#define AFE_PCM_CFG_QUANT_MULAW_NOPAD 0x1
168#define AFE_PCM_CFG_QUANT_LINEAR_NOPAD 0x2
169#define AFE_PCM_CFG_QUANT_ALAW_PAD 0x3
170#define AFE_PCM_CFG_QUANT_MULAW_PAD 0x4
171#define AFE_PCM_CFG_QUANT_LINEAR_PAD 0x5
172#define AFE_PCM_CFG_CDATAOE_MASTER 0x0
173#define AFE_PCM_CFG_CDATAOE_SHARE 0x1
174
175struct afe_port_pcm_cfg {
176 u16 mode; /* PCM (short sync) = 0, AUXPCM (long sync) = 1 */
177 u16 sync; /* external = 0 , internal = 1 */
178 u16 frame; /* 8 bpf = 0 */
179 /* 16 bpf = 1 */
180 /* 32 bpf = 2 */
181 /* 64 bpf = 3 */
182 /* 128 bpf = 4 */
183 /* 256 bpf = 5 */
184 u16 quant;
185 u16 slot; /* Slot for PCM stream , 0 - 31 */
186 u16 data; /* 0, PCM block is the only master */
187 /* 1, PCM block is shares to driver data out signal */
188 /* other master */
189 u16 reserved;
190} __attribute__ ((packed));
191
192enum {
193 AFE_I2S_SD0 = 1,
194 AFE_I2S_SD1,
195 AFE_I2S_SD2,
196 AFE_I2S_SD3,
197 AFE_I2S_QUAD01,
198 AFE_I2S_QUAD23,
199 AFE_I2S_6CHS,
200 AFE_I2S_8CHS,
201};
202
203#define AFE_MI2S_MONO 0
204#define AFE_MI2S_STEREO 3
205#define AFE_MI2S_4CHANNELS 4
206#define AFE_MI2S_6CHANNELS 6
207#define AFE_MI2S_8CHANNELS 8
208
209struct afe_port_mi2s_cfg {
210 u16 bitwidth; /* 16,24,32 */
211 u16 line; /* Called ChannelMode in documentation */
212 /* i2s_sd0 = 1 */
213 /* i2s_sd1 = 2 */
214 /* i2s_sd2 = 3 */
215 /* i2s_sd3 = 4 */
216 /* i2s_quad01 = 5 */
217 /* i2s_quad23 = 6 */
218 /* i2s_6chs = 7 */
219 /* i2s_8chs = 8 */
220 u16 channel; /* Called MonoStereo in documentation */
221 /* i2s mono = 0 */
222 /* i2s mono right = 1 */
223 /* i2s mono left = 2 */
224 /* i2s stereo = 3 */
225 u16 ws; /* 0, word select signal from external source */
226 /* 1, word select signal from internal source */
227 u16 reserved;
228} __attribute__ ((packed));
229
230struct afe_port_hdmi_cfg {
231 u16 bitwidth; /* 16,24,32 */
232 u16 channel_mode; /* HDMI Stereo = 0 */
233 /* HDMI_3Point1 (4-ch) = 1 */
234 /* HDMI_5Point1 (6-ch) = 2 */
235 /* HDMI_6Point1 (8-ch) = 3 */
236 u16 data_type; /* HDMI_Linear = 0 */
Kiran Kandi5e809b02012-01-31 00:24:33 -0800237 /* HDMI_non_Linear = 1 */
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700238} __attribute__ ((packed));
239
240
Kiran Kandi5e809b02012-01-31 00:24:33 -0800241struct afe_port_hdmi_multi_ch_cfg {
242 u16 data_type; /* HDMI_Linear = 0 */
243 /* HDMI_non_Linear = 1 */
244 u16 channel_allocation; /* The default is 0 (Stereo) */
245 u16 reserved; /* must be set to 0 */
246} __packed;
247
248
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700249/* Slimbus Device Ids */
250#define AFE_SLIMBUS_DEVICE_1 0x0
251#define AFE_SLIMBUS_DEVICE_2 0x1
252#define AFE_PORT_MAX_AUDIO_CHAN_CNT 16
253
254struct afe_port_slimbus_cfg {
255 u16 slimbus_dev_id; /* SLIMBUS Device id.*/
256
257 u16 slave_dev_pgd_la; /* Slave ported generic device
258 * logical address.
259 */
260 u16 slave_dev_intfdev_la; /* Slave interface device logical
261 * address.
262 */
263 u16 bit_width; /** bit width of the samples, 16, 24.*/
264
265 u16 data_format; /** data format.*/
266
267 u16 num_channels; /** Number of channels.*/
268
269 /** Slave port mapping for respective channels.*/
270 u16 slave_port_mapping[AFE_PORT_MAX_AUDIO_CHAN_CNT];
271
272 u16 reserved;
273} __packed;
274
Bharath Ramachandramurthy9c79f132011-11-28 11:18:57 -0800275struct afe_port_slimbus_sch_cfg {
276 u16 slimbus_dev_id; /* SLIMBUS Device id.*/
277 u16 bit_width; /** bit width of the samples, 16, 24.*/
278 u16 data_format; /** data format.*/
279 u16 num_channels; /** Number of channels.*/
280 u16 reserved;
281 /** Slave channel mapping for respective channels.*/
282 u8 slave_ch_mapping[8];
283} __packed;
284
Laxminath Kasam32657ec2011-08-01 19:26:57 +0530285struct afe_port_rtproxy_cfg {
286 u16 bitwidth; /* 16,24,32 */
287 u16 interleaved; /* interleaved = 1 */
288 /* Noninterleaved = 0 */
289 u16 frame_sz; /* 5ms buffers = 160bytes */
290 u16 jitter; /* 10ms of jitter = 320 */
291 u16 lw_mark; /* Low watermark in bytes for triggering event*/
292 u16 hw_mark; /* High watermark bytes for triggering event*/
293 u16 rsvd;
294 int num_ch; /* 1 to 8 */
295} __packed;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700296
Bharath Ramachandramurthy9c79f132011-11-28 11:18:57 -0800297#define AFE_PORT_AUDIO_IF_CONFIG 0x000100d3
298#define AFE_PORT_AUDIO_SLIM_SCH_CONFIG 0x000100e4
Kiran Kandi5e809b02012-01-31 00:24:33 -0800299#define AFE_PORT_MULTI_CHAN_HDMI_AUDIO_IF_CONFIG 0x000100D9
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700300
301union afe_port_config {
Bharath Ramachandramurthy9c79f132011-11-28 11:18:57 -0800302 struct afe_port_pcm_cfg pcm;
303 struct afe_port_mi2s_cfg mi2s;
304 struct afe_port_hdmi_cfg hdmi;
305 struct afe_port_hdmi_multi_ch_cfg hdmi_multi_ch;
306 struct afe_port_slimbus_cfg slimbus;
307 struct afe_port_slimbus_sch_cfg slim_sch;
308 struct afe_port_rtproxy_cfg rtproxy;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700309} __attribute__((packed));
310
311struct afe_audioif_config_command {
312 struct apr_hdr hdr;
313 u16 port_id;
314 union afe_port_config port;
315} __attribute__ ((packed));
316
317#define AFE_TEST_CODEC_LOOPBACK_CTL 0x000100d5
318struct afe_codec_loopback_command {
319 u16 port_inf; /* Primary i2s = 0 */
320 /* PCM = 2 */
321 /* Secondary i2s = 4 */
322 /* Mi2s = 6 */
323 u16 enable; /* 0, disable. 1, enable */
324} __attribute__ ((packed));
325
326
327#define AFE_PARAM_ID_SIDETONE_GAIN 0x00010300
328struct afe_param_sidetone_gain {
329 u16 gain;
330 u16 reserved;
331} __attribute__ ((packed));
332
333#define AFE_PARAM_ID_SAMPLING_RATE 0x00010301
334struct afe_param_sampling_rate {
335 u32 sampling_rate;
336} __attribute__ ((packed));
337
338
339#define AFE_PARAM_ID_CHANNELS 0x00010302
340struct afe_param_channels {
341 u16 channels;
342 u16 reserved;
343} __attribute__ ((packed));
344
345
346#define AFE_PARAM_ID_LOOPBACK_GAIN 0x00010303
347struct afe_param_loopback_gain {
348 u16 gain;
349 u16 reserved;
350} __attribute__ ((packed));
351
352
353#define AFE_MODULE_ID_PORT_INFO 0x00010200
354struct afe_param_payload {
355 u32 module_id;
356 u32 param_id;
357 u16 param_size;
358 u16 reserved;
359 union {
360 struct afe_param_sidetone_gain sidetone_gain;
361 struct afe_param_sampling_rate sampling_rate;
362 struct afe_param_channels channels;
363 struct afe_param_loopback_gain loopback_gain;
364 } __attribute__((packed)) param;
365} __attribute__ ((packed));
366
367#define AFE_PORT_CMD_SET_PARAM 0x000100dc
368
369struct afe_port_cmd_set_param {
370 struct apr_hdr hdr;
371 u16 port_id;
372 u16 payload_size;
373 u32 payload_address;
374 struct afe_param_payload payload;
375} __attribute__ ((packed));
376
Ben Rombergerb7603232011-11-23 17:16:27 -0800377struct afe_port_cmd_set_param_no_payload {
378 struct apr_hdr hdr;
379 u16 port_id;
380 u16 payload_size;
381 u32 payload_address;
382} __packed;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700383
384#define AFE_EVENT_GET_ACTIVE_PORTS 0x00010100
385struct afe_get_active_ports_rsp {
386 u16 num_ports;
387 u16 port_id;
388} __attribute__ ((packed));
389
390
391#define AFE_EVENT_GET_ACTIVE_HANDLES 0x00010102
392struct afe_get_active_handles_rsp {
393 u16 port_id;
394 u16 num_handles;
395 u16 mode; /* 0, voice rx */
396 /* 1, voice tx */
397 /* 2, audio rx */
398 /* 3, audio tx */
399 u16 handle;
400} __attribute__ ((packed));
401
Laxminath Kasam32657ec2011-08-01 19:26:57 +0530402#define AFE_SERVICE_CMD_MEMORY_MAP 0x000100DE
403struct afe_cmd_memory_map {
404 struct apr_hdr hdr;
405 u32 phy_addr;
406 u32 mem_sz;
407 u16 mem_id;
408 u16 rsvd;
409} __packed;
410
411#define AFE_SERVICE_CMD_MEMORY_UNMAP 0x000100DF
412struct afe_cmd_memory_unmap {
413 struct apr_hdr hdr;
414 u32 phy_addr;
415} __packed;
416
417#define AFE_SERVICE_CMD_REG_RTPORT 0x000100E0
418struct afe_cmd_reg_rtport {
419 struct apr_hdr hdr;
420 u16 port_id;
421 u16 rsvd;
422} __packed;
423
424#define AFE_SERVICE_CMD_UNREG_RTPORT 0x000100E1
425struct afe_cmd_unreg_rtport {
426 struct apr_hdr hdr;
427 u16 port_id;
428 u16 rsvd;
429} __packed;
430
431#define AFE_SERVICE_CMD_RTPORT_WR 0x000100E2
432struct afe_cmd_rtport_wr {
433 struct apr_hdr hdr;
434 u16 port_id;
435 u16 rsvd;
436 u32 buf_addr;
437 u32 bytes_avail;
438} __packed;
439
440#define AFE_SERVICE_CMD_RTPORT_RD 0x000100E3
441struct afe_cmd_rtport_rd {
442 struct apr_hdr hdr;
443 u16 port_id;
444 u16 rsvd;
445 u32 buf_addr;
446 u32 bytes_avail;
447} __packed;
448
449#define AFE_EVENT_RT_PROXY_PORT_STATUS 0x00010105
450
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700451#define ADM_MAX_COPPS 5
452
453#define ADM_SERVICE_CMD_GET_COPP_HANDLES 0x00010300
454struct adm_get_copp_handles_command {
455 struct apr_hdr hdr;
456} __attribute__ ((packed));
457
458#define ADM_CMD_MATRIX_MAP_ROUTINGS 0x00010301
459struct adm_routings_session {
460 u16 id;
461 u16 num_copps;
462 u16 copp_id[ADM_MAX_COPPS+1]; /*Padding if numCopps is odd */
463} __packed;
464
465struct adm_routings_command {
466 struct apr_hdr hdr;
467 u32 path; /* 0 = Rx, 1 Tx */
468 u32 num_sessions;
469 struct adm_routings_session session[8];
470} __attribute__ ((packed));
471
472
473#define ADM_CMD_MATRIX_RAMP_GAINS 0x00010302
474struct adm_ramp_gain {
475 struct apr_hdr hdr;
476 u16 session_id;
477 u16 copp_id;
478 u16 initial_gain;
479 u16 gain_increment;
480 u16 ramp_duration;
481 u16 reserved;
482} __attribute__ ((packed));
483
484struct adm_ramp_gains_command {
485 struct apr_hdr hdr;
486 u32 id;
487 u32 num_gains;
488 struct adm_ramp_gain gains[ADM_MAX_COPPS];
489} __attribute__ ((packed));
490
491
492#define ADM_CMD_COPP_OPEN 0x00010304
493struct adm_copp_open_command {
494 struct apr_hdr hdr;
495 u16 flags;
496 u16 mode; /* 1-RX, 2-Live TX, 3-Non Live TX */
497 u16 endpoint_id1;
498 u16 endpoint_id2;
499 u32 topology_id;
500 u16 channel_config;
501 u16 reserved;
502 u32 rate;
503} __attribute__ ((packed));
504
505#define ADM_CMD_COPP_CLOSE 0x00010305
506
Kiran Kandi5e809b02012-01-31 00:24:33 -0800507#define ADM_CMD_MULTI_CHANNEL_COPP_OPEN 0x00010310
508struct adm_multi_ch_copp_open_command {
509 struct apr_hdr hdr;
510 u16 flags;
511 u16 mode; /* 1-RX, 2-Live TX, 3-Non Live TX */
512 u16 endpoint_id1;
513 u16 endpoint_id2;
514 u32 topology_id;
515 u16 channel_config;
516 u16 reserved;
517 u32 rate;
518 u8 dev_channel_mapping[8];
519} __packed;
520
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700521#define ADM_CMD_MEMORY_MAP 0x00010C30
522struct adm_cmd_memory_map{
523 struct apr_hdr hdr;
524 u32 buf_add;
525 u32 buf_size;
526 u16 mempool_id;
527 u16 reserved;
528} __attribute__((packed));
529
530#define ADM_CMD_MEMORY_UNMAP 0x00010C31
531struct adm_cmd_memory_unmap{
532 struct apr_hdr hdr;
533 u32 buf_add;
534} __attribute__((packed));
535
536#define ADM_CMD_MEMORY_MAP_REGIONS 0x00010C47
537struct adm_memory_map_regions{
538 u32 phys;
539 u32 buf_size;
540} __attribute__((packed));
541
542struct adm_cmd_memory_map_regions{
543 struct apr_hdr hdr;
544 u16 mempool_id;
545 u16 nregions;
546} __attribute__((packed));
547
548#define ADM_CMD_MEMORY_UNMAP_REGIONS 0x00010C48
549struct adm_memory_unmap_regions{
550 u32 phys;
551} __attribute__((packed));
552
553struct adm_cmd_memory_unmap_regions{
554 struct apr_hdr hdr;
555 u16 nregions;
556 u16 reserved;
557} __attribute__((packed));
558
559#define DEFAULT_COPP_TOPOLOGY 0x00010be3
560#define DEFAULT_POPP_TOPOLOGY 0x00010be4
561#define VPM_TX_SM_ECNS_COPP_TOPOLOGY 0x00010F71
562#define VPM_TX_DM_FLUENCE_COPP_TOPOLOGY 0x00010F72
Jayasena Sangaraboina0fc197d2011-12-09 13:20:33 -0800563#define VPM_TX_QMIC_FLUENCE_COPP_TOPOLOGY 0x00010F75
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700564
565#define ASM_MAX_EQ_BANDS 12
566
567struct asm_eq_band {
568 u32 band_idx; /* The band index, 0 .. 11 */
569 u32 filter_type; /* Filter band type */
570 u32 center_freq_hz; /* Filter band center frequency */
571 u32 filter_gain; /* Filter band initial gain (dB) */
572 /* Range is +12 dB to -12 dB with 1dB increments. */
573 u32 q_factor;
574} __attribute__ ((packed));
575
576struct asm_equalizer_params {
577 u32 enable;
578 u32 num_bands;
579 struct asm_eq_band eq_bands[ASM_MAX_EQ_BANDS];
580} __attribute__ ((packed));
581
582struct asm_master_gain_params {
583 u16 master_gain;
584 u16 padding;
585} __attribute__ ((packed));
586
587struct asm_lrchannel_gain_params {
588 u16 left_gain;
589 u16 right_gain;
590} __attribute__ ((packed));
591
592struct asm_mute_params {
593 u32 muteflag;
594} __attribute__ ((packed));
595
596struct asm_softvolume_params {
597 u32 period;
598 u32 step;
599 u32 rampingcurve;
600} __attribute__ ((packed));
601
602struct asm_softpause_params {
603 u32 enable;
604 u32 period;
605 u32 step;
606 u32 rampingcurve;
607} __packed;
608
609struct asm_pp_param_data_hdr {
610 u32 module_id;
611 u32 param_id;
612 u16 param_size;
613 u16 reserved;
614} __attribute__ ((packed));
615
616struct asm_pp_params_command {
617 struct apr_hdr hdr;
618 u32 *payload;
619 u32 payload_size;
620 struct asm_pp_param_data_hdr params;
621} __attribute__ ((packed));
622
623#define EQUALIZER_MODULE_ID 0x00010c27
624#define EQUALIZER_PARAM_ID 0x00010c28
625
626#define VOLUME_CONTROL_MODULE_ID 0x00010bfe
627#define MASTER_GAIN_PARAM_ID 0x00010bff
628#define L_R_CHANNEL_GAIN_PARAM_ID 0x00010c00
629#define MUTE_CONFIG_PARAM_ID 0x00010c01
630#define SOFT_PAUSE_PARAM_ID 0x00010D6A
Swaminathan Sathappanb0021cd2011-08-31 15:20:12 -0700631#define SOFT_VOLUME_PARAM_ID 0x00010C29
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700632
633#define IIR_FILTER_ENABLE_PARAM_ID 0x00010c03
634#define IIR_FILTER_PREGAIN_PARAM_ID 0x00010c04
635#define IIR_FILTER_CONFIG_PARAM_ID 0x00010c05
636
637#define MBADRC_MODULE_ID 0x00010c06
638#define MBADRC_ENABLE_PARAM_ID 0x00010c07
639#define MBADRC_CONFIG_PARAM_ID 0x00010c08
640
641
642#define ADM_CMD_SET_PARAMS 0x00010306
643#define ADM_CMD_GET_PARAMS 0x0001030B
644#define ADM_CMDRSP_GET_PARAMS 0x0001030C
645struct adm_set_params_command {
646 struct apr_hdr hdr;
647 u32 payload;
648 u32 payload_size;
649} __attribute__ ((packed));
650
651
652#define ADM_CMD_TAP_COPP_PCM 0x00010307
653struct adm_tap_copp_pcm_command {
654 struct apr_hdr hdr;
655} __attribute__ ((packed));
656
657
658/* QDSP6 to Client messages
659*/
660#define ADM_SERVICE_CMDRSP_GET_COPP_HANDLES 0x00010308
661struct adm_get_copp_handles_respond {
662 struct apr_hdr hdr;
663 u32 handles;
664 u32 copp_id;
665} __attribute__ ((packed));
666
667#define ADM_CMDRSP_COPP_OPEN 0x0001030A
668struct adm_copp_open_respond {
669 u32 status;
670 u16 copp_id;
671 u16 reserved;
672} __attribute__ ((packed));
673
Kiran Kandi5e809b02012-01-31 00:24:33 -0800674#define ADM_CMDRSP_MULTI_CHANNEL_COPP_OPEN 0x00010311
675
676
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700677#define ASM_STREAM_PRIORITY_NORMAL 0
678#define ASM_STREAM_PRIORITY_LOW 1
679#define ASM_STREAM_PRIORITY_HIGH 2
680#define ASM_STREAM_PRIORITY_RESERVED 3
681
682#define ASM_END_POINT_DEVICE_MATRIX 0
683#define ASM_END_POINT_STREAM 1
684
685#define AAC_ENC_MODE_AAC_LC 0x02
686#define AAC_ENC_MODE_AAC_P 0x05
687#define AAC_ENC_MODE_EAAC_P 0x1D
688
689#define ASM_STREAM_CMD_CLOSE 0x00010BCD
690#define ASM_STREAM_CMD_FLUSH 0x00010BCE
691#define ASM_STREAM_CMD_SET_PP_PARAMS 0x00010BCF
692#define ASM_STREAM_CMD_GET_PP_PARAMS 0x00010BD0
693#define ASM_STREAM_CMDRSP_GET_PP_PARAMS 0x00010BD1
694#define ASM_SESSION_CMD_PAUSE 0x00010BD3
695#define ASM_SESSION_CMD_GET_SESSION_TIME 0x00010BD4
696#define ASM_DATA_CMD_EOS 0x00010BDB
697#define ASM_DATA_EVENT_EOS 0x00010BDD
698
699#define ASM_SERVICE_CMD_GET_STREAM_HANDLES 0x00010C0B
700#define ASM_STREAM_CMD_FLUSH_READBUFS 0x00010C09
701
702#define ASM_SESSION_EVENT_RX_UNDERFLOW 0x00010C17
703#define ASM_SESSION_EVENT_TX_OVERFLOW 0x00010C18
704#define ASM_SERVICE_CMD_GET_WALLCLOCK_TIME 0x00010C19
705#define ASM_DATA_CMDRSP_EOS 0x00010C1C
706
707/* ASM Data structures */
708
709/* common declarations */
710struct asm_pcm_cfg {
711 u16 ch_cfg;
712 u16 bits_per_sample;
713 u32 sample_rate;
714 u16 is_signed;
715 u16 interleaved;
716};
717
Kiran Kandi5e809b02012-01-31 00:24:33 -0800718#define PCM_CHANNEL_NULL 0
719
720/* Front left channel. */
721#define PCM_CHANNEL_FL 1
722
723/* Front right channel. */
724#define PCM_CHANNEL_FR 2
725
726/* Front center channel. */
727#define PCM_CHANNEL_FC 3
728
729/* Left surround channel.*/
730#define PCM_CHANNEL_LS 4
731
732/* Right surround channel.*/
733#define PCM_CHANNEL_RS 5
734
735/* Low frequency effect channel. */
736#define PCM_CHANNEL_LFE 6
737
738/* Center surround channel; Rear center channel. */
739#define PCM_CHANNEL_CS 7
740
741/* Left back channel; Rear left channel. */
742#define PCM_CHANNEL_LB 8
743
744/* Right back channel; Rear right channel. */
745#define PCM_CHANNEL_RB 9
746
747/* Top surround channel. */
748#define PCM_CHANNEL_TS 10
749
750/* Center vertical height channel.*/
751#define PCM_CHANNEL_CVH 11
752
753/* Mono surround channel.*/
754#define PCM_CHANNEL_MS 12
755
756/* Front left of center. */
757#define PCM_CHANNEL_FLC 13
758
759/* Front right of center. */
760#define PCM_CHANNEL_FRC 14
761
762/* Rear left of center. */
763#define PCM_CHANNEL_RLC 15
764
765/* Rear right of center. */
766#define PCM_CHANNEL_RRC 16
767
768#define PCM_FORMAT_MAX_NUM_CHANNEL 8
769
770
771/*
772 * Multiple-channel PCM decoder format block structure used in the
773 * #ASM_STREAM_CMD_OPEN_WRITE command.
774 * The data must be in little-endian format.
775 */
776struct asm_multi_channel_pcm_fmt_blk {
777
778 u16 num_channels; /*
779 * Number of channels.
780 * Supported values:1 to 8
781 */
782
783 u16 bits_per_sample; /*
784 * Number of bits per sample per channel.
785 * Supported values: 16, 24 When used for
786 * playback, the client must send 24-bit
787 * samples packed in 32-bit words. The
788 * 24-bit samples must be placed in the most
789 * significant 24 bits of the 32-bit word. When
790 * used for recording, the aDSP sends 24-bit
791 * samples packed in 32-bit words. The 24-bit
792 * samples are placed in the most significant
793 * 24 bits of the 32-bit word.
794 */
795
796 u32 sample_rate; /*
797 * Number of samples per second
798 * (in Hertz). Supported values:
799 * 2000 to 48000
800 */
801
802 u16 is_signed; /*
803 * Flag that indicates the samples
804 * are signed (1).
805 */
806
807 u16 is_interleaved; /*
808 * Flag that indicates whether the channels are
809 * de-interleaved (0) or interleaved (1).
810 * Interleaved format means corresponding
811 * samples from the left and right channels are
812 * interleaved within the buffer.
813 * De-interleaved format means samples from
814 * each channel are contiguous in the buffer.
815 * The samples from one channel immediately
816 * follow those of the previous channel.
817 */
818
819 u8 channel_mapping[8]; /*
820 * Supported values:
821 * PCM_CHANNEL_NULL, PCM_CHANNEL_FL,
822 * PCM_CHANNEL_FR, PCM_CHANNEL_FC,
823 * PCM_CHANNEL_LS, PCM_CHANNEL_RS,
824 * PCM_CHANNEL_LFE, PCM_CHANNEL_CS,
825 * PCM_CHANNEL_LB, PCM_CHANNEL_RB,
826 * PCM_CHANNEL_TS, PCM_CHANNEL_CVH,
827 * PCM_CHANNEL_MS, PCM_CHANNEL_FLC,
828 * PCM_CHANNEL_FRC, PCM_CHANNEL_RLC,
829 * PCM_CHANNEL_RRC.
830 * Channel[i] mapping describes channel I. Each
831 * element i of the array describes channel I
832 * inside the buffer where I < num_channels.
833 * An unused channel is set to zero.
834 */
835};
836
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700837struct asm_adpcm_cfg {
838 u16 ch_cfg;
839 u16 bits_per_sample;
840 u32 sample_rate;
841 u32 block_size;
842};
843
844struct asm_yadpcm_cfg {
845 u16 ch_cfg;
846 u16 bits_per_sample;
847 u32 sample_rate;
848};
849
850struct asm_midi_cfg {
851 u32 nMode;
852};
853
854struct asm_wma_cfg {
855 u16 format_tag;
856 u16 ch_cfg;
857 u32 sample_rate;
858 u32 avg_bytes_per_sec;
859 u16 block_align;
860 u16 valid_bits_per_sample;
861 u32 ch_mask;
862 u16 encode_opt;
863 u16 adv_encode_opt;
864 u32 adv_encode_opt2;
865 u32 drc_peak_ref;
866 u32 drc_peak_target;
867 u32 drc_ave_ref;
868 u32 drc_ave_target;
869};
870
871struct asm_wmapro_cfg {
872 u16 format_tag;
873 u16 ch_cfg;
874 u32 sample_rate;
875 u32 avg_bytes_per_sec;
876 u16 block_align;
877 u16 valid_bits_per_sample;
878 u32 ch_mask;
879 u16 encode_opt;
880 u16 adv_encode_opt;
881 u32 adv_encode_opt2;
882 u32 drc_peak_ref;
883 u32 drc_peak_target;
884 u32 drc_ave_ref;
885 u32 drc_ave_target;
886};
887
888struct asm_aac_cfg {
889 u16 format;
890 u16 aot;
891 u16 ep_config;
892 u16 section_data_resilience;
893 u16 scalefactor_data_resilience;
894 u16 spectral_data_resilience;
895 u16 ch_cfg;
896 u16 reserved;
897 u32 sample_rate;
898};
899
900struct asm_flac_cfg {
901 u16 stream_info_present;
902 u16 min_blk_size;
903 u16 max_blk_size;
904 u16 ch_cfg;
905 u16 sample_size;
906 u16 sample_rate;
907 u16 md5_sum;
908 u32 ext_sample_rate;
909 u32 min_frame_size;
910 u32 max_frame_size;
911};
912
913struct asm_vorbis_cfg {
914 u32 ch_cfg;
915 u32 bit_rate;
916 u32 min_bit_rate;
917 u32 max_bit_rate;
918 u16 bit_depth_pcm_sample;
919 u16 bit_stream_format;
920};
921
922struct asm_aac_read_cfg {
923 u32 bitrate;
924 u32 enc_mode;
925 u16 format;
926 u16 ch_cfg;
927 u32 sample_rate;
928};
929
930struct asm_amrnb_read_cfg {
931 u16 mode;
932 u16 dtx_mode;
933};
934
Alex Wong2caeecc2011-10-28 10:52:15 +0530935struct asm_amrwb_read_cfg {
936 u16 mode;
937 u16 dtx_mode;
938};
939
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700940struct asm_evrc_read_cfg {
941 u16 max_rate;
942 u16 min_rate;
943 u16 rate_modulation_cmd;
944 u16 reserved;
945};
946
947struct asm_qcelp13_read_cfg {
948 u16 max_rate;
949 u16 min_rate;
950 u16 reduced_rate_level;
951 u16 rate_modulation_cmd;
952};
953
954struct asm_sbc_read_cfg {
955 u32 subband;
956 u32 block_len;
957 u32 ch_mode;
958 u32 alloc_method;
959 u32 bit_rate;
960 u32 sample_rate;
961};
962
963struct asm_sbc_bitrate {
964 u32 bitrate;
965};
966
967struct asm_immed_decode {
968 u32 mode;
969};
970
971struct asm_sbr_ps {
972 u32 enable;
973};
974
Swaminathan Sathappan70765cd2011-07-19 18:42:47 -0700975struct asm_dual_mono {
976 u16 sce_left;
977 u16 sce_right;
978};
979
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700980struct asm_encode_cfg_blk {
981 u32 frames_per_buf;
982 u32 format_id;
983 u32 cfg_size;
984 union {
985 struct asm_pcm_cfg pcm;
986 struct asm_aac_read_cfg aac;
987 struct asm_amrnb_read_cfg amrnb;
988 struct asm_evrc_read_cfg evrc;
989 struct asm_qcelp13_read_cfg qcelp13;
990 struct asm_sbc_read_cfg sbc;
Alex Wong2caeecc2011-10-28 10:52:15 +0530991 struct asm_amrwb_read_cfg amrwb;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700992 } __attribute__((packed)) cfg;
993};
994
995struct asm_frame_meta_info {
996 u32 offset_to_frame;
997 u32 frame_size;
998 u32 encoded_pcm_samples;
999 u32 msw_ts;
1000 u32 lsw_ts;
1001 u32 nflags;
1002};
1003
1004/* Stream level commands */
1005#define ASM_STREAM_CMD_OPEN_READ 0x00010BCB
1006struct asm_stream_cmd_open_read {
1007 struct apr_hdr hdr;
1008 u32 uMode;
1009 u32 src_endpoint;
1010 u32 pre_proc_top;
1011 u32 format;
1012} __attribute__((packed));
1013
1014/* Supported formats */
1015#define LINEAR_PCM 0x00010BE5
1016#define DTMF 0x00010BE6
1017#define ADPCM 0x00010BE7
1018#define YADPCM 0x00010BE8
1019#define MP3 0x00010BE9
Bharath Ramachandramurthy4f71d502011-10-23 19:45:22 -07001020#define MPEG4_AAC 0x00010BEA
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001021#define AMRNB_FS 0x00010BEB
Alex Wong2caeecc2011-10-28 10:52:15 +05301022#define AMRWB_FS 0x00010BEC
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001023#define V13K_FS 0x00010BED
1024#define EVRC_FS 0x00010BEE
1025#define EVRCB_FS 0x00010BEF
1026#define EVRCWB_FS 0x00010BF0
1027#define MIDI 0x00010BF1
1028#define SBC 0x00010BF2
1029#define WMA_V10PRO 0x00010BF3
1030#define WMA_V9 0x00010BF4
1031#define AMR_WB_PLUS 0x00010BF5
1032#define AC3_DECODER 0x00010BF6
1033#define G711_ALAW_FS 0x00010BF7
1034#define G711_MLAW_FS 0x00010BF8
1035#define G711_PCM_FS 0x00010BF9
Bharath Ramachandramurthy4f71d502011-10-23 19:45:22 -07001036#define MPEG4_MULTI_AAC 0x00010D86
Baruch Eruchimovitche9cbfc12011-10-09 19:47:08 +02001037#define US_POINT_EPOS_FORMAT 0x00012310
1038#define US_RAW_FORMAT 0x0001127C
Kiran Kandi5e809b02012-01-31 00:24:33 -08001039#define MULTI_CHANNEL_PCM 0x00010C66
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001040
1041#define ASM_ENCDEC_SBCRATE 0x00010C13
1042#define ASM_ENCDEC_IMMDIATE_DECODE 0x00010C14
1043#define ASM_ENCDEC_CFG_BLK 0x00010C2C
1044
1045#define ASM_ENCDEC_SBCRATE 0x00010C13
1046#define ASM_ENCDEC_IMMDIATE_DECODE 0x00010C14
1047#define ASM_ENCDEC_CFG_BLK 0x00010C2C
1048
1049#define ASM_STREAM_CMD_OPEN_WRITE 0x00010BCA
1050struct asm_stream_cmd_open_write {
1051 struct apr_hdr hdr;
1052 u32 uMode;
1053 u16 sink_endpoint;
1054 u16 stream_handle;
1055 u32 post_proc_top;
1056 u32 format;
1057} __attribute__((packed));
1058
1059#define ASM_STREAM_CMD_OPEN_READWRITE 0x00010BCC
1060
1061struct asm_stream_cmd_open_read_write {
1062 struct apr_hdr hdr;
1063 u32 uMode;
1064 u32 post_proc_top;
1065 u32 write_format;
1066 u32 read_format;
1067} __attribute__((packed));
1068
1069#define ASM_STREAM_CMD_SET_ENCDEC_PARAM 0x00010C10
1070#define ASM_STREAM_CMD_GET_ENCDEC_PARAM 0x00010C11
1071#define ASM_ENCDEC_CFG_BLK_ID 0x00010C2C
1072#define ASM_ENABLE_SBR_PS 0x00010C63
Swaminathan Sathappan70765cd2011-07-19 18:42:47 -07001073#define ASM_CONFIGURE_DUAL_MONO 0x00010C64
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001074struct asm_stream_cmd_encdec_cfg_blk{
1075 struct apr_hdr hdr;
1076 u32 param_id;
1077 u32 param_size;
1078 struct asm_encode_cfg_blk enc_blk;
1079} __attribute__((packed));
1080
1081struct asm_stream_cmd_encdec_sbc_bitrate{
1082 struct apr_hdr hdr;
1083 u32 param_id;
1084 struct asm_sbc_bitrate sbc_bitrate;
1085} __attribute__((packed));
1086
1087struct asm_stream_cmd_encdec_immed_decode{
1088 struct apr_hdr hdr;
1089 u32 param_id;
1090 u32 param_size;
1091 struct asm_immed_decode dec;
1092} __attribute__((packed));
1093
1094struct asm_stream_cmd_encdec_sbr{
1095 struct apr_hdr hdr;
1096 u32 param_id;
1097 u32 param_size;
1098 struct asm_sbr_ps sbr_ps;
1099} __attribute__((packed));
1100
Swaminathan Sathappan70765cd2011-07-19 18:42:47 -07001101struct asm_stream_cmd_encdec_dualmono {
1102 struct apr_hdr hdr;
1103 u32 param_id;
1104 u32 param_size;
1105 struct asm_dual_mono channel_map;
1106} __packed;
1107
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001108#define ASM_STREAM _CMD_ADJUST_SAMPLES 0x00010C0A
1109struct asm_stream_cmd_adjust_samples{
1110 struct apr_hdr hdr;
1111 u16 nsamples;
1112 u16 reserved;
1113} __attribute__((packed));
1114
1115#define ASM_STREAM_CMD_TAP_POPP_PCM 0x00010BF9
1116struct asm_stream_cmd_tap_popp_pcm{
1117 struct apr_hdr hdr;
1118 u16 enable;
1119 u16 reserved;
1120 u32 module_id;
1121} __attribute__((packed));
1122
1123/* Session Level commands */
1124#define ASM_SESSION_CMD_MEMORY_MAP 0x00010C32
1125struct asm_stream_cmd_memory_map{
1126 struct apr_hdr hdr;
1127 u32 buf_add;
1128 u32 buf_size;
1129 u16 mempool_id;
1130 u16 reserved;
1131} __attribute__((packed));
1132
1133#define ASM_SESSION_CMD_MEMORY_UNMAP 0x00010C33
1134struct asm_stream_cmd_memory_unmap{
1135 struct apr_hdr hdr;
1136 u32 buf_add;
1137} __attribute__((packed));
1138
1139#define ASM_SESSION_CMD_MEMORY_MAP_REGIONS 0x00010C45
1140struct asm_memory_map_regions{
1141 u32 phys;
1142 u32 buf_size;
1143} __attribute__((packed));
1144
1145struct asm_stream_cmd_memory_map_regions{
1146 struct apr_hdr hdr;
1147 u16 mempool_id;
1148 u16 nregions;
1149} __attribute__((packed));
1150
1151#define ASM_SESSION_CMD_MEMORY_UNMAP_REGIONS 0x00010C46
1152struct asm_memory_unmap_regions{
1153 u32 phys;
1154} __attribute__((packed));
1155
1156struct asm_stream_cmd_memory_unmap_regions{
1157 struct apr_hdr hdr;
1158 u16 nregions;
1159 u16 reserved;
1160} __attribute__((packed));
1161
1162#define ASM_SESSION_CMD_RUN 0x00010BD2
1163struct asm_stream_cmd_run{
1164 struct apr_hdr hdr;
1165 u32 flags;
1166 u32 msw_ts;
1167 u32 lsw_ts;
1168} __attribute__((packed));
1169
1170/* Session level events */
1171#define ASM_SESSION_CMD_REGISTER_FOR_RX_UNDERFLOW_EVENTS 0x00010BD5
1172struct asm_stream_cmd_reg_rx_underflow_event{
1173 struct apr_hdr hdr;
1174 u16 enable;
1175 u16 reserved;
1176} __attribute__((packed));
1177
1178#define ASM_SESSION_CMD_REGISTER_FOR_TX_OVERFLOW_EVENTS 0x00010BD6
1179struct asm_stream_cmd_reg_tx_overflow_event{
1180 struct apr_hdr hdr;
1181 u16 enable;
1182 u16 reserved;
1183} __attribute__((packed));
1184
1185/* Data Path commands */
1186#define ASM_DATA_CMD_WRITE 0x00010BD9
1187struct asm_stream_cmd_write{
1188 struct apr_hdr hdr;
1189 u32 buf_add;
1190 u32 avail_bytes;
1191 u32 uid;
1192 u32 msw_ts;
1193 u32 lsw_ts;
1194 u32 uflags;
1195} __attribute__((packed));
1196
1197#define ASM_DATA_CMD_READ 0x00010BDA
1198struct asm_stream_cmd_read{
1199 struct apr_hdr hdr;
1200 u32 buf_add;
1201 u32 buf_size;
1202 u32 uid;
1203} __attribute__((packed));
1204
1205#define ASM_DATA_CMD_MEDIA_FORMAT_UPDATE 0x00010BDC
Deepa Madiregama55cbf782011-09-10 05:44:39 +05301206#define ASM_DATA_EVENT_ENC_SR_CM_NOTIFY 0x00010BDE
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001207struct asm_stream_media_format_update{
1208 struct apr_hdr hdr;
1209 u32 format;
1210 u32 cfg_size;
1211 union {
1212 struct asm_pcm_cfg pcm_cfg;
1213 struct asm_adpcm_cfg adpcm_cfg;
1214 struct asm_yadpcm_cfg yadpcm_cfg;
1215 struct asm_midi_cfg midi_cfg;
1216 struct asm_wma_cfg wma_cfg;
1217 struct asm_wmapro_cfg wmapro_cfg;
1218 struct asm_aac_cfg aac_cfg;
1219 struct asm_flac_cfg flac_cfg;
1220 struct asm_vorbis_cfg vorbis_cfg;
Kiran Kandi5e809b02012-01-31 00:24:33 -08001221 struct asm_multi_channel_pcm_fmt_blk multi_ch_pcm_cfg;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001222 } __attribute__((packed)) write_cfg;
1223} __attribute__((packed));
1224
1225
1226/* Command Responses */
1227#define ASM_STREAM_CMDRSP_GET_ENCDEC_PARAM 0x00010C12
1228struct asm_stream_cmdrsp_get_readwrite_param{
1229 struct apr_hdr hdr;
1230 u32 status;
1231 u32 param_id;
1232 u16 param_size;
1233 u16 padding;
1234 union {
1235 struct asm_sbc_bitrate sbc_bitrate;
1236 struct asm_immed_decode aac_dec;
1237 } __attribute__((packed)) read_write_cfg;
1238} __attribute__((packed));
1239
1240
1241#define ASM_SESSION_CMDRSP_GET_SESSION_TIME 0x00010BD8
1242struct asm_stream_cmdrsp_get_session_time{
1243 struct apr_hdr hdr;
1244 u32 status;
1245 u32 msw_ts;
1246 u32 lsw_ts;
1247} __attribute__((packed));
1248
1249#define ASM_DATA_EVENT_WRITE_DONE 0x00010BDF
1250struct asm_data_event_write_done{
1251 u32 buf_add;
1252 u32 status;
1253} __attribute__((packed));
1254
1255#define ASM_DATA_EVENT_READ_DONE 0x00010BE0
1256struct asm_data_event_read_done{
1257 u32 status;
1258 u32 buffer_add;
1259 u32 enc_frame_size;
1260 u32 offset;
1261 u32 msw_ts;
1262 u32 lsw_ts;
1263 u32 flags;
1264 u32 num_frames;
1265 u32 id;
1266} __attribute__((packed));
1267
1268#define ASM_DATA_EVENT_SR_CM_CHANGE_NOTIFY 0x00010C65
1269struct asm_data_event_sr_cm_change_notify {
1270 u32 sample_rate;
1271 u16 no_of_channels;
1272 u16 reserved;
1273 u8 channel_map[8];
1274} __packed;
1275
1276/* service level events */
1277
1278#define ASM_SERVICE_CMDRSP_GET_STREAM_HANDLES 0x00010C1B
1279struct asm_svc_cmdrsp_get_strm_handles{
1280 struct apr_hdr hdr;
1281 u32 num_handles;
1282 u32 stream_handles;
1283} __attribute__((packed));
1284
1285
1286#define ASM_SERVICE_CMDRSP_GET_WALLCLOCK_TIME 0x00010C1A
1287struct asm_svc_cmdrsp_get_wallclock_time{
1288 struct apr_hdr hdr;
1289 u32 status;
1290 u32 msw_ts;
1291 u32 lsw_ts;
1292} __attribute__((packed));
1293
1294/*
1295 * Error code
1296*/
1297#define ADSP_EOK 0x00000000 /* Success / completed / no errors. */
1298#define ADSP_EFAILED 0x00000001 /* General failure. */
1299#define ADSP_EBADPARAM 0x00000002 /* Bad operation parameter(s). */
1300#define ADSP_EUNSUPPORTED 0x00000003 /* Unsupported routine/operation. */
1301#define ADSP_EVERSION 0x00000004 /* Unsupported version. */
1302#define ADSP_EUNEXPECTED 0x00000005 /* Unexpected problem encountered. */
1303#define ADSP_EPANIC 0x00000006 /* Unhandled problem occurred. */
1304#define ADSP_ENORESOURCE 0x00000007 /* Unable to allocate resource(s). */
1305#define ADSP_EHANDLE 0x00000008 /* Invalid handle. */
1306#define ADSP_EALREADY 0x00000009 /* Operation is already processed. */
1307#define ADSP_ENOTREADY 0x0000000A /* Operation not ready to be processed*/
1308#define ADSP_EPENDING 0x0000000B /* Operation is pending completion*/
1309#define ADSP_EBUSY 0x0000000C /* Operation could not be accepted or
1310 processed. */
1311#define ADSP_EABORTED 0x0000000D /* Operation aborted due to an error. */
1312#define ADSP_EPREEMPTED 0x0000000E /* Operation preempted by higher priority*/
1313#define ADSP_ECONTINUE 0x0000000F /* Operation requests intervention
1314 to complete. */
1315#define ADSP_EIMMEDIATE 0x00000010 /* Operation requests immediate
1316 intervention to complete. */
1317#define ADSP_ENOTIMPL 0x00000011 /* Operation is not implemented. */
1318#define ADSP_ENEEDMORE 0x00000012 /* Operation needs more data or resources*/
1319
1320#endif /*_APR_AUDIO_H_*/