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