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