blob: f71d743d72e2ef7581961d0eeb683755a39ec7d5 [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
Neema Shetty3c9d2862012-03-11 01:25:32 -080064#define SLIMBUS_INVALID 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
773
774/*
775 * Multiple-channel PCM decoder format block structure used in the
776 * #ASM_STREAM_CMD_OPEN_WRITE command.
777 * The data must be in little-endian format.
778 */
779struct asm_multi_channel_pcm_fmt_blk {
780
781 u16 num_channels; /*
782 * Number of channels.
783 * Supported values:1 to 8
784 */
785
786 u16 bits_per_sample; /*
787 * Number of bits per sample per channel.
788 * Supported values: 16, 24 When used for
789 * playback, the client must send 24-bit
790 * samples packed in 32-bit words. The
791 * 24-bit samples must be placed in the most
792 * significant 24 bits of the 32-bit word. When
793 * used for recording, the aDSP sends 24-bit
794 * samples packed in 32-bit words. The 24-bit
795 * samples are placed in the most significant
796 * 24 bits of the 32-bit word.
797 */
798
799 u32 sample_rate; /*
800 * Number of samples per second
801 * (in Hertz). Supported values:
802 * 2000 to 48000
803 */
804
805 u16 is_signed; /*
806 * Flag that indicates the samples
807 * are signed (1).
808 */
809
810 u16 is_interleaved; /*
811 * Flag that indicates whether the channels are
812 * de-interleaved (0) or interleaved (1).
813 * Interleaved format means corresponding
814 * samples from the left and right channels are
815 * interleaved within the buffer.
816 * De-interleaved format means samples from
817 * each channel are contiguous in the buffer.
818 * The samples from one channel immediately
819 * follow those of the previous channel.
820 */
821
822 u8 channel_mapping[8]; /*
823 * Supported values:
824 * PCM_CHANNEL_NULL, PCM_CHANNEL_FL,
825 * PCM_CHANNEL_FR, PCM_CHANNEL_FC,
826 * PCM_CHANNEL_LS, PCM_CHANNEL_RS,
827 * PCM_CHANNEL_LFE, PCM_CHANNEL_CS,
828 * PCM_CHANNEL_LB, PCM_CHANNEL_RB,
829 * PCM_CHANNEL_TS, PCM_CHANNEL_CVH,
830 * PCM_CHANNEL_MS, PCM_CHANNEL_FLC,
831 * PCM_CHANNEL_FRC, PCM_CHANNEL_RLC,
832 * PCM_CHANNEL_RRC.
833 * Channel[i] mapping describes channel I. Each
834 * element i of the array describes channel I
835 * inside the buffer where I < num_channels.
836 * An unused channel is set to zero.
837 */
838};
839
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700840struct asm_adpcm_cfg {
841 u16 ch_cfg;
842 u16 bits_per_sample;
843 u32 sample_rate;
844 u32 block_size;
845};
846
847struct asm_yadpcm_cfg {
848 u16 ch_cfg;
849 u16 bits_per_sample;
850 u32 sample_rate;
851};
852
853struct asm_midi_cfg {
854 u32 nMode;
855};
856
857struct asm_wma_cfg {
858 u16 format_tag;
859 u16 ch_cfg;
860 u32 sample_rate;
861 u32 avg_bytes_per_sec;
862 u16 block_align;
863 u16 valid_bits_per_sample;
864 u32 ch_mask;
865 u16 encode_opt;
866 u16 adv_encode_opt;
867 u32 adv_encode_opt2;
868 u32 drc_peak_ref;
869 u32 drc_peak_target;
870 u32 drc_ave_ref;
871 u32 drc_ave_target;
872};
873
874struct asm_wmapro_cfg {
875 u16 format_tag;
876 u16 ch_cfg;
877 u32 sample_rate;
878 u32 avg_bytes_per_sec;
879 u16 block_align;
880 u16 valid_bits_per_sample;
881 u32 ch_mask;
882 u16 encode_opt;
883 u16 adv_encode_opt;
884 u32 adv_encode_opt2;
885 u32 drc_peak_ref;
886 u32 drc_peak_target;
887 u32 drc_ave_ref;
888 u32 drc_ave_target;
889};
890
891struct asm_aac_cfg {
892 u16 format;
893 u16 aot;
894 u16 ep_config;
895 u16 section_data_resilience;
896 u16 scalefactor_data_resilience;
897 u16 spectral_data_resilience;
898 u16 ch_cfg;
899 u16 reserved;
900 u32 sample_rate;
901};
902
903struct asm_flac_cfg {
904 u16 stream_info_present;
905 u16 min_blk_size;
906 u16 max_blk_size;
907 u16 ch_cfg;
908 u16 sample_size;
909 u16 sample_rate;
910 u16 md5_sum;
911 u32 ext_sample_rate;
912 u32 min_frame_size;
913 u32 max_frame_size;
914};
915
916struct asm_vorbis_cfg {
917 u32 ch_cfg;
918 u32 bit_rate;
919 u32 min_bit_rate;
920 u32 max_bit_rate;
921 u16 bit_depth_pcm_sample;
922 u16 bit_stream_format;
923};
924
925struct asm_aac_read_cfg {
926 u32 bitrate;
927 u32 enc_mode;
928 u16 format;
929 u16 ch_cfg;
930 u32 sample_rate;
931};
932
933struct asm_amrnb_read_cfg {
934 u16 mode;
935 u16 dtx_mode;
936};
937
Alex Wong2caeecc2011-10-28 10:52:15 +0530938struct asm_amrwb_read_cfg {
939 u16 mode;
940 u16 dtx_mode;
941};
942
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700943struct asm_evrc_read_cfg {
944 u16 max_rate;
945 u16 min_rate;
946 u16 rate_modulation_cmd;
947 u16 reserved;
948};
949
950struct asm_qcelp13_read_cfg {
951 u16 max_rate;
952 u16 min_rate;
953 u16 reduced_rate_level;
954 u16 rate_modulation_cmd;
955};
956
957struct asm_sbc_read_cfg {
958 u32 subband;
959 u32 block_len;
960 u32 ch_mode;
961 u32 alloc_method;
962 u32 bit_rate;
963 u32 sample_rate;
964};
965
966struct asm_sbc_bitrate {
967 u32 bitrate;
968};
969
970struct asm_immed_decode {
971 u32 mode;
972};
973
974struct asm_sbr_ps {
975 u32 enable;
976};
977
Swaminathan Sathappan70765cd2011-07-19 18:42:47 -0700978struct asm_dual_mono {
979 u16 sce_left;
980 u16 sce_right;
981};
982
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700983struct asm_encode_cfg_blk {
984 u32 frames_per_buf;
985 u32 format_id;
986 u32 cfg_size;
987 union {
988 struct asm_pcm_cfg pcm;
989 struct asm_aac_read_cfg aac;
990 struct asm_amrnb_read_cfg amrnb;
991 struct asm_evrc_read_cfg evrc;
992 struct asm_qcelp13_read_cfg qcelp13;
993 struct asm_sbc_read_cfg sbc;
Alex Wong2caeecc2011-10-28 10:52:15 +0530994 struct asm_amrwb_read_cfg amrwb;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700995 } __attribute__((packed)) cfg;
996};
997
998struct asm_frame_meta_info {
999 u32 offset_to_frame;
1000 u32 frame_size;
1001 u32 encoded_pcm_samples;
1002 u32 msw_ts;
1003 u32 lsw_ts;
1004 u32 nflags;
1005};
1006
1007/* Stream level commands */
1008#define ASM_STREAM_CMD_OPEN_READ 0x00010BCB
1009struct asm_stream_cmd_open_read {
1010 struct apr_hdr hdr;
1011 u32 uMode;
1012 u32 src_endpoint;
1013 u32 pre_proc_top;
1014 u32 format;
1015} __attribute__((packed));
1016
1017/* Supported formats */
1018#define LINEAR_PCM 0x00010BE5
1019#define DTMF 0x00010BE6
1020#define ADPCM 0x00010BE7
1021#define YADPCM 0x00010BE8
1022#define MP3 0x00010BE9
Bharath Ramachandramurthy4f71d502011-10-23 19:45:22 -07001023#define MPEG4_AAC 0x00010BEA
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001024#define AMRNB_FS 0x00010BEB
Alex Wong2caeecc2011-10-28 10:52:15 +05301025#define AMRWB_FS 0x00010BEC
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001026#define V13K_FS 0x00010BED
1027#define EVRC_FS 0x00010BEE
1028#define EVRCB_FS 0x00010BEF
1029#define EVRCWB_FS 0x00010BF0
1030#define MIDI 0x00010BF1
1031#define SBC 0x00010BF2
1032#define WMA_V10PRO 0x00010BF3
1033#define WMA_V9 0x00010BF4
1034#define AMR_WB_PLUS 0x00010BF5
1035#define AC3_DECODER 0x00010BF6
Santosh Mardi23321202012-03-22 04:33:25 +05301036#define EAC3_DECODER 0x00010C3C
1037#define DTS 0x00010D88
1038#define ATRAC 0x00010D89
1039#define MAT 0x00010D8A
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001040#define G711_ALAW_FS 0x00010BF7
1041#define G711_MLAW_FS 0x00010BF8
1042#define G711_PCM_FS 0x00010BF9
Bharath Ramachandramurthy4f71d502011-10-23 19:45:22 -07001043#define MPEG4_MULTI_AAC 0x00010D86
Baruch Eruchimovitche9cbfc12011-10-09 19:47:08 +02001044#define US_POINT_EPOS_FORMAT 0x00012310
1045#define US_RAW_FORMAT 0x0001127C
Kiran Kandi5e809b02012-01-31 00:24:33 -08001046#define MULTI_CHANNEL_PCM 0x00010C66
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001047
1048#define ASM_ENCDEC_SBCRATE 0x00010C13
1049#define ASM_ENCDEC_IMMDIATE_DECODE 0x00010C14
1050#define ASM_ENCDEC_CFG_BLK 0x00010C2C
1051
1052#define ASM_ENCDEC_SBCRATE 0x00010C13
1053#define ASM_ENCDEC_IMMDIATE_DECODE 0x00010C14
1054#define ASM_ENCDEC_CFG_BLK 0x00010C2C
1055
1056#define ASM_STREAM_CMD_OPEN_WRITE 0x00010BCA
1057struct asm_stream_cmd_open_write {
1058 struct apr_hdr hdr;
1059 u32 uMode;
1060 u16 sink_endpoint;
1061 u16 stream_handle;
1062 u32 post_proc_top;
1063 u32 format;
1064} __attribute__((packed));
1065
Santosh Mardi23321202012-03-22 04:33:25 +05301066#define IEC_61937_MASK 0x00000001
1067#define IEC_60958_MASK 0x00000002
1068
1069#define ASM_STREAM_CMD_OPEN_WRITE_COMPRESSED 0x00010D84
1070struct asm_stream_cmd_open_write_compressed {
1071 struct apr_hdr hdr;
1072 u32 flags;
1073 u32 format;
1074} __packed;
1075
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001076#define ASM_STREAM_CMD_OPEN_READWRITE 0x00010BCC
1077
1078struct asm_stream_cmd_open_read_write {
1079 struct apr_hdr hdr;
1080 u32 uMode;
1081 u32 post_proc_top;
1082 u32 write_format;
1083 u32 read_format;
1084} __attribute__((packed));
1085
Santosh Mardi23321202012-03-22 04:33:25 +05301086#define ADM_CMD_CONNECT_AFE_PORT 0x00010320
1087
1088struct adm_cmd_connect_afe_port {
1089 struct apr_hdr hdr;
1090 u8 mode; /*mode represent the interface is for RX or TX*/
1091 u8 session_id; /*ASM session ID*/
1092 u16 afe_port_id;
1093} __packed;
1094
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001095#define ASM_STREAM_CMD_SET_ENCDEC_PARAM 0x00010C10
1096#define ASM_STREAM_CMD_GET_ENCDEC_PARAM 0x00010C11
1097#define ASM_ENCDEC_CFG_BLK_ID 0x00010C2C
1098#define ASM_ENABLE_SBR_PS 0x00010C63
Swaminathan Sathappan70765cd2011-07-19 18:42:47 -07001099#define ASM_CONFIGURE_DUAL_MONO 0x00010C64
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001100struct asm_stream_cmd_encdec_cfg_blk{
1101 struct apr_hdr hdr;
1102 u32 param_id;
1103 u32 param_size;
1104 struct asm_encode_cfg_blk enc_blk;
1105} __attribute__((packed));
1106
1107struct asm_stream_cmd_encdec_sbc_bitrate{
1108 struct apr_hdr hdr;
1109 u32 param_id;
1110 struct asm_sbc_bitrate sbc_bitrate;
1111} __attribute__((packed));
1112
1113struct asm_stream_cmd_encdec_immed_decode{
1114 struct apr_hdr hdr;
1115 u32 param_id;
1116 u32 param_size;
1117 struct asm_immed_decode dec;
1118} __attribute__((packed));
1119
1120struct asm_stream_cmd_encdec_sbr{
1121 struct apr_hdr hdr;
1122 u32 param_id;
1123 u32 param_size;
1124 struct asm_sbr_ps sbr_ps;
1125} __attribute__((packed));
1126
Swaminathan Sathappan70765cd2011-07-19 18:42:47 -07001127struct asm_stream_cmd_encdec_dualmono {
1128 struct apr_hdr hdr;
1129 u32 param_id;
1130 u32 param_size;
1131 struct asm_dual_mono channel_map;
1132} __packed;
1133
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001134#define ASM_STREAM _CMD_ADJUST_SAMPLES 0x00010C0A
1135struct asm_stream_cmd_adjust_samples{
1136 struct apr_hdr hdr;
1137 u16 nsamples;
1138 u16 reserved;
1139} __attribute__((packed));
1140
1141#define ASM_STREAM_CMD_TAP_POPP_PCM 0x00010BF9
1142struct asm_stream_cmd_tap_popp_pcm{
1143 struct apr_hdr hdr;
1144 u16 enable;
1145 u16 reserved;
1146 u32 module_id;
1147} __attribute__((packed));
1148
1149/* Session Level commands */
1150#define ASM_SESSION_CMD_MEMORY_MAP 0x00010C32
1151struct asm_stream_cmd_memory_map{
1152 struct apr_hdr hdr;
1153 u32 buf_add;
1154 u32 buf_size;
1155 u16 mempool_id;
1156 u16 reserved;
1157} __attribute__((packed));
1158
1159#define ASM_SESSION_CMD_MEMORY_UNMAP 0x00010C33
1160struct asm_stream_cmd_memory_unmap{
1161 struct apr_hdr hdr;
1162 u32 buf_add;
1163} __attribute__((packed));
1164
1165#define ASM_SESSION_CMD_MEMORY_MAP_REGIONS 0x00010C45
1166struct asm_memory_map_regions{
1167 u32 phys;
1168 u32 buf_size;
1169} __attribute__((packed));
1170
1171struct asm_stream_cmd_memory_map_regions{
1172 struct apr_hdr hdr;
1173 u16 mempool_id;
1174 u16 nregions;
1175} __attribute__((packed));
1176
1177#define ASM_SESSION_CMD_MEMORY_UNMAP_REGIONS 0x00010C46
1178struct asm_memory_unmap_regions{
1179 u32 phys;
1180} __attribute__((packed));
1181
1182struct asm_stream_cmd_memory_unmap_regions{
1183 struct apr_hdr hdr;
1184 u16 nregions;
1185 u16 reserved;
1186} __attribute__((packed));
1187
1188#define ASM_SESSION_CMD_RUN 0x00010BD2
1189struct asm_stream_cmd_run{
1190 struct apr_hdr hdr;
1191 u32 flags;
1192 u32 msw_ts;
1193 u32 lsw_ts;
1194} __attribute__((packed));
1195
1196/* Session level events */
1197#define ASM_SESSION_CMD_REGISTER_FOR_RX_UNDERFLOW_EVENTS 0x00010BD5
1198struct asm_stream_cmd_reg_rx_underflow_event{
1199 struct apr_hdr hdr;
1200 u16 enable;
1201 u16 reserved;
1202} __attribute__((packed));
1203
1204#define ASM_SESSION_CMD_REGISTER_FOR_TX_OVERFLOW_EVENTS 0x00010BD6
1205struct asm_stream_cmd_reg_tx_overflow_event{
1206 struct apr_hdr hdr;
1207 u16 enable;
1208 u16 reserved;
1209} __attribute__((packed));
1210
1211/* Data Path commands */
1212#define ASM_DATA_CMD_WRITE 0x00010BD9
1213struct asm_stream_cmd_write{
1214 struct apr_hdr hdr;
1215 u32 buf_add;
1216 u32 avail_bytes;
1217 u32 uid;
1218 u32 msw_ts;
1219 u32 lsw_ts;
1220 u32 uflags;
1221} __attribute__((packed));
1222
1223#define ASM_DATA_CMD_READ 0x00010BDA
1224struct asm_stream_cmd_read{
1225 struct apr_hdr hdr;
1226 u32 buf_add;
1227 u32 buf_size;
1228 u32 uid;
1229} __attribute__((packed));
1230
1231#define ASM_DATA_CMD_MEDIA_FORMAT_UPDATE 0x00010BDC
Deepa Madiregama55cbf782011-09-10 05:44:39 +05301232#define ASM_DATA_EVENT_ENC_SR_CM_NOTIFY 0x00010BDE
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001233struct asm_stream_media_format_update{
1234 struct apr_hdr hdr;
1235 u32 format;
1236 u32 cfg_size;
1237 union {
1238 struct asm_pcm_cfg pcm_cfg;
1239 struct asm_adpcm_cfg adpcm_cfg;
1240 struct asm_yadpcm_cfg yadpcm_cfg;
1241 struct asm_midi_cfg midi_cfg;
1242 struct asm_wma_cfg wma_cfg;
1243 struct asm_wmapro_cfg wmapro_cfg;
1244 struct asm_aac_cfg aac_cfg;
1245 struct asm_flac_cfg flac_cfg;
1246 struct asm_vorbis_cfg vorbis_cfg;
Kiran Kandi5e809b02012-01-31 00:24:33 -08001247 struct asm_multi_channel_pcm_fmt_blk multi_ch_pcm_cfg;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001248 } __attribute__((packed)) write_cfg;
1249} __attribute__((packed));
1250
1251
1252/* Command Responses */
1253#define ASM_STREAM_CMDRSP_GET_ENCDEC_PARAM 0x00010C12
1254struct asm_stream_cmdrsp_get_readwrite_param{
1255 struct apr_hdr hdr;
1256 u32 status;
1257 u32 param_id;
1258 u16 param_size;
1259 u16 padding;
1260 union {
1261 struct asm_sbc_bitrate sbc_bitrate;
1262 struct asm_immed_decode aac_dec;
1263 } __attribute__((packed)) read_write_cfg;
1264} __attribute__((packed));
1265
1266
1267#define ASM_SESSION_CMDRSP_GET_SESSION_TIME 0x00010BD8
1268struct asm_stream_cmdrsp_get_session_time{
1269 struct apr_hdr hdr;
1270 u32 status;
1271 u32 msw_ts;
1272 u32 lsw_ts;
1273} __attribute__((packed));
1274
1275#define ASM_DATA_EVENT_WRITE_DONE 0x00010BDF
1276struct asm_data_event_write_done{
1277 u32 buf_add;
1278 u32 status;
1279} __attribute__((packed));
1280
1281#define ASM_DATA_EVENT_READ_DONE 0x00010BE0
1282struct asm_data_event_read_done{
1283 u32 status;
1284 u32 buffer_add;
1285 u32 enc_frame_size;
1286 u32 offset;
1287 u32 msw_ts;
1288 u32 lsw_ts;
1289 u32 flags;
1290 u32 num_frames;
1291 u32 id;
1292} __attribute__((packed));
1293
1294#define ASM_DATA_EVENT_SR_CM_CHANGE_NOTIFY 0x00010C65
1295struct asm_data_event_sr_cm_change_notify {
1296 u32 sample_rate;
1297 u16 no_of_channels;
1298 u16 reserved;
1299 u8 channel_map[8];
1300} __packed;
1301
1302/* service level events */
1303
1304#define ASM_SERVICE_CMDRSP_GET_STREAM_HANDLES 0x00010C1B
1305struct asm_svc_cmdrsp_get_strm_handles{
1306 struct apr_hdr hdr;
1307 u32 num_handles;
1308 u32 stream_handles;
1309} __attribute__((packed));
1310
1311
1312#define ASM_SERVICE_CMDRSP_GET_WALLCLOCK_TIME 0x00010C1A
1313struct asm_svc_cmdrsp_get_wallclock_time{
1314 struct apr_hdr hdr;
1315 u32 status;
1316 u32 msw_ts;
1317 u32 lsw_ts;
1318} __attribute__((packed));
1319
1320/*
1321 * Error code
1322*/
1323#define ADSP_EOK 0x00000000 /* Success / completed / no errors. */
1324#define ADSP_EFAILED 0x00000001 /* General failure. */
1325#define ADSP_EBADPARAM 0x00000002 /* Bad operation parameter(s). */
1326#define ADSP_EUNSUPPORTED 0x00000003 /* Unsupported routine/operation. */
1327#define ADSP_EVERSION 0x00000004 /* Unsupported version. */
1328#define ADSP_EUNEXPECTED 0x00000005 /* Unexpected problem encountered. */
1329#define ADSP_EPANIC 0x00000006 /* Unhandled problem occurred. */
1330#define ADSP_ENORESOURCE 0x00000007 /* Unable to allocate resource(s). */
1331#define ADSP_EHANDLE 0x00000008 /* Invalid handle. */
1332#define ADSP_EALREADY 0x00000009 /* Operation is already processed. */
1333#define ADSP_ENOTREADY 0x0000000A /* Operation not ready to be processed*/
1334#define ADSP_EPENDING 0x0000000B /* Operation is pending completion*/
1335#define ADSP_EBUSY 0x0000000C /* Operation could not be accepted or
1336 processed. */
1337#define ADSP_EABORTED 0x0000000D /* Operation aborted due to an error. */
1338#define ADSP_EPREEMPTED 0x0000000E /* Operation preempted by higher priority*/
1339#define ADSP_ECONTINUE 0x0000000F /* Operation requests intervention
1340 to complete. */
1341#define ADSP_EIMMEDIATE 0x00000010 /* Operation requests immediate
1342 intervention to complete. */
1343#define ADSP_ENOTIMPL 0x00000011 /* Operation is not implemented. */
1344#define ADSP_ENEEDMORE 0x00000012 /* Operation needs more data or resources*/
1345
1346#endif /*_APR_AUDIO_H_*/