Derek Chen | 61e5212 | 2016-05-26 18:00:39 -0400 | [diff] [blame] | 1 | /* Copyright (c) 2012-2017, The Linux Foundation. All rights reserved. |
Banajit Goswami | 0530e2f | 2016-12-09 21:34:37 -0800 | [diff] [blame] | 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 | #include <linux/qdsp6v2/rtac.h> |
| 21 | #include <sound/q6afe-v2.h> |
| 22 | #include <sound/q6audio-v2.h> |
| 23 | |
| 24 | #define MAX_MODULES_IN_TOPO 16 |
| 25 | #define ADM_GET_TOPO_MODULE_LIST_LENGTH\ |
| 26 | ((MAX_MODULES_IN_TOPO + 1) * sizeof(uint32_t)) |
| 27 | #define AUD_PROC_BLOCK_SIZE 4096 |
| 28 | #define AUD_VOL_BLOCK_SIZE 4096 |
| 29 | #define AUDIO_RX_CALIBRATION_SIZE (AUD_PROC_BLOCK_SIZE + \ |
| 30 | AUD_VOL_BLOCK_SIZE) |
| 31 | enum { |
| 32 | ADM_CUSTOM_TOP_CAL = 0, |
| 33 | ADM_AUDPROC_CAL, |
| 34 | ADM_AUDVOL_CAL, |
| 35 | ADM_RTAC_INFO_CAL, |
| 36 | ADM_RTAC_APR_CAL, |
| 37 | ADM_DTS_EAGLE, |
| 38 | ADM_SRS_TRUMEDIA, |
| 39 | ADM_RTAC_AUDVOL_CAL, |
| 40 | ADM_MAX_CAL_TYPES |
| 41 | }; |
| 42 | |
| 43 | enum { |
| 44 | ADM_MEM_MAP_INDEX_SOURCE_TRACKING = ADM_MAX_CAL_TYPES, |
| 45 | ADM_MEM_MAP_INDEX_MAX |
| 46 | }; |
| 47 | |
| 48 | enum { |
| 49 | ADM_CLIENT_ID_DEFAULT = 0, |
| 50 | ADM_CLIENT_ID_SOURCE_TRACKING, |
| 51 | ADM_CLIENT_ID_MAX, |
| 52 | }; |
| 53 | |
| 54 | #define MAX_COPPS_PER_PORT 0x8 |
| 55 | #define ADM_MAX_CHANNELS 8 |
| 56 | |
| 57 | /* multiple copp per stream. */ |
| 58 | struct route_payload { |
| 59 | unsigned int copp_idx[MAX_COPPS_PER_PORT]; |
| 60 | unsigned int port_id[MAX_COPPS_PER_PORT]; |
| 61 | int app_type; |
| 62 | int acdb_dev_id; |
| 63 | int sample_rate; |
| 64 | unsigned short num_copps; |
| 65 | unsigned int session_id; |
| 66 | }; |
| 67 | |
| 68 | int srs_trumedia_open(int port_id, int copp_idx, __s32 srs_tech_id, |
| 69 | void *srs_params); |
| 70 | |
| 71 | int adm_dts_eagle_set(int port_id, int copp_idx, int param_id, |
| 72 | void *data, uint32_t size); |
| 73 | |
| 74 | int adm_dts_eagle_get(int port_id, int copp_idx, int param_id, |
| 75 | void *data, uint32_t size); |
| 76 | |
| 77 | void adm_copp_mfc_cfg(int port_id, int copp_idx, int dst_sample_rate); |
| 78 | |
| 79 | int adm_get_params(int port_id, int copp_idx, uint32_t module_id, |
| 80 | uint32_t param_id, uint32_t params_length, char *params); |
| 81 | |
| 82 | int adm_send_params_v5(int port_id, int copp_idx, char *params, |
| 83 | uint32_t params_length); |
| 84 | |
| 85 | int adm_dolby_dap_send_params(int port_id, int copp_idx, char *params, |
| 86 | uint32_t params_length); |
| 87 | |
| 88 | int adm_open(int port, int path, int rate, int mode, int topology, |
| 89 | int perf_mode, uint16_t bits_per_sample, |
| 90 | int app_type, int acdbdev_id); |
| 91 | |
| 92 | int adm_map_rtac_block(struct rtac_cal_block_data *cal_block); |
| 93 | |
| 94 | int adm_unmap_rtac_block(uint32_t *mem_map_handle); |
| 95 | |
| 96 | int adm_close(int port, int topology, int perf_mode); |
| 97 | |
| 98 | int adm_matrix_map(int path, struct route_payload payload_map, |
| 99 | int perf_mode); |
| 100 | |
| 101 | int adm_connect_afe_port(int mode, int session_id, int port_id); |
| 102 | |
| 103 | void adm_ec_ref_rx_id(int port_id); |
| 104 | |
Derek Chen | 61e5212 | 2016-05-26 18:00:39 -0400 | [diff] [blame] | 105 | void adm_num_ec_ref_rx_chans(int num_chans); |
| 106 | |
| 107 | void adm_ec_ref_rx_bit_width(int bit_width); |
| 108 | |
| 109 | void adm_ec_ref_rx_sampling_rate(int sampling_rate); |
| 110 | |
Banajit Goswami | 0530e2f | 2016-12-09 21:34:37 -0800 | [diff] [blame] | 111 | int adm_get_lowlatency_copp_id(int port_id); |
| 112 | |
| 113 | int adm_set_multi_ch_map(char *channel_map, int path); |
| 114 | |
| 115 | int adm_get_multi_ch_map(char *channel_map, int path); |
| 116 | |
| 117 | int adm_validate_and_get_port_index(int port_id); |
| 118 | |
| 119 | int adm_get_default_copp_idx(int port_id); |
| 120 | |
| 121 | int adm_get_topology_for_port_from_copp_id(int port_id, int copp_id); |
| 122 | |
| 123 | int adm_get_topology_for_port_copp_idx(int port_id, int copp_idx); |
| 124 | |
| 125 | int adm_get_indexes_from_copp_id(int copp_id, int *port_idx, int *copp_idx); |
| 126 | |
| 127 | int adm_set_stereo_to_custom_stereo(int port_id, int copp_idx, |
| 128 | unsigned int session_id, |
| 129 | char *params, uint32_t params_length); |
| 130 | |
| 131 | int adm_get_pp_topo_module_list(int port_id, int copp_idx, int32_t param_length, |
| 132 | char *params); |
| 133 | |
| 134 | int adm_set_volume(int port_id, int copp_idx, int volume); |
| 135 | |
| 136 | int adm_set_softvolume(int port_id, int copp_idx, |
| 137 | struct audproc_softvolume_params *softvol_param); |
| 138 | |
Derek Chen | 5dea59a | 2016-06-06 20:40:29 -0400 | [diff] [blame] | 139 | int adm_set_mic_gain(int port_id, int copp_idx, int volume); |
| 140 | |
Rahul Sharma | 6e83698 | 2016-12-09 00:45:44 +0530 | [diff] [blame^] | 141 | int adm_send_set_multichannel_ec_primary_mic_ch(int port_id, int copp_idx, |
| 142 | int primary_mic_ch); |
| 143 | |
Banajit Goswami | 0530e2f | 2016-12-09 21:34:37 -0800 | [diff] [blame] | 144 | int adm_param_enable(int port_id, int copp_idx, int module_id, int enable); |
| 145 | |
| 146 | int adm_send_calibration(int port_id, int copp_idx, int path, int perf_mode, |
| 147 | int cal_type, char *params, int size); |
| 148 | |
| 149 | int adm_set_wait_parameters(int port_id, int copp_idx); |
| 150 | |
| 151 | int adm_reset_wait_parameters(int port_id, int copp_idx); |
| 152 | |
| 153 | int adm_wait_timeout(int port_id, int copp_idx, int wait_time); |
| 154 | |
| 155 | int adm_store_cal_data(int port_id, int copp_idx, int path, int perf_mode, |
| 156 | int cal_type, char *params, int *size); |
| 157 | |
| 158 | int adm_send_compressed_device_mute(int port_id, int copp_idx, bool mute_on); |
| 159 | |
| 160 | int adm_send_compressed_device_latency(int port_id, int copp_idx, int latency); |
| 161 | int adm_set_sound_focus(int port_id, int copp_idx, |
| 162 | struct sound_focus_param soundFocusData); |
| 163 | int adm_get_sound_focus(int port_id, int copp_idx, |
| 164 | struct sound_focus_param *soundFocusData); |
| 165 | int adm_get_source_tracking(int port_id, int copp_idx, |
| 166 | struct source_tracking_param *sourceTrackingData); |
| 167 | #endif /* __Q6_ADM_V2_H__ */ |