blob: 85da871e94eb4d0422d7d03628efcb57ac358863 [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 */
228 u16 reserved;
229} __attribute__ ((packed));
230
231struct afe_port_hdmi_cfg {
232 u16 bitwidth; /* 16,24,32 */
233 u16 channel_mode; /* HDMI Stereo = 0 */
234 /* HDMI_3Point1 (4-ch) = 1 */
235 /* HDMI_5Point1 (6-ch) = 2 */
236 /* HDMI_6Point1 (8-ch) = 3 */
237 u16 data_type; /* HDMI_Linear = 0 */
Kiran Kandi5e809b02012-01-31 00:24:33 -0800238 /* HDMI_non_Linear = 1 */
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700239} __attribute__ ((packed));
240
241
Kiran Kandi5e809b02012-01-31 00:24:33 -0800242struct afe_port_hdmi_multi_ch_cfg {
243 u16 data_type; /* HDMI_Linear = 0 */
244 /* HDMI_non_Linear = 1 */
245 u16 channel_allocation; /* The default is 0 (Stereo) */
246 u16 reserved; /* must be set to 0 */
247} __packed;
248
249
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700250/* Slimbus Device Ids */
251#define AFE_SLIMBUS_DEVICE_1 0x0
252#define AFE_SLIMBUS_DEVICE_2 0x1
253#define AFE_PORT_MAX_AUDIO_CHAN_CNT 16
254
255struct afe_port_slimbus_cfg {
256 u16 slimbus_dev_id; /* SLIMBUS Device id.*/
257
258 u16 slave_dev_pgd_la; /* Slave ported generic device
259 * logical address.
260 */
261 u16 slave_dev_intfdev_la; /* Slave interface device logical
262 * address.
263 */
264 u16 bit_width; /** bit width of the samples, 16, 24.*/
265
266 u16 data_format; /** data format.*/
267
268 u16 num_channels; /** Number of channels.*/
269
270 /** Slave port mapping for respective channels.*/
271 u16 slave_port_mapping[AFE_PORT_MAX_AUDIO_CHAN_CNT];
272
273 u16 reserved;
274} __packed;
275
Bharath Ramachandramurthy9c79f132011-11-28 11:18:57 -0800276struct afe_port_slimbus_sch_cfg {
277 u16 slimbus_dev_id; /* SLIMBUS Device id.*/
278 u16 bit_width; /** bit width of the samples, 16, 24.*/
279 u16 data_format; /** data format.*/
280 u16 num_channels; /** Number of channels.*/
281 u16 reserved;
282 /** Slave channel mapping for respective channels.*/
283 u8 slave_ch_mapping[8];
284} __packed;
285
Laxminath Kasam32657ec2011-08-01 19:26:57 +0530286struct afe_port_rtproxy_cfg {
287 u16 bitwidth; /* 16,24,32 */
288 u16 interleaved; /* interleaved = 1 */
289 /* Noninterleaved = 0 */
290 u16 frame_sz; /* 5ms buffers = 160bytes */
291 u16 jitter; /* 10ms of jitter = 320 */
292 u16 lw_mark; /* Low watermark in bytes for triggering event*/
293 u16 hw_mark; /* High watermark bytes for triggering event*/
294 u16 rsvd;
295 int num_ch; /* 1 to 8 */
296} __packed;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700297
Bharath Ramachandramurthy9c79f132011-11-28 11:18:57 -0800298#define AFE_PORT_AUDIO_IF_CONFIG 0x000100d3
299#define AFE_PORT_AUDIO_SLIM_SCH_CONFIG 0x000100e4
Kiran Kandi5e809b02012-01-31 00:24:33 -0800300#define AFE_PORT_MULTI_CHAN_HDMI_AUDIO_IF_CONFIG 0x000100D9
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700301
302union afe_port_config {
Bharath Ramachandramurthy9c79f132011-11-28 11:18:57 -0800303 struct afe_port_pcm_cfg pcm;
304 struct afe_port_mi2s_cfg mi2s;
305 struct afe_port_hdmi_cfg hdmi;
306 struct afe_port_hdmi_multi_ch_cfg hdmi_multi_ch;
307 struct afe_port_slimbus_cfg slimbus;
308 struct afe_port_slimbus_sch_cfg slim_sch;
309 struct afe_port_rtproxy_cfg rtproxy;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700310} __attribute__((packed));
311
312struct afe_audioif_config_command {
313 struct apr_hdr hdr;
314 u16 port_id;
315 union afe_port_config port;
316} __attribute__ ((packed));
317
318#define AFE_TEST_CODEC_LOOPBACK_CTL 0x000100d5
319struct afe_codec_loopback_command {
320 u16 port_inf; /* Primary i2s = 0 */
321 /* PCM = 2 */
322 /* Secondary i2s = 4 */
323 /* Mi2s = 6 */
324 u16 enable; /* 0, disable. 1, enable */
325} __attribute__ ((packed));
326
327
328#define AFE_PARAM_ID_SIDETONE_GAIN 0x00010300
329struct afe_param_sidetone_gain {
330 u16 gain;
331 u16 reserved;
332} __attribute__ ((packed));
333
334#define AFE_PARAM_ID_SAMPLING_RATE 0x00010301
335struct afe_param_sampling_rate {
336 u32 sampling_rate;
337} __attribute__ ((packed));
338
339
340#define AFE_PARAM_ID_CHANNELS 0x00010302
341struct afe_param_channels {
342 u16 channels;
343 u16 reserved;
344} __attribute__ ((packed));
345
346
347#define AFE_PARAM_ID_LOOPBACK_GAIN 0x00010303
348struct afe_param_loopback_gain {
349 u16 gain;
350 u16 reserved;
351} __attribute__ ((packed));
352
353
354#define AFE_MODULE_ID_PORT_INFO 0x00010200
355struct afe_param_payload {
356 u32 module_id;
357 u32 param_id;
358 u16 param_size;
359 u16 reserved;
360 union {
361 struct afe_param_sidetone_gain sidetone_gain;
362 struct afe_param_sampling_rate sampling_rate;
363 struct afe_param_channels channels;
364 struct afe_param_loopback_gain loopback_gain;
365 } __attribute__((packed)) param;
366} __attribute__ ((packed));
367
368#define AFE_PORT_CMD_SET_PARAM 0x000100dc
369
370struct afe_port_cmd_set_param {
371 struct apr_hdr hdr;
372 u16 port_id;
373 u16 payload_size;
374 u32 payload_address;
375 struct afe_param_payload payload;
376} __attribute__ ((packed));
377
Ben Rombergerb7603232011-11-23 17:16:27 -0800378struct afe_port_cmd_set_param_no_payload {
379 struct apr_hdr hdr;
380 u16 port_id;
381 u16 payload_size;
382 u32 payload_address;
383} __packed;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700384
385#define AFE_EVENT_GET_ACTIVE_PORTS 0x00010100
386struct afe_get_active_ports_rsp {
387 u16 num_ports;
388 u16 port_id;
389} __attribute__ ((packed));
390
391
392#define AFE_EVENT_GET_ACTIVE_HANDLES 0x00010102
393struct afe_get_active_handles_rsp {
394 u16 port_id;
395 u16 num_handles;
396 u16 mode; /* 0, voice rx */
397 /* 1, voice tx */
398 /* 2, audio rx */
399 /* 3, audio tx */
400 u16 handle;
401} __attribute__ ((packed));
402
Laxminath Kasam32657ec2011-08-01 19:26:57 +0530403#define AFE_SERVICE_CMD_MEMORY_MAP 0x000100DE
404struct afe_cmd_memory_map {
405 struct apr_hdr hdr;
406 u32 phy_addr;
407 u32 mem_sz;
408 u16 mem_id;
409 u16 rsvd;
410} __packed;
411
412#define AFE_SERVICE_CMD_MEMORY_UNMAP 0x000100DF
413struct afe_cmd_memory_unmap {
414 struct apr_hdr hdr;
415 u32 phy_addr;
416} __packed;
417
418#define AFE_SERVICE_CMD_REG_RTPORT 0x000100E0
419struct afe_cmd_reg_rtport {
420 struct apr_hdr hdr;
421 u16 port_id;
422 u16 rsvd;
423} __packed;
424
425#define AFE_SERVICE_CMD_UNREG_RTPORT 0x000100E1
426struct afe_cmd_unreg_rtport {
427 struct apr_hdr hdr;
428 u16 port_id;
429 u16 rsvd;
430} __packed;
431
432#define AFE_SERVICE_CMD_RTPORT_WR 0x000100E2
433struct afe_cmd_rtport_wr {
434 struct apr_hdr hdr;
435 u16 port_id;
436 u16 rsvd;
437 u32 buf_addr;
438 u32 bytes_avail;
439} __packed;
440
441#define AFE_SERVICE_CMD_RTPORT_RD 0x000100E3
442struct afe_cmd_rtport_rd {
443 struct apr_hdr hdr;
444 u16 port_id;
445 u16 rsvd;
446 u32 buf_addr;
447 u32 bytes_avail;
448} __packed;
449
450#define AFE_EVENT_RT_PROXY_PORT_STATUS 0x00010105
451
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700452#define ADM_MAX_COPPS 5
453
454#define ADM_SERVICE_CMD_GET_COPP_HANDLES 0x00010300
455struct adm_get_copp_handles_command {
456 struct apr_hdr hdr;
457} __attribute__ ((packed));
458
459#define ADM_CMD_MATRIX_MAP_ROUTINGS 0x00010301
460struct adm_routings_session {
461 u16 id;
462 u16 num_copps;
463 u16 copp_id[ADM_MAX_COPPS+1]; /*Padding if numCopps is odd */
464} __packed;
465
466struct adm_routings_command {
467 struct apr_hdr hdr;
468 u32 path; /* 0 = Rx, 1 Tx */
469 u32 num_sessions;
470 struct adm_routings_session session[8];
471} __attribute__ ((packed));
472
473
474#define ADM_CMD_MATRIX_RAMP_GAINS 0x00010302
475struct adm_ramp_gain {
476 struct apr_hdr hdr;
477 u16 session_id;
478 u16 copp_id;
479 u16 initial_gain;
480 u16 gain_increment;
481 u16 ramp_duration;
482 u16 reserved;
483} __attribute__ ((packed));
484
485struct adm_ramp_gains_command {
486 struct apr_hdr hdr;
487 u32 id;
488 u32 num_gains;
489 struct adm_ramp_gain gains[ADM_MAX_COPPS];
490} __attribute__ ((packed));
491
492
493#define ADM_CMD_COPP_OPEN 0x00010304
494struct adm_copp_open_command {
495 struct apr_hdr hdr;
496 u16 flags;
497 u16 mode; /* 1-RX, 2-Live TX, 3-Non Live TX */
498 u16 endpoint_id1;
499 u16 endpoint_id2;
500 u32 topology_id;
501 u16 channel_config;
502 u16 reserved;
503 u32 rate;
504} __attribute__ ((packed));
505
506#define ADM_CMD_COPP_CLOSE 0x00010305
507
Kiran Kandi5e809b02012-01-31 00:24:33 -0800508#define ADM_CMD_MULTI_CHANNEL_COPP_OPEN 0x00010310
509struct adm_multi_ch_copp_open_command {
510 struct apr_hdr hdr;
511 u16 flags;
512 u16 mode; /* 1-RX, 2-Live TX, 3-Non Live TX */
513 u16 endpoint_id1;
514 u16 endpoint_id2;
515 u32 topology_id;
516 u16 channel_config;
517 u16 reserved;
518 u32 rate;
519 u8 dev_channel_mapping[8];
520} __packed;
521
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700522#define ADM_CMD_MEMORY_MAP 0x00010C30
523struct adm_cmd_memory_map{
524 struct apr_hdr hdr;
525 u32 buf_add;
526 u32 buf_size;
527 u16 mempool_id;
528 u16 reserved;
529} __attribute__((packed));
530
531#define ADM_CMD_MEMORY_UNMAP 0x00010C31
532struct adm_cmd_memory_unmap{
533 struct apr_hdr hdr;
534 u32 buf_add;
535} __attribute__((packed));
536
537#define ADM_CMD_MEMORY_MAP_REGIONS 0x00010C47
538struct adm_memory_map_regions{
539 u32 phys;
540 u32 buf_size;
541} __attribute__((packed));
542
543struct adm_cmd_memory_map_regions{
544 struct apr_hdr hdr;
545 u16 mempool_id;
546 u16 nregions;
547} __attribute__((packed));
548
549#define ADM_CMD_MEMORY_UNMAP_REGIONS 0x00010C48
550struct adm_memory_unmap_regions{
551 u32 phys;
552} __attribute__((packed));
553
554struct adm_cmd_memory_unmap_regions{
555 struct apr_hdr hdr;
556 u16 nregions;
557 u16 reserved;
558} __attribute__((packed));
559
560#define DEFAULT_COPP_TOPOLOGY 0x00010be3
561#define DEFAULT_POPP_TOPOLOGY 0x00010be4
562#define VPM_TX_SM_ECNS_COPP_TOPOLOGY 0x00010F71
563#define VPM_TX_DM_FLUENCE_COPP_TOPOLOGY 0x00010F72
Jayasena Sangaraboina0fc197d2011-12-09 13:20:33 -0800564#define VPM_TX_QMIC_FLUENCE_COPP_TOPOLOGY 0x00010F75
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700565
566#define ASM_MAX_EQ_BANDS 12
567
568struct asm_eq_band {
569 u32 band_idx; /* The band index, 0 .. 11 */
570 u32 filter_type; /* Filter band type */
571 u32 center_freq_hz; /* Filter band center frequency */
572 u32 filter_gain; /* Filter band initial gain (dB) */
573 /* Range is +12 dB to -12 dB with 1dB increments. */
574 u32 q_factor;
575} __attribute__ ((packed));
576
577struct asm_equalizer_params {
578 u32 enable;
579 u32 num_bands;
580 struct asm_eq_band eq_bands[ASM_MAX_EQ_BANDS];
581} __attribute__ ((packed));
582
583struct asm_master_gain_params {
584 u16 master_gain;
585 u16 padding;
586} __attribute__ ((packed));
587
588struct asm_lrchannel_gain_params {
589 u16 left_gain;
590 u16 right_gain;
591} __attribute__ ((packed));
592
593struct asm_mute_params {
594 u32 muteflag;
595} __attribute__ ((packed));
596
597struct asm_softvolume_params {
598 u32 period;
599 u32 step;
600 u32 rampingcurve;
601} __attribute__ ((packed));
602
603struct asm_softpause_params {
604 u32 enable;
605 u32 period;
606 u32 step;
607 u32 rampingcurve;
608} __packed;
609
610struct asm_pp_param_data_hdr {
611 u32 module_id;
612 u32 param_id;
613 u16 param_size;
614 u16 reserved;
615} __attribute__ ((packed));
616
617struct asm_pp_params_command {
618 struct apr_hdr hdr;
619 u32 *payload;
620 u32 payload_size;
621 struct asm_pp_param_data_hdr params;
622} __attribute__ ((packed));
623
624#define EQUALIZER_MODULE_ID 0x00010c27
625#define EQUALIZER_PARAM_ID 0x00010c28
626
627#define VOLUME_CONTROL_MODULE_ID 0x00010bfe
628#define MASTER_GAIN_PARAM_ID 0x00010bff
629#define L_R_CHANNEL_GAIN_PARAM_ID 0x00010c00
630#define MUTE_CONFIG_PARAM_ID 0x00010c01
631#define SOFT_PAUSE_PARAM_ID 0x00010D6A
Swaminathan Sathappanb0021cd2011-08-31 15:20:12 -0700632#define SOFT_VOLUME_PARAM_ID 0x00010C29
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700633
634#define IIR_FILTER_ENABLE_PARAM_ID 0x00010c03
635#define IIR_FILTER_PREGAIN_PARAM_ID 0x00010c04
636#define IIR_FILTER_CONFIG_PARAM_ID 0x00010c05
637
638#define MBADRC_MODULE_ID 0x00010c06
639#define MBADRC_ENABLE_PARAM_ID 0x00010c07
640#define MBADRC_CONFIG_PARAM_ID 0x00010c08
641
642
643#define ADM_CMD_SET_PARAMS 0x00010306
644#define ADM_CMD_GET_PARAMS 0x0001030B
645#define ADM_CMDRSP_GET_PARAMS 0x0001030C
646struct adm_set_params_command {
647 struct apr_hdr hdr;
648 u32 payload;
649 u32 payload_size;
650} __attribute__ ((packed));
651
652
653#define ADM_CMD_TAP_COPP_PCM 0x00010307
654struct adm_tap_copp_pcm_command {
655 struct apr_hdr hdr;
656} __attribute__ ((packed));
657
658
659/* QDSP6 to Client messages
660*/
661#define ADM_SERVICE_CMDRSP_GET_COPP_HANDLES 0x00010308
662struct adm_get_copp_handles_respond {
663 struct apr_hdr hdr;
664 u32 handles;
665 u32 copp_id;
666} __attribute__ ((packed));
667
668#define ADM_CMDRSP_COPP_OPEN 0x0001030A
669struct adm_copp_open_respond {
670 u32 status;
671 u16 copp_id;
672 u16 reserved;
673} __attribute__ ((packed));
674
Kiran Kandi5e809b02012-01-31 00:24:33 -0800675#define ADM_CMDRSP_MULTI_CHANNEL_COPP_OPEN 0x00010311
676
677
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700678#define ASM_STREAM_PRIORITY_NORMAL 0
679#define ASM_STREAM_PRIORITY_LOW 1
680#define ASM_STREAM_PRIORITY_HIGH 2
681#define ASM_STREAM_PRIORITY_RESERVED 3
682
683#define ASM_END_POINT_DEVICE_MATRIX 0
684#define ASM_END_POINT_STREAM 1
685
686#define AAC_ENC_MODE_AAC_LC 0x02
687#define AAC_ENC_MODE_AAC_P 0x05
688#define AAC_ENC_MODE_EAAC_P 0x1D
689
690#define ASM_STREAM_CMD_CLOSE 0x00010BCD
691#define ASM_STREAM_CMD_FLUSH 0x00010BCE
692#define ASM_STREAM_CMD_SET_PP_PARAMS 0x00010BCF
693#define ASM_STREAM_CMD_GET_PP_PARAMS 0x00010BD0
694#define ASM_STREAM_CMDRSP_GET_PP_PARAMS 0x00010BD1
695#define ASM_SESSION_CMD_PAUSE 0x00010BD3
696#define ASM_SESSION_CMD_GET_SESSION_TIME 0x00010BD4
697#define ASM_DATA_CMD_EOS 0x00010BDB
698#define ASM_DATA_EVENT_EOS 0x00010BDD
699
700#define ASM_SERVICE_CMD_GET_STREAM_HANDLES 0x00010C0B
701#define ASM_STREAM_CMD_FLUSH_READBUFS 0x00010C09
702
703#define ASM_SESSION_EVENT_RX_UNDERFLOW 0x00010C17
704#define ASM_SESSION_EVENT_TX_OVERFLOW 0x00010C18
705#define ASM_SERVICE_CMD_GET_WALLCLOCK_TIME 0x00010C19
706#define ASM_DATA_CMDRSP_EOS 0x00010C1C
707
708/* ASM Data structures */
709
710/* common declarations */
711struct asm_pcm_cfg {
712 u16 ch_cfg;
713 u16 bits_per_sample;
714 u32 sample_rate;
715 u16 is_signed;
716 u16 interleaved;
717};
718
Kiran Kandi5e809b02012-01-31 00:24:33 -0800719#define PCM_CHANNEL_NULL 0
720
721/* Front left channel. */
722#define PCM_CHANNEL_FL 1
723
724/* Front right channel. */
725#define PCM_CHANNEL_FR 2
726
727/* Front center channel. */
728#define PCM_CHANNEL_FC 3
729
730/* Left surround channel.*/
731#define PCM_CHANNEL_LS 4
732
733/* Right surround channel.*/
734#define PCM_CHANNEL_RS 5
735
736/* Low frequency effect channel. */
737#define PCM_CHANNEL_LFE 6
738
739/* Center surround channel; Rear center channel. */
740#define PCM_CHANNEL_CS 7
741
742/* Left back channel; Rear left channel. */
743#define PCM_CHANNEL_LB 8
744
745/* Right back channel; Rear right channel. */
746#define PCM_CHANNEL_RB 9
747
748/* Top surround channel. */
749#define PCM_CHANNEL_TS 10
750
751/* Center vertical height channel.*/
752#define PCM_CHANNEL_CVH 11
753
754/* Mono surround channel.*/
755#define PCM_CHANNEL_MS 12
756
757/* Front left of center. */
758#define PCM_CHANNEL_FLC 13
759
760/* Front right of center. */
761#define PCM_CHANNEL_FRC 14
762
763/* Rear left of center. */
764#define PCM_CHANNEL_RLC 15
765
766/* Rear right of center. */
767#define PCM_CHANNEL_RRC 16
768
769#define PCM_FORMAT_MAX_NUM_CHANNEL 8
770
771
772/*
773 * Multiple-channel PCM decoder format block structure used in the
774 * #ASM_STREAM_CMD_OPEN_WRITE command.
775 * The data must be in little-endian format.
776 */
777struct asm_multi_channel_pcm_fmt_blk {
778
779 u16 num_channels; /*
780 * Number of channels.
781 * Supported values:1 to 8
782 */
783
784 u16 bits_per_sample; /*
785 * Number of bits per sample per channel.
786 * Supported values: 16, 24 When used for
787 * playback, the client must send 24-bit
788 * samples packed in 32-bit words. The
789 * 24-bit samples must be placed in the most
790 * significant 24 bits of the 32-bit word. When
791 * used for recording, the aDSP sends 24-bit
792 * samples packed in 32-bit words. The 24-bit
793 * samples are placed in the most significant
794 * 24 bits of the 32-bit word.
795 */
796
797 u32 sample_rate; /*
798 * Number of samples per second
799 * (in Hertz). Supported values:
800 * 2000 to 48000
801 */
802
803 u16 is_signed; /*
804 * Flag that indicates the samples
805 * are signed (1).
806 */
807
808 u16 is_interleaved; /*
809 * Flag that indicates whether the channels are
810 * de-interleaved (0) or interleaved (1).
811 * Interleaved format means corresponding
812 * samples from the left and right channels are
813 * interleaved within the buffer.
814 * De-interleaved format means samples from
815 * each channel are contiguous in the buffer.
816 * The samples from one channel immediately
817 * follow those of the previous channel.
818 */
819
820 u8 channel_mapping[8]; /*
821 * Supported values:
822 * PCM_CHANNEL_NULL, PCM_CHANNEL_FL,
823 * PCM_CHANNEL_FR, PCM_CHANNEL_FC,
824 * PCM_CHANNEL_LS, PCM_CHANNEL_RS,
825 * PCM_CHANNEL_LFE, PCM_CHANNEL_CS,
826 * PCM_CHANNEL_LB, PCM_CHANNEL_RB,
827 * PCM_CHANNEL_TS, PCM_CHANNEL_CVH,
828 * PCM_CHANNEL_MS, PCM_CHANNEL_FLC,
829 * PCM_CHANNEL_FRC, PCM_CHANNEL_RLC,
830 * PCM_CHANNEL_RRC.
831 * Channel[i] mapping describes channel I. Each
832 * element i of the array describes channel I
833 * inside the buffer where I < num_channels.
834 * An unused channel is set to zero.
835 */
836};
837
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700838struct asm_adpcm_cfg {
839 u16 ch_cfg;
840 u16 bits_per_sample;
841 u32 sample_rate;
842 u32 block_size;
843};
844
845struct asm_yadpcm_cfg {
846 u16 ch_cfg;
847 u16 bits_per_sample;
848 u32 sample_rate;
849};
850
851struct asm_midi_cfg {
852 u32 nMode;
853};
854
855struct asm_wma_cfg {
856 u16 format_tag;
857 u16 ch_cfg;
858 u32 sample_rate;
859 u32 avg_bytes_per_sec;
860 u16 block_align;
861 u16 valid_bits_per_sample;
862 u32 ch_mask;
863 u16 encode_opt;
864 u16 adv_encode_opt;
865 u32 adv_encode_opt2;
866 u32 drc_peak_ref;
867 u32 drc_peak_target;
868 u32 drc_ave_ref;
869 u32 drc_ave_target;
870};
871
872struct asm_wmapro_cfg {
873 u16 format_tag;
874 u16 ch_cfg;
875 u32 sample_rate;
876 u32 avg_bytes_per_sec;
877 u16 block_align;
878 u16 valid_bits_per_sample;
879 u32 ch_mask;
880 u16 encode_opt;
881 u16 adv_encode_opt;
882 u32 adv_encode_opt2;
883 u32 drc_peak_ref;
884 u32 drc_peak_target;
885 u32 drc_ave_ref;
886 u32 drc_ave_target;
887};
888
889struct asm_aac_cfg {
890 u16 format;
891 u16 aot;
892 u16 ep_config;
893 u16 section_data_resilience;
894 u16 scalefactor_data_resilience;
895 u16 spectral_data_resilience;
896 u16 ch_cfg;
897 u16 reserved;
898 u32 sample_rate;
899};
900
901struct asm_flac_cfg {
902 u16 stream_info_present;
903 u16 min_blk_size;
904 u16 max_blk_size;
905 u16 ch_cfg;
906 u16 sample_size;
907 u16 sample_rate;
908 u16 md5_sum;
909 u32 ext_sample_rate;
910 u32 min_frame_size;
911 u32 max_frame_size;
912};
913
914struct asm_vorbis_cfg {
915 u32 ch_cfg;
916 u32 bit_rate;
917 u32 min_bit_rate;
918 u32 max_bit_rate;
919 u16 bit_depth_pcm_sample;
920 u16 bit_stream_format;
921};
922
923struct asm_aac_read_cfg {
924 u32 bitrate;
925 u32 enc_mode;
926 u16 format;
927 u16 ch_cfg;
928 u32 sample_rate;
929};
930
931struct asm_amrnb_read_cfg {
932 u16 mode;
933 u16 dtx_mode;
934};
935
Alex Wong2caeecc2011-10-28 10:52:15 +0530936struct asm_amrwb_read_cfg {
937 u16 mode;
938 u16 dtx_mode;
939};
940
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700941struct asm_evrc_read_cfg {
942 u16 max_rate;
943 u16 min_rate;
944 u16 rate_modulation_cmd;
945 u16 reserved;
946};
947
948struct asm_qcelp13_read_cfg {
949 u16 max_rate;
950 u16 min_rate;
951 u16 reduced_rate_level;
952 u16 rate_modulation_cmd;
953};
954
955struct asm_sbc_read_cfg {
956 u32 subband;
957 u32 block_len;
958 u32 ch_mode;
959 u32 alloc_method;
960 u32 bit_rate;
961 u32 sample_rate;
962};
963
964struct asm_sbc_bitrate {
965 u32 bitrate;
966};
967
968struct asm_immed_decode {
969 u32 mode;
970};
971
972struct asm_sbr_ps {
973 u32 enable;
974};
975
Swaminathan Sathappan70765cd2011-07-19 18:42:47 -0700976struct asm_dual_mono {
977 u16 sce_left;
978 u16 sce_right;
979};
980
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700981struct asm_encode_cfg_blk {
982 u32 frames_per_buf;
983 u32 format_id;
984 u32 cfg_size;
985 union {
986 struct asm_pcm_cfg pcm;
987 struct asm_aac_read_cfg aac;
988 struct asm_amrnb_read_cfg amrnb;
989 struct asm_evrc_read_cfg evrc;
990 struct asm_qcelp13_read_cfg qcelp13;
991 struct asm_sbc_read_cfg sbc;
Alex Wong2caeecc2011-10-28 10:52:15 +0530992 struct asm_amrwb_read_cfg amrwb;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700993 } __attribute__((packed)) cfg;
994};
995
996struct asm_frame_meta_info {
997 u32 offset_to_frame;
998 u32 frame_size;
999 u32 encoded_pcm_samples;
1000 u32 msw_ts;
1001 u32 lsw_ts;
1002 u32 nflags;
1003};
1004
1005/* Stream level commands */
1006#define ASM_STREAM_CMD_OPEN_READ 0x00010BCB
1007struct asm_stream_cmd_open_read {
1008 struct apr_hdr hdr;
1009 u32 uMode;
1010 u32 src_endpoint;
1011 u32 pre_proc_top;
1012 u32 format;
1013} __attribute__((packed));
1014
1015/* Supported formats */
1016#define LINEAR_PCM 0x00010BE5
1017#define DTMF 0x00010BE6
1018#define ADPCM 0x00010BE7
1019#define YADPCM 0x00010BE8
1020#define MP3 0x00010BE9
Bharath Ramachandramurthy4f71d502011-10-23 19:45:22 -07001021#define MPEG4_AAC 0x00010BEA
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001022#define AMRNB_FS 0x00010BEB
Alex Wong2caeecc2011-10-28 10:52:15 +05301023#define AMRWB_FS 0x00010BEC
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001024#define V13K_FS 0x00010BED
1025#define EVRC_FS 0x00010BEE
1026#define EVRCB_FS 0x00010BEF
1027#define EVRCWB_FS 0x00010BF0
1028#define MIDI 0x00010BF1
1029#define SBC 0x00010BF2
1030#define WMA_V10PRO 0x00010BF3
1031#define WMA_V9 0x00010BF4
1032#define AMR_WB_PLUS 0x00010BF5
1033#define AC3_DECODER 0x00010BF6
1034#define G711_ALAW_FS 0x00010BF7
1035#define G711_MLAW_FS 0x00010BF8
1036#define G711_PCM_FS 0x00010BF9
Bharath Ramachandramurthy4f71d502011-10-23 19:45:22 -07001037#define MPEG4_MULTI_AAC 0x00010D86
Baruch Eruchimovitche9cbfc12011-10-09 19:47:08 +02001038#define US_POINT_EPOS_FORMAT 0x00012310
1039#define US_RAW_FORMAT 0x0001127C
Kiran Kandi5e809b02012-01-31 00:24:33 -08001040#define MULTI_CHANNEL_PCM 0x00010C66
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001041
1042#define ASM_ENCDEC_SBCRATE 0x00010C13
1043#define ASM_ENCDEC_IMMDIATE_DECODE 0x00010C14
1044#define ASM_ENCDEC_CFG_BLK 0x00010C2C
1045
1046#define ASM_ENCDEC_SBCRATE 0x00010C13
1047#define ASM_ENCDEC_IMMDIATE_DECODE 0x00010C14
1048#define ASM_ENCDEC_CFG_BLK 0x00010C2C
1049
1050#define ASM_STREAM_CMD_OPEN_WRITE 0x00010BCA
1051struct asm_stream_cmd_open_write {
1052 struct apr_hdr hdr;
1053 u32 uMode;
1054 u16 sink_endpoint;
1055 u16 stream_handle;
1056 u32 post_proc_top;
1057 u32 format;
1058} __attribute__((packed));
1059
1060#define ASM_STREAM_CMD_OPEN_READWRITE 0x00010BCC
1061
1062struct asm_stream_cmd_open_read_write {
1063 struct apr_hdr hdr;
1064 u32 uMode;
1065 u32 post_proc_top;
1066 u32 write_format;
1067 u32 read_format;
1068} __attribute__((packed));
1069
1070#define ASM_STREAM_CMD_SET_ENCDEC_PARAM 0x00010C10
1071#define ASM_STREAM_CMD_GET_ENCDEC_PARAM 0x00010C11
1072#define ASM_ENCDEC_CFG_BLK_ID 0x00010C2C
1073#define ASM_ENABLE_SBR_PS 0x00010C63
Swaminathan Sathappan70765cd2011-07-19 18:42:47 -07001074#define ASM_CONFIGURE_DUAL_MONO 0x00010C64
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001075struct asm_stream_cmd_encdec_cfg_blk{
1076 struct apr_hdr hdr;
1077 u32 param_id;
1078 u32 param_size;
1079 struct asm_encode_cfg_blk enc_blk;
1080} __attribute__((packed));
1081
1082struct asm_stream_cmd_encdec_sbc_bitrate{
1083 struct apr_hdr hdr;
1084 u32 param_id;
1085 struct asm_sbc_bitrate sbc_bitrate;
1086} __attribute__((packed));
1087
1088struct asm_stream_cmd_encdec_immed_decode{
1089 struct apr_hdr hdr;
1090 u32 param_id;
1091 u32 param_size;
1092 struct asm_immed_decode dec;
1093} __attribute__((packed));
1094
1095struct asm_stream_cmd_encdec_sbr{
1096 struct apr_hdr hdr;
1097 u32 param_id;
1098 u32 param_size;
1099 struct asm_sbr_ps sbr_ps;
1100} __attribute__((packed));
1101
Swaminathan Sathappan70765cd2011-07-19 18:42:47 -07001102struct asm_stream_cmd_encdec_dualmono {
1103 struct apr_hdr hdr;
1104 u32 param_id;
1105 u32 param_size;
1106 struct asm_dual_mono channel_map;
1107} __packed;
1108
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001109#define ASM_STREAM _CMD_ADJUST_SAMPLES 0x00010C0A
1110struct asm_stream_cmd_adjust_samples{
1111 struct apr_hdr hdr;
1112 u16 nsamples;
1113 u16 reserved;
1114} __attribute__((packed));
1115
1116#define ASM_STREAM_CMD_TAP_POPP_PCM 0x00010BF9
1117struct asm_stream_cmd_tap_popp_pcm{
1118 struct apr_hdr hdr;
1119 u16 enable;
1120 u16 reserved;
1121 u32 module_id;
1122} __attribute__((packed));
1123
1124/* Session Level commands */
1125#define ASM_SESSION_CMD_MEMORY_MAP 0x00010C32
1126struct asm_stream_cmd_memory_map{
1127 struct apr_hdr hdr;
1128 u32 buf_add;
1129 u32 buf_size;
1130 u16 mempool_id;
1131 u16 reserved;
1132} __attribute__((packed));
1133
1134#define ASM_SESSION_CMD_MEMORY_UNMAP 0x00010C33
1135struct asm_stream_cmd_memory_unmap{
1136 struct apr_hdr hdr;
1137 u32 buf_add;
1138} __attribute__((packed));
1139
1140#define ASM_SESSION_CMD_MEMORY_MAP_REGIONS 0x00010C45
1141struct asm_memory_map_regions{
1142 u32 phys;
1143 u32 buf_size;
1144} __attribute__((packed));
1145
1146struct asm_stream_cmd_memory_map_regions{
1147 struct apr_hdr hdr;
1148 u16 mempool_id;
1149 u16 nregions;
1150} __attribute__((packed));
1151
1152#define ASM_SESSION_CMD_MEMORY_UNMAP_REGIONS 0x00010C46
1153struct asm_memory_unmap_regions{
1154 u32 phys;
1155} __attribute__((packed));
1156
1157struct asm_stream_cmd_memory_unmap_regions{
1158 struct apr_hdr hdr;
1159 u16 nregions;
1160 u16 reserved;
1161} __attribute__((packed));
1162
1163#define ASM_SESSION_CMD_RUN 0x00010BD2
1164struct asm_stream_cmd_run{
1165 struct apr_hdr hdr;
1166 u32 flags;
1167 u32 msw_ts;
1168 u32 lsw_ts;
1169} __attribute__((packed));
1170
1171/* Session level events */
1172#define ASM_SESSION_CMD_REGISTER_FOR_RX_UNDERFLOW_EVENTS 0x00010BD5
1173struct asm_stream_cmd_reg_rx_underflow_event{
1174 struct apr_hdr hdr;
1175 u16 enable;
1176 u16 reserved;
1177} __attribute__((packed));
1178
1179#define ASM_SESSION_CMD_REGISTER_FOR_TX_OVERFLOW_EVENTS 0x00010BD6
1180struct asm_stream_cmd_reg_tx_overflow_event{
1181 struct apr_hdr hdr;
1182 u16 enable;
1183 u16 reserved;
1184} __attribute__((packed));
1185
1186/* Data Path commands */
1187#define ASM_DATA_CMD_WRITE 0x00010BD9
1188struct asm_stream_cmd_write{
1189 struct apr_hdr hdr;
1190 u32 buf_add;
1191 u32 avail_bytes;
1192 u32 uid;
1193 u32 msw_ts;
1194 u32 lsw_ts;
1195 u32 uflags;
1196} __attribute__((packed));
1197
1198#define ASM_DATA_CMD_READ 0x00010BDA
1199struct asm_stream_cmd_read{
1200 struct apr_hdr hdr;
1201 u32 buf_add;
1202 u32 buf_size;
1203 u32 uid;
1204} __attribute__((packed));
1205
1206#define ASM_DATA_CMD_MEDIA_FORMAT_UPDATE 0x00010BDC
Deepa Madiregama55cbf782011-09-10 05:44:39 +05301207#define ASM_DATA_EVENT_ENC_SR_CM_NOTIFY 0x00010BDE
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001208struct asm_stream_media_format_update{
1209 struct apr_hdr hdr;
1210 u32 format;
1211 u32 cfg_size;
1212 union {
1213 struct asm_pcm_cfg pcm_cfg;
1214 struct asm_adpcm_cfg adpcm_cfg;
1215 struct asm_yadpcm_cfg yadpcm_cfg;
1216 struct asm_midi_cfg midi_cfg;
1217 struct asm_wma_cfg wma_cfg;
1218 struct asm_wmapro_cfg wmapro_cfg;
1219 struct asm_aac_cfg aac_cfg;
1220 struct asm_flac_cfg flac_cfg;
1221 struct asm_vorbis_cfg vorbis_cfg;
Kiran Kandi5e809b02012-01-31 00:24:33 -08001222 struct asm_multi_channel_pcm_fmt_blk multi_ch_pcm_cfg;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001223 } __attribute__((packed)) write_cfg;
1224} __attribute__((packed));
1225
1226
1227/* Command Responses */
1228#define ASM_STREAM_CMDRSP_GET_ENCDEC_PARAM 0x00010C12
1229struct asm_stream_cmdrsp_get_readwrite_param{
1230 struct apr_hdr hdr;
1231 u32 status;
1232 u32 param_id;
1233 u16 param_size;
1234 u16 padding;
1235 union {
1236 struct asm_sbc_bitrate sbc_bitrate;
1237 struct asm_immed_decode aac_dec;
1238 } __attribute__((packed)) read_write_cfg;
1239} __attribute__((packed));
1240
1241
1242#define ASM_SESSION_CMDRSP_GET_SESSION_TIME 0x00010BD8
1243struct asm_stream_cmdrsp_get_session_time{
1244 struct apr_hdr hdr;
1245 u32 status;
1246 u32 msw_ts;
1247 u32 lsw_ts;
1248} __attribute__((packed));
1249
1250#define ASM_DATA_EVENT_WRITE_DONE 0x00010BDF
1251struct asm_data_event_write_done{
1252 u32 buf_add;
1253 u32 status;
1254} __attribute__((packed));
1255
1256#define ASM_DATA_EVENT_READ_DONE 0x00010BE0
1257struct asm_data_event_read_done{
1258 u32 status;
1259 u32 buffer_add;
1260 u32 enc_frame_size;
1261 u32 offset;
1262 u32 msw_ts;
1263 u32 lsw_ts;
1264 u32 flags;
1265 u32 num_frames;
1266 u32 id;
1267} __attribute__((packed));
1268
1269#define ASM_DATA_EVENT_SR_CM_CHANGE_NOTIFY 0x00010C65
1270struct asm_data_event_sr_cm_change_notify {
1271 u32 sample_rate;
1272 u16 no_of_channels;
1273 u16 reserved;
1274 u8 channel_map[8];
1275} __packed;
1276
1277/* service level events */
1278
1279#define ASM_SERVICE_CMDRSP_GET_STREAM_HANDLES 0x00010C1B
1280struct asm_svc_cmdrsp_get_strm_handles{
1281 struct apr_hdr hdr;
1282 u32 num_handles;
1283 u32 stream_handles;
1284} __attribute__((packed));
1285
1286
1287#define ASM_SERVICE_CMDRSP_GET_WALLCLOCK_TIME 0x00010C1A
1288struct asm_svc_cmdrsp_get_wallclock_time{
1289 struct apr_hdr hdr;
1290 u32 status;
1291 u32 msw_ts;
1292 u32 lsw_ts;
1293} __attribute__((packed));
1294
1295/*
1296 * Error code
1297*/
1298#define ADSP_EOK 0x00000000 /* Success / completed / no errors. */
1299#define ADSP_EFAILED 0x00000001 /* General failure. */
1300#define ADSP_EBADPARAM 0x00000002 /* Bad operation parameter(s). */
1301#define ADSP_EUNSUPPORTED 0x00000003 /* Unsupported routine/operation. */
1302#define ADSP_EVERSION 0x00000004 /* Unsupported version. */
1303#define ADSP_EUNEXPECTED 0x00000005 /* Unexpected problem encountered. */
1304#define ADSP_EPANIC 0x00000006 /* Unhandled problem occurred. */
1305#define ADSP_ENORESOURCE 0x00000007 /* Unable to allocate resource(s). */
1306#define ADSP_EHANDLE 0x00000008 /* Invalid handle. */
1307#define ADSP_EALREADY 0x00000009 /* Operation is already processed. */
1308#define ADSP_ENOTREADY 0x0000000A /* Operation not ready to be processed*/
1309#define ADSP_EPENDING 0x0000000B /* Operation is pending completion*/
1310#define ADSP_EBUSY 0x0000000C /* Operation could not be accepted or
1311 processed. */
1312#define ADSP_EABORTED 0x0000000D /* Operation aborted due to an error. */
1313#define ADSP_EPREEMPTED 0x0000000E /* Operation preempted by higher priority*/
1314#define ADSP_ECONTINUE 0x0000000F /* Operation requests intervention
1315 to complete. */
1316#define ADSP_EIMMEDIATE 0x00000010 /* Operation requests immediate
1317 intervention to complete. */
1318#define ADSP_ENOTIMPL 0x00000011 /* Operation is not implemented. */
1319#define ADSP_ENEEDMORE 0x00000012 /* Operation needs more data or resources*/
1320
1321#endif /*_APR_AUDIO_H_*/