1 /* Copyright (c) 2012-2018, The Linux Foundation. All rights reserved.
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.
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.
12 #ifndef __Q6_ASM_V2_H__
13 #define __Q6_ASM_V2_H__
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>
23 #define CH_MODE_MONO 0x001
24 #define CH_MODE_STEREO 0x002
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 #define FORMAT_APTXHD 0x0022
62 #define ENCDEC_SBCBITRATE 0x0001
63 #define ENCDEC_IMMEDIATE_DECODE 0x0002
64 #define ENCDEC_CFG_BLK 0x0003
66 #define CMD_PAUSE 0x0001
67 #define CMD_FLUSH 0x0002
68 #define CMD_EOS 0x0003
69 #define CMD_CLOSE 0x0004
70 #define CMD_OUT_FLUSH 0x0005
71 #define CMD_SUSPEND 0x0006
73 /* bit 0:1 represents priority of stream */
74 #define STREAM_PRIORITY_NORMAL 0x0000
75 #define STREAM_PRIORITY_LOW 0x0001
76 #define STREAM_PRIORITY_HIGH 0x0002
78 /* bit 4 represents META enable of encoded data buffer */
79 #define BUFFER_META_ENABLE 0x0010
81 /* bit 5 represents timestamp */
82 /* bit 5 - 0 -- ASM_DATA_EVENT_READ_DONE will have relative time-stamp*/
83 /* bit 5 - 1 -- ASM_DATA_EVENT_READ_DONE will have absolute time-stamp*/
84 #define ABSOLUTE_TIMESTAMP_ENABLE 0x0020
86 /* Enable Sample_Rate/Channel_Mode notification event from Decoder */
87 #define SR_CM_NOTIFY_ENABLE 0x0004
89 #define TUN_WRITE_IO_MODE 0x0008 /* tunnel read write mode */
90 #define TUN_READ_IO_MODE 0x0004 /* tunnel read write mode */
91 #define SYNC_IO_MODE 0x0001
92 #define ASYNC_IO_MODE 0x0002
93 #define COMPRESSED_IO 0x0040
94 #define COMPRESSED_STREAM_IO 0x0080
95 #define NT_MODE 0x0400
97 #define NO_TIMESTAMP 0xFF00
98 #define SET_TIMESTAMP 0x0000
100 #define SOFT_PAUSE_ENABLE 1
101 #define SOFT_PAUSE_DISABLE 0
103 #define ASM_ACTIVE_STREAMS_ALLOWED 0x9
104 /* Control session is used for mapping calibration memory */
105 #define ASM_CONTROL_SESSION (ASM_ACTIVE_STREAMS_ALLOWED + 1)
107 #define ASM_SHIFT_GAPLESS_MODE_FLAG 31
108 #define ASM_SHIFT_LAST_BUFFER_FLAG 30
110 #define ASM_LITTLE_ENDIAN 0
111 #define ASM_BIG_ENDIAN 1
113 /* PCM_MEDIA_FORMAT_Version */
115 PCM_MEDIA_FORMAT_V2 = 0,
121 /* PCM format modes in DSP */
129 /* payload structure bytes */
130 #define READDONE_IDX_STATUS 0
131 #define READDONE_IDX_BUFADD_LSW 1
132 #define READDONE_IDX_BUFADD_MSW 2
133 #define READDONE_IDX_MEMMAP_HDL 3
134 #define READDONE_IDX_SIZE 4
135 #define READDONE_IDX_OFFSET 5
136 #define READDONE_IDX_LSW_TS 6
137 #define READDONE_IDX_MSW_TS 7
138 #define READDONE_IDX_FLAGS 8
139 #define READDONE_IDX_NUMFRAMES 9
140 #define READDONE_IDX_SEQ_ID 10
142 #define SOFT_PAUSE_PERIOD 30 /* ramp up/down for 30ms */
143 #define SOFT_PAUSE_STEP 0 /* Step value 0ms or 0us */
145 SOFT_PAUSE_CURVE_LINEAR = 0,
146 SOFT_PAUSE_CURVE_EXP,
147 SOFT_PAUSE_CURVE_LOG,
150 #define SOFT_VOLUME_PERIOD 30 /* ramp up/down for 30ms */
151 #define SOFT_VOLUME_STEP 0 /* Step value 0ms or 0us */
153 SOFT_VOLUME_CURVE_LINEAR = 0,
154 SOFT_VOLUME_CURVE_EXP,
155 SOFT_VOLUME_CURVE_LOG,
158 #define SOFT_VOLUME_INSTANCE_1 1
159 #define SOFT_VOLUME_INSTANCE_2 2
161 typedef void (*app_cb)(uint32_t opcode, uint32_t token,
162 uint32_t *payload, void *priv);
164 struct audio_buffer {
168 uint32_t size;/* size of buffer */
169 uint32_t actual_size; /* actual number of bytes read by DSP */
170 struct ion_handle *handle;
171 struct ion_client *client;
174 struct audio_aio_write_param {
181 uint32_t metadata_len;
182 uint32_t last_buffer;
185 struct audio_aio_read_param {
189 uint32_t flags;/*meta data flags*/
192 struct audio_port_data {
193 struct audio_buffer *buf;
194 uint32_t max_buf_cnt;
197 struct list_head mem_map_handle;
199 /* read or write locks */
204 struct shared_io_config {
206 uint16_t bits_per_sample;
209 uint16_t sample_word_size;
214 struct audio_client {
218 atomic_t cmd_state_pp;
219 /* Relative or absolute TS */
221 atomic_t nowait_cmd_cnt;
227 struct apr_svc *mmap_apr;
228 struct apr_svc *apr2;
229 struct mutex cmd_lock;
230 /* idx:1 out port, 0: in port*/
231 struct audio_port_data port[2];
232 wait_queue_head_t cmd_wait;
233 wait_queue_head_t time_wait;
234 wait_queue_head_t mem_wait;
240 /* audio cache operations fptr*/
241 int (*fptr_cache_ops)(struct audio_buffer *abuff, int cache_op);
242 atomic_t unmap_cb_success;
244 /* holds latest DSP pipeline delay */
247 struct audio_buffer shared_pos_buf;
248 struct shared_io_config config;
251 void q6asm_audio_client_free(struct audio_client *ac);
253 struct audio_client *q6asm_audio_client_alloc(app_cb cb, void *priv);
255 struct audio_client *q6asm_get_audio_client(int session_id);
257 int q6asm_audio_client_buf_alloc(unsigned int dir/* 1:Out,0:In */,
258 struct audio_client *ac,
261 int q6asm_audio_client_buf_alloc_contiguous(unsigned int dir
263 struct audio_client *ac,
265 unsigned int bufcnt);
267 int q6asm_audio_client_buf_free_contiguous(unsigned int dir,
268 struct audio_client *ac);
270 int q6asm_set_pp_params(struct audio_client *ac,
271 struct mem_mapping_hdr *mem_hdr, u8 *param_data,
274 int q6asm_pack_and_set_pp_param_in_band(struct audio_client *ac,
275 struct param_hdr_v3 param_hdr,
278 int q6asm_set_soft_volume_module_instance_ids(int instance,
279 struct param_hdr_v3 *param_hdr);
281 int q6asm_open_read(struct audio_client *ac, uint32_t format
282 /*, uint16_t bits_per_sample*/);
284 int q6asm_open_read_v2(struct audio_client *ac, uint32_t format,
285 uint16_t bits_per_sample);
287 int q6asm_open_read_v3(struct audio_client *ac, uint32_t format,
288 uint16_t bits_per_sample);
290 int q6asm_open_read_v4(struct audio_client *ac, uint32_t format,
291 uint16_t bits_per_sample, bool ts_mode);
293 int q6asm_open_read_v5(struct audio_client *ac, uint32_t format,
294 uint16_t bits_per_sample, bool ts_mode);
296 int q6asm_open_read_with_retry(struct audio_client *ac, uint32_t format,
297 uint16_t bits_per_sample, bool ts_mode);
299 int q6asm_open_write(struct audio_client *ac, uint32_t format
300 /*, uint16_t bits_per_sample*/);
302 int q6asm_open_write_v2(struct audio_client *ac, uint32_t format,
303 uint16_t bits_per_sample);
305 int q6asm_open_shared_io(struct audio_client *ac,
306 struct shared_io_config *c, int dir);
308 int q6asm_open_write_v3(struct audio_client *ac, uint32_t format,
309 uint16_t bits_per_sample);
311 int q6asm_open_write_v4(struct audio_client *ac, uint32_t format,
312 uint16_t bits_per_sample);
314 int q6asm_open_write_v5(struct audio_client *ac, uint32_t format,
315 uint16_t bits_per_sample);
317 int q6asm_open_write_with_retry(struct audio_client *ac, uint32_t format,
318 uint16_t bits_per_sample);
320 int q6asm_stream_open_write_v2(struct audio_client *ac, uint32_t format,
321 uint16_t bits_per_sample, int32_t stream_id,
322 bool is_gapless_mode);
324 int q6asm_stream_open_write_v3(struct audio_client *ac, uint32_t format,
325 uint16_t bits_per_sample, int32_t stream_id,
326 bool is_gapless_mode);
328 int q6asm_stream_open_write_v4(struct audio_client *ac, uint32_t format,
329 uint16_t bits_per_sample, int32_t stream_id,
330 bool is_gapless_mode);
332 int q6asm_open_write_compressed(struct audio_client *ac, uint32_t format,
333 uint32_t passthrough_flag);
335 int q6asm_open_read_write(struct audio_client *ac,
339 int q6asm_open_read_write_v2(struct audio_client *ac, uint32_t rd_format,
340 uint32_t wr_format, bool is_meta_data_mode,
341 uint32_t bits_per_sample, bool overwrite_topology,
344 int q6asm_open_loopback_v2(struct audio_client *ac,
345 uint16_t bits_per_sample);
347 int q6asm_open_loopback_with_retry(struct audio_client *ac,
348 uint16_t bits_per_sample);
350 int q6asm_open_transcode_loopback(struct audio_client *ac,
351 uint16_t bits_per_sample, uint32_t source_format,
352 uint32_t sink_format);
354 int q6asm_write(struct audio_client *ac, uint32_t len, uint32_t msw_ts,
355 uint32_t lsw_ts, uint32_t flags);
356 int q6asm_write_nolock(struct audio_client *ac, uint32_t len, uint32_t msw_ts,
357 uint32_t lsw_ts, uint32_t flags);
359 int q6asm_async_write(struct audio_client *ac,
360 struct audio_aio_write_param *param);
362 int q6asm_async_read(struct audio_client *ac,
363 struct audio_aio_read_param *param);
365 int q6asm_read(struct audio_client *ac);
366 int q6asm_read_v2(struct audio_client *ac, uint32_t len);
367 int q6asm_read_nolock(struct audio_client *ac);
369 int q6asm_memory_map(struct audio_client *ac, phys_addr_t buf_add,
370 int dir, uint32_t bufsz, uint32_t bufcnt);
372 int q6asm_memory_unmap(struct audio_client *ac, phys_addr_t buf_add,
375 struct audio_buffer *q6asm_shared_io_buf(struct audio_client *ac, int dir);
377 int q6asm_shared_io_free(struct audio_client *ac, int dir);
379 int q6asm_get_shared_pos(struct audio_client *ac, uint32_t *si, uint32_t *msw,
382 int q6asm_map_rtac_block(struct rtac_cal_block_data *cal_block);
384 int q6asm_unmap_rtac_block(uint32_t *mem_map_handle);
386 int q6asm_send_cal(struct audio_client *ac);
388 int q6asm_run(struct audio_client *ac, uint32_t flags,
389 uint32_t msw_ts, uint32_t lsw_ts);
391 int q6asm_run_nowait(struct audio_client *ac, uint32_t flags,
392 uint32_t msw_ts, uint32_t lsw_ts);
394 int q6asm_stream_run_nowait(struct audio_client *ac, uint32_t flags,
395 uint32_t msw_ts, uint32_t lsw_ts, uint32_t stream_id);
397 int q6asm_reg_tx_overflow(struct audio_client *ac, uint16_t enable);
399 int q6asm_reg_rx_underflow(struct audio_client *ac, uint16_t enable);
401 int q6asm_cmd(struct audio_client *ac, int cmd);
403 int q6asm_stream_cmd(struct audio_client *ac, int cmd, uint32_t stream_id);
405 int q6asm_cmd_nowait(struct audio_client *ac, int cmd);
407 int q6asm_stream_cmd_nowait(struct audio_client *ac, int cmd,
410 void *q6asm_is_cpu_buf_avail(int dir, struct audio_client *ac,
411 uint32_t *size, uint32_t *idx);
413 int q6asm_cpu_buf_release(int dir, struct audio_client *ac);
415 void *q6asm_is_cpu_buf_avail_nolock(int dir, struct audio_client *ac,
416 uint32_t *size, uint32_t *idx);
418 int q6asm_is_dsp_buf_avail(int dir, struct audio_client *ac);
420 /* File format specific configurations to be added below */
422 int q6asm_enc_cfg_blk_aac(struct audio_client *ac,
423 uint32_t frames_per_buf,
424 uint32_t sample_rate, uint32_t channels,
426 uint32_t mode, uint32_t format);
428 int q6asm_enc_cfg_blk_g711(struct audio_client *ac,
429 uint32_t frames_per_buf,
430 uint32_t sample_rate);
432 int q6asm_enc_cfg_blk_pcm(struct audio_client *ac,
433 uint32_t rate, uint32_t channels);
435 int q6asm_enc_cfg_blk_pcm_v2(struct audio_client *ac,
436 uint32_t rate, uint32_t channels,
437 uint16_t bits_per_sample,
438 bool use_default_chmap, bool use_back_flavor,
441 int q6asm_enc_cfg_blk_pcm_v3(struct audio_client *ac,
442 uint32_t rate, uint32_t channels,
443 uint16_t bits_per_sample, bool use_default_chmap,
444 bool use_back_flavor, u8 *channel_map,
445 uint16_t sample_word_size);
447 int q6asm_enc_cfg_blk_pcm_v4(struct audio_client *ac,
448 uint32_t rate, uint32_t channels,
449 uint16_t bits_per_sample, bool use_default_chmap,
450 bool use_back_flavor, u8 *channel_map,
451 uint16_t sample_word_size, uint16_t endianness,
454 int q6asm_enc_cfg_blk_pcm_format_support(struct audio_client *ac,
455 uint32_t rate, uint32_t channels,
456 uint16_t bits_per_sample);
458 int q6asm_enc_cfg_blk_pcm_format_support_v3(struct audio_client *ac,
459 uint32_t rate, uint32_t channels,
460 uint16_t bits_per_sample,
461 uint16_t sample_word_size);
463 int q6asm_enc_cfg_blk_pcm_format_support_v4(struct audio_client *ac,
464 uint32_t rate, uint32_t channels,
465 uint16_t bits_per_sample,
466 uint16_t sample_word_size,
470 int q6asm_enc_cfg_blk_pcm_format_support_v5(struct audio_client *ac,
471 uint32_t rate, uint32_t channels,
472 uint16_t bits_per_sample,
473 uint16_t sample_word_size,
477 int q6asm_set_encdec_chan_map(struct audio_client *ac,
478 uint32_t num_channels);
480 int q6asm_enc_cfg_blk_pcm_native(struct audio_client *ac,
481 uint32_t rate, uint32_t channels);
483 int q6asm_enable_sbrps(struct audio_client *ac,
486 int q6asm_cfg_dual_mono_aac(struct audio_client *ac,
487 uint16_t sce_left, uint16_t sce_right);
489 int q6asm_cfg_aac_sel_mix_coef(struct audio_client *ac, uint32_t mix_coeff);
491 int q6asm_enc_cfg_blk_qcelp(struct audio_client *ac, uint32_t frames_per_buf,
492 uint16_t min_rate, uint16_t max_rate,
493 uint16_t reduced_rate_level, uint16_t rate_modulation_cmd);
495 int q6asm_enc_cfg_blk_evrc(struct audio_client *ac, uint32_t frames_per_buf,
496 uint16_t min_rate, uint16_t max_rate,
497 uint16_t rate_modulation_cmd);
499 int q6asm_enc_cfg_blk_amrnb(struct audio_client *ac, uint32_t frames_per_buf,
500 uint16_t band_mode, uint16_t dtx_enable);
502 int q6asm_enc_cfg_blk_amrwb(struct audio_client *ac, uint32_t frames_per_buf,
503 uint16_t band_mode, uint16_t dtx_enable);
505 int q6asm_media_format_block_pcm(struct audio_client *ac,
506 uint32_t rate, uint32_t channels);
508 int q6asm_media_format_block_pcm_format_support(struct audio_client *ac,
509 uint32_t rate, uint32_t channels,
510 uint16_t bits_per_sample);
512 int q6asm_media_format_block_pcm_format_support_v2(struct audio_client *ac,
513 uint32_t rate, uint32_t channels,
514 uint16_t bits_per_sample, int stream_id,
515 bool use_default_chmap, char *channel_map);
517 int q6asm_media_format_block_pcm_format_support_v3(struct audio_client *ac,
520 uint16_t bits_per_sample,
522 bool use_default_chmap,
524 uint16_t sample_word_size);
526 int q6asm_media_format_block_pcm_format_support_v4(struct audio_client *ac,
529 uint16_t bits_per_sample,
531 bool use_default_chmap,
533 uint16_t sample_word_size,
537 int q6asm_media_format_block_multi_ch_pcm(struct audio_client *ac,
538 uint32_t rate, uint32_t channels,
539 bool use_default_chmap, char *channel_map);
541 int q6asm_media_format_block_multi_ch_pcm_v2(
542 struct audio_client *ac,
543 uint32_t rate, uint32_t channels,
544 bool use_default_chmap, char *channel_map,
545 uint16_t bits_per_sample);
546 int q6asm_media_format_block_gen_compr(
547 struct audio_client *ac,
548 uint32_t rate, uint32_t channels,
549 bool use_default_chmap, char *channel_map,
550 uint16_t bits_per_sample);
552 int q6asm_media_format_block_iec(
553 struct audio_client *ac,
554 uint32_t rate, uint32_t channels);
556 int q6asm_media_format_block_multi_ch_pcm_v3(struct audio_client *ac,
557 uint32_t rate, uint32_t channels,
558 bool use_default_chmap,
560 uint16_t bits_per_sample,
561 uint16_t sample_word_size);
563 int q6asm_media_format_block_multi_ch_pcm_v4(struct audio_client *ac,
564 uint32_t rate, uint32_t channels,
565 bool use_default_chmap,
567 uint16_t bits_per_sample,
568 uint16_t sample_word_size,
572 int q6asm_media_format_block_multi_ch_pcm_v5(struct audio_client *ac,
573 uint32_t rate, uint32_t channels,
574 bool use_default_chmap,
576 uint16_t bits_per_sample,
577 uint16_t sample_word_size,
581 int q6asm_media_format_block_aac(struct audio_client *ac,
582 struct asm_aac_cfg *cfg);
584 int q6asm_stream_media_format_block_aac(struct audio_client *ac,
585 struct asm_aac_cfg *cfg, int stream_id);
587 int q6asm_media_format_block_multi_aac(struct audio_client *ac,
588 struct asm_aac_cfg *cfg);
590 int q6asm_media_format_block_wma(struct audio_client *ac,
591 void *cfg, int stream_id);
593 int q6asm_media_format_block_wmapro(struct audio_client *ac,
594 void *cfg, int stream_id);
596 int q6asm_media_format_block_amrwbplus(struct audio_client *ac,
597 struct asm_amrwbplus_cfg *cfg);
599 int q6asm_stream_media_format_block_flac(struct audio_client *ac,
600 struct asm_flac_cfg *cfg, int stream_id);
602 int q6asm_media_format_block_alac(struct audio_client *ac,
603 struct asm_alac_cfg *cfg, int stream_id);
605 int q6asm_media_format_block_g711(struct audio_client *ac,
606 struct asm_g711_dec_cfg *cfg, int stream_id);
608 int q6asm_stream_media_format_block_vorbis(struct audio_client *ac,
609 struct asm_vorbis_cfg *cfg, int stream_id);
611 int q6asm_media_format_block_ape(struct audio_client *ac,
612 struct asm_ape_cfg *cfg, int stream_id);
614 int q6asm_media_format_block_dsd(struct audio_client *ac,
615 struct asm_dsd_cfg *cfg, int stream_id);
617 int q6asm_stream_media_format_block_aptx_dec(struct audio_client *ac,
618 uint32_t sr, int stream_id);
620 int q6asm_ds1_set_endp_params(struct audio_client *ac,
621 int param_id, int param_value);
623 /* Send stream based end params */
624 int q6asm_ds1_set_stream_endp_params(struct audio_client *ac, int param_id,
625 int param_value, int stream_id);
628 int q6asm_equalizer(struct audio_client *ac, void *eq);
630 /* Send Volume Command */
631 int q6asm_set_volume(struct audio_client *ac, int volume);
633 /* Send Volume Command */
634 int q6asm_set_volume_v2(struct audio_client *ac, int volume, int instance);
636 /* DTS Eagle Params */
637 int q6asm_dts_eagle_set(struct audio_client *ac, int param_id, uint32_t size,
638 void *data, struct param_outband *po, int m_id);
639 int q6asm_dts_eagle_get(struct audio_client *ac, int param_id, uint32_t size,
640 void *data, struct param_outband *po, int m_id);
642 /* Send aptx decoder BT address */
643 int q6asm_set_aptx_dec_bt_addr(struct audio_client *ac,
644 struct aptx_dec_bt_addr_cfg *cfg);
646 /* Set SoftPause Params */
647 int q6asm_set_softpause(struct audio_client *ac,
648 struct asm_softpause_params *param);
650 /* Set Softvolume Params */
651 int q6asm_set_softvolume(struct audio_client *ac,
652 struct asm_softvolume_params *param);
654 /* Set Softvolume Params */
655 int q6asm_set_softvolume_v2(struct audio_client *ac,
656 struct asm_softvolume_params *param, int instance);
658 /* Set panning and MFC params */
659 int q6asm_set_mfc_panning_params(struct audio_client *ac,
660 struct asm_stream_pan_ctrl_params *pan_param);
662 /* Set vol gain pair */
663 int q6asm_set_vol_ctrl_gain_pair(struct audio_client *ac,
664 struct asm_stream_pan_ctrl_params *pan_param);
666 /* Send left-right channel gain */
667 int q6asm_set_lrgain(struct audio_client *ac, int left_gain, int right_gain);
669 /* Send multi channel gain */
670 int q6asm_set_multich_gain(struct audio_client *ac, uint32_t channels,
671 uint32_t *gains, uint8_t *ch_map, bool use_default);
673 /* Enable Mute/unmute flag */
674 int q6asm_set_mute(struct audio_client *ac, int muteflag);
676 int q6asm_get_session_time(struct audio_client *ac, uint64_t *tstamp);
678 int q6asm_get_session_time_legacy(struct audio_client *ac, uint64_t *tstamp);
680 int q6asm_send_audio_effects_params(struct audio_client *ac, char *params,
681 uint32_t params_length);
683 int q6asm_send_stream_cmd(struct audio_client *ac,
684 struct msm_adsp_event_data *data);
686 int q6asm_audio_map_shm_fd(struct audio_client *ac, struct ion_client **client,
687 struct ion_handle **handle, int fd);
689 int q6asm_send_rtic_event_ack(struct audio_client *ac,
690 void *param, uint32_t params_length);
692 /* Client can set the IO mode to either AIO/SIO mode */
693 int q6asm_set_io_mode(struct audio_client *ac, uint32_t mode);
695 /* Get Service ID for APR communication */
696 int q6asm_get_apr_service_id(int session_id);
698 /* Common format block without any payload
700 int q6asm_media_format_block(struct audio_client *ac, uint32_t format);
702 /* Send the meta data to remove initial and trailing silence */
703 int q6asm_send_meta_data(struct audio_client *ac, uint32_t initial_samples,
704 uint32_t trailing_samples);
706 /* Send the stream meta data to remove initial and trailing silence */
707 int q6asm_stream_send_meta_data(struct audio_client *ac, uint32_t stream_id,
708 uint32_t initial_samples, uint32_t trailing_samples);
710 int q6asm_get_asm_topology(int session_id);
711 int q6asm_get_asm_app_type(int session_id);
713 int q6asm_send_mtmx_strtr_window(struct audio_client *ac,
714 struct asm_session_mtmx_strtr_param_window_v2_t *window_param,
717 /* Configure DSP render mode */
718 int q6asm_send_mtmx_strtr_render_mode(struct audio_client *ac,
719 uint32_t render_mode);
721 /* Configure DSP clock recovery mode */
722 int q6asm_send_mtmx_strtr_clk_rec_mode(struct audio_client *ac,
723 uint32_t clk_rec_mode);
725 /* Enable adjust session clock in DSP */
726 int q6asm_send_mtmx_strtr_enable_adjust_session_clock(struct audio_client *ac,
729 /* Retrieve the current DSP path delay */
730 int q6asm_get_path_delay(struct audio_client *ac);
732 /* Helper functions to retrieve data from token */
733 uint8_t q6asm_get_buf_index_from_token(uint32_t token);
734 uint8_t q6asm_get_stream_id_from_token(uint32_t token);
736 /* Adjust session clock in DSP */
737 int q6asm_adjust_session_clock(struct audio_client *ac,
738 uint32_t adjust_time_lsw,
739 uint32_t adjust_time_msw);
740 int q6asm_get_svc_version(uint32_t service_id);
741 #endif /* __Q6_ASM_H__ */