blob: 19a844c316e310fec8a11f1c6970fef23c58b822 [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_ADM_V2_H__
13#define __Q6_ADM_V2_H__
14
15
16#define ADM_PATH_PLAYBACK 0x1
17#define ADM_PATH_LIVE_REC 0x2
18#define ADM_PATH_NONLIVE_REC 0x3
19#define ADM_PATH_COMPRESSED_RX 0x5
20#define ADM_PATH_COMPRESSED_TX 0x6
Laxminath Kasam605b42f2017-08-01 22:02:15 +053021#include <dsp/rtac.h>
22#include <dsp/q6afe-v2.h>
23#include <dsp/q6audio-v2.h>
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +053024
25#define MAX_MODULES_IN_TOPO 16
26#define ADM_GET_TOPO_MODULE_LIST_LENGTH\
27 ((MAX_MODULES_IN_TOPO + 1) * sizeof(uint32_t))
28#define AUD_PROC_BLOCK_SIZE 4096
29#define AUD_VOL_BLOCK_SIZE 4096
30#define AUDIO_RX_CALIBRATION_SIZE (AUD_PROC_BLOCK_SIZE + \
31 AUD_VOL_BLOCK_SIZE)
32enum {
33 ADM_CUSTOM_TOP_CAL = 0,
34 ADM_AUDPROC_CAL,
Aditya Bavanari2a627ae2017-11-21 20:24:53 +053035 ADM_LSM_AUDPROC_CAL,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +053036 ADM_AUDVOL_CAL,
37 ADM_RTAC_INFO_CAL,
38 ADM_RTAC_APR_CAL,
39 ADM_SRS_TRUMEDIA,
40 ADM_RTAC_AUDVOL_CAL,
41 ADM_MAX_CAL_TYPES
42};
43
44enum {
45 ADM_MEM_MAP_INDEX_SOURCE_TRACKING = ADM_MAX_CAL_TYPES,
46 ADM_MEM_MAP_INDEX_MAX
47};
48
49enum {
50 ADM_CLIENT_ID_DEFAULT = 0,
51 ADM_CLIENT_ID_SOURCE_TRACKING,
52 ADM_CLIENT_ID_MAX,
53};
54
55#define MAX_COPPS_PER_PORT 0x8
56#define ADM_MAX_CHANNELS 8
57
58/* multiple copp per stream. */
59struct route_payload {
60 unsigned int copp_idx[MAX_COPPS_PER_PORT];
61 unsigned int port_id[MAX_COPPS_PER_PORT];
62 int app_type[MAX_COPPS_PER_PORT];
63 int acdb_dev_id[MAX_COPPS_PER_PORT];
64 int sample_rate[MAX_COPPS_PER_PORT];
65 unsigned short num_copps;
66 unsigned int session_id;
67};
68
69struct default_chmixer_param_id_coeff {
70 uint32_t index;
71 uint16_t num_output_channels;
72 uint16_t num_input_channels;
73};
74
75struct msm_pcm_channel_mixer {
76 int output_channel;
77 int input_channels[ADM_MAX_CHANNELS];
78 bool enable;
79 int rule;
80 int channel_weight[ADM_MAX_CHANNELS][ADM_MAX_CHANNELS];
81};
82
83int srs_trumedia_open(int port_id, int copp_idx, __s32 srs_tech_id,
84 void *srs_params);
85
86int adm_dts_eagle_set(int port_id, int copp_idx, int param_id,
87 void *data, uint32_t size);
88
89int adm_dts_eagle_get(int port_id, int copp_idx, int param_id,
90 void *data, uint32_t size);
91
92void adm_copp_mfc_cfg(int port_id, int copp_idx, int dst_sample_rate);
93
94int adm_get_params(int port_id, int copp_idx, uint32_t module_id,
95 uint32_t param_id, uint32_t params_length, char *params);
96
97int adm_send_params_v5(int port_id, int copp_idx, char *params,
98 uint32_t params_length);
99
100int adm_dolby_dap_send_params(int port_id, int copp_idx, char *params,
101 uint32_t params_length);
102
103int adm_open(int port, int path, int rate, int mode, int topology,
104 int perf_mode, uint16_t bits_per_sample,
105 int app_type, int acdbdev_id);
106
107int adm_map_rtac_block(struct rtac_cal_block_data *cal_block);
108
109int adm_unmap_rtac_block(uint32_t *mem_map_handle);
110
111int adm_close(int port, int topology, int perf_mode);
112
113int adm_matrix_map(int path, struct route_payload payload_map,
114 int perf_mode, uint32_t passthr_mode);
115
116int adm_connect_afe_port(int mode, int session_id, int port_id);
117
118void adm_ec_ref_rx_id(int port_id);
119
120void adm_num_ec_ref_rx_chans(int num_chans);
121
122void adm_ec_ref_rx_bit_width(int bit_width);
123
124void adm_ec_ref_rx_sampling_rate(int sampling_rate);
125
126int adm_get_lowlatency_copp_id(int port_id);
127
128int adm_set_multi_ch_map(char *channel_map, int path);
129
130int adm_get_multi_ch_map(char *channel_map, int path);
131
132int adm_validate_and_get_port_index(int port_id);
133
134int adm_get_default_copp_idx(int port_id);
135
136int adm_get_topology_for_port_from_copp_id(int port_id, int copp_id);
137
138int adm_get_topology_for_port_copp_idx(int port_id, int copp_idx);
139
140int adm_get_indexes_from_copp_id(int copp_id, int *port_idx, int *copp_idx);
141
142int adm_set_stereo_to_custom_stereo(int port_id, int copp_idx,
143 unsigned int session_id,
144 char *params, uint32_t params_length);
145
146int adm_get_pp_topo_module_list(int port_id, int copp_idx, int32_t param_length,
147 char *params);
148
149int adm_set_volume(int port_id, int copp_idx, int volume);
150
151int adm_set_softvolume(int port_id, int copp_idx,
152 struct audproc_softvolume_params *softvol_param);
153
154int adm_set_mic_gain(int port_id, int copp_idx, int volume);
155
156int adm_send_set_multichannel_ec_primary_mic_ch(int port_id, int copp_idx,
157 int primary_mic_ch);
158
159int adm_param_enable(int port_id, int copp_idx, int module_id, int enable);
160
161int adm_send_calibration(int port_id, int copp_idx, int path, int perf_mode,
162 int cal_type, char *params, int size);
163
164int adm_set_wait_parameters(int port_id, int copp_idx);
165
166int adm_reset_wait_parameters(int port_id, int copp_idx);
167
168int adm_wait_timeout(int port_id, int copp_idx, int wait_time);
169
170int adm_store_cal_data(int port_id, int copp_idx, int path, int perf_mode,
171 int cal_type, char *params, int *size);
172
173int adm_send_compressed_device_mute(int port_id, int copp_idx, bool mute_on);
174
175int adm_send_compressed_device_latency(int port_id, int copp_idx, int latency);
176int adm_set_sound_focus(int port_id, int copp_idx,
177 struct sound_focus_param soundFocusData);
178int adm_get_sound_focus(int port_id, int copp_idx,
179 struct sound_focus_param *soundFocusData);
180int adm_get_source_tracking(int port_id, int copp_idx,
181 struct source_tracking_param *sourceTrackingData);
182int adm_swap_speaker_channels(int port_id, int copp_idx, int sample_rate,
183 bool spk_swap);
184int adm_programable_channel_mixer(int port_id, int copp_idx, int session_id,
185 int session_type,
186 struct msm_pcm_channel_mixer *ch_mixer,
187 int channel_index);
Laxminath Kasam8b1366a2017-10-05 01:44:16 +0530188void msm_dts_srs_acquire_lock(void);
189void msm_dts_srs_release_lock(void);
Aditya Bavanari2a627ae2017-11-21 20:24:53 +0530190void adm_set_lsm_port_id(int port_id);
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +0530191#endif /* __Q6_ADM_V2_H__ */