blob: 6bc93f58f59e3a0d5b64e066bd6a34ebbc0c6ae9 [file] [log] [blame]
Banajit Goswami0530e2f2016-12-09 21:34:37 -08001/* Copyright (c) 2012-2017, The Linux Foundation. All rights reserved.
2 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License version 2 and
5 * only version 2 as published by the Free Software Foundation.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 */
12#ifndef __Q6_ASM_V2_H__
13#define __Q6_ASM_V2_H__
14
15#include <linux/qdsp6v2/apr.h>
16#include <linux/qdsp6v2/rtac.h>
17#include <sound/apr_audio-v2.h>
18#include <linux/list.h>
19#include <linux/msm_ion.h>
20
21#define IN 0x000
22#define OUT 0x001
23#define CH_MODE_MONO 0x001
24#define CH_MODE_STEREO 0x002
25
26#define FORMAT_LINEAR_PCM 0x0000
27#define FORMAT_DTMF 0x0001
28#define FORMAT_ADPCM 0x0002
29#define FORMAT_YADPCM 0x0003
30#define FORMAT_MP3 0x0004
31#define FORMAT_MPEG4_AAC 0x0005
32#define FORMAT_AMRNB 0x0006
33#define FORMAT_AMRWB 0x0007
34#define FORMAT_V13K 0x0008
35#define FORMAT_EVRC 0x0009
36#define FORMAT_EVRCB 0x000a
37#define FORMAT_EVRCWB 0x000b
38#define FORMAT_MIDI 0x000c
39#define FORMAT_SBC 0x000d
40#define FORMAT_WMA_V10PRO 0x000e
41#define FORMAT_WMA_V9 0x000f
42#define FORMAT_AMR_WB_PLUS 0x0010
43#define FORMAT_MPEG4_MULTI_AAC 0x0011
44#define FORMAT_MULTI_CHANNEL_LINEAR_PCM 0x0012
45#define FORMAT_AC3 0x0013
46#define FORMAT_EAC3 0x0014
47#define FORMAT_MP2 0x0015
48#define FORMAT_FLAC 0x0016
49#define FORMAT_ALAC 0x0017
50#define FORMAT_VORBIS 0x0018
51#define FORMAT_APE 0x0019
52#define FORMAT_G711_ALAW_FS 0x001a
53#define FORMAT_G711_MLAW_FS 0x001b
54#define FORMAT_DTS 0x001c
55#define FORMAT_DSD 0x001d
Dhanalakshmi Siddani6d7d62c2016-12-26 16:01:43 +053056#define FORMAT_APTX 0x001e
Josh Kirschdb567c12017-01-04 17:59:30 -080057#define FORMAT_GEN_COMPR 0x001f
Banajit Goswami0530e2f2016-12-09 21:34:37 -080058
59#define ENCDEC_SBCBITRATE 0x0001
60#define ENCDEC_IMMEDIATE_DECODE 0x0002
61#define ENCDEC_CFG_BLK 0x0003
62
63#define CMD_PAUSE 0x0001
64#define CMD_FLUSH 0x0002
65#define CMD_EOS 0x0003
66#define CMD_CLOSE 0x0004
67#define CMD_OUT_FLUSH 0x0005
68#define CMD_SUSPEND 0x0006
69
70/* bit 0:1 represents priority of stream */
71#define STREAM_PRIORITY_NORMAL 0x0000
72#define STREAM_PRIORITY_LOW 0x0001
73#define STREAM_PRIORITY_HIGH 0x0002
74
75/* bit 4 represents META enable of encoded data buffer */
76#define BUFFER_META_ENABLE 0x0010
77
78/* bit 5 represents timestamp */
79/* bit 5 - 0 -- ASM_DATA_EVENT_READ_DONE will have relative time-stamp*/
80/* bit 5 - 1 -- ASM_DATA_EVENT_READ_DONE will have absolute time-stamp*/
81#define ABSOLUTE_TIMESTAMP_ENABLE 0x0020
82
83/* Enable Sample_Rate/Channel_Mode notification event from Decoder */
84#define SR_CM_NOTIFY_ENABLE 0x0004
85
86#define TUN_WRITE_IO_MODE 0x0008 /* tunnel read write mode */
87#define TUN_READ_IO_MODE 0x0004 /* tunnel read write mode */
88#define SYNC_IO_MODE 0x0001
89#define ASYNC_IO_MODE 0x0002
90#define COMPRESSED_IO 0x0040
91#define COMPRESSED_STREAM_IO 0x0080
92#define NT_MODE 0x0400
93
94#define NO_TIMESTAMP 0xFF00
95#define SET_TIMESTAMP 0x0000
96
97#define SOFT_PAUSE_ENABLE 1
98#define SOFT_PAUSE_DISABLE 0
99
100#define ASM_ACTIVE_STREAMS_ALLOWED 0x8
101/* Control session is used for mapping calibration memory */
102#define ASM_CONTROL_SESSION (ASM_ACTIVE_STREAMS_ALLOWED + 1)
103
104#define ASM_SHIFT_GAPLESS_MODE_FLAG 31
105#define ASM_SHIFT_LAST_BUFFER_FLAG 30
106
107#define ASM_LITTLE_ENDIAN 0
108#define ASM_BIG_ENDIAN 1
109
110/* PCM_MEDIA_FORMAT_Version */
111enum {
112 PCM_MEDIA_FORMAT_V2 = 0,
113 PCM_MEDIA_FORMAT_V3,
114 PCM_MEDIA_FORMAT_V4,
115};
116
117/* PCM format modes in DSP */
118enum {
119 DEFAULT_QF = 0,
120 Q15 = 15,
121 Q23 = 23,
122 Q31 = 31,
123};
124
125/* payload structure bytes */
126#define READDONE_IDX_STATUS 0
127#define READDONE_IDX_BUFADD_LSW 1
128#define READDONE_IDX_BUFADD_MSW 2
129#define READDONE_IDX_MEMMAP_HDL 3
130#define READDONE_IDX_SIZE 4
131#define READDONE_IDX_OFFSET 5
132#define READDONE_IDX_LSW_TS 6
133#define READDONE_IDX_MSW_TS 7
134#define READDONE_IDX_FLAGS 8
135#define READDONE_IDX_NUMFRAMES 9
136#define READDONE_IDX_SEQ_ID 10
137
138#define SOFT_PAUSE_PERIOD 30 /* ramp up/down for 30ms */
139#define SOFT_PAUSE_STEP 0 /* Step value 0ms or 0us */
140enum {
141 SOFT_PAUSE_CURVE_LINEAR = 0,
142 SOFT_PAUSE_CURVE_EXP,
143 SOFT_PAUSE_CURVE_LOG,
144};
145
146#define SOFT_VOLUME_PERIOD 30 /* ramp up/down for 30ms */
147#define SOFT_VOLUME_STEP 0 /* Step value 0ms or 0us */
148enum {
149 SOFT_VOLUME_CURVE_LINEAR = 0,
150 SOFT_VOLUME_CURVE_EXP,
151 SOFT_VOLUME_CURVE_LOG,
152};
153
154#define SOFT_VOLUME_INSTANCE_1 1
155#define SOFT_VOLUME_INSTANCE_2 2
156
157typedef void (*app_cb)(uint32_t opcode, uint32_t token,
158 uint32_t *payload, void *priv);
159
160struct audio_buffer {
161 dma_addr_t phys;
162 void *data;
163 uint32_t used;
164 uint32_t size;/* size of buffer */
165 uint32_t actual_size; /* actual number of bytes read by DSP */
166 struct ion_handle *handle;
167 struct ion_client *client;
168};
169
170struct audio_aio_write_param {
171 phys_addr_t paddr;
172 uint32_t len;
173 uint32_t uid;
174 uint32_t lsw_ts;
175 uint32_t msw_ts;
176 uint32_t flags;
177 uint32_t metadata_len;
178 uint32_t last_buffer;
179};
180
181struct audio_aio_read_param {
182 phys_addr_t paddr;
183 uint32_t len;
184 uint32_t uid;
185 uint32_t flags;/*meta data flags*/
186};
187
188struct audio_port_data {
189 struct audio_buffer *buf;
190 uint32_t max_buf_cnt;
191 uint32_t dsp_buf;
192 uint32_t cpu_buf;
193 struct list_head mem_map_handle;
194 uint32_t tmp_hdl;
195 /* read or write locks */
196 struct mutex lock;
197 spinlock_t dsp_lock;
198};
199
200struct shared_io_config {
201 uint32_t format;
202 uint16_t bits_per_sample;
203 uint32_t rate;
204 uint32_t channels;
205 uint16_t sample_word_size;
206 uint32_t bufsz;
207 uint32_t bufcnt;
208};
209
210struct audio_client {
211 int session;
212 app_cb cb;
213 atomic_t cmd_state;
214 /* Relative or absolute TS */
215 atomic_t time_flag;
216 atomic_t nowait_cmd_cnt;
217 atomic_t mem_state;
218 void *priv;
219 uint32_t io_mode;
220 uint64_t time_stamp;
221 struct apr_svc *apr;
222 struct apr_svc *mmap_apr;
223 struct apr_svc *apr2;
224 struct mutex cmd_lock;
225 /* idx:1 out port, 0: in port*/
226 struct audio_port_data port[2];
227 wait_queue_head_t cmd_wait;
228 wait_queue_head_t time_wait;
229 wait_queue_head_t mem_wait;
230 int perf_mode;
231 int stream_id;
232 struct device *dev;
233 int topology;
234 int app_type;
235 /* audio cache operations fptr*/
236 int (*fptr_cache_ops)(struct audio_buffer *abuff, int cache_op);
237 atomic_t unmap_cb_success;
238 atomic_t reset;
239 /* holds latest DSP pipeline delay */
240 uint32_t path_delay;
241 /* shared io */
242 struct audio_buffer shared_pos_buf;
243 struct shared_io_config config;
244};
245
246void q6asm_audio_client_free(struct audio_client *ac);
247
248struct audio_client *q6asm_audio_client_alloc(app_cb cb, void *priv);
249
250struct audio_client *q6asm_get_audio_client(int session_id);
251
252int q6asm_audio_client_buf_alloc(unsigned int dir/* 1:Out,0:In */,
253 struct audio_client *ac,
254 unsigned int bufsz,
255 uint32_t bufcnt);
256int q6asm_audio_client_buf_alloc_contiguous(unsigned int dir
257 /* 1:Out,0:In */,
258 struct audio_client *ac,
259 unsigned int bufsz,
260 unsigned int bufcnt);
261
262int q6asm_audio_client_buf_free_contiguous(unsigned int dir,
263 struct audio_client *ac);
264
265int q6asm_open_read(struct audio_client *ac, uint32_t format
266 /*, uint16_t bits_per_sample*/);
267
268int q6asm_open_read_v2(struct audio_client *ac, uint32_t format,
269 uint16_t bits_per_sample);
270
271int q6asm_open_read_v3(struct audio_client *ac, uint32_t format,
272 uint16_t bits_per_sample);
273
274int q6asm_open_read_v4(struct audio_client *ac, uint32_t format,
Satish Babu Patakokilac3727832017-01-05 20:45:38 +0530275 uint16_t bits_per_sample, bool ts_mode);
Banajit Goswami0530e2f2016-12-09 21:34:37 -0800276
277int q6asm_open_write(struct audio_client *ac, uint32_t format
278 /*, uint16_t bits_per_sample*/);
279
280int q6asm_open_write_v2(struct audio_client *ac, uint32_t format,
281 uint16_t bits_per_sample);
282
283int q6asm_open_shared_io(struct audio_client *ac,
284 struct shared_io_config *c, int dir);
285
286int q6asm_open_write_v3(struct audio_client *ac, uint32_t format,
287 uint16_t bits_per_sample);
288
289int q6asm_open_write_v4(struct audio_client *ac, uint32_t format,
290 uint16_t bits_per_sample);
291
292int q6asm_stream_open_write_v2(struct audio_client *ac, uint32_t format,
293 uint16_t bits_per_sample, int32_t stream_id,
294 bool is_gapless_mode);
295
296int q6asm_stream_open_write_v3(struct audio_client *ac, uint32_t format,
297 uint16_t bits_per_sample, int32_t stream_id,
298 bool is_gapless_mode);
299
300int q6asm_stream_open_write_v4(struct audio_client *ac, uint32_t format,
301 uint16_t bits_per_sample, int32_t stream_id,
302 bool is_gapless_mode);
303
304int q6asm_open_write_compressed(struct audio_client *ac, uint32_t format,
305 uint32_t passthrough_flag);
306
307int q6asm_open_read_write(struct audio_client *ac,
308 uint32_t rd_format,
309 uint32_t wr_format);
310
311int q6asm_open_read_write_v2(struct audio_client *ac, uint32_t rd_format,
312 uint32_t wr_format, bool is_meta_data_mode,
313 uint32_t bits_per_sample, bool overwrite_topology,
314 int topology);
315
316int q6asm_open_loopback_v2(struct audio_client *ac,
317 uint16_t bits_per_sample);
318
319int q6asm_write(struct audio_client *ac, uint32_t len, uint32_t msw_ts,
320 uint32_t lsw_ts, uint32_t flags);
321int q6asm_write_nolock(struct audio_client *ac, uint32_t len, uint32_t msw_ts,
322 uint32_t lsw_ts, uint32_t flags);
323
324int q6asm_async_write(struct audio_client *ac,
325 struct audio_aio_write_param *param);
326
327int q6asm_async_read(struct audio_client *ac,
328 struct audio_aio_read_param *param);
329
330int q6asm_read(struct audio_client *ac);
331int q6asm_read_v2(struct audio_client *ac, uint32_t len);
332int q6asm_read_nolock(struct audio_client *ac);
333
334int q6asm_memory_map(struct audio_client *ac, phys_addr_t buf_add,
335 int dir, uint32_t bufsz, uint32_t bufcnt);
336
337int q6asm_memory_unmap(struct audio_client *ac, phys_addr_t buf_add,
338 int dir);
339
340struct audio_buffer *q6asm_shared_io_buf(struct audio_client *ac, int dir);
341
342int q6asm_shared_io_free(struct audio_client *ac, int dir);
343
344int q6asm_get_shared_pos(struct audio_client *ac, uint32_t *si, uint32_t *msw,
345 uint32_t *lsw);
346
347int q6asm_map_rtac_block(struct rtac_cal_block_data *cal_block);
348
349int q6asm_unmap_rtac_block(uint32_t *mem_map_handle);
350
351int q6asm_send_cal(struct audio_client *ac);
352
353int q6asm_run(struct audio_client *ac, uint32_t flags,
354 uint32_t msw_ts, uint32_t lsw_ts);
355
356int q6asm_run_nowait(struct audio_client *ac, uint32_t flags,
357 uint32_t msw_ts, uint32_t lsw_ts);
358
359int q6asm_stream_run_nowait(struct audio_client *ac, uint32_t flags,
360 uint32_t msw_ts, uint32_t lsw_ts, uint32_t stream_id);
361
362int q6asm_reg_tx_overflow(struct audio_client *ac, uint16_t enable);
363
364int q6asm_reg_rx_underflow(struct audio_client *ac, uint16_t enable);
365
366int q6asm_cmd(struct audio_client *ac, int cmd);
367
368int q6asm_stream_cmd(struct audio_client *ac, int cmd, uint32_t stream_id);
369
370int q6asm_cmd_nowait(struct audio_client *ac, int cmd);
371
372int q6asm_stream_cmd_nowait(struct audio_client *ac, int cmd,
373 uint32_t stream_id);
374
375void *q6asm_is_cpu_buf_avail(int dir, struct audio_client *ac,
376 uint32_t *size, uint32_t *idx);
377
378int q6asm_cpu_buf_release(int dir, struct audio_client *ac);
379
380void *q6asm_is_cpu_buf_avail_nolock(int dir, struct audio_client *ac,
381 uint32_t *size, uint32_t *idx);
382
383int q6asm_is_dsp_buf_avail(int dir, struct audio_client *ac);
384
385/* File format specific configurations to be added below */
386
387int q6asm_enc_cfg_blk_aac(struct audio_client *ac,
388 uint32_t frames_per_buf,
389 uint32_t sample_rate, uint32_t channels,
390 uint32_t bit_rate,
391 uint32_t mode, uint32_t format);
392
393int q6asm_enc_cfg_blk_g711(struct audio_client *ac,
394 uint32_t frames_per_buf,
395 uint32_t sample_rate);
396
397int q6asm_enc_cfg_blk_pcm(struct audio_client *ac,
398 uint32_t rate, uint32_t channels);
399
400int q6asm_enc_cfg_blk_pcm_v2(struct audio_client *ac,
401 uint32_t rate, uint32_t channels,
402 uint16_t bits_per_sample,
403 bool use_default_chmap, bool use_back_flavor,
404 u8 *channel_map);
405
406int q6asm_enc_cfg_blk_pcm_v3(struct audio_client *ac,
407 uint32_t rate, uint32_t channels,
408 uint16_t bits_per_sample, bool use_default_chmap,
409 bool use_back_flavor, u8 *channel_map,
410 uint16_t sample_word_size);
411
412int q6asm_enc_cfg_blk_pcm_v4(struct audio_client *ac,
413 uint32_t rate, uint32_t channels,
414 uint16_t bits_per_sample, bool use_default_chmap,
415 bool use_back_flavor, u8 *channel_map,
416 uint16_t sample_word_size, uint16_t endianness,
417 uint16_t mode);
418
419int q6asm_enc_cfg_blk_pcm_format_support(struct audio_client *ac,
420 uint32_t rate, uint32_t channels,
421 uint16_t bits_per_sample);
422
423int q6asm_enc_cfg_blk_pcm_format_support_v3(struct audio_client *ac,
424 uint32_t rate, uint32_t channels,
425 uint16_t bits_per_sample,
426 uint16_t sample_word_size);
427
428int q6asm_enc_cfg_blk_pcm_format_support_v4(struct audio_client *ac,
429 uint32_t rate, uint32_t channels,
430 uint16_t bits_per_sample,
431 uint16_t sample_word_size,
432 uint16_t endianness,
433 uint16_t mode);
434
435int q6asm_set_encdec_chan_map(struct audio_client *ac,
436 uint32_t num_channels);
437
438int q6asm_enc_cfg_blk_pcm_native(struct audio_client *ac,
439 uint32_t rate, uint32_t channels);
440
441int q6asm_enable_sbrps(struct audio_client *ac,
442 uint32_t sbr_ps);
443
444int q6asm_cfg_dual_mono_aac(struct audio_client *ac,
445 uint16_t sce_left, uint16_t sce_right);
446
447int q6asm_cfg_aac_sel_mix_coef(struct audio_client *ac, uint32_t mix_coeff);
448
449int q6asm_enc_cfg_blk_qcelp(struct audio_client *ac, uint32_t frames_per_buf,
450 uint16_t min_rate, uint16_t max_rate,
451 uint16_t reduced_rate_level, uint16_t rate_modulation_cmd);
452
453int q6asm_enc_cfg_blk_evrc(struct audio_client *ac, uint32_t frames_per_buf,
454 uint16_t min_rate, uint16_t max_rate,
455 uint16_t rate_modulation_cmd);
456
457int q6asm_enc_cfg_blk_amrnb(struct audio_client *ac, uint32_t frames_per_buf,
458 uint16_t band_mode, uint16_t dtx_enable);
459
460int q6asm_enc_cfg_blk_amrwb(struct audio_client *ac, uint32_t frames_per_buf,
461 uint16_t band_mode, uint16_t dtx_enable);
462
463int q6asm_media_format_block_pcm(struct audio_client *ac,
464 uint32_t rate, uint32_t channels);
465
466int q6asm_media_format_block_pcm_format_support(struct audio_client *ac,
467 uint32_t rate, uint32_t channels,
468 uint16_t bits_per_sample);
469
470int q6asm_media_format_block_pcm_format_support_v2(struct audio_client *ac,
471 uint32_t rate, uint32_t channels,
472 uint16_t bits_per_sample, int stream_id,
473 bool use_default_chmap, char *channel_map);
474
475int q6asm_media_format_block_pcm_format_support_v3(struct audio_client *ac,
476 uint32_t rate,
477 uint32_t channels,
478 uint16_t bits_per_sample,
479 int stream_id,
480 bool use_default_chmap,
481 char *channel_map,
482 uint16_t sample_word_size);
483
484int q6asm_media_format_block_pcm_format_support_v4(struct audio_client *ac,
485 uint32_t rate,
486 uint32_t channels,
487 uint16_t bits_per_sample,
488 int stream_id,
489 bool use_default_chmap,
490 char *channel_map,
491 uint16_t sample_word_size,
492 uint16_t endianness,
493 uint16_t mode);
494
495int q6asm_media_format_block_multi_ch_pcm(struct audio_client *ac,
496 uint32_t rate, uint32_t channels,
497 bool use_default_chmap, char *channel_map);
498
499int q6asm_media_format_block_multi_ch_pcm_v2(
500 struct audio_client *ac,
501 uint32_t rate, uint32_t channels,
502 bool use_default_chmap, char *channel_map,
503 uint16_t bits_per_sample);
Josh Kirschdb567c12017-01-04 17:59:30 -0800504int q6asm_media_format_block_gen_compr(
505 struct audio_client *ac,
506 uint32_t rate, uint32_t channels,
507 bool use_default_chmap, char *channel_map,
508 uint16_t bits_per_sample);
Banajit Goswami0530e2f2016-12-09 21:34:37 -0800509
510int q6asm_media_format_block_multi_ch_pcm_v3(struct audio_client *ac,
511 uint32_t rate, uint32_t channels,
512 bool use_default_chmap,
513 char *channel_map,
514 uint16_t bits_per_sample,
515 uint16_t sample_word_size);
516
517int q6asm_media_format_block_multi_ch_pcm_v4(struct audio_client *ac,
518 uint32_t rate, uint32_t channels,
519 bool use_default_chmap,
520 char *channel_map,
521 uint16_t bits_per_sample,
522 uint16_t sample_word_size,
523 uint16_t endianness,
524 uint16_t mode);
525
526int q6asm_media_format_block_aac(struct audio_client *ac,
527 struct asm_aac_cfg *cfg);
528
529int q6asm_stream_media_format_block_aac(struct audio_client *ac,
530 struct asm_aac_cfg *cfg, int stream_id);
531
532int q6asm_media_format_block_multi_aac(struct audio_client *ac,
533 struct asm_aac_cfg *cfg);
534
535int q6asm_media_format_block_wma(struct audio_client *ac,
536 void *cfg, int stream_id);
537
538int q6asm_media_format_block_wmapro(struct audio_client *ac,
539 void *cfg, int stream_id);
540
541int q6asm_media_format_block_amrwbplus(struct audio_client *ac,
542 struct asm_amrwbplus_cfg *cfg);
543
544int q6asm_stream_media_format_block_flac(struct audio_client *ac,
545 struct asm_flac_cfg *cfg, int stream_id);
546
547int q6asm_media_format_block_alac(struct audio_client *ac,
548 struct asm_alac_cfg *cfg, int stream_id);
549
550int q6asm_media_format_block_g711(struct audio_client *ac,
551 struct asm_g711_dec_cfg *cfg, int stream_id);
552
553int q6asm_stream_media_format_block_vorbis(struct audio_client *ac,
554 struct asm_vorbis_cfg *cfg, int stream_id);
555
556int q6asm_media_format_block_ape(struct audio_client *ac,
557 struct asm_ape_cfg *cfg, int stream_id);
558
559int q6asm_media_format_block_dsd(struct audio_client *ac,
560 struct asm_dsd_cfg *cfg, int stream_id);
561
Dhanalakshmi Siddani6d7d62c2016-12-26 16:01:43 +0530562int q6asm_stream_media_format_block_aptx_dec(struct audio_client *ac,
563 uint32_t sr, int stream_id);
564
Banajit Goswami0530e2f2016-12-09 21:34:37 -0800565int q6asm_ds1_set_endp_params(struct audio_client *ac,
566 int param_id, int param_value);
567
568/* Send stream based end params */
569int q6asm_ds1_set_stream_endp_params(struct audio_client *ac, int param_id,
570 int param_value, int stream_id);
571
572/* PP specific */
573int q6asm_equalizer(struct audio_client *ac, void *eq);
574
575/* Send Volume Command */
576int q6asm_set_volume(struct audio_client *ac, int volume);
577
578/* Send Volume Command */
579int q6asm_set_volume_v2(struct audio_client *ac, int volume, int instance);
580
581/* DTS Eagle Params */
582int q6asm_dts_eagle_set(struct audio_client *ac, int param_id, uint32_t size,
583 void *data, struct param_outband *po, int m_id);
584int q6asm_dts_eagle_get(struct audio_client *ac, int param_id, uint32_t size,
585 void *data, struct param_outband *po, int m_id);
586
Dhanalakshmi Siddani6d7d62c2016-12-26 16:01:43 +0530587/* Send aptx decoder BT address */
588int q6asm_set_aptx_dec_bt_addr(struct audio_client *ac,
589 struct aptx_dec_bt_addr_cfg *cfg);
590
Banajit Goswami0530e2f2016-12-09 21:34:37 -0800591/* Set SoftPause Params */
592int q6asm_set_softpause(struct audio_client *ac,
593 struct asm_softpause_params *param);
594
595/* Set Softvolume Params */
596int q6asm_set_softvolume(struct audio_client *ac,
597 struct asm_softvolume_params *param);
598
599/* Set Softvolume Params */
600int q6asm_set_softvolume_v2(struct audio_client *ac,
601 struct asm_softvolume_params *param, int instance);
602
603/* Send left-right channel gain */
604int q6asm_set_lrgain(struct audio_client *ac, int left_gain, int right_gain);
605
606/* Send multi channel gain */
607int q6asm_set_multich_gain(struct audio_client *ac, uint32_t channels,
608 uint32_t *gains, uint8_t *ch_map, bool use_default);
609
610/* Enable Mute/unmute flag */
611int q6asm_set_mute(struct audio_client *ac, int muteflag);
612
613int q6asm_get_session_time(struct audio_client *ac, uint64_t *tstamp);
614
615int q6asm_get_session_time_legacy(struct audio_client *ac, uint64_t *tstamp);
616
617int q6asm_send_audio_effects_params(struct audio_client *ac, char *params,
618 uint32_t params_length);
619
620/* Client can set the IO mode to either AIO/SIO mode */
621int q6asm_set_io_mode(struct audio_client *ac, uint32_t mode);
622
623/* Get Service ID for APR communication */
624int q6asm_get_apr_service_id(int session_id);
625
626/* Common format block without any payload */
627int q6asm_media_format_block(struct audio_client *ac, uint32_t format);
628
629/* Send the meta data to remove initial and trailing silence */
630int q6asm_send_meta_data(struct audio_client *ac, uint32_t initial_samples,
631 uint32_t trailing_samples);
632
633/* Send the stream meta data to remove initial and trailing silence */
634int q6asm_stream_send_meta_data(struct audio_client *ac, uint32_t stream_id,
635 uint32_t initial_samples, uint32_t trailing_samples);
636
637int q6asm_get_asm_topology(int session_id);
638int q6asm_get_asm_app_type(int session_id);
639
640int q6asm_send_mtmx_strtr_window(struct audio_client *ac,
641 struct asm_session_mtmx_strtr_param_window_v2_t *window_param,
642 uint32_t param_id);
643
Manish Dewangan9286b2f2017-01-24 19:07:47 +0530644/* Configure DSP render mode */
645int q6asm_send_mtmx_strtr_render_mode(struct audio_client *ac,
646 uint32_t render_mode);
647
Manish Dewanganf72bee22017-01-31 17:51:00 +0530648/* Configure DSP clock recovery mode */
649int q6asm_send_mtmx_strtr_clk_rec_mode(struct audio_client *ac,
650 uint32_t clk_rec_mode);
651
Banajit Goswami0530e2f2016-12-09 21:34:37 -0800652/* Retrieve the current DSP path delay */
653int q6asm_get_path_delay(struct audio_client *ac);
654
655/* Helper functions to retrieve data from token */
656uint8_t q6asm_get_buf_index_from_token(uint32_t token);
657uint8_t q6asm_get_stream_id_from_token(uint32_t token);
658
659#endif /* __Q6_ASM_H__ */