Vignesh Kulothungan | 78d3e82 | 2018-03-13 16:05:20 -0700 | [diff] [blame] | 1 | /* Copyright (c) 2012-2018, The Linux Foundation. All rights reserved. |
Asish Bhattacharya | 8e2277f | 2017-07-20 18:31:55 +0530 | [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 __QDSP6VOICE_H__ |
| 13 | #define __QDSP6VOICE_H__ |
| 14 | |
Asish Bhattacharya | 8e2277f | 2017-07-20 18:31:55 +0530 | [diff] [blame] | 15 | #include <linux/msm_ion.h> |
Aditya Bavanari | 318556e | 2018-12-03 17:26:24 +0530 | [diff] [blame] | 16 | #include <linux/power_supply.h> |
| 17 | #include <uapi/linux/vm_bms.h> |
Asish Bhattacharya | 8e2277f | 2017-07-20 18:31:55 +0530 | [diff] [blame] | 18 | #include <sound/voice_params.h> |
Laxminath Kasam | 605b42f | 2017-08-01 22:02:15 +0530 | [diff] [blame] | 19 | #include <dsp/rtac.h> |
Vignesh Kulothungan | 78d3e82 | 2018-03-13 16:05:20 -0700 | [diff] [blame] | 20 | #include <dsp/q6core.h> |
Laxminath Kasam | 605b42f | 2017-08-01 22:02:15 +0530 | [diff] [blame] | 21 | #include <ipc/apr.h> |
Asish Bhattacharya | 8e2277f | 2017-07-20 18:31:55 +0530 | [diff] [blame] | 22 | |
| 23 | #define MAX_VOC_PKT_SIZE 642 |
| 24 | #define SESSION_NAME_LEN 20 |
| 25 | #define NUM_OF_MEMORY_BLOCKS 1 |
| 26 | #define NUM_OF_BUFFERS 2 |
| 27 | #define VSS_NUM_CHANNELS_MAX 8 |
| 28 | #define VSS_CHANNEL_MAPPING_SIZE (sizeof(uint8_t) * VSS_NUM_CHANNELS_MAX) |
| 29 | /* |
| 30 | * BUFFER BLOCK SIZE based on |
| 31 | * the supported page size |
| 32 | */ |
| 33 | #define BUFFER_BLOCK_SIZE 4096 |
| 34 | |
| 35 | #define MAX_COL_INFO_SIZE 324 |
| 36 | |
| 37 | #define VOC_REC_UPLINK 0x00 |
| 38 | #define VOC_REC_DOWNLINK 0x01 |
| 39 | #define VOC_REC_BOTH 0x02 |
| 40 | |
| 41 | #define VSS_IVERSION_CMD_GET 0x00011378 |
| 42 | #define VSS_IVERSION_RSP_GET 0x00011379 |
| 43 | #define CVD_VERSION_STRING_MAX_SIZE 31 |
| 44 | #define CVD_VERSION_DEFAULT "" |
| 45 | #define CVD_VERSION_0_0 "0.0" |
| 46 | #define CVD_VERSION_2_1 "2.1" |
| 47 | #define CVD_VERSION_2_2 "2.2" |
| 48 | #define CVD_VERSION_2_3 "2.3" |
| 49 | |
| 50 | #define CVD_INT_VERSION_DEFAULT 0 |
| 51 | #define CVD_INT_VERSION_0_0 1 |
| 52 | #define CVD_INT_VERSION_2_1 2 |
| 53 | #define CVD_INT_VERSION_2_2 3 |
| 54 | #define CVD_INT_VERSION_2_3 4 |
| 55 | #define CVD_INT_VERSION_LAST CVD_INT_VERSION_2_3 |
| 56 | #define CVD_INT_VERSION_MAX (CVD_INT_VERSION_LAST + 1) |
| 57 | |
| 58 | struct cvd_version_table { |
| 59 | char cvd_ver[CVD_VERSION_STRING_MAX_SIZE]; |
| 60 | int cvd_ver_int; |
| 61 | }; |
| 62 | |
| 63 | int voc_get_cvd_version(char *cvd_version); |
| 64 | |
| 65 | /* Payload structure for the VSS_IVERSION_RSP_GET command response */ |
| 66 | struct vss_iversion_rsp_get_t { |
| 67 | char version[CVD_VERSION_STRING_MAX_SIZE]; |
| 68 | /* NULL-terminated version string */ |
| 69 | }; |
| 70 | |
| 71 | enum { |
| 72 | CVP_VOC_RX_TOPOLOGY_CAL = 0, |
| 73 | CVP_VOC_TX_TOPOLOGY_CAL, |
| 74 | CVP_VOCPROC_CAL, |
| 75 | CVP_VOCVOL_CAL, |
| 76 | CVP_VOCDEV_CFG_CAL, |
| 77 | CVP_VOCPROC_COL_CAL, |
| 78 | CVP_VOCVOL_COL_CAL, |
| 79 | CVS_VOCSTRM_CAL, |
| 80 | CVS_VOCSTRM_COL_CAL, |
| 81 | VOICE_RTAC_INFO_CAL, |
| 82 | VOICE_RTAC_APR_CAL, |
| 83 | MAX_VOICE_CAL_TYPES |
| 84 | }; |
| 85 | |
| 86 | struct voice_header { |
| 87 | uint32_t id; |
| 88 | uint32_t data_len; |
| 89 | }; |
| 90 | |
| 91 | struct voice_init { |
| 92 | struct voice_header hdr; |
| 93 | void *cb_handle; |
| 94 | }; |
| 95 | |
| 96 | /* Stream information payload structure */ |
| 97 | struct stream_data { |
| 98 | uint32_t stream_mute; |
| 99 | uint32_t stream_mute_ramp_duration_ms; |
| 100 | }; |
| 101 | |
| 102 | /* Device information payload structure */ |
| 103 | struct device_data { |
| 104 | uint32_t dev_mute; |
| 105 | uint32_t sample_rate; |
| 106 | uint16_t bits_per_sample; |
| 107 | uint8_t channel_mapping[VSS_NUM_CHANNELS_MAX]; |
| 108 | uint32_t enabled; |
| 109 | uint32_t dev_id; |
| 110 | uint32_t port_id; |
| 111 | uint32_t volume_step_value; |
| 112 | uint32_t volume_ramp_duration_ms; |
| 113 | uint32_t dev_mute_ramp_duration_ms; |
| 114 | uint32_t no_of_channels; |
| 115 | }; |
| 116 | |
| 117 | /* |
| 118 | * Format information structure to match |
| 119 | * vss_param_endpoint_media_format_info_t |
| 120 | */ |
| 121 | struct media_format_info { |
| 122 | uint32_t port_id; |
| 123 | uint16_t num_channels; |
| 124 | uint16_t bits_per_sample; |
| 125 | uint32_t sample_rate; |
| 126 | uint8_t channel_mapping[VSS_NUM_CHANNELS_MAX]; |
| 127 | }; |
| 128 | |
| 129 | enum { |
Laxminath Kasam | 38070be | 2017-08-17 18:21:59 +0530 | [diff] [blame] | 130 | VOC_GENERIC_SET_PARAM_TOKEN = 0, |
Asish Bhattacharya | 8e2277f | 2017-07-20 18:31:55 +0530 | [diff] [blame] | 131 | VOC_RTAC_SET_PARAM_TOKEN, |
| 132 | VOC_SET_MEDIA_FORMAT_PARAM_TOKEN, |
| 133 | VOC_SET_PARAM_TOKEN_MAX |
| 134 | }; |
| 135 | |
| 136 | struct voice_dev_route_state { |
| 137 | u16 rx_route_flag; |
| 138 | u16 tx_route_flag; |
| 139 | }; |
| 140 | |
| 141 | struct voice_rec_route_state { |
| 142 | u16 ul_flag; |
| 143 | u16 dl_flag; |
| 144 | }; |
| 145 | |
| 146 | enum { |
| 147 | VOC_INIT = 0, |
| 148 | VOC_RUN, |
| 149 | VOC_CHANGE, |
| 150 | VOC_RELEASE, |
| 151 | VOC_ERROR, |
| 152 | VOC_STANDBY, |
| 153 | }; |
| 154 | |
| 155 | struct mem_buffer { |
| 156 | dma_addr_t phys; |
| 157 | void *data; |
| 158 | uint32_t size; /* size of buffer */ |
| 159 | }; |
| 160 | |
| 161 | struct share_mem_buf { |
| 162 | struct ion_handle *handle; |
| 163 | struct ion_client *client; |
| 164 | struct mem_buffer buf[NUM_OF_BUFFERS]; |
| 165 | }; |
| 166 | |
| 167 | struct mem_map_table { |
| 168 | dma_addr_t phys; |
| 169 | void *data; |
| 170 | size_t size; /* size of buffer */ |
| 171 | struct ion_handle *handle; |
| 172 | struct ion_client *client; |
| 173 | }; |
| 174 | |
| 175 | /* Common */ |
| 176 | #define VSS_ICOMMON_CMD_SET_UI_PROPERTY 0x00011103 |
| 177 | /* Set a UI property */ |
| 178 | #define VSS_ICOMMON_CMD_MAP_MEMORY 0x00011025 |
| 179 | #define VSS_ICOMMON_CMD_UNMAP_MEMORY 0x00011026 |
| 180 | /* General shared memory; byte-accessible, 4 kB-aligned. */ |
| 181 | #define VSS_ICOMMON_MAP_MEMORY_SHMEM8_4K_POOL 3 |
| 182 | |
| 183 | struct vss_icommon_cmd_map_memory_t { |
| 184 | uint32_t phys_addr; |
| 185 | /* Physical address of a memory region; must be at least |
| 186 | * 4 kB aligned. |
| 187 | */ |
| 188 | |
| 189 | uint32_t mem_size; |
| 190 | /* Number of bytes in the region; should be a multiple of 32. */ |
| 191 | |
| 192 | uint16_t mem_pool_id; |
| 193 | /* Type of memory being provided. The memory ID implicitly defines |
| 194 | * the characteristics of the memory. The characteristics might include |
| 195 | * alignment type, permissions, etc. |
| 196 | * Memory pool ID. Possible values: |
| 197 | * 3 -- VSS_ICOMMON_MEM_TYPE_SHMEM8_4K_POOL. |
| 198 | */ |
| 199 | } __packed; |
| 200 | |
| 201 | struct vss_icommon_cmd_unmap_memory_t { |
| 202 | uint32_t phys_addr; |
| 203 | /* Physical address of a memory region; must be at least |
| 204 | * 4 kB aligned. |
| 205 | */ |
| 206 | } __packed; |
| 207 | |
| 208 | struct vss_map_memory_cmd { |
| 209 | struct apr_hdr hdr; |
| 210 | struct vss_icommon_cmd_map_memory_t vss_map_mem; |
| 211 | } __packed; |
| 212 | |
| 213 | struct vss_unmap_memory_cmd { |
| 214 | struct apr_hdr hdr; |
| 215 | struct vss_icommon_cmd_unmap_memory_t vss_unmap_mem; |
| 216 | } __packed; |
| 217 | |
| 218 | struct vss_param_endpoint_media_format_info_t { |
| 219 | /* AFE port ID to which this media format corresponds to. */ |
| 220 | uint32_t port_id; |
| 221 | /* |
| 222 | * Number of channels of data. |
| 223 | * Supported values: 1 to 8 |
| 224 | */ |
| 225 | uint16_t num_channels; |
| 226 | /* |
| 227 | * Bits per sample of data. |
| 228 | * Supported values: 16 and 24 |
| 229 | */ |
| 230 | uint16_t bits_per_sample; |
| 231 | /* |
| 232 | * Sampling rate in Hz. |
| 233 | * Supported values: 8000, 11025, 16000, 22050, 24000, 32000, |
| 234 | * 44100, 48000, 88200, 96000, 176400, and 192000 |
| 235 | */ |
| 236 | uint32_t sample_rate; |
| 237 | /* |
| 238 | * The channel[i] mapping describes channel i. Each element i |
| 239 | * of the array describes channel i inside the data buffer. An |
| 240 | * unused or unknown channel is set to 0. |
| 241 | */ |
| 242 | uint8_t channel_mapping[VSS_NUM_CHANNELS_MAX]; |
| 243 | } __packed; |
| 244 | |
Laxminath Kasam | 38070be | 2017-08-17 18:21:59 +0530 | [diff] [blame] | 245 | struct vss_param_vocproc_dev_channel_info_t { |
| 246 | uint32_t num_channels; |
| 247 | uint32_t bits_per_sample; |
| 248 | uint8_t channel_mapping[VSS_NUM_CHANNELS_MAX]; |
| 249 | } __packed; |
| 250 | |
Aditya Bavanari | 245361d | 2017-09-07 12:11:30 +0530 | [diff] [blame] | 251 | struct vss_param_channel_mixer_info_t { |
| 252 | uint32_t index; |
| 253 | uint16_t num_output_channels; |
| 254 | uint16_t num_input_channels; |
| 255 | uint16_t out_channel_map[2]; |
| 256 | uint16_t in_channel_map[1]; |
| 257 | uint16_t channel_weight_coeff[2][1]; |
| 258 | uint16_t reserved; |
| 259 | } __packed; |
| 260 | |
Laxminath Kasam | 38070be | 2017-08-17 18:21:59 +0530 | [diff] [blame] | 261 | struct vss_param_mfc_config_info_t { |
| 262 | uint32_t sample_rate; |
| 263 | uint16_t bits_per_sample; |
| 264 | uint16_t num_channels; |
| 265 | uint16_t channel_type[VSS_NUM_CHANNELS_MAX]; |
| 266 | } __packed; |
| 267 | |
Asish Bhattacharya | 8e2277f | 2017-07-20 18:31:55 +0530 | [diff] [blame] | 268 | struct vss_icommon_param_data_t { |
| 269 | /* Valid ID of the module. */ |
| 270 | uint32_t module_id; |
| 271 | /* Valid ID of the parameter. */ |
| 272 | uint32_t param_id; |
| 273 | /* |
| 274 | * Data size of the structure relating to the param_id/module_id |
| 275 | * combination in uint8_t bytes. |
| 276 | */ |
| 277 | uint16_t param_size; |
| 278 | /* This field must be set to zero. */ |
| 279 | uint16_t reserved; |
| 280 | /* |
| 281 | * Parameter data payload when inband. Should have size param_size. |
| 282 | * Bit size of payload must be a multiple of 4. |
| 283 | */ |
| 284 | union { |
| 285 | struct vss_param_endpoint_media_format_info_t media_format_info; |
| 286 | }; |
| 287 | } __packed; |
| 288 | |
Laxminath Kasam | 38070be | 2017-08-17 18:21:59 +0530 | [diff] [blame] | 289 | struct vss_icommon_param_data_channel_info_v2_t { |
| 290 | /* Valid ID of the module. */ |
| 291 | uint32_t module_id; |
| 292 | /* Valid ID of the parameter. */ |
| 293 | uint32_t param_id; |
| 294 | /* |
| 295 | * Data size of the structure relating to the param_id/module_id |
| 296 | * combination in uint8_t bytes. |
| 297 | */ |
| 298 | uint16_t param_size; |
| 299 | /* This field must be set to zero. */ |
| 300 | uint16_t reserved; |
| 301 | struct vss_param_vocproc_dev_channel_info_t channel_info; |
| 302 | } __packed; |
| 303 | |
| 304 | struct vss_icommon_cmd_set_param_channel_info_v2_t { |
| 305 | /* |
| 306 | * Pointer to the unique identifier for an address (physical/virtual). |
| 307 | * |
| 308 | * If the parameter data payload is within the message payload |
| 309 | * (in-band), set this field to 0. The parameter data begins at the |
| 310 | * specified data payload address. |
| 311 | * |
| 312 | * If the parameter data is out-of-band, this field is the handle to |
| 313 | * the physical address in the shared memory that holds the parameter |
| 314 | * data. |
| 315 | */ |
| 316 | uint32_t mem_handle; |
| 317 | /* |
| 318 | * Location of the parameter data payload. |
| 319 | * |
| 320 | * The payload is an array of vss_icommon_param_data_t. If the |
| 321 | * mem_handle is 0, this field is ignored. |
| 322 | */ |
| 323 | uint64_t mem_address; |
| 324 | /* Size of the parameter data payload in bytes. */ |
| 325 | uint32_t mem_size; |
| 326 | struct vss_icommon_param_data_channel_info_v2_t param_data; |
| 327 | } __packed; |
| 328 | |
Aditya Bavanari | 245361d | 2017-09-07 12:11:30 +0530 | [diff] [blame] | 329 | struct vss_icommon_param_data_ch_mixer_v2_t { |
| 330 | /* Valid ID of the module. */ |
| 331 | uint32_t module_id; |
| 332 | /* Valid ID of the parameter. */ |
| 333 | uint32_t param_id; |
| 334 | /* |
| 335 | * Data size of the structure relating to the param_id/module_id |
| 336 | * combination in uint8_t bytes. |
| 337 | */ |
| 338 | uint16_t param_size; |
| 339 | /* This field must be set to zero. */ |
| 340 | uint16_t reserved; |
| 341 | struct vss_param_channel_mixer_info_t ch_mixer_info; |
| 342 | } __packed; |
| 343 | |
| 344 | struct vss_icommon_cmd_set_param_ch_mixer_v2_t { |
| 345 | /* |
| 346 | * Pointer to the unique identifier for an address (physical/virtual). |
| 347 | * |
| 348 | * If the parameter data payload is within the message payload |
| 349 | * (in-band), set this field to 0. The parameter data begins at the |
| 350 | * specified data payload address. |
| 351 | * |
| 352 | * If the parameter data is out-of-band, this field is the handle to |
| 353 | * the physical address in the shared memory that holds the parameter |
| 354 | * data. |
| 355 | */ |
| 356 | uint32_t mem_handle; |
| 357 | /* |
| 358 | * Location of the parameter data payload. |
| 359 | * |
| 360 | * The payload is an array of vss_icommon_param_data_t. If the |
| 361 | * mem_handle is 0, this field is ignored. |
| 362 | */ |
| 363 | uint64_t mem_address; |
| 364 | /* Size of the parameter data payload in bytes. */ |
| 365 | uint32_t mem_size; |
| 366 | |
| 367 | struct vss_icommon_param_data_ch_mixer_v2_t param_data; |
| 368 | } __packed; |
| 369 | |
Laxminath Kasam | 38070be | 2017-08-17 18:21:59 +0530 | [diff] [blame] | 370 | struct vss_icommon_param_data_mfc_config_v2_t { |
| 371 | /* Valid ID of the module. */ |
| 372 | uint32_t module_id; |
| 373 | /* Valid ID of the parameter. */ |
| 374 | uint32_t param_id; |
| 375 | /* |
| 376 | * Data size of the structure relating to the param_id/module_id |
| 377 | * combination in uint8_t bytes. |
| 378 | */ |
| 379 | uint16_t param_size; |
| 380 | /* This field must be set to zero. */ |
| 381 | uint16_t reserved; |
| 382 | struct vss_param_mfc_config_info_t mfc_config_info; |
| 383 | } __packed; |
| 384 | |
| 385 | struct vss_icommon_cmd_set_param_mfc_config_v2_t { |
| 386 | /* |
| 387 | * Pointer to the unique identifier for an address (physical/virtual). |
| 388 | * |
| 389 | * If the parameter data payload is within the message payload |
| 390 | * (in-band), set this field to 0. The parameter data begins at the |
| 391 | * specified data payload address. |
| 392 | * |
| 393 | * If the parameter data is out-of-band, this field is the handle to |
| 394 | * the physical address in the shared memory that holds the parameter |
| 395 | * data. |
| 396 | */ |
| 397 | |
| 398 | uint32_t mem_handle; |
| 399 | /* |
| 400 | * Location of the parameter data payload. |
| 401 | * |
| 402 | * The payload is an array of vss_icommon_param_data_t. If the |
| 403 | * mem_handle is 0, this field is ignored. |
| 404 | */ |
| 405 | uint64_t mem_address; |
| 406 | /* Size of the parameter data payload in bytes. */ |
| 407 | uint32_t mem_size; |
| 408 | |
| 409 | struct vss_icommon_param_data_mfc_config_v2_t param_data; |
| 410 | } __packed; |
| 411 | |
Asish Bhattacharya | 8e2277f | 2017-07-20 18:31:55 +0530 | [diff] [blame] | 412 | /* Payload structure for the VSS_ICOMMON_CMD_SET_PARAM_V2 command. */ |
| 413 | struct vss_icommon_cmd_set_param_v2_t { |
| 414 | /* |
| 415 | * Pointer to the unique identifier for an address (physical/virtual). |
| 416 | * |
| 417 | * If the parameter data payload is within the message payload |
| 418 | * (in-band), set this field to 0. The parameter data begins at the |
| 419 | * specified data payload address. |
| 420 | * |
| 421 | * If the parameter data is out-of-band, this field is the handle to |
| 422 | * the physical address in the shared memory that holds the parameter |
| 423 | * data. |
| 424 | */ |
| 425 | uint32_t mem_handle; |
| 426 | /* |
| 427 | * Location of the parameter data payload. |
| 428 | * |
| 429 | * The payload is an array of vss_icommon_param_data_t. If the |
| 430 | * mem_handle is 0, this field is ignored. |
| 431 | */ |
| 432 | uint64_t mem_address; |
| 433 | /* Size of the parameter data payload in bytes. */ |
| 434 | uint32_t mem_size; |
| 435 | /* Parameter data payload when the data is inband. */ |
| 436 | struct vss_icommon_param_data_t param_data; |
| 437 | } __packed; |
| 438 | |
| 439 | /* TO MVM commands */ |
| 440 | #define VSS_IMVM_CMD_CREATE_PASSIVE_CONTROL_SESSION 0x000110FF |
| 441 | /**< No payload. Wait for APRV2_IBASIC_RSP_RESULT response. */ |
| 442 | |
| 443 | #define VSS_IMVM_CMD_SET_POLICY_DUAL_CONTROL 0x00011327 |
| 444 | /* |
| 445 | * VSS_IMVM_CMD_SET_POLICY_DUAL_CONTROL |
| 446 | * Description: This command is required to let MVM know |
| 447 | * who is in control of session. |
| 448 | * Payload: Defined by vss_imvm_cmd_set_policy_dual_control_t. |
| 449 | * Result: Wait for APRV2_IBASIC_RSP_RESULT response. |
| 450 | */ |
| 451 | |
| 452 | #define VSS_IMVM_CMD_CREATE_FULL_CONTROL_SESSION 0x000110FE |
| 453 | /* Create a new full control MVM session. */ |
| 454 | |
| 455 | #define APRV2_IBASIC_CMD_DESTROY_SESSION 0x0001003C |
| 456 | /**< No payload. Wait for APRV2_IBASIC_RSP_RESULT response. */ |
| 457 | |
| 458 | #define VSS_IMVM_CMD_ATTACH_STREAM 0x0001123C |
| 459 | /* Attach a stream to the MVM. */ |
| 460 | |
| 461 | #define VSS_IMVM_CMD_DETACH_STREAM 0x0001123D |
| 462 | /* Detach a stream from the MVM. */ |
| 463 | |
| 464 | #define VSS_IMVM_CMD_ATTACH_VOCPROC 0x0001123E |
| 465 | /* Attach a vocproc to the MVM. The MVM will symmetrically connect this vocproc |
| 466 | * to all the streams currently attached to it. |
| 467 | */ |
| 468 | |
| 469 | #define VSS_IMVM_CMD_DETACH_VOCPROC 0x0001123F |
| 470 | /* Detach a vocproc from the MVM. The MVM will symmetrically disconnect this |
| 471 | * vocproc from all the streams to which it is currently attached. |
| 472 | */ |
| 473 | |
| 474 | #define VSS_IMVM_CMD_START_VOICE 0x00011190 |
| 475 | /**< No payload. Wait for APRV2_IBASIC_RSP_RESULT response. */ |
| 476 | |
| 477 | #define VSS_IMVM_CMD_STANDBY_VOICE 0x00011191 |
| 478 | /**< No payload. Wait for APRV2_IBASIC_RSP_RESULT response. */ |
| 479 | |
| 480 | #define VSS_IMVM_CMD_STOP_VOICE 0x00011192 |
| 481 | /**< No payload. Wait for APRV2_IBASIC_RSP_RESULT response. */ |
| 482 | |
| 483 | #define VSS_IMVM_CMD_PAUSE_VOICE 0x0001137D |
| 484 | /* No payload. Wait for APRV2_IBASIC_RSP_RESULT response. */ |
| 485 | |
| 486 | #define VSS_ISTREAM_CMD_ATTACH_VOCPROC 0x000110F8 |
| 487 | /**< Wait for APRV2_IBASIC_RSP_RESULT response. */ |
| 488 | |
| 489 | #define VSS_ISTREAM_CMD_DETACH_VOCPROC 0x000110F9 |
| 490 | /**< Wait for APRV2_IBASIC_RSP_RESULT response. */ |
| 491 | |
| 492 | |
| 493 | #define VSS_ISTREAM_CMD_SET_TTY_MODE 0x00011196 |
| 494 | /**< Wait for APRV2_IBASIC_RSP_RESULT response. */ |
| 495 | |
| 496 | #define VSS_ICOMMON_CMD_SET_NETWORK 0x0001119C |
| 497 | /* Set the network type. */ |
| 498 | |
| 499 | #define VSS_ICOMMON_CMD_SET_VOICE_TIMING 0x000111E0 |
| 500 | /* Set the voice timing parameters. */ |
| 501 | |
| 502 | #define VSS_IMEMORY_CMD_MAP_PHYSICAL 0x00011334 |
| 503 | #define VSS_IMEMORY_RSP_MAP 0x00011336 |
| 504 | #define VSS_IMEMORY_CMD_UNMAP 0x00011337 |
| 505 | #define VSS_IMVM_CMD_SET_CAL_NETWORK 0x0001137A |
| 506 | #define VSS_IMVM_CMD_SET_CAL_MEDIA_TYPE 0x0001137B |
| 507 | #define VSS_IHDVOICE_CMD_ENABLE 0x000130A2 |
| 508 | #define VSS_IHDVOICE_CMD_DISABLE 0x000130A3 |
| 509 | |
Vignesh Kulothungan | 78d3e82 | 2018-03-13 16:05:20 -0700 | [diff] [blame] | 510 | /* To listen for events from MVM module */ |
| 511 | #define VSS_INOTIFY_CMD_LISTEN_FOR_EVENT_CLASS 0x00012E56 |
| 512 | /* To cancel listening for events from MVM module */ |
| 513 | #define VSS_INOTIFY_CMD_CANCEL_EVENT_CLASS 0x00012E57 |
| 514 | /* To receive ongoing voice activity notification */ |
| 515 | #define VSS_ICOMMON_EVENT_CLASS_VOICE_ACTIVITY_UPDATE 0x000131EF |
| 516 | /* Voice activity notification from MVM */ |
| 517 | #define VSS_ICOMMON_EVT_VOICE_ACTIVITY_UPDATE 0x000131F0 |
| 518 | /* Mic path is broken. */ |
| 519 | #define VSS_ICOMMON_VOICE_ACTIVITY_MIC_BREAK 0x000131F3 |
| 520 | /* Mic path is restored. */ |
| 521 | #define VSS_ICOMMON_VOICE_ACITIVTY_MIC_UNBREAK 0x000131F4 |
| 522 | |
Asish Bhattacharya | 8e2277f | 2017-07-20 18:31:55 +0530 | [diff] [blame] | 523 | enum msm_audio_voc_rate { |
| 524 | VOC_0_RATE, /* Blank frame */ |
| 525 | VOC_8_RATE, /* 1/8 rate */ |
| 526 | VOC_4_RATE, /* 1/4 rate */ |
| 527 | VOC_2_RATE, /* 1/2 rate */ |
| 528 | VOC_1_RATE, /* Full rate */ |
| 529 | VOC_8_RATE_NC /* Noncritical 1/8 rate */ |
| 530 | }; |
| 531 | |
| 532 | struct vss_istream_cmd_set_tty_mode_t { |
| 533 | uint32_t mode; |
| 534 | /**< |
| 535 | * TTY mode. |
| 536 | * |
| 537 | * 0 : TTY disabled |
| 538 | * 1 : HCO |
| 539 | * 2 : VCO |
| 540 | * 3 : FULL |
| 541 | */ |
| 542 | } __packed; |
| 543 | |
| 544 | struct vss_istream_cmd_attach_vocproc_t { |
| 545 | uint16_t handle; |
| 546 | /**< Handle of vocproc being attached. */ |
| 547 | } __packed; |
| 548 | |
| 549 | struct vss_istream_cmd_detach_vocproc_t { |
| 550 | uint16_t handle; |
| 551 | /**< Handle of vocproc being detached. */ |
| 552 | } __packed; |
| 553 | |
| 554 | struct vss_imvm_cmd_attach_stream_t { |
| 555 | uint16_t handle; |
| 556 | /* The stream handle to attach. */ |
| 557 | } __packed; |
| 558 | |
| 559 | struct vss_imvm_cmd_detach_stream_t { |
| 560 | uint16_t handle; |
| 561 | /* The stream handle to detach. */ |
| 562 | } __packed; |
| 563 | |
| 564 | struct vss_icommon_cmd_set_network_t { |
| 565 | uint32_t network_id; |
| 566 | /* Network ID. (Refer to VSS_NETWORK_ID_XXX). */ |
| 567 | } __packed; |
| 568 | |
| 569 | struct vss_icommon_cmd_set_voice_timing_t { |
| 570 | uint16_t mode; |
| 571 | /* |
| 572 | * The vocoder frame synchronization mode. |
| 573 | * |
| 574 | * 0 : No frame sync. |
| 575 | * 1 : Hard VFR (20ms Vocoder Frame Reference interrupt). |
| 576 | */ |
| 577 | uint16_t enc_offset; |
| 578 | /* |
| 579 | * The offset in microseconds from the VFR to deliver a Tx vocoder |
| 580 | * packet. The offset should be less than 20000us. |
| 581 | */ |
| 582 | uint16_t dec_req_offset; |
| 583 | /* |
| 584 | * The offset in microseconds from the VFR to request for an Rx vocoder |
| 585 | * packet. The offset should be less than 20000us. |
| 586 | */ |
| 587 | uint16_t dec_offset; |
| 588 | /* |
| 589 | * The offset in microseconds from the VFR to indicate the deadline to |
| 590 | * receive an Rx vocoder packet. The offset should be less than 20000us. |
| 591 | * Rx vocoder packets received after this deadline are not guaranteed to |
| 592 | * be processed. |
| 593 | */ |
| 594 | } __packed; |
| 595 | |
| 596 | struct vss_imvm_cmd_create_control_session_t { |
| 597 | char name[SESSION_NAME_LEN]; |
| 598 | /* |
| 599 | * A variable-sized stream name. |
| 600 | * |
| 601 | * The stream name size is the payload size minus the size of the other |
| 602 | * fields. |
| 603 | */ |
| 604 | } __packed; |
| 605 | |
| 606 | |
| 607 | struct vss_imvm_cmd_set_policy_dual_control_t { |
| 608 | bool enable_flag; |
| 609 | /* Set to TRUE to enable modem state machine control */ |
| 610 | } __packed; |
| 611 | |
| 612 | struct mvm_attach_vocproc_cmd { |
| 613 | struct apr_hdr hdr; |
| 614 | struct vss_istream_cmd_attach_vocproc_t mvm_attach_cvp_handle; |
| 615 | } __packed; |
| 616 | |
| 617 | struct mvm_detach_vocproc_cmd { |
| 618 | struct apr_hdr hdr; |
| 619 | struct vss_istream_cmd_detach_vocproc_t mvm_detach_cvp_handle; |
| 620 | } __packed; |
| 621 | |
| 622 | struct mvm_create_ctl_session_cmd { |
| 623 | struct apr_hdr hdr; |
| 624 | struct vss_imvm_cmd_create_control_session_t mvm_session; |
| 625 | } __packed; |
| 626 | |
| 627 | struct mvm_modem_dual_control_session_cmd { |
| 628 | struct apr_hdr hdr; |
| 629 | struct vss_imvm_cmd_set_policy_dual_control_t voice_ctl; |
| 630 | } __packed; |
| 631 | |
| 632 | struct mvm_set_tty_mode_cmd { |
| 633 | struct apr_hdr hdr; |
| 634 | struct vss_istream_cmd_set_tty_mode_t tty_mode; |
| 635 | } __packed; |
| 636 | |
| 637 | struct mvm_attach_stream_cmd { |
| 638 | struct apr_hdr hdr; |
| 639 | struct vss_imvm_cmd_attach_stream_t attach_stream; |
| 640 | } __packed; |
| 641 | |
| 642 | struct mvm_detach_stream_cmd { |
| 643 | struct apr_hdr hdr; |
| 644 | struct vss_imvm_cmd_detach_stream_t detach_stream; |
| 645 | } __packed; |
| 646 | |
| 647 | struct mvm_set_network_cmd { |
| 648 | struct apr_hdr hdr; |
| 649 | struct vss_icommon_cmd_set_network_t network; |
| 650 | } __packed; |
| 651 | |
| 652 | struct mvm_set_voice_timing_cmd { |
| 653 | struct apr_hdr hdr; |
| 654 | struct vss_icommon_cmd_set_voice_timing_t timing; |
| 655 | } __packed; |
| 656 | |
| 657 | struct mvm_set_hd_enable_cmd { |
| 658 | struct apr_hdr hdr; |
| 659 | } __packed; |
| 660 | |
| 661 | struct vss_imemory_table_descriptor_t { |
| 662 | uint32_t mem_address_lsw; |
| 663 | uint32_t mem_address_msw; |
| 664 | /* |
| 665 | * Base physical address of the table. The address must be aligned |
| 666 | * to LCM( cache_line_size, page_align, max_data_width ), where the |
| 667 | * attributes are specified in #VSS_IMEMORY_CMD_MAP_PHYSICAL, and |
| 668 | * LCM = Least Common Multiple. The table at the address must have |
| 669 | * the format specified by #vss_imemory_table_t. |
| 670 | */ |
| 671 | uint32_t mem_size; |
| 672 | /* Size in bytes of the table. */ |
| 673 | } __packed; |
| 674 | |
| 675 | struct vss_imemory_block_t { |
| 676 | uint64_t mem_address; |
| 677 | /* |
| 678 | * Base address of the memory block. The address is virtual for virtual |
| 679 | * memory and physical for physical memory. The address must be aligned |
| 680 | * to LCM( cache_line_size, page_align, max_data_width ), where the |
| 681 | * attributes are specified in VSS_IMEMORY_CMD_MAP_VIRTUAL or |
| 682 | * VSS_IMEMORY_CMD_MAP_PHYSICAL, and LCM = Least Common Multiple. |
| 683 | */ |
| 684 | uint32_t mem_size; |
| 685 | /* |
| 686 | * Size in bytes of the memory block. The size must be multiple of |
| 687 | * page_align, where page_align is specified in |
| 688 | * VSS_IMEMORY_CMD_MAP_VIRTUAL or #VSS_IMEMORY_CMD_MAP_PHYSICAL. |
| 689 | */ |
| 690 | } __packed; |
| 691 | |
| 692 | struct vss_imemory_table_t { |
| 693 | struct vss_imemory_table_descriptor_t next_table_descriptor; |
| 694 | /* |
| 695 | * Specifies the next table. If there is no next table, |
| 696 | * set the size of the table to 0 and the table address is ignored. |
| 697 | */ |
| 698 | struct vss_imemory_block_t blocks[NUM_OF_MEMORY_BLOCKS]; |
| 699 | /* Specifies one ore more memory blocks. */ |
| 700 | } __packed; |
| 701 | |
| 702 | struct vss_imemory_cmd_map_physical_t { |
| 703 | struct apr_hdr hdr; |
| 704 | struct vss_imemory_table_descriptor_t table_descriptor; |
| 705 | bool is_cached; |
| 706 | /* |
| 707 | * Indicates cached or uncached memory. Supported values: |
| 708 | * TRUE - Cached. |
| 709 | */ |
| 710 | uint16_t cache_line_size; |
| 711 | /* Cache line size in bytes. Supported values: 128 */ |
| 712 | uint32_t access_mask; |
| 713 | /* |
| 714 | * CVD's access permission to the memory while it is mapped. |
| 715 | * Supported values: |
| 716 | * bit 0 - If set, the memory is readable. |
| 717 | * bit 1 - If set, the memory is writable. |
| 718 | */ |
| 719 | uint32_t page_align; |
| 720 | /* Page frame alignment in bytes. Supported values: 4096 */ |
| 721 | uint8_t min_data_width; |
| 722 | /* |
| 723 | * Minimum native data type width in bits that can be accessed. |
| 724 | * Supported values: 8 |
| 725 | */ |
| 726 | uint8_t max_data_width; |
| 727 | /* |
| 728 | * Maximum native data type width in bits that can be accessed. |
| 729 | * Supported values: 64 |
| 730 | */ |
| 731 | } __packed; |
| 732 | |
| 733 | struct vss_imvm_cmd_set_cal_network_t { |
| 734 | struct apr_hdr hdr; |
| 735 | uint32_t network_id; |
| 736 | } __packed; |
| 737 | |
| 738 | struct vss_imvm_cmd_set_cal_media_type_t { |
| 739 | struct apr_hdr hdr; |
| 740 | uint32_t media_id; |
| 741 | } __packed; |
| 742 | |
| 743 | struct vss_imemory_cmd_unmap_t { |
| 744 | struct apr_hdr hdr; |
| 745 | uint32_t mem_handle; |
| 746 | } __packed; |
| 747 | |
Vignesh Kulothungan | 78d3e82 | 2018-03-13 16:05:20 -0700 | [diff] [blame] | 748 | /* |
| 749 | * Payload structure for VSS_INOTIFY_CMD_LISTEN_FOR_EVENT_CLASS and |
| 750 | * VSS_INOTIFY_CMD_CANCEL_EVENT_CLASS commands. |
| 751 | */ |
| 752 | struct vss_inotify_cmd_event_class_t { |
| 753 | struct apr_hdr hdr; |
| 754 | /* Event class ID to listen for. */ |
| 755 | uint32_t class_id; |
| 756 | } __packed; |
| 757 | |
| 758 | /* Payload structure for the VSS_ICOMMOM_EVT_VOICE_ACTIVITY_UPDATE event. */ |
| 759 | struct vss_evt_voice_activity { |
| 760 | uint32_t activity; |
| 761 | /* |
| 762 | * Specifies the voice acitivity. |
| 763 | * @values |
| 764 | * #VSS_ICOMMON_VOICE_ACTIVITY_VPTX_MUTE |
| 765 | * #VSS_ICOMMON_VOICE_ACTIVITY_VPTX_UNMUTE |
| 766 | * #VSS_ICOMMON_VOICE_ACTIVITY_MIC_BREAK |
| 767 | * #VSS_ICOMMON_VOICE_ACITIVTY_MIC_UNBREAK |
| 768 | * #VSS_ICOMMON_VOICE_ACTIVITY_UI_STREAM_TX_MUTE |
| 769 | * #VSS_ICOMMON_VOICE_ACTIVITY_UI_STREAM_TX_UNMUTE |
| 770 | * #VSS_ICOMMON_VOICE_ACTIVITY_UI_VOCPROC_TX_MUTE |
| 771 | * #VSS_ICOMMON_VOICE_ACTIVITY_UI_VOCPROC_TX_UNMUTE |
| 772 | */ |
| 773 | } __packed; |
| 774 | |
Asish Bhattacharya | 8e2277f | 2017-07-20 18:31:55 +0530 | [diff] [blame] | 775 | /* TO CVS commands */ |
| 776 | #define VSS_ISTREAM_CMD_CREATE_PASSIVE_CONTROL_SESSION 0x00011140 |
| 777 | /**< Wait for APRV2_IBASIC_RSP_RESULT response. */ |
| 778 | |
| 779 | #define VSS_ISTREAM_CMD_CREATE_FULL_CONTROL_SESSION 0x000110F7 |
| 780 | /* Create a new full control stream session. */ |
| 781 | |
| 782 | #define APRV2_IBASIC_CMD_DESTROY_SESSION 0x0001003C |
| 783 | |
| 784 | /* |
| 785 | * This command changes the mute setting. The new mute setting will |
| 786 | * be applied over the specified ramp duration. |
| 787 | */ |
| 788 | #define VSS_IVOLUME_CMD_MUTE_V2 0x0001138B |
| 789 | |
| 790 | #define VSS_ISTREAM_CMD_REGISTER_CALIBRATION_DATA_V2 0x00011369 |
| 791 | |
| 792 | #define VSS_ISTREAM_CMD_DEREGISTER_CALIBRATION_DATA 0x0001127A |
| 793 | |
| 794 | #define VSS_ISTREAM_CMD_REGISTER_STATIC_CALIBRATION_DATA 0x0001307D |
| 795 | #define VSS_ISTREAM_CMD_DEREGISTER_STATIC_CALIBRATION_DATA 0x0001307E |
| 796 | |
| 797 | #define VSS_ISTREAM_CMD_SET_MEDIA_TYPE 0x00011186 |
| 798 | /* Set media type on the stream. */ |
| 799 | |
| 800 | #define VSS_ISTREAM_EVT_SEND_ENC_BUFFER 0x00011015 |
| 801 | /* Event sent by the stream to its client to provide an encoded packet. */ |
| 802 | |
| 803 | #define VSS_ISTREAM_EVT_REQUEST_DEC_BUFFER 0x00011017 |
| 804 | /* Event sent by the stream to its client requesting for a decoder packet. |
| 805 | * The client should respond with a VSS_ISTREAM_EVT_SEND_DEC_BUFFER event. |
| 806 | */ |
| 807 | |
| 808 | #define VSS_ISTREAM_EVT_OOB_NOTIFY_DEC_BUFFER_REQUEST 0x0001136E |
| 809 | |
| 810 | #define VSS_ISTREAM_EVT_SEND_DEC_BUFFER 0x00011016 |
| 811 | /* Event sent by the client to the stream in response to a |
| 812 | * VSS_ISTREAM_EVT_REQUEST_DEC_BUFFER event, providing a decoder packet. |
| 813 | */ |
| 814 | |
| 815 | #define VSS_ISTREAM_CMD_VOC_AMR_SET_ENC_RATE 0x0001113E |
| 816 | /* Set AMR encoder rate. */ |
| 817 | |
| 818 | #define VSS_ISTREAM_CMD_VOC_AMRWB_SET_ENC_RATE 0x0001113F |
| 819 | /* Set AMR-WB encoder rate. */ |
| 820 | |
| 821 | #define VSS_ISTREAM_CMD_CDMA_SET_ENC_MINMAX_RATE 0x00011019 |
| 822 | /* Set encoder minimum and maximum rate. */ |
| 823 | |
| 824 | #define VSS_ISTREAM_CMD_SET_ENC_DTX_MODE 0x0001101D |
| 825 | /* Set encoder DTX mode. */ |
| 826 | |
| 827 | #define MODULE_ID_VOICE_MODULE_ST 0x00010EE3 |
| 828 | #define VOICE_PARAM_MOD_ENABLE 0x00010E00 |
| 829 | #define MOD_ENABLE_PARAM_LEN 4 |
| 830 | |
| 831 | #define VSS_IPLAYBACK_CMD_START 0x000112BD |
| 832 | /* Start in-call music delivery on the Tx voice path. */ |
| 833 | |
| 834 | #define VSS_IPLAYBACK_CMD_STOP 0x00011239 |
| 835 | /* Stop the in-call music delivery on the Tx voice path. */ |
| 836 | |
| 837 | #define VSS_IPLAYBACK_PORT_ID_DEFAULT 0x0000FFFF |
| 838 | /* Default AFE port ID. */ |
| 839 | |
| 840 | #define VSS_IPLAYBACK_PORT_ID_VOICE 0x00008005 |
| 841 | /* AFE port ID for VOICE 1. */ |
| 842 | |
| 843 | #define VSS_IPLAYBACK_PORT_ID_VOICE2 0x00008002 |
| 844 | /* AFE port ID for VOICE 2. */ |
| 845 | |
| 846 | #define VSS_IRECORD_CMD_START 0x000112BE |
| 847 | /* Start in-call conversation recording. */ |
| 848 | #define VSS_IRECORD_CMD_STOP 0x00011237 |
| 849 | /* Stop in-call conversation recording. */ |
| 850 | |
| 851 | #define VSS_IRECORD_PORT_ID_DEFAULT 0x0000FFFF |
| 852 | /* Default AFE port ID. */ |
| 853 | |
| 854 | #define VSS_IRECORD_TAP_POINT_NONE 0x00010F78 |
| 855 | /* Indicates no tapping for specified path. */ |
| 856 | |
| 857 | #define VSS_IRECORD_TAP_POINT_STREAM_END 0x00010F79 |
| 858 | /* Indicates that specified path should be tapped at the end of the stream. */ |
| 859 | |
| 860 | #define VSS_IRECORD_MODE_TX_RX_STEREO 0x00010F7A |
| 861 | /* Select Tx on left channel and Rx on right channel. */ |
| 862 | |
| 863 | #define VSS_IRECORD_MODE_TX_RX_MIXING 0x00010F7B |
| 864 | /* Select mixed Tx and Rx paths. */ |
| 865 | |
Laxminath Kasam | 38070be | 2017-08-17 18:21:59 +0530 | [diff] [blame] | 866 | #define VSS_PARAM_VOCPROC_TX_CHANNEL_INFO 0x0001328E |
| 867 | |
| 868 | #define VSS_PARAM_VOCPROC_RX_CHANNEL_INFO 0x0001328F |
| 869 | |
| 870 | #define VSS_PARAM_VOCPROC_EC_REF_CHANNEL_INFO 0x00013290 |
| 871 | |
Asish Bhattacharya | 8e2277f | 2017-07-20 18:31:55 +0530 | [diff] [blame] | 872 | #define VSS_PARAM_TX_PORT_ENDPOINT_MEDIA_INFO 0x00013253 |
| 873 | |
| 874 | #define VSS_PARAM_RX_PORT_ENDPOINT_MEDIA_INFO 0x00013254 |
| 875 | |
| 876 | #define VSS_PARAM_EC_REF_PORT_ENDPOINT_MEDIA_INFO 0x00013255 |
| 877 | |
| 878 | #define VSS_MODULE_CVD_GENERIC 0x0001316E |
| 879 | |
| 880 | #define VSS_ISTREAM_EVT_NOT_READY 0x000110FD |
| 881 | |
| 882 | #define VSS_ISTREAM_EVT_READY 0x000110FC |
| 883 | |
| 884 | #define VSS_ISTREAM_EVT_OOB_NOTIFY_DEC_BUFFER_READY 0x0001136F |
| 885 | /*notify dsp that decoder buffer is ready*/ |
| 886 | |
| 887 | #define VSS_ISTREAM_EVT_OOB_NOTIFY_ENC_BUFFER_READY 0x0001136C |
| 888 | /*dsp notifying client that encoder buffer is ready*/ |
| 889 | |
| 890 | #define VSS_ISTREAM_EVT_OOB_NOTIFY_ENC_BUFFER_CONSUMED 0x0001136D |
| 891 | /*notify dsp that encoder buffer is consumed*/ |
| 892 | |
| 893 | #define VSS_ISTREAM_CMD_SET_OOB_PACKET_EXCHANGE_CONFIG 0x0001136B |
| 894 | |
| 895 | #define VSS_ISTREAM_PACKET_EXCHANGE_MODE_INBAND 0 |
| 896 | /* In-band packet exchange mode. */ |
| 897 | |
| 898 | #define VSS_ISTREAM_PACKET_EXCHANGE_MODE_OUT_OF_BAND 1 |
| 899 | /* Out-of-band packet exchange mode. */ |
| 900 | |
| 901 | #define VSS_ISTREAM_CMD_SET_PACKET_EXCHANGE_MODE 0x0001136A |
| 902 | |
| 903 | struct vss_iplayback_cmd_start_t { |
| 904 | uint16_t port_id; |
| 905 | /* |
| 906 | * AFE Port ID from which the audio samples are available. |
| 907 | * To use the default AFE pseudo port (0x8005), set this value to |
| 908 | * #VSS_IPLAYBACK_PORT_ID_DEFAULT. |
| 909 | */ |
| 910 | } __packed; |
| 911 | |
| 912 | struct vss_irecord_cmd_start_t { |
| 913 | uint32_t rx_tap_point; |
| 914 | /* Tap point to use on the Rx path. Supported values are: |
| 915 | * VSS_IRECORD_TAP_POINT_NONE : Do not record Rx path. |
| 916 | * VSS_IRECORD_TAP_POINT_STREAM_END : Rx tap point is at the end of |
| 917 | * the stream. |
| 918 | */ |
| 919 | uint32_t tx_tap_point; |
| 920 | /* Tap point to use on the Tx path. Supported values are: |
| 921 | * VSS_IRECORD_TAP_POINT_NONE : Do not record tx path. |
| 922 | * VSS_IRECORD_TAP_POINT_STREAM_END : Tx tap point is at the end of |
| 923 | * the stream. |
| 924 | */ |
| 925 | uint16_t port_id; |
| 926 | /* AFE Port ID to which the conversation recording stream needs to be |
| 927 | * sent. Set this to #VSS_IRECORD_PORT_ID_DEFAULT to use default AFE |
| 928 | * pseudo ports (0x8003 for Rx and 0x8004 for Tx). |
| 929 | */ |
| 930 | uint32_t mode; |
| 931 | /* Recording Mode. The mode parameter value is ignored if the port_id |
| 932 | * is set to #VSS_IRECORD_PORT_ID_DEFAULT. |
| 933 | * The supported values: |
| 934 | * #VSS_IRECORD_MODE_TX_RX_STEREO |
| 935 | * #VSS_IRECORD_MODE_TX_RX_MIXING |
| 936 | */ |
| 937 | } __packed; |
| 938 | |
| 939 | struct vss_istream_cmd_create_passive_control_session_t { |
| 940 | char name[SESSION_NAME_LEN]; |
| 941 | /**< |
| 942 | * A variable-sized stream name. |
| 943 | * |
| 944 | * The stream name size is the payload size minus the size of the other |
| 945 | * fields. |
| 946 | */ |
| 947 | } __packed; |
| 948 | |
| 949 | #define VSS_IVOLUME_DIRECTION_TX 0 |
| 950 | #define VSS_IVOLUME_DIRECTION_RX 1 |
| 951 | |
| 952 | #define VSS_IVOLUME_MUTE_OFF 0 |
| 953 | #define VSS_IVOLUME_MUTE_ON 1 |
| 954 | |
| 955 | #define DEFAULT_MUTE_RAMP_DURATION 500 |
| 956 | #define DEFAULT_VOLUME_RAMP_DURATION 20 |
| 957 | #define MAX_RAMP_DURATION 5000 |
| 958 | |
| 959 | struct vss_ivolume_cmd_mute_v2_t { |
| 960 | uint16_t direction; |
| 961 | /* |
| 962 | * The direction field sets the direction to apply the mute command. |
| 963 | * The Supported values: |
| 964 | * VSS_IVOLUME_DIRECTION_TX |
| 965 | * VSS_IVOLUME_DIRECTION_RX |
| 966 | */ |
| 967 | uint16_t mute_flag; |
| 968 | /* |
| 969 | * Turn mute on or off. The Supported values: |
| 970 | * VSS_IVOLUME_MUTE_OFF |
| 971 | * VSS_IVOLUME_MUTE_ON |
| 972 | */ |
| 973 | uint16_t ramp_duration_ms; |
| 974 | /* |
| 975 | * Mute change ramp duration in milliseconds. |
| 976 | * The Supported values: 0 to 5000. |
| 977 | */ |
| 978 | } __packed; |
| 979 | |
| 980 | struct vss_istream_cmd_create_full_control_session_t { |
| 981 | uint16_t direction; |
| 982 | /* |
| 983 | * Stream direction. |
| 984 | * |
| 985 | * 0 : TX only |
| 986 | * 1 : RX only |
| 987 | * 2 : TX and RX |
| 988 | * 3 : TX and RX loopback |
| 989 | */ |
| 990 | uint32_t enc_media_type; |
| 991 | /* Tx vocoder type. (Refer to VSS_MEDIA_ID_XXX). */ |
| 992 | uint32_t dec_media_type; |
| 993 | /* Rx vocoder type. (Refer to VSS_MEDIA_ID_XXX). */ |
| 994 | uint32_t network_id; |
| 995 | /* Network ID. (Refer to VSS_NETWORK_ID_XXX). */ |
| 996 | char name[SESSION_NAME_LEN]; |
| 997 | /* |
| 998 | * A variable-sized stream name. |
| 999 | * |
| 1000 | * The stream name size is the payload size minus the size of the other |
| 1001 | * fields. |
| 1002 | */ |
| 1003 | } __packed; |
| 1004 | |
| 1005 | struct vss_istream_cmd_set_media_type_t { |
| 1006 | uint32_t rx_media_id; |
| 1007 | /* Set the Rx vocoder type. (Refer to VSS_MEDIA_ID_XXX). */ |
| 1008 | uint32_t tx_media_id; |
| 1009 | /* Set the Tx vocoder type. (Refer to VSS_MEDIA_ID_XXX). */ |
| 1010 | } __packed; |
| 1011 | |
| 1012 | struct vss_istream_evt_send_enc_buffer_t { |
| 1013 | uint32_t media_id; |
| 1014 | /* Media ID of the packet. */ |
| 1015 | uint8_t packet_data[MAX_VOC_PKT_SIZE]; |
| 1016 | /* Packet data buffer. */ |
| 1017 | } __packed; |
| 1018 | |
| 1019 | struct vss_istream_evt_send_dec_buffer_t { |
| 1020 | uint32_t media_id; |
| 1021 | /* Media ID of the packet. */ |
| 1022 | uint8_t packet_data[MAX_VOC_PKT_SIZE]; |
| 1023 | /* Packet data. */ |
| 1024 | } __packed; |
| 1025 | |
| 1026 | struct vss_istream_cmd_voc_amr_set_enc_rate_t { |
| 1027 | uint32_t mode; |
| 1028 | /* Set the AMR encoder rate. |
| 1029 | * |
| 1030 | * 0x00000000 : 4.75 kbps |
| 1031 | * 0x00000001 : 5.15 kbps |
| 1032 | * 0x00000002 : 5.90 kbps |
| 1033 | * 0x00000003 : 6.70 kbps |
| 1034 | * 0x00000004 : 7.40 kbps |
| 1035 | * 0x00000005 : 7.95 kbps |
| 1036 | * 0x00000006 : 10.2 kbps |
| 1037 | * 0x00000007 : 12.2 kbps |
| 1038 | */ |
| 1039 | } __packed; |
| 1040 | |
| 1041 | struct vss_istream_cmd_voc_amrwb_set_enc_rate_t { |
| 1042 | uint32_t mode; |
| 1043 | /* Set the AMR-WB encoder rate. |
| 1044 | * |
| 1045 | * 0x00000000 : 6.60 kbps |
| 1046 | * 0x00000001 : 8.85 kbps |
| 1047 | * 0x00000002 : 12.65 kbps |
| 1048 | * 0x00000003 : 14.25 kbps |
| 1049 | * 0x00000004 : 15.85 kbps |
| 1050 | * 0x00000005 : 18.25 kbps |
| 1051 | * 0x00000006 : 19.85 kbps |
| 1052 | * 0x00000007 : 23.05 kbps |
| 1053 | * 0x00000008 : 23.85 kbps |
| 1054 | */ |
| 1055 | } __packed; |
| 1056 | |
| 1057 | struct vss_istream_cmd_cdma_set_enc_minmax_rate_t { |
| 1058 | uint16_t min_rate; |
| 1059 | /* Set the lower bound encoder rate. |
| 1060 | * |
| 1061 | * 0x0000 : Blank frame |
| 1062 | * 0x0001 : Eighth rate |
| 1063 | * 0x0002 : Quarter rate |
| 1064 | * 0x0003 : Half rate |
| 1065 | * 0x0004 : Full rate |
| 1066 | */ |
| 1067 | uint16_t max_rate; |
| 1068 | /* Set the upper bound encoder rate. |
| 1069 | * |
| 1070 | * 0x0000 : Blank frame |
| 1071 | * 0x0001 : Eighth rate |
| 1072 | * 0x0002 : Quarter rate |
| 1073 | * 0x0003 : Half rate |
| 1074 | * 0x0004 : Full rate |
| 1075 | */ |
| 1076 | } __packed; |
| 1077 | |
| 1078 | struct vss_istream_cmd_set_enc_dtx_mode_t { |
| 1079 | uint32_t enable; |
| 1080 | /* Toggle DTX on or off. |
| 1081 | * |
| 1082 | * 0 : Disables DTX |
| 1083 | * 1 : Enables DTX |
| 1084 | */ |
| 1085 | } __packed; |
| 1086 | |
| 1087 | struct vss_istream_cmd_register_calibration_data_v2_t { |
| 1088 | uint32_t cal_mem_handle; |
| 1089 | /* Handle to the shared memory that holds the calibration data. */ |
| 1090 | uint32_t cal_mem_address_lsw; |
| 1091 | uint32_t cal_mem_address_msw; |
| 1092 | /* Location of calibration data. */ |
| 1093 | uint32_t cal_mem_size; |
| 1094 | /* Size of the calibration data in bytes. */ |
| 1095 | uint8_t column_info[MAX_COL_INFO_SIZE]; |
| 1096 | /* |
| 1097 | * Column info contains the number of columns and the array of columns |
| 1098 | * in the calibration table. The order in which the columns are provided |
| 1099 | * here must match the order in which they exist in the calibration |
| 1100 | * table provided. |
| 1101 | */ |
| 1102 | } __packed; |
| 1103 | |
| 1104 | struct vss_icommon_cmd_set_ui_property_enable_t { |
| 1105 | uint32_t module_id; |
| 1106 | /* Unique ID of the module. */ |
| 1107 | uint32_t param_id; |
| 1108 | /* Unique ID of the parameter. */ |
| 1109 | uint16_t param_size; |
| 1110 | /* Size of the parameter in bytes: MOD_ENABLE_PARAM_LEN */ |
| 1111 | uint16_t reserved; |
| 1112 | /* Reserved; set to 0. */ |
| 1113 | uint16_t enable; |
| 1114 | uint16_t reserved_field; |
| 1115 | /* Reserved, set to 0. */ |
| 1116 | }; |
| 1117 | |
| 1118 | /* |
| 1119 | * Event sent by the stream to the client that enables Rx DTMF |
| 1120 | * detection whenever DTMF is detected in the Rx path. |
| 1121 | * |
| 1122 | * The DTMF detection feature can only be used to detect DTMF |
| 1123 | * frequencies as listed in the vss_istream_evt_rx_dtmf_detected_t |
| 1124 | * structure. |
| 1125 | */ |
| 1126 | |
| 1127 | #define VSS_ISTREAM_EVT_RX_DTMF_DETECTED 0x0001101A |
| 1128 | |
| 1129 | struct vss_istream_cmd_set_rx_dtmf_detection { |
| 1130 | /* |
| 1131 | * Enables/disables Rx DTMF detection |
| 1132 | * |
| 1133 | * Possible values are |
| 1134 | * 0 - disable |
| 1135 | * 1 - enable |
| 1136 | * |
| 1137 | */ |
| 1138 | uint32_t enable; |
| 1139 | }; |
| 1140 | |
| 1141 | #define VSS_ISTREAM_CMD_SET_RX_DTMF_DETECTION 0x00011027 |
| 1142 | |
| 1143 | struct vss_istream_evt_rx_dtmf_detected { |
| 1144 | uint16_t low_freq; |
| 1145 | /* |
| 1146 | * Detected low frequency. Possible values: |
| 1147 | * 697 Hz |
| 1148 | * 770 Hz |
| 1149 | * 852 Hz |
| 1150 | * 941 Hz |
| 1151 | */ |
| 1152 | uint16_t high_freq; |
| 1153 | /* |
| 1154 | * Detected high frequency. Possible values: |
| 1155 | * 1209 Hz |
| 1156 | * 1336 Hz |
| 1157 | * 1477 Hz |
| 1158 | * 1633 Hz |
| 1159 | */ |
| 1160 | }; |
| 1161 | |
| 1162 | struct cvs_set_rx_dtmf_detection_cmd { |
| 1163 | struct apr_hdr hdr; |
| 1164 | struct vss_istream_cmd_set_rx_dtmf_detection cvs_dtmf_det; |
| 1165 | } __packed; |
| 1166 | |
| 1167 | |
| 1168 | struct cvs_create_passive_ctl_session_cmd { |
| 1169 | struct apr_hdr hdr; |
| 1170 | struct vss_istream_cmd_create_passive_control_session_t cvs_session; |
| 1171 | } __packed; |
| 1172 | |
| 1173 | struct cvs_create_full_ctl_session_cmd { |
| 1174 | struct apr_hdr hdr; |
| 1175 | struct vss_istream_cmd_create_full_control_session_t cvs_session; |
| 1176 | } __packed; |
| 1177 | |
| 1178 | struct cvs_destroy_session_cmd { |
| 1179 | struct apr_hdr hdr; |
| 1180 | } __packed; |
| 1181 | |
| 1182 | struct cvs_set_mute_cmd { |
| 1183 | struct apr_hdr hdr; |
| 1184 | struct vss_ivolume_cmd_mute_v2_t cvs_set_mute; |
| 1185 | } __packed; |
| 1186 | |
| 1187 | struct cvs_set_media_type_cmd { |
| 1188 | struct apr_hdr hdr; |
| 1189 | struct vss_istream_cmd_set_media_type_t media_type; |
| 1190 | } __packed; |
| 1191 | |
| 1192 | struct cvs_send_dec_buf_cmd { |
| 1193 | struct apr_hdr hdr; |
| 1194 | struct vss_istream_evt_send_dec_buffer_t dec_buf; |
| 1195 | } __packed; |
| 1196 | |
| 1197 | struct cvs_set_amr_enc_rate_cmd { |
| 1198 | struct apr_hdr hdr; |
| 1199 | struct vss_istream_cmd_voc_amr_set_enc_rate_t amr_rate; |
| 1200 | } __packed; |
| 1201 | |
| 1202 | struct cvs_set_amrwb_enc_rate_cmd { |
| 1203 | struct apr_hdr hdr; |
| 1204 | struct vss_istream_cmd_voc_amrwb_set_enc_rate_t amrwb_rate; |
| 1205 | } __packed; |
| 1206 | |
| 1207 | struct cvs_set_cdma_enc_minmax_rate_cmd { |
| 1208 | struct apr_hdr hdr; |
| 1209 | struct vss_istream_cmd_cdma_set_enc_minmax_rate_t cdma_rate; |
| 1210 | } __packed; |
| 1211 | |
| 1212 | struct cvs_set_enc_dtx_mode_cmd { |
| 1213 | struct apr_hdr hdr; |
| 1214 | struct vss_istream_cmd_set_enc_dtx_mode_t dtx_mode; |
| 1215 | } __packed; |
| 1216 | |
| 1217 | struct cvs_register_cal_data_cmd { |
| 1218 | struct apr_hdr hdr; |
| 1219 | struct vss_istream_cmd_register_calibration_data_v2_t cvs_cal_data; |
| 1220 | } __packed; |
| 1221 | |
| 1222 | struct cvs_deregister_cal_data_cmd { |
| 1223 | struct apr_hdr hdr; |
| 1224 | } __packed; |
| 1225 | |
| 1226 | struct cvs_set_pp_enable_cmd { |
| 1227 | struct apr_hdr hdr; |
| 1228 | struct vss_icommon_cmd_set_ui_property_enable_t vss_set_pp; |
| 1229 | } __packed; |
| 1230 | struct cvs_start_record_cmd { |
| 1231 | struct apr_hdr hdr; |
| 1232 | struct vss_irecord_cmd_start_t rec_mode; |
| 1233 | } __packed; |
| 1234 | |
| 1235 | struct cvs_start_playback_cmd { |
| 1236 | struct apr_hdr hdr; |
| 1237 | struct vss_iplayback_cmd_start_t playback_mode; |
| 1238 | } __packed; |
| 1239 | |
| 1240 | struct cvs_dec_buffer_ready_cmd { |
| 1241 | struct apr_hdr hdr; |
| 1242 | } __packed; |
| 1243 | |
| 1244 | struct cvs_enc_buffer_consumed_cmd { |
| 1245 | struct apr_hdr hdr; |
| 1246 | } __packed; |
| 1247 | |
| 1248 | struct vss_istream_cmd_set_oob_packet_exchange_config_t { |
| 1249 | struct apr_hdr hdr; |
| 1250 | uint32_t mem_handle; |
| 1251 | uint32_t enc_buf_addr_lsw; |
| 1252 | uint32_t enc_buf_addr_msw; |
| 1253 | uint32_t enc_buf_size; |
| 1254 | uint32_t dec_buf_addr_lsw; |
| 1255 | uint32_t dec_buf_addr_msw; |
| 1256 | uint32_t dec_buf_size; |
| 1257 | } __packed; |
| 1258 | |
| 1259 | struct vss_istream_cmd_set_packet_exchange_mode_t { |
| 1260 | struct apr_hdr hdr; |
| 1261 | uint32_t mode; |
| 1262 | } __packed; |
| 1263 | |
| 1264 | /* TO CVP commands */ |
| 1265 | |
| 1266 | #define VSS_IVOCPROC_CMD_CREATE_FULL_CONTROL_SESSION 0x000100C3 |
| 1267 | /**< Wait for APRV2_IBASIC_RSP_RESULT response. */ |
| 1268 | |
| 1269 | #define APRV2_IBASIC_CMD_DESTROY_SESSION 0x0001003C |
| 1270 | |
| 1271 | #define VSS_IVOCPROC_CMD_SET_DEVICE_V2 0x000112C6 |
| 1272 | |
| 1273 | #define VSS_IVOCPROC_CMD_SET_DEVICE_V3 0x0001316A |
| 1274 | |
| 1275 | #define VSS_IVOCPROC_CMD_TOPOLOGY_SET_DEV_CHANNELS 0x00013199 |
| 1276 | |
| 1277 | #define VSS_IVOCPROC_CMD_TOPOLOGY_COMMIT 0x00013198 |
| 1278 | |
| 1279 | #define VSS_IVOCPROC_CMD_SET_VP3_DATA 0x000110EB |
| 1280 | |
| 1281 | #define VSS_IVOLUME_CMD_SET_STEP 0x000112C2 |
| 1282 | |
| 1283 | #define VSS_IVOCPROC_CMD_ENABLE 0x000100C6 |
| 1284 | /**< No payload. Wait for APRV2_IBASIC_RSP_RESULT response. */ |
| 1285 | |
| 1286 | #define VSS_IVOCPROC_CMD_DISABLE 0x000110E1 |
| 1287 | /**< No payload. Wait for APRV2_IBASIC_RSP_RESULT response. */ |
| 1288 | |
| 1289 | /* |
| 1290 | * Registers the memory that contains device specific configuration data with |
| 1291 | * the vocproc. The client must register device configuration data with the |
| 1292 | * vocproc that corresponds with the device being set on the vocproc. |
| 1293 | */ |
| 1294 | #define VSS_IVOCPROC_CMD_REGISTER_DEVICE_CONFIG 0x00011371 |
| 1295 | |
| 1296 | /* |
| 1297 | * Deregisters the memory that holds device configuration data from the |
| 1298 | vocproc. |
| 1299 | */ |
| 1300 | #define VSS_IVOCPROC_CMD_DEREGISTER_DEVICE_CONFIG 0x00011372 |
| 1301 | |
| 1302 | #define VSS_IVOCPROC_CMD_REGISTER_CALIBRATION_DATA_V2 0x00011373 |
| 1303 | #define VSS_IVOCPROC_CMD_DEREGISTER_CALIBRATION_DATA 0x00011276 |
| 1304 | |
| 1305 | #define VSS_IVOCPROC_CMD_REGISTER_VOL_CALIBRATION_DATA 0x00011374 |
| 1306 | #define VSS_IVOCPROC_CMD_DEREGISTER_VOL_CALIBRATION_DATA 0x00011375 |
| 1307 | |
| 1308 | #define VSS_IVOCPROC_CMD_REGISTER_STATIC_CALIBRATION_DATA 0x00013079 |
| 1309 | #define VSS_IVOCPROC_CMD_DEREGISTER_STATIC_CALIBRATION_DATA 0x0001307A |
| 1310 | |
| 1311 | #define VSS_IVOCPROC_CMD_REGISTER_DYNAMIC_CALIBRATION_DATA 0x0001307B |
| 1312 | #define VSS_IVOCPROC_CMD_DEREGISTER_DYNAMIC_CALIBRATION_DATA 0x0001307C |
| 1313 | |
| 1314 | #define VSS_IVOCPROC_TOPOLOGY_ID_NONE 0x00010F70 |
Laxminath Kasam | 8f7ccc2 | 2017-08-28 17:35:04 +0530 | [diff] [blame] | 1315 | #define VSS_IVOCPROC_TOPOLOGY_ID_TX_SM_ECNS_V2 0x00010F89 |
Asish Bhattacharya | 8e2277f | 2017-07-20 18:31:55 +0530 | [diff] [blame] | 1316 | #define VSS_IVOCPROC_TOPOLOGY_ID_TX_DM_FLUENCE 0x00010F72 |
| 1317 | |
| 1318 | #define VSS_IVOCPROC_TOPOLOGY_ID_RX_DEFAULT 0x00010F77 |
| 1319 | |
| 1320 | /* Newtwork IDs */ |
| 1321 | #define VSS_ICOMMON_CAL_NETWORK_ID_NONE 0x0001135E |
| 1322 | |
| 1323 | /* Select internal mixing mode. */ |
| 1324 | #define VSS_IVOCPROC_VOCPROC_MODE_EC_INT_MIXING 0x00010F7C |
| 1325 | |
| 1326 | /* Select external mixing mode. */ |
| 1327 | #define VSS_IVOCPROC_VOCPROC_MODE_EC_EXT_MIXING 0x00010F7D |
| 1328 | |
| 1329 | /* Default AFE port ID. Applicable to Tx and Rx. */ |
| 1330 | #define VSS_IVOCPROC_PORT_ID_NONE 0xFFFF |
| 1331 | |
| 1332 | #define VSS_NETWORK_ID_DEFAULT 0x00010037 |
| 1333 | |
| 1334 | /* Voice over Internet Protocol (VoIP) network ID. Common for all bands.*/ |
| 1335 | #define VSS_NETWORK_ID_VOIP 0x00011362 |
| 1336 | |
| 1337 | /* Media types */ |
| 1338 | #define VSS_MEDIA_ID_EVRC_MODEM 0x00010FC2 |
| 1339 | /* 80-VF690-47 CDMA enhanced variable rate vocoder modem format. */ |
| 1340 | #define VSS_MEDIA_ID_AMR_NB_MODEM 0x00010FC6 |
| 1341 | /* 80-VF690-47 UMTS AMR-NB vocoder modem format. */ |
| 1342 | #define VSS_MEDIA_ID_AMR_WB_MODEM 0x00010FC7 |
| 1343 | /* 80-VF690-47 UMTS AMR-WB vocoder modem format. */ |
| 1344 | |
| 1345 | #define VSS_MEDIA_ID_PCM_8_KHZ 0x00010FCB |
| 1346 | #define VSS_MEDIA_ID_PCM_16_KHZ 0x00010FCC |
| 1347 | #define VSS_MEDIA_ID_PCM_32_KHZ 0x00010FD9 |
| 1348 | #define VSS_MEDIA_ID_PCM_48_KHZ 0x00010FD6 |
| 1349 | |
| 1350 | /* Linear PCM (16-bit, little-endian). */ |
| 1351 | #define VSS_MEDIA_ID_G711_ALAW 0x00010FCD |
| 1352 | /* G.711 a-law (contains two 10ms vocoder frames). */ |
| 1353 | #define VSS_MEDIA_ID_G711_MULAW 0x00010FCE |
| 1354 | /* G.711 mu-law (contains two 10ms vocoder frames). */ |
| 1355 | #define VSS_MEDIA_ID_G729 0x00010FD0 |
| 1356 | /* G.729AB (contains two 10ms vocoder frames. */ |
| 1357 | #define VSS_MEDIA_ID_4GV_NB_MODEM 0x00010FC3 |
| 1358 | /*CDMA EVRC-B vocoder modem format */ |
| 1359 | #define VSS_MEDIA_ID_4GV_WB_MODEM 0x00010FC4 |
| 1360 | /*CDMA EVRC-WB vocoder modem format */ |
| 1361 | #define VSS_MEDIA_ID_4GV_NW_MODEM 0x00010FC5 |
| 1362 | /*CDMA EVRC-NW vocoder modem format */ |
| 1363 | |
| 1364 | #define VSS_IVOCPROC_CMD_CREATE_FULL_CONTROL_SESSION_V2 0x000112BF |
| 1365 | #define VSS_IVOCPROC_CMD_CREATE_FULL_CONTROL_SESSION_V3 0x00013169 |
| 1366 | |
| 1367 | #define VSS_NUM_DEV_CHANNELS_1 1 |
| 1368 | #define VSS_NUM_DEV_CHANNELS_2 2 |
| 1369 | #define VSS_NUM_DEV_CHANNELS_3 3 |
| 1370 | #define VSS_NUM_DEV_CHANNELS_4 4 |
| 1371 | |
| 1372 | struct vss_ivocproc_cmd_create_full_control_session_v2_t { |
| 1373 | uint16_t direction; |
| 1374 | /* |
| 1375 | * Vocproc direction. The supported values: |
| 1376 | * VSS_IVOCPROC_DIRECTION_RX |
| 1377 | * VSS_IVOCPROC_DIRECTION_TX |
| 1378 | * VSS_IVOCPROC_DIRECTION_RX_TX |
| 1379 | */ |
| 1380 | uint16_t tx_port_id; |
| 1381 | /* |
| 1382 | * Tx device port ID to which the vocproc connects. If a port ID is |
| 1383 | * not being supplied, set this to #VSS_IVOCPROC_PORT_ID_NONE. |
| 1384 | */ |
| 1385 | uint32_t tx_topology_id; |
| 1386 | /* |
| 1387 | * Tx path topology ID. If a topology ID is not being supplied, set |
| 1388 | * this to #VSS_IVOCPROC_TOPOLOGY_ID_NONE. |
| 1389 | */ |
| 1390 | uint16_t rx_port_id; |
| 1391 | /* |
| 1392 | * Rx device port ID to which the vocproc connects. If a port ID is |
| 1393 | * not being supplied, set this to #VSS_IVOCPROC_PORT_ID_NONE. |
| 1394 | */ |
| 1395 | uint32_t rx_topology_id; |
| 1396 | /* |
| 1397 | * Rx path topology ID. If a topology ID is not being supplied, set |
| 1398 | * this to #VSS_IVOCPROC_TOPOLOGY_ID_NONE. |
| 1399 | */ |
| 1400 | uint32_t profile_id; |
| 1401 | /* Voice calibration profile ID. */ |
| 1402 | uint32_t vocproc_mode; |
| 1403 | /* |
| 1404 | * Vocproc mode. The supported values: |
| 1405 | * VSS_IVOCPROC_VOCPROC_MODE_EC_INT_MIXING |
| 1406 | * VSS_IVOCPROC_VOCPROC_MODE_EC_EXT_MIXING |
| 1407 | */ |
| 1408 | uint16_t ec_ref_port_id; |
| 1409 | /* |
| 1410 | * Port ID to which the vocproc connects for receiving echo |
| 1411 | * cancellation reference signal. If a port ID is not being supplied, |
| 1412 | * set this to #VSS_IVOCPROC_PORT_ID_NONE. This parameter value is |
| 1413 | * ignored when the vocproc_mode parameter is set to |
| 1414 | * VSS_IVOCPROC_VOCPROC_MODE_EC_INT_MIXING. |
| 1415 | */ |
| 1416 | char name[SESSION_NAME_LEN]; |
| 1417 | /* |
| 1418 | * Session name string used to identify a session that can be shared |
| 1419 | * with passive controllers (optional). The string size, including the |
| 1420 | * NULL termination character, is limited to 31 characters. |
| 1421 | */ |
| 1422 | } __packed; |
| 1423 | |
| 1424 | struct vss_ivocproc_cmd_set_volume_index_t { |
| 1425 | uint16_t vol_index; |
| 1426 | /* |
| 1427 | * Volume index utilized by the vocproc to index into the volume table |
| 1428 | * provided in VSS_IVOCPROC_CMD_CACHE_VOLUME_CALIBRATION_TABLE and set |
| 1429 | * volume on the VDSP. |
| 1430 | */ |
| 1431 | } __packed; |
| 1432 | |
| 1433 | struct vss_ivolume_cmd_set_step_t { |
| 1434 | uint16_t direction; |
| 1435 | /* |
| 1436 | * The direction field sets the direction to apply the volume command. |
| 1437 | * The supported values: |
| 1438 | * #VSS_IVOLUME_DIRECTION_RX |
| 1439 | */ |
| 1440 | uint32_t value; |
| 1441 | /* |
| 1442 | * Volume step used to find the corresponding linear volume and |
| 1443 | * the best match index in the registered volume calibration table. |
| 1444 | */ |
| 1445 | uint16_t ramp_duration_ms; |
| 1446 | /* |
| 1447 | * Volume change ramp duration in milliseconds. |
| 1448 | * The supported values: 0 to 5000. |
| 1449 | */ |
| 1450 | } __packed; |
| 1451 | |
| 1452 | struct vss_ivocproc_cmd_set_device_v2_t { |
| 1453 | uint16_t tx_port_id; |
| 1454 | /* |
| 1455 | * TX device port ID which vocproc will connect to. |
| 1456 | * VSS_IVOCPROC_PORT_ID_NONE means vocproc will not connect to any port. |
| 1457 | */ |
| 1458 | uint32_t tx_topology_id; |
| 1459 | /* |
| 1460 | * TX leg topology ID. |
| 1461 | * VSS_IVOCPROC_TOPOLOGY_ID_NONE means vocproc does not contain any |
| 1462 | * pre/post-processing blocks and is pass-through. |
| 1463 | */ |
| 1464 | uint16_t rx_port_id; |
| 1465 | /* |
| 1466 | * RX device port ID which vocproc will connect to. |
| 1467 | * VSS_IVOCPROC_PORT_ID_NONE means vocproc will not connect to any port. |
| 1468 | */ |
| 1469 | uint32_t rx_topology_id; |
| 1470 | /* |
| 1471 | * RX leg topology ID. |
| 1472 | * VSS_IVOCPROC_TOPOLOGY_ID_NONE means vocproc does not contain any |
| 1473 | * pre/post-processing blocks and is pass-through. |
| 1474 | */ |
| 1475 | uint32_t vocproc_mode; |
| 1476 | /* Vocproc mode. The supported values: |
| 1477 | * VSS_IVOCPROC_VOCPROC_MODE_EC_INT_MIXING - 0x00010F7C |
| 1478 | * VSS_IVOCPROC_VOCPROC_MODE_EC_EXT_MIXING - 0x00010F7D |
| 1479 | */ |
| 1480 | uint16_t ec_ref_port_id; |
| 1481 | /* Port ID to which the vocproc connects for receiving |
| 1482 | * echo |
| 1483 | */ |
| 1484 | } __packed; |
| 1485 | |
| 1486 | struct vss_ivocproc_cmd_register_device_config_t { |
| 1487 | uint32_t mem_handle; |
| 1488 | /* |
| 1489 | * Handle to the shared memory that holds the per-network calibration |
| 1490 | * data. |
| 1491 | */ |
| 1492 | uint32_t mem_address_lsw; |
| 1493 | uint32_t mem_address_msw; |
| 1494 | /* Location of calibration data. */ |
| 1495 | uint32_t mem_size; |
| 1496 | /* Size of the calibration data in bytes. */ |
| 1497 | } __packed; |
| 1498 | |
| 1499 | struct vss_ivocproc_cmd_register_calibration_data_v2_t { |
| 1500 | uint32_t cal_mem_handle; |
| 1501 | /* |
| 1502 | * Handle to the shared memory that holds the per-network calibration |
| 1503 | * data. |
| 1504 | */ |
| 1505 | uint32_t cal_mem_address_lsw; |
| 1506 | uint32_t cal_mem_address_msw; |
| 1507 | /* Location of calibration data. */ |
| 1508 | uint32_t cal_mem_size; |
| 1509 | /* Size of the calibration data in bytes. */ |
| 1510 | uint8_t column_info[MAX_COL_INFO_SIZE]; |
| 1511 | /* |
| 1512 | * Column info contains the number of columns and the array of columns |
| 1513 | * in the calibration table. The order in which the columns are provided |
| 1514 | * here must match the order in which they exist in the calibration |
| 1515 | * table provided. |
| 1516 | */ |
| 1517 | } __packed; |
| 1518 | |
| 1519 | struct vss_ivocproc_cmd_register_volume_cal_data_t { |
| 1520 | uint32_t cal_mem_handle; |
| 1521 | /* |
| 1522 | * Handle to the shared memory that holds the volume calibration |
| 1523 | * data. |
| 1524 | */ |
| 1525 | uint32_t cal_mem_address_lsw; |
| 1526 | uint32_t cal_mem_address_msw; |
| 1527 | /* Location of volume calibration data. */ |
| 1528 | uint32_t cal_mem_size; |
| 1529 | /* Size of the volume calibration data in bytes. */ |
| 1530 | uint8_t column_info[MAX_COL_INFO_SIZE]; |
| 1531 | /* |
| 1532 | * Column info contains the number of columns and the array of columns |
| 1533 | * in the calibration table. The order in which the columns are provided |
| 1534 | * here must match the order in which they exist in the calibration |
| 1535 | * table provided. |
| 1536 | */ |
| 1537 | } __packed; |
| 1538 | |
| 1539 | struct vss_ivocproc_cmd_topology_set_dev_channels_t { |
| 1540 | uint16_t tx_num_channels; |
| 1541 | /* |
| 1542 | * Number of Mics. |
| 1543 | * Supported values |
| 1544 | * 1 VSS_NUM_DEV_CHANNELS_1 |
| 1545 | * 2 VSS_NUM_DEV_CHANNELS_2 |
| 1546 | * 3 VSS_NUM_DEV_CHANNELS_3 |
| 1547 | * 4 VSS_NUM_DEV_CHANNELS_4 |
| 1548 | */ |
| 1549 | uint16_t rx_num_channels; |
| 1550 | /* |
| 1551 | * Number of speaker channels. |
| 1552 | * Supported values |
| 1553 | * 1 VSS_NUM_DEV_CHANNELS_1 |
| 1554 | */ |
| 1555 | } __packed; |
| 1556 | |
| 1557 | /* Starts a vocoder PCM session */ |
| 1558 | #define VSS_IVPCM_CMD_START_V2 0x00011339 |
| 1559 | |
| 1560 | /* Default tap point location on the TX path. */ |
| 1561 | #define VSS_IVPCM_TAP_POINT_TX_DEFAULT 0x00011289 |
| 1562 | |
| 1563 | /* Default tap point location on the RX path. */ |
| 1564 | #define VSS_IVPCM_TAP_POINT_RX_DEFAULT 0x0001128A |
| 1565 | |
| 1566 | /* Indicates tap point direction is output. */ |
| 1567 | #define VSS_IVPCM_TAP_POINT_DIR_OUT 0 |
| 1568 | |
| 1569 | /* Indicates tap point direction is input. */ |
| 1570 | #define VSS_IVPCM_TAP_POINT_DIR_IN 1 |
| 1571 | |
| 1572 | /* Indicates tap point direction is output and input. */ |
| 1573 | #define VSS_IVPCM_TAP_POINT_DIR_OUT_IN 2 |
| 1574 | |
| 1575 | |
| 1576 | #define VSS_IVPCM_SAMPLING_RATE_AUTO 0 |
| 1577 | |
| 1578 | /* Indicates 8 KHz vocoder PCM sampling rate. */ |
| 1579 | #define VSS_IVPCM_SAMPLING_RATE_8K 8000 |
| 1580 | |
| 1581 | /* Indicates 16 KHz vocoder PCM sampling rate. */ |
| 1582 | #define VSS_IVPCM_SAMPLING_RATE_16K 16000 |
| 1583 | |
| 1584 | /* RX and TX */ |
| 1585 | #define MAX_TAP_POINTS_SUPPORTED 2 |
| 1586 | |
| 1587 | struct vss_ivpcm_tap_point { |
| 1588 | uint32_t tap_point; |
| 1589 | uint16_t direction; |
| 1590 | uint16_t sampling_rate; |
| 1591 | uint16_t duration; |
| 1592 | } __packed; |
| 1593 | |
| 1594 | |
| 1595 | struct vss_ivpcm_cmd_start_v2_t { |
| 1596 | uint32_t mem_handle; |
| 1597 | uint32_t num_tap_points; |
| 1598 | struct vss_ivpcm_tap_point tap_points[MAX_TAP_POINTS_SUPPORTED]; |
| 1599 | } __packed; |
| 1600 | |
| 1601 | #define VSS_IVPCM_EVT_PUSH_BUFFER_V2 0x0001133A |
| 1602 | |
| 1603 | /* Push buffer event mask indicating output buffer is filled. */ |
| 1604 | #define VSS_IVPCM_PUSH_BUFFER_MASK_OUTPUT_BUFFER 1 |
| 1605 | |
| 1606 | /* Push buffer event mask indicating input buffer is consumed. */ |
| 1607 | #define VSS_IVPCM_PUSH_BUFFER_MASK_INPUT_BUFFER 2 |
| 1608 | |
| 1609 | |
| 1610 | struct vss_ivpcm_evt_push_buffer_v2_t { |
| 1611 | uint32_t tap_point; |
| 1612 | uint32_t push_buf_mask; |
| 1613 | uint64_t out_buf_mem_address; |
| 1614 | uint16_t out_buf_mem_size; |
| 1615 | uint64_t in_buf_mem_address; |
| 1616 | uint16_t in_buf_mem_size; |
| 1617 | uint16_t sampling_rate; |
| 1618 | uint16_t num_in_channels; |
| 1619 | } __packed; |
| 1620 | |
| 1621 | #define VSS_IVPCM_EVT_NOTIFY_V2 0x0001133B |
| 1622 | |
| 1623 | /* Notify event mask indicates output buffer is filled. */ |
| 1624 | #define VSS_IVPCM_NOTIFY_MASK_OUTPUT_BUFFER 1 |
| 1625 | |
| 1626 | /* Notify event mask indicates input buffer is consumed. */ |
| 1627 | #define VSS_IVPCM_NOTIFY_MASK_INPUT_BUFFER 2 |
| 1628 | |
| 1629 | /* Notify event mask indicates a timetick */ |
| 1630 | #define VSS_IVPCM_NOTIFY_MASK_TIMETICK 4 |
| 1631 | |
| 1632 | /* Notify event mask indicates an error occurred in output buffer operation */ |
| 1633 | #define VSS_IVPCM_NOTIFY_MASK_OUTPUT_ERROR 8 |
| 1634 | |
| 1635 | /* Notify event mask indicates an error occurred in input buffer operation */ |
| 1636 | #define VSS_IVPCM_NOTIFY_MASK_INPUT_ERROR 16 |
| 1637 | |
| 1638 | |
| 1639 | struct vss_ivpcm_evt_notify_v2_t { |
| 1640 | uint32_t tap_point; |
| 1641 | uint32_t notify_mask; |
| 1642 | uint64_t out_buff_addr; |
| 1643 | uint64_t in_buff_addr; |
| 1644 | uint16_t filled_out_size; |
| 1645 | uint16_t request_buf_size; |
| 1646 | uint16_t sampling_rate; |
| 1647 | uint16_t num_out_channels; |
| 1648 | } __packed; |
| 1649 | |
| 1650 | struct cvp_start_cmd { |
| 1651 | struct apr_hdr hdr; |
| 1652 | struct vss_ivpcm_cmd_start_v2_t vpcm_start_cmd; |
| 1653 | } __packed; |
| 1654 | |
| 1655 | struct cvp_push_buf_cmd { |
| 1656 | struct apr_hdr hdr; |
| 1657 | struct vss_ivpcm_evt_push_buffer_v2_t vpcm_evt_push_buffer; |
| 1658 | } __packed; |
| 1659 | |
| 1660 | #define VSS_IVPCM_CMD_STOP 0x0001100B |
| 1661 | |
| 1662 | struct cvp_create_full_ctl_session_cmd { |
| 1663 | struct apr_hdr hdr; |
| 1664 | struct vss_ivocproc_cmd_create_full_control_session_v2_t cvp_session; |
| 1665 | } __packed; |
| 1666 | |
| 1667 | struct cvp_command { |
| 1668 | struct apr_hdr hdr; |
| 1669 | } __packed; |
| 1670 | |
| 1671 | struct cvp_set_device_cmd { |
| 1672 | struct apr_hdr hdr; |
| 1673 | struct vss_ivocproc_cmd_set_device_v2_t cvp_set_device_v2; |
| 1674 | } __packed; |
| 1675 | |
| 1676 | struct cvp_set_dev_channels_cmd { |
| 1677 | struct apr_hdr hdr; |
| 1678 | struct vss_ivocproc_cmd_topology_set_dev_channels_t cvp_set_channels; |
| 1679 | } __packed; |
| 1680 | |
| 1681 | struct cvp_set_media_format_cmd { |
| 1682 | struct apr_hdr hdr; |
Laxminath Kasam | 38070be | 2017-08-17 18:21:59 +0530 | [diff] [blame] | 1683 | struct vss_icommon_cmd_set_param_v2_t cvp_set_media_param_v2; |
| 1684 | } __packed; |
| 1685 | |
| 1686 | struct cvp_set_channel_info_cmd_v2 { |
| 1687 | struct apr_hdr hdr; |
| 1688 | struct vss_icommon_cmd_set_param_channel_info_v2_t |
| 1689 | cvp_set_ch_info_param_v2; |
| 1690 | } __packed; |
| 1691 | |
Aditya Bavanari | 245361d | 2017-09-07 12:11:30 +0530 | [diff] [blame] | 1692 | struct cvp_set_channel_mixer_info_cmd_v2 { |
| 1693 | struct apr_hdr hdr; |
| 1694 | struct vss_icommon_cmd_set_param_ch_mixer_v2_t |
| 1695 | cvp_set_ch_mixer_param_v2; |
| 1696 | } __packed; |
| 1697 | |
Laxminath Kasam | 38070be | 2017-08-17 18:21:59 +0530 | [diff] [blame] | 1698 | struct cvp_set_mfc_config_cmd_v2 { |
| 1699 | struct apr_hdr hdr; |
| 1700 | struct vss_icommon_cmd_set_param_mfc_config_v2_t cvp_set_mfc_param_v2; |
Asish Bhattacharya | 8e2277f | 2017-07-20 18:31:55 +0530 | [diff] [blame] | 1701 | } __packed; |
| 1702 | |
| 1703 | struct cvp_set_vp3_data_cmd { |
| 1704 | struct apr_hdr hdr; |
| 1705 | } __packed; |
| 1706 | |
| 1707 | struct cvp_set_rx_volume_index_cmd { |
| 1708 | struct apr_hdr hdr; |
| 1709 | struct vss_ivocproc_cmd_set_volume_index_t cvp_set_vol_idx; |
| 1710 | } __packed; |
| 1711 | |
| 1712 | struct cvp_set_rx_volume_step_cmd { |
| 1713 | struct apr_hdr hdr; |
| 1714 | struct vss_ivolume_cmd_set_step_t cvp_set_vol_step; |
| 1715 | } __packed; |
| 1716 | |
| 1717 | struct cvp_register_dev_cfg_cmd { |
| 1718 | struct apr_hdr hdr; |
| 1719 | struct vss_ivocproc_cmd_register_device_config_t cvp_dev_cfg_data; |
| 1720 | } __packed; |
| 1721 | |
| 1722 | struct cvp_deregister_dev_cfg_cmd { |
| 1723 | struct apr_hdr hdr; |
| 1724 | } __packed; |
| 1725 | |
| 1726 | struct cvp_register_cal_data_cmd { |
| 1727 | struct apr_hdr hdr; |
| 1728 | struct vss_ivocproc_cmd_register_calibration_data_v2_t cvp_cal_data; |
| 1729 | } __packed; |
| 1730 | |
| 1731 | struct cvp_deregister_cal_data_cmd { |
| 1732 | struct apr_hdr hdr; |
| 1733 | } __packed; |
| 1734 | |
| 1735 | struct cvp_register_vol_cal_data_cmd { |
| 1736 | struct apr_hdr hdr; |
| 1737 | struct vss_ivocproc_cmd_register_volume_cal_data_t cvp_vol_cal_data; |
| 1738 | } __packed; |
| 1739 | |
| 1740 | struct cvp_deregister_vol_cal_data_cmd { |
| 1741 | struct apr_hdr hdr; |
| 1742 | } __packed; |
| 1743 | |
| 1744 | struct cvp_set_mute_cmd { |
| 1745 | struct apr_hdr hdr; |
| 1746 | struct vss_ivolume_cmd_mute_v2_t cvp_set_mute; |
| 1747 | } __packed; |
| 1748 | |
| 1749 | /* CB for up-link packets. */ |
| 1750 | typedef void (*ul_cb_fn)(uint8_t *voc_pkt, |
| 1751 | uint32_t pkt_len, |
| 1752 | uint32_t timestamp, |
| 1753 | void *private_data); |
| 1754 | |
| 1755 | /* CB for down-link packets. */ |
| 1756 | typedef void (*dl_cb_fn)(uint8_t *voc_pkt, |
| 1757 | void *private_data); |
| 1758 | |
| 1759 | /* CB for DTMF RX Detection */ |
| 1760 | typedef void (*dtmf_rx_det_cb_fn)(uint8_t *pkt, |
| 1761 | char *session, |
| 1762 | void *private_data); |
| 1763 | |
| 1764 | typedef void (*voip_ssr_cb) (uint32_t opcode, |
| 1765 | void *private_data); |
| 1766 | |
| 1767 | typedef void (*hostpcm_cb_fn)(uint8_t *data, |
| 1768 | char *session, |
| 1769 | void *private_data); |
| 1770 | |
| 1771 | struct mvs_driver_info { |
| 1772 | uint32_t media_type; |
| 1773 | uint32_t rate; |
| 1774 | uint32_t network_type; |
| 1775 | uint32_t dtx_mode; |
| 1776 | ul_cb_fn ul_cb; |
| 1777 | dl_cb_fn dl_cb; |
| 1778 | voip_ssr_cb ssr_cb; |
| 1779 | void *private_data; |
| 1780 | uint32_t evrc_min_rate; |
| 1781 | uint32_t evrc_max_rate; |
| 1782 | }; |
| 1783 | |
| 1784 | struct dtmf_driver_info { |
| 1785 | dtmf_rx_det_cb_fn dtmf_rx_ul_cb; |
| 1786 | void *private_data; |
| 1787 | }; |
| 1788 | |
| 1789 | struct hostpcm_driver_info { |
| 1790 | hostpcm_cb_fn hostpcm_evt_cb; |
| 1791 | void *private_data; |
| 1792 | }; |
| 1793 | |
| 1794 | struct incall_rec_info { |
| 1795 | uint32_t rec_enable; |
| 1796 | uint32_t rec_mode; |
| 1797 | uint32_t recording; |
| 1798 | }; |
| 1799 | |
| 1800 | struct incall_music_info { |
| 1801 | uint32_t play_enable; |
| 1802 | uint32_t playing; |
| 1803 | int count; |
| 1804 | int force; |
| 1805 | uint16_t port_id; |
| 1806 | }; |
| 1807 | |
| 1808 | struct share_memory_info { |
| 1809 | u32 mem_handle; |
| 1810 | struct share_mem_buf sh_buf; |
| 1811 | struct mem_map_table memtbl; |
| 1812 | }; |
| 1813 | |
| 1814 | #define VSS_ISOUNDFOCUS_CMD_SET_SECTORS 0x00013133 |
| 1815 | #define VSS_ISOUNDFOCUS_CMD_GET_SECTORS 0x00013134 |
| 1816 | #define VSS_ISOUNDFOCUS_RSP_GET_SECTORS 0x00013135 |
| 1817 | #define VSS_ISOURCETRACK_CMD_GET_ACTIVITY 0x00013136 |
| 1818 | |
| 1819 | struct vss_isoundfocus_cmd_set_sectors_t { |
| 1820 | uint16_t start_angles[8]; |
| 1821 | uint8_t enables[8]; |
| 1822 | uint16_t gain_step; |
| 1823 | } __packed; |
| 1824 | |
| 1825 | /* Payload of the VSS_ISOUNDFOCUS_RSP_GET_SECTORS response */ |
| 1826 | struct vss_isoundfocus_rsp_get_sectors_t { |
| 1827 | uint16_t start_angles[8]; |
| 1828 | uint8_t enables[8]; |
| 1829 | uint16_t gain_step; |
| 1830 | } __packed; |
| 1831 | |
| 1832 | struct cvp_set_sound_focus_param_cmd_t { |
| 1833 | struct apr_hdr hdr; |
| 1834 | struct vss_isoundfocus_cmd_set_sectors_t cvp_set_sound_focus_param; |
| 1835 | } __packed; |
| 1836 | |
| 1837 | /* Payload structure for the VSS_ISOURCETRACK_CMD_GET_ACTIVITY command */ |
| 1838 | struct vss_isourcetrack_cmd_get_activity_t { |
| 1839 | uint32_t mem_handle; |
| 1840 | uint32_t mem_address_lsw; |
| 1841 | uint32_t mem_address_msw; |
| 1842 | uint32_t mem_size; |
| 1843 | } __packed; |
| 1844 | |
| 1845 | struct cvp_get_source_tracking_param_cmd_t { |
| 1846 | struct apr_hdr hdr; |
| 1847 | struct vss_isourcetrack_cmd_get_activity_t |
| 1848 | cvp_get_source_tracking_param; |
| 1849 | } __packed; |
| 1850 | |
| 1851 | /* Structure for the sound activity data */ |
| 1852 | struct vss_isourcetrack_activity_data_t { |
| 1853 | uint8_t voice_active[8]; |
| 1854 | uint16_t talker_doa; |
| 1855 | uint16_t interferer_doa[3]; |
| 1856 | uint8_t sound_strength[360]; |
| 1857 | } __packed; |
| 1858 | |
| 1859 | struct shared_mem_info { |
| 1860 | uint32_t mem_handle; |
| 1861 | struct mem_map_table sh_mem_block; |
| 1862 | struct mem_map_table sh_mem_table; |
| 1863 | }; |
| 1864 | |
| 1865 | struct voice_data { |
| 1866 | int voc_state;/*INIT, CHANGE, RELEASE, RUN */ |
| 1867 | |
| 1868 | /* Shared mem to store decoder and encoder packets */ |
| 1869 | struct share_memory_info shmem_info; |
| 1870 | |
| 1871 | wait_queue_head_t mvm_wait; |
| 1872 | wait_queue_head_t cvs_wait; |
| 1873 | wait_queue_head_t cvp_wait; |
| 1874 | |
| 1875 | /* Cache the values related to Rx and Tx devices */ |
| 1876 | struct device_data dev_rx; |
| 1877 | struct device_data dev_tx; |
| 1878 | |
| 1879 | /* Cache the values related to Rx and Tx streams */ |
| 1880 | struct stream_data stream_rx; |
| 1881 | struct stream_data stream_tx; |
| 1882 | |
| 1883 | u32 mvm_state; |
| 1884 | u32 cvs_state; |
| 1885 | u32 cvp_state; |
| 1886 | |
| 1887 | u32 async_err; |
| 1888 | |
| 1889 | /* Handle to MVM in the Q6 */ |
| 1890 | u16 mvm_handle; |
| 1891 | /* Handle to CVS in the Q6 */ |
| 1892 | u16 cvs_handle; |
| 1893 | /* Handle to CVP in the Q6 */ |
| 1894 | u16 cvp_handle; |
| 1895 | |
| 1896 | struct mutex lock; |
| 1897 | |
| 1898 | bool disable_topology; |
| 1899 | |
| 1900 | uint16_t sidetone_gain; |
| 1901 | uint8_t tty_mode; |
| 1902 | /* slowtalk enable value */ |
| 1903 | uint32_t st_enable; |
| 1904 | uint32_t hd_enable; |
| 1905 | uint32_t dtmf_rx_detect_en; |
| 1906 | /* Local Call Hold mode */ |
| 1907 | uint8_t lch_mode; |
| 1908 | |
| 1909 | struct voice_dev_route_state voc_route_state; |
| 1910 | |
| 1911 | u32 session_id; |
| 1912 | |
| 1913 | struct incall_rec_info rec_info; |
| 1914 | |
| 1915 | struct incall_music_info music_info; |
| 1916 | |
| 1917 | struct voice_rec_route_state rec_route_state; |
Vignesh Kulothungan | 78d3e82 | 2018-03-13 16:05:20 -0700 | [diff] [blame] | 1918 | |
| 1919 | bool mic_break_status; |
| 1920 | struct work_struct voice_mic_break_work; |
Aditya Bavanari | 318556e | 2018-12-03 17:26:24 +0530 | [diff] [blame] | 1921 | |
| 1922 | struct power_supply *psy; |
Asish Bhattacharya | 8e2277f | 2017-07-20 18:31:55 +0530 | [diff] [blame] | 1923 | }; |
| 1924 | |
| 1925 | struct cal_mem { |
| 1926 | struct ion_handle *handle; |
| 1927 | uint32_t phy; |
| 1928 | void *buf; |
| 1929 | }; |
| 1930 | |
| 1931 | #define MAX_VOC_SESSIONS 8 |
| 1932 | |
| 1933 | struct common_data { |
| 1934 | /* these default values are for all devices */ |
| 1935 | uint32_t default_mute_val; |
| 1936 | uint32_t default_sample_val; |
| 1937 | uint32_t default_vol_step_val; |
| 1938 | uint32_t default_vol_ramp_duration_ms; |
| 1939 | uint32_t default_mute_ramp_duration_ms; |
| 1940 | bool ec_ref_ext; |
| 1941 | struct media_format_info ec_media_fmt_info; |
| 1942 | |
| 1943 | /* APR to MVM in the Q6 */ |
| 1944 | void *apr_q6_mvm; |
| 1945 | /* APR to CVS in the Q6 */ |
| 1946 | void *apr_q6_cvs; |
| 1947 | /* APR to CVP in the Q6 */ |
| 1948 | void *apr_q6_cvp; |
| 1949 | |
| 1950 | struct cal_type_data *cal_data[MAX_VOICE_CAL_TYPES]; |
| 1951 | |
| 1952 | struct mem_map_table cal_mem_map_table; |
| 1953 | uint32_t cal_mem_handle; |
| 1954 | |
| 1955 | struct mem_map_table rtac_mem_map_table; |
| 1956 | uint32_t rtac_mem_handle; |
| 1957 | |
| 1958 | uint32_t voice_host_pcm_mem_handle; |
| 1959 | |
| 1960 | struct cal_mem cvp_cal; |
| 1961 | struct cal_mem cvs_cal; |
| 1962 | |
| 1963 | struct mutex common_lock; |
| 1964 | |
| 1965 | struct mvs_driver_info mvs_info; |
| 1966 | |
| 1967 | struct dtmf_driver_info dtmf_info; |
| 1968 | |
| 1969 | struct hostpcm_driver_info hostpcm_info; |
| 1970 | |
| 1971 | struct voice_data voice[MAX_VOC_SESSIONS]; |
| 1972 | |
| 1973 | bool srvcc_rec_flag; |
| 1974 | bool is_destroy_cvd; |
| 1975 | char cvd_version[CVD_VERSION_STRING_MAX_SIZE]; |
Laxminath Kasam | 38070be | 2017-08-17 18:21:59 +0530 | [diff] [blame] | 1976 | int cvp_version; |
| 1977 | bool is_avcs_version_queried; |
Asish Bhattacharya | 8e2277f | 2017-07-20 18:31:55 +0530 | [diff] [blame] | 1978 | bool is_per_vocoder_cal_enabled; |
| 1979 | bool is_sound_focus_resp_success; |
| 1980 | bool is_source_tracking_resp_success; |
| 1981 | struct vss_isoundfocus_rsp_get_sectors_t soundFocusResponse; |
| 1982 | struct shared_mem_info source_tracking_sh_mem; |
| 1983 | struct vss_isourcetrack_activity_data_t sourceTrackingResponse; |
| 1984 | bool sidetone_enable; |
Vignesh Kulothungan | 78d3e82 | 2018-03-13 16:05:20 -0700 | [diff] [blame] | 1985 | bool mic_break_enable; |
| 1986 | struct audio_uevent_data *uevent_data; |
Aditya Bavanari | 318556e | 2018-12-03 17:26:24 +0530 | [diff] [blame] | 1987 | bool is_vote_bms; |
Asish Bhattacharya | 8e2277f | 2017-07-20 18:31:55 +0530 | [diff] [blame] | 1988 | }; |
| 1989 | |
| 1990 | struct voice_session_itr { |
| 1991 | int cur_idx; |
| 1992 | int session_idx; |
| 1993 | }; |
| 1994 | |
| 1995 | void voc_register_mvs_cb(ul_cb_fn ul_cb, |
| 1996 | dl_cb_fn dl_cb, |
| 1997 | voip_ssr_cb ssr_cb, |
| 1998 | void *private_data); |
| 1999 | |
| 2000 | void voc_register_dtmf_rx_detection_cb(dtmf_rx_det_cb_fn dtmf_rx_ul_cb, |
| 2001 | void *private_data); |
| 2002 | |
| 2003 | void voc_config_vocoder(uint32_t media_type, |
| 2004 | uint32_t rate, |
| 2005 | uint32_t network_type, |
| 2006 | uint32_t dtx_mode, |
| 2007 | uint32_t evrc_min_rate, |
| 2008 | uint32_t evrc_max_rate); |
| 2009 | |
| 2010 | enum { |
| 2011 | DEV_RX = 0, |
| 2012 | DEV_TX, |
| 2013 | }; |
| 2014 | |
| 2015 | enum { |
| 2016 | RX_PATH = 0, |
| 2017 | TX_PATH, |
| 2018 | EC_REF_PATH, |
| 2019 | }; |
| 2020 | |
| 2021 | #define VOC_PATH_PASSIVE 0 |
| 2022 | #define VOC_PATH_FULL 1 |
| 2023 | #define VOC_PATH_VOLTE_PASSIVE 2 |
| 2024 | #define VOC_PATH_VOICE2_PASSIVE 3 |
| 2025 | #define VOC_PATH_QCHAT_PASSIVE 4 |
| 2026 | #define VOC_PATH_VOWLAN_PASSIVE 5 |
| 2027 | #define VOC_PATH_VOICEMMODE1_PASSIVE 6 |
| 2028 | #define VOC_PATH_VOICEMMODE2_PASSIVE 7 |
| 2029 | |
| 2030 | #define MAX_SESSION_NAME_LEN 32 |
| 2031 | #define VOICE_SESSION_NAME "Voice session" |
| 2032 | #define VOIP_SESSION_NAME "VoIP session" |
| 2033 | #define VOLTE_SESSION_NAME "VoLTE session" |
| 2034 | #define VOICE2_SESSION_NAME "Voice2 session" |
| 2035 | #define QCHAT_SESSION_NAME "QCHAT session" |
| 2036 | #define VOWLAN_SESSION_NAME "VoWLAN session" |
| 2037 | #define VOICEMMODE1_NAME "VoiceMMode1" |
| 2038 | #define VOICEMMODE2_NAME "VoiceMMode2" |
| 2039 | |
| 2040 | #define VOICE2_SESSION_VSID_STR "10DC1000" |
| 2041 | #define QCHAT_SESSION_VSID_STR "10803000" |
| 2042 | #define VOWLAN_SESSION_VSID_STR "10002000" |
| 2043 | #define VOICEMMODE1_VSID_STR "11C05000" |
| 2044 | #define VOICEMMODE2_VSID_STR "11DC5000" |
| 2045 | #define VOICE_SESSION_VSID 0x10C01000 |
| 2046 | #define VOICE2_SESSION_VSID 0x10DC1000 |
| 2047 | #define VOLTE_SESSION_VSID 0x10C02000 |
| 2048 | #define VOIP_SESSION_VSID 0x10004000 |
| 2049 | #define QCHAT_SESSION_VSID 0x10803000 |
| 2050 | #define VOWLAN_SESSION_VSID 0x10002000 |
| 2051 | #define VOICEMMODE1_VSID 0x11C05000 |
| 2052 | #define VOICEMMODE2_VSID 0x11DC5000 |
| 2053 | #define ALL_SESSION_VSID 0xFFFFFFFF |
| 2054 | #define VSID_MAX ALL_SESSION_VSID |
| 2055 | |
| 2056 | /* called by alsa driver */ |
| 2057 | int voc_set_pp_enable(uint32_t session_id, uint32_t module_id, |
| 2058 | uint32_t enable); |
| 2059 | int voc_get_pp_enable(uint32_t session_id, uint32_t module_id); |
| 2060 | int voc_set_hd_enable(uint32_t session_id, uint32_t enable); |
| 2061 | uint8_t voc_get_tty_mode(uint32_t session_id); |
| 2062 | int voc_set_tty_mode(uint32_t session_id, uint8_t tty_mode); |
| 2063 | int voc_start_voice_call(uint32_t session_id); |
| 2064 | int voc_end_voice_call(uint32_t session_id); |
| 2065 | int voc_standby_voice_call(uint32_t session_id); |
| 2066 | int voc_resume_voice_call(uint32_t session_id); |
| 2067 | int voc_set_lch(uint32_t session_id, enum voice_lch_mode lch_mode); |
| 2068 | int voc_set_rx_vol_step(uint32_t session_id, uint32_t dir, uint32_t vol_step, |
| 2069 | uint32_t ramp_duration); |
| 2070 | int voc_set_tx_mute(uint32_t session_id, uint32_t dir, uint32_t mute, |
| 2071 | uint32_t ramp_duration); |
| 2072 | int voc_set_device_mute(uint32_t session_id, uint32_t dir, uint32_t mute, |
| 2073 | uint32_t ramp_duration); |
| 2074 | int voc_get_rx_device_mute(uint32_t session_id); |
| 2075 | int voc_set_route_flag(uint32_t session_id, uint8_t path_dir, uint8_t set); |
| 2076 | uint8_t voc_get_route_flag(uint32_t session_id, uint8_t path_dir); |
Vignesh Kulothungan | 78d3e82 | 2018-03-13 16:05:20 -0700 | [diff] [blame] | 2077 | bool voc_get_mbd_enable(void); |
| 2078 | uint8_t voc_set_mbd_enable(bool enable); |
Asish Bhattacharya | 8e2277f | 2017-07-20 18:31:55 +0530 | [diff] [blame] | 2079 | int voc_enable_dtmf_rx_detection(uint32_t session_id, uint32_t enable); |
| 2080 | void voc_disable_dtmf_det_on_active_sessions(void); |
| 2081 | int voc_alloc_cal_shared_memory(void); |
| 2082 | int voc_alloc_voip_shared_memory(void); |
| 2083 | int is_voc_initialized(void); |
| 2084 | int voc_register_vocproc_vol_table(void); |
| 2085 | int voc_deregister_vocproc_vol_table(void); |
| 2086 | int voc_send_cvp_map_vocpcm_memory(uint32_t session_id, |
| 2087 | struct mem_map_table *tp_mem_table, |
| 2088 | phys_addr_t paddr, uint32_t bufsize); |
| 2089 | int voc_send_cvp_unmap_vocpcm_memory(uint32_t session_id); |
| 2090 | int voc_send_cvp_start_vocpcm(uint32_t session_id, |
| 2091 | struct vss_ivpcm_tap_point *vpcm_tp, |
| 2092 | uint32_t no_of_tp); |
| 2093 | int voc_send_cvp_vocpcm_push_buf_evt(uint32_t session_id, |
| 2094 | struct vss_ivpcm_evt_push_buffer_v2_t *push_buff_evt); |
| 2095 | int voc_send_cvp_stop_vocpcm(uint32_t session_id); |
| 2096 | void voc_register_hpcm_evt_cb(hostpcm_cb_fn hostpcm_cb, |
| 2097 | void *private_data); |
| 2098 | void voc_deregister_hpcm_evt_cb(void); |
| 2099 | |
| 2100 | int voc_map_rtac_block(struct rtac_cal_block_data *cal_block); |
| 2101 | int voc_unmap_rtac_block(uint32_t *mem_map_handle); |
| 2102 | |
| 2103 | uint32_t voc_get_session_id(char *name); |
| 2104 | |
| 2105 | int voc_start_playback(uint32_t set, uint16_t port_id); |
| 2106 | int voc_start_record(uint32_t port_id, uint32_t set, uint32_t session_id); |
| 2107 | int voice_get_idx_for_session(u32 session_id); |
| 2108 | int voc_set_ext_ec_ref_port_id(uint16_t port_id, bool state); |
| 2109 | int voc_get_ext_ec_ref_port_id(void); |
| 2110 | int voc_set_ext_ec_ref_media_fmt_info(struct media_format_info *finfo); |
| 2111 | int voc_update_amr_vocoder_rate(uint32_t session_id); |
| 2112 | int voc_disable_device(uint32_t session_id); |
| 2113 | int voc_enable_device(uint32_t session_id); |
| 2114 | void voc_set_destroy_cvd_flag(bool is_destroy_cvd); |
Aditya Bavanari | 318556e | 2018-12-03 17:26:24 +0530 | [diff] [blame] | 2115 | void voc_set_vote_bms_flag(bool is_vote_bms); |
Asish Bhattacharya | 8e2277f | 2017-07-20 18:31:55 +0530 | [diff] [blame] | 2116 | int voc_disable_topology(uint32_t session_id, uint32_t disable); |
| 2117 | int voc_set_device_config(uint32_t session_id, uint8_t path_dir, |
| 2118 | struct media_format_info *finfo); |
| 2119 | uint32_t voice_get_topology(uint32_t topology_idx); |
Aditya Bavanari | 88513a3 | 2017-10-12 12:29:25 +0530 | [diff] [blame] | 2120 | int voice_set_topology_specific_info(struct voice_data *v, |
| 2121 | uint32_t topology_idx); |
Asish Bhattacharya | 8e2277f | 2017-07-20 18:31:55 +0530 | [diff] [blame] | 2122 | int voc_set_sound_focus(struct sound_focus_param sound_focus_param); |
| 2123 | int voc_get_sound_focus(struct sound_focus_param *soundFocusData); |
| 2124 | int voc_get_source_tracking(struct source_tracking_param *sourceTrackingData); |
| 2125 | int voc_set_afe_sidetone(uint32_t session_id, bool sidetone_enable); |
| 2126 | bool voc_get_afe_sidetone(void); |
| 2127 | #endif |