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