Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1 | #ifndef QDSP5AUDPPCMDI_H |
| 2 | #define QDSP5AUDPPCMDI_H |
| 3 | |
| 4 | /*====*====*====*====*====*====*====*====*====*====*====*====*====*====*====* |
| 5 | |
| 6 | A U D I O P O S T P R O C E S S I N G I N T E R N A L C O M M A N D S |
| 7 | |
| 8 | GENERAL DESCRIPTION |
| 9 | This file contains defintions of format blocks of commands |
| 10 | that are accepted by AUDPP Task |
| 11 | |
| 12 | REFERENCES |
| 13 | None |
| 14 | |
| 15 | EXTERNALIZED FUNCTIONS |
| 16 | None |
| 17 | |
Sriranjan Srikantam | 87a6c29 | 2013-01-25 16:39:58 +0530 | [diff] [blame] | 18 | Copyright(c) 1992-2009, 2012-2013 The Linux Foundation. All rights reserved. |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 19 | |
| 20 | This software is licensed under the terms of the GNU General Public |
| 21 | License version 2, as published by the Free Software Foundation, and |
| 22 | may be copied, distributed, and modified under those terms. |
| 23 | |
| 24 | This program is distributed in the hope that it will be useful, |
| 25 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 26 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 27 | GNU General Public License for more details. |
| 28 | |
| 29 | *====*====*====*====*====*====*====*====*====*====*====*====*====*====*====*/ |
| 30 | /*=========================================================================== |
| 31 | |
| 32 | EDIT HISTORY FOR FILE |
| 33 | |
| 34 | This section contains comments describing changes made to this file. |
| 35 | Notice that changes are listed in reverse chronological order. |
| 36 | |
| 37 | $Header: //source/qcom/qct/multimedia2/Audio/drivers/QDSP5Driver/QDSP5Interface/main/latest/qdsp5audppcmdi.h#2 $ |
| 38 | |
| 39 | ===========================================================================*/ |
| 40 | |
| 41 | /* |
| 42 | * ARM to AUDPPTASK Commands |
| 43 | * |
| 44 | * ARM uses three command queues to communicate with AUDPPTASK |
| 45 | * 1)uPAudPPCmd1Queue : Used for more frequent and shorter length commands |
| 46 | * Location : MEMA |
| 47 | * Buffer Size : 6 words |
| 48 | * No of buffers in a queue : 20 for gaming audio and 5 for other images |
| 49 | * 2)uPAudPPCmd2Queue : Used for commands which are not much lengthier |
| 50 | * Location : MEMA |
| 51 | * Buffer Size : 23 |
| 52 | * No of buffers in a queue : 2 |
| 53 | * 3)uPAudOOCmd3Queue : Used for lengthier and more frequent commands |
| 54 | * Location : MEMA |
| 55 | * Buffer Size : 145 |
| 56 | * No of buffers in a queue : 3 |
| 57 | */ |
| 58 | |
| 59 | /* |
| 60 | * Commands Related to uPAudPPCmd1Queue |
| 61 | */ |
| 62 | |
| 63 | /* |
| 64 | * Command Structure to enable or disable the active decoders |
| 65 | */ |
| 66 | |
| 67 | #define AUDPP_CMD_CFG_DEC_TYPE 0x0001 |
| 68 | #define AUDPP_CMD_CFG_DEC_TYPE_LEN sizeof(audpp_cmd_cfg_dec_type) |
| 69 | |
| 70 | /* Enable the decoder */ |
| 71 | #define AUDPP_CMD_DEC_TYPE_M 0x000F |
| 72 | |
| 73 | #define AUDPP_CMD_ENA_DEC_V 0x4000 |
| 74 | #define AUDPP_CMD_DIS_DEC_V 0x0000 |
| 75 | #define AUDPP_CMD_DEC_STATE_M 0x4000 |
Phani Kumar Allada | ae39d6d | 2012-06-12 11:52:20 +0530 | [diff] [blame] | 76 | #define AUDPP_CMD_LPA_MODE 0x2000 |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 77 | |
| 78 | #define AUDPP_CMD_UPDATDE_CFG_DEC 0x8000 |
| 79 | #define AUDPP_CMD_DONT_UPDATE_CFG_DEC 0x0000 |
| 80 | |
| 81 | |
| 82 | /* Type specification of cmd_cfg_dec */ |
| 83 | |
| 84 | typedef struct { |
| 85 | unsigned short cmd_id; |
| 86 | unsigned short dec0_cfg; |
| 87 | unsigned short dec1_cfg; |
| 88 | unsigned short dec2_cfg; |
| 89 | unsigned short dec3_cfg; |
| 90 | unsigned short dec4_cfg; |
| 91 | } __attribute__((packed)) audpp_cmd_cfg_dec_type; |
| 92 | |
| 93 | /* |
| 94 | * Command Structure to Pause , Resume and flushes the selected audio decoders |
| 95 | */ |
| 96 | |
| 97 | #define AUDPP_CMD_DEC_CTRL 0x0002 |
| 98 | #define AUDPP_CMD_DEC_CTRL_LEN sizeof(audpp_cmd_dec_ctrl) |
| 99 | |
| 100 | /* Decoder control commands for pause, resume and flush */ |
| 101 | #define AUDPP_CMD_FLUSH_V 0x2000 |
| 102 | |
| 103 | #define AUDPP_CMD_PAUSE_V 0x4000 |
| 104 | #define AUDPP_CMD_RESUME_V 0x0000 |
| 105 | |
| 106 | #define AUDPP_CMD_UPDATE_V 0x8000 |
| 107 | #define AUDPP_CMD_IGNORE_V 0x0000 |
| 108 | |
| 109 | |
| 110 | /* Type Spec for decoder control command*/ |
| 111 | |
| 112 | typedef struct { |
| 113 | unsigned short cmd_id; |
| 114 | unsigned short dec0_ctrl; |
| 115 | unsigned short dec1_ctrl; |
| 116 | unsigned short dec2_ctrl; |
| 117 | unsigned short dec3_ctrl; |
| 118 | unsigned short dec4_ctrl; |
| 119 | } __attribute__((packed)) audpp_cmd_dec_ctrl; |
| 120 | |
| 121 | /* |
| 122 | * Command Structure to Configure the AVSync FeedBack Mechanism |
| 123 | */ |
| 124 | |
| 125 | #define AUDPP_CMD_AVSYNC 0x0003 |
| 126 | #define AUDPP_CMD_AVSYNC_LEN sizeof(audpp_cmd_avsync) |
| 127 | |
| 128 | typedef struct { |
| 129 | unsigned short cmd_id; |
| 130 | unsigned short object_number; |
| 131 | unsigned short interrupt_interval_lsw; |
| 132 | unsigned short interrupt_interval_msw; |
| 133 | } __attribute__((packed)) audpp_cmd_avsync; |
| 134 | |
| 135 | /* |
| 136 | * Command Structure to enable or disable(sleep) the AUDPPTASK |
| 137 | */ |
| 138 | |
| 139 | #define AUDPP_CMD_CFG 0x0004 |
| 140 | #define AUDPP_CMD_CFG_LEN sizeof(audpp_cmd_cfg) |
| 141 | |
| 142 | #define AUDPP_CMD_CFG_SLEEP 0x0000 |
| 143 | #define AUDPP_CMD_CFG_ENABLE 0xFFFF |
| 144 | |
| 145 | typedef struct { |
| 146 | unsigned short cmd_id; |
| 147 | unsigned short cfg; |
| 148 | } __attribute__((packed)) audpp_cmd_cfg; |
| 149 | |
| 150 | /* |
| 151 | * Command Structure to Inject or drop the specified no of samples |
| 152 | */ |
| 153 | |
| 154 | #define AUDPP_CMD_ADJUST_SAMP 0x0005 |
| 155 | #define AUDPP_CMD_ADJUST_SAMP_LEN sizeof(audpp_cmd_adjust_samp) |
| 156 | |
| 157 | #define AUDPP_CMD_SAMP_DROP -1 |
| 158 | #define AUDPP_CMD_SAMP_INSERT 0x0001 |
| 159 | |
| 160 | #define AUDPP_CMD_NUM_SAMPLES 0x0001 |
| 161 | |
| 162 | typedef struct { |
| 163 | unsigned short cmd_id; |
| 164 | unsigned short object_no; |
| 165 | signed short sample_insert_or_drop; |
| 166 | unsigned short num_samples; |
| 167 | } __attribute__((packed)) audpp_cmd_adjust_samp; |
| 168 | |
| 169 | /* |
| 170 | * Command Structure to Configure AVSync Feedback Mechanism |
| 171 | */ |
| 172 | |
| 173 | #define AUDPP_CMD_AVSYNC_CMD_2 0x0006 |
| 174 | #define AUDPP_CMD_AVSYNC_CMD_2_LEN sizeof(audpp_cmd_avsync_cmd_2) |
| 175 | |
| 176 | typedef struct { |
| 177 | unsigned short cmd_id; |
| 178 | unsigned short object_number; |
| 179 | unsigned short interrupt_interval_lsw; |
| 180 | unsigned short interrupt_interval_msw; |
| 181 | unsigned short sample_counter_dlsw; |
| 182 | unsigned short sample_counter_dmsw; |
| 183 | unsigned short sample_counter_msw; |
| 184 | unsigned short byte_counter_dlsw; |
| 185 | unsigned short byte_counter_dmsw; |
| 186 | unsigned short byte_counter_msw; |
| 187 | } __attribute__((packed)) audpp_cmd_avsync_cmd_2; |
| 188 | |
| 189 | /* |
| 190 | * Command Structure to Configure AVSync Feedback Mechanism |
| 191 | */ |
| 192 | |
| 193 | #define AUDPP_CMD_AVSYNC_CMD_3 0x0007 |
| 194 | #define AUDPP_CMD_AVSYNC_CMD_3_LEN sizeof(audpp_cmd_avsync_cmd_3) |
| 195 | |
| 196 | typedef struct { |
| 197 | unsigned short cmd_id; |
| 198 | unsigned short object_number; |
| 199 | unsigned short interrupt_interval_lsw; |
| 200 | unsigned short interrupt_interval_msw; |
| 201 | unsigned short sample_counter_dlsw; |
| 202 | unsigned short sample_counter_dmsw; |
| 203 | unsigned short sample_counter_msw; |
| 204 | unsigned short byte_counter_dlsw; |
| 205 | unsigned short byte_counter_dmsw; |
| 206 | unsigned short byte_counter_msw; |
| 207 | } __attribute__((packed)) audpp_cmd_avsync_cmd_3; |
| 208 | |
| 209 | #define AUDPP_CMD_ROUTING_MODE 0x0008 |
| 210 | #define AUDPP_CMD_ROUTING_MODE_LEN \ |
| 211 | sizeof(struct audpp_cmd_routing_mode) |
| 212 | |
| 213 | struct audpp_cmd_routing_mode { |
| 214 | unsigned short cmd_id; |
| 215 | unsigned short object_number; |
| 216 | unsigned short routing_mode; |
| 217 | } __attribute__((packed)); |
| 218 | |
| 219 | /* |
| 220 | * Commands Related to uPAudPPCmd2Queue |
| 221 | */ |
| 222 | |
| 223 | /* |
| 224 | * Command Structure to configure Per decoder Parameters (Common) |
| 225 | */ |
| 226 | |
| 227 | #define AUDPP_CMD_CFG_ADEC_PARAMS 0x0000 |
| 228 | #define AUDPP_CMD_CFG_ADEC_PARAMS_COMMON_LEN \ |
| 229 | sizeof(audpp_cmd_cfg_adec_params_common) |
| 230 | |
| 231 | #define AUDPP_CMD_STATUS_MSG_FLAG_ENA_FCM 0x4000 |
| 232 | #define AUDPP_CMD_STATUS_MSG_FLAG_DIS_FCM 0x0000 |
| 233 | |
| 234 | #define AUDPP_CMD_STATUS_MSG_FLAG_ENA_DCM 0x8000 |
| 235 | #define AUDPP_CMD_STATUS_MSG_FLAG_DIS_DCM 0x0000 |
| 236 | |
| 237 | /* Sampling frequency*/ |
| 238 | #define AUDPP_CMD_SAMP_RATE_96000 0x0000 |
| 239 | #define AUDPP_CMD_SAMP_RATE_88200 0x0001 |
| 240 | #define AUDPP_CMD_SAMP_RATE_64000 0x0002 |
| 241 | #define AUDPP_CMD_SAMP_RATE_48000 0x0003 |
| 242 | #define AUDPP_CMD_SAMP_RATE_44100 0x0004 |
| 243 | #define AUDPP_CMD_SAMP_RATE_32000 0x0005 |
| 244 | #define AUDPP_CMD_SAMP_RATE_24000 0x0006 |
| 245 | #define AUDPP_CMD_SAMP_RATE_22050 0x0007 |
| 246 | #define AUDPP_CMD_SAMP_RATE_16000 0x0008 |
| 247 | #define AUDPP_CMD_SAMP_RATE_12000 0x0009 |
| 248 | #define AUDPP_CMD_SAMP_RATE_11025 0x000A |
| 249 | #define AUDPP_CMD_SAMP_RATE_8000 0x000B |
| 250 | |
| 251 | |
| 252 | /* |
| 253 | * Type specification of cmd_adec_cfg sent to all decoder |
| 254 | */ |
| 255 | |
| 256 | typedef struct { |
| 257 | unsigned short cmd_id; |
| 258 | unsigned short length; |
| 259 | unsigned short dec_id; |
| 260 | unsigned short status_msg_flag; |
| 261 | unsigned short decoder_frame_counter_msg_period; |
| 262 | unsigned short input_sampling_frequency; |
| 263 | } __attribute__((packed)) audpp_cmd_cfg_adec_params_common; |
| 264 | |
| 265 | /* |
| 266 | * Command Structure to configure Per decoder Parameters (Wav) |
| 267 | */ |
| 268 | |
| 269 | #define AUDPP_CMD_CFG_ADEC_PARAMS_WAV_LEN \ |
| 270 | sizeof(audpp_cmd_cfg_adec_params_wav) |
| 271 | |
| 272 | |
| 273 | #define AUDPP_CMD_WAV_STEREO_CFG_MONO 0x0001 |
| 274 | #define AUDPP_CMD_WAV_STEREO_CFG_STEREO 0x0002 |
| 275 | |
| 276 | #define AUDPP_CMD_WAV_PCM_WIDTH_8 0x0000 |
| 277 | #define AUDPP_CMD_WAV_PCM_WIDTH_16 0x0001 |
| 278 | #define AUDPP_CMD_WAV_PCM_WIDTH_24 0x0002 |
| 279 | |
| 280 | typedef struct { |
| 281 | audpp_cmd_cfg_adec_params_common common; |
| 282 | unsigned short stereo_cfg; |
| 283 | unsigned short pcm_width; |
| 284 | unsigned short sign; |
| 285 | } __attribute__((packed)) audpp_cmd_cfg_adec_params_wav; |
| 286 | |
| 287 | /* |
| 288 | * Command Structure to configure Per decoder Parameters (ADPCM) |
| 289 | */ |
| 290 | |
| 291 | #define AUDPP_CMD_CFG_ADEC_PARAMS_ADPCM_LEN \ |
| 292 | sizeof(audpp_cmd_cfg_adec_params_adpcm) |
| 293 | |
| 294 | |
| 295 | #define AUDPP_CMD_ADPCM_STEREO_CFG_MONO 0x0001 |
| 296 | #define AUDPP_CMD_ADPCM_STEREO_CFG_STEREO 0x0002 |
| 297 | |
| 298 | typedef struct { |
| 299 | audpp_cmd_cfg_adec_params_common common; |
| 300 | unsigned short stereo_cfg; |
| 301 | unsigned short block_size; |
| 302 | } __attribute__((packed)) audpp_cmd_cfg_adec_params_adpcm; |
| 303 | |
| 304 | /* |
| 305 | * Command Structure to configure Per decoder Parameters (WMA) |
| 306 | */ |
| 307 | |
| 308 | #define AUDPP_CMD_CFG_ADEC_PARAMS_WMA_LEN \ |
| 309 | sizeof(struct audpp_cmd_cfg_adec_params_wma) |
| 310 | |
| 311 | struct audpp_cmd_cfg_adec_params_wma { |
| 312 | audpp_cmd_cfg_adec_params_common common; |
| 313 | unsigned short armdatareqthr; |
| 314 | unsigned short channelsdecoded; |
| 315 | unsigned short wmabytespersec; |
| 316 | unsigned short wmasamplingfreq; |
| 317 | unsigned short wmaencoderopts; |
| 318 | } __attribute__((packed)); |
| 319 | |
| 320 | /* |
| 321 | * Command Structure to configure Per decoder Parameters (WMAPRO) |
| 322 | */ |
| 323 | |
| 324 | #define AUDPP_CMD_CFG_ADEC_PARAMS_WMAPRO_LEN \ |
| 325 | sizeof(struct audpp_cmd_cfg_adec_params_wmapro) |
| 326 | |
| 327 | struct audpp_cmd_cfg_adec_params_wmapro { |
| 328 | audpp_cmd_cfg_adec_params_common common; |
| 329 | unsigned short armdatareqthr; |
| 330 | uint8_t validbitspersample; |
| 331 | uint8_t numchannels; |
| 332 | unsigned short formattag; |
| 333 | unsigned short samplingrate; |
| 334 | unsigned short avgbytespersecond; |
| 335 | unsigned short asfpacketlength; |
| 336 | unsigned short channelmask; |
| 337 | unsigned short encodeopt; |
| 338 | unsigned short advancedencodeopt; |
| 339 | uint32_t advancedencodeopt2; |
| 340 | } __attribute__((packed)); |
| 341 | |
| 342 | /* |
| 343 | * Command Structure to configure Per decoder Parameters (MP3) |
| 344 | */ |
| 345 | |
| 346 | #define AUDPP_CMD_CFG_ADEC_PARAMS_MP3_LEN \ |
| 347 | sizeof(audpp_cmd_cfg_adec_params_mp3) |
| 348 | |
| 349 | typedef struct { |
| 350 | audpp_cmd_cfg_adec_params_common common; |
| 351 | } __attribute__((packed)) audpp_cmd_cfg_adec_params_mp3; |
| 352 | |
| 353 | |
| 354 | /* |
| 355 | * Command Structure to configure Per decoder Parameters (AAC) |
| 356 | */ |
| 357 | |
| 358 | #define AUDPP_CMD_CFG_ADEC_PARAMS_AAC_LEN \ |
| 359 | sizeof(audpp_cmd_cfg_adec_params_aac) |
| 360 | |
| 361 | |
| 362 | #define AUDPP_CMD_AAC_FORMAT_ADTS -1 |
| 363 | #define AUDPP_CMD_AAC_FORMAT_RAW 0x0000 |
| 364 | #define AUDPP_CMD_AAC_FORMAT_PSUEDO_RAW 0x0001 |
| 365 | #define AUDPP_CMD_AAC_FORMAT_LOAS 0x0002 |
| 366 | |
| 367 | #define AUDPP_CMD_AAC_AUDIO_OBJECT_LC 0x0002 |
| 368 | #define AUDPP_CMD_AAC_AUDIO_OBJECT_LTP 0x0004 |
| 369 | #define AUDPP_CMD_AAC_AUDIO_OBJECT_ERLC 0x0011 |
| 370 | |
| 371 | #define AUDPP_CMD_AAC_SBR_ON_FLAG_ON 0x0001 |
| 372 | #define AUDPP_CMD_AAC_SBR_ON_FLAG_OFF 0x0000 |
| 373 | |
| 374 | #define AUDPP_CMD_AAC_SBR_PS_ON_FLAG_ON 0x0001 |
| 375 | #define AUDPP_CMD_AAC_SBR_PS_ON_FLAG_OFF 0x0000 |
| 376 | |
| 377 | typedef struct { |
| 378 | audpp_cmd_cfg_adec_params_common common; |
| 379 | signed short format; |
| 380 | unsigned short audio_object; |
| 381 | unsigned short ep_config; |
| 382 | unsigned short aac_section_data_resilience_flag; |
| 383 | unsigned short aac_scalefactor_data_resilience_flag; |
| 384 | unsigned short aac_spectral_data_resilience_flag; |
| 385 | unsigned short sbr_on_flag; |
| 386 | unsigned short sbr_ps_on_flag; |
| 387 | unsigned short channel_configuration; |
| 388 | } __attribute__((packed)) audpp_cmd_cfg_adec_params_aac; |
| 389 | |
| 390 | /* |
| 391 | * Command Structure to configure Per decoder Parameters (V13K) |
| 392 | */ |
| 393 | |
| 394 | #define AUDPP_CMD_CFG_ADEC_PARAMS_V13K_LEN \ |
| 395 | sizeof(struct audpp_cmd_cfg_adec_params_v13k) |
| 396 | |
| 397 | |
| 398 | #define AUDPP_CMD_STEREO_CFG_MONO 0x0001 |
| 399 | #define AUDPP_CMD_STEREO_CFG_STEREO 0x0002 |
| 400 | |
| 401 | struct audpp_cmd_cfg_adec_params_v13k { |
| 402 | audpp_cmd_cfg_adec_params_common common; |
| 403 | unsigned short stereo_cfg; |
| 404 | } __attribute__((packed)); |
| 405 | |
| 406 | #define AUDPP_CMD_CFG_ADEC_PARAMS_EVRC_LEN \ |
| 407 | sizeof(struct audpp_cmd_cfg_adec_params_evrc) |
| 408 | |
| 409 | struct audpp_cmd_cfg_adec_params_evrc { |
| 410 | audpp_cmd_cfg_adec_params_common common; |
| 411 | unsigned short stereo_cfg; |
| 412 | } __attribute__ ((packed)); |
| 413 | |
| 414 | /* |
| 415 | * Command Structure to configure Per decoder Parameters (AMRWB) |
| 416 | */ |
Chaithanya Krishna Bacharaju | 8e838cc | 2012-08-16 11:32:46 +0530 | [diff] [blame] | 417 | #define ADEC_PARAMS_AC3_INDEX 14 |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 418 | |
| 419 | struct audpp_cmd_cfg_adec_params_amrwb { |
| 420 | audpp_cmd_cfg_adec_params_common common; |
| 421 | unsigned short stereo_cfg; |
| 422 | } __attribute__((packed)) ; |
| 423 | |
| 424 | #define AUDPP_CMD_CFG_ADEC_PARAMS_AMRWB_LEN \ |
| 425 | sizeof(struct audpp_cmd_cfg_adec_params_amrwb) |
| 426 | |
| 427 | /* |
Chaithanya Krishna Bacharaju | 8e838cc | 2012-08-16 11:32:46 +0530 | [diff] [blame] | 428 | * Command Structure to configure Per decoder Parameters (AC3) |
| 429 | */ |
| 430 | |
| 431 | struct audpp_cmd_cfg_adec_params_ac3 { |
| 432 | audpp_cmd_cfg_adec_params_common common; |
| 433 | unsigned short index[ADEC_PARAMS_AC3_INDEX]; |
| 434 | } __packed; |
| 435 | |
| 436 | #define AUDPP_CMD_CFG_ADEC_PARAMS_AC3_LEN \ |
| 437 | sizeof(struct audpp_cmd_cfg_adec_params_ac3) |
| 438 | |
| 439 | /* |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 440 | * Command Structure to configure the HOST PCM interface |
| 441 | */ |
| 442 | |
| 443 | #define AUDPP_CMD_PCM_INTF 0x0001 |
| 444 | #define AUDPP_CMD_PCM_INTF_2 0x0002 |
| 445 | #define AUDPP_CMD_PCM_INTF_LEN sizeof(audpp_cmd_pcm_intf) |
| 446 | |
| 447 | #define AUDPP_CMD_PCM_INTF_MONO_V 0x0001 |
| 448 | #define AUDPP_CMD_PCM_INTF_STEREO_V 0x0002 |
| 449 | |
| 450 | /* These two values differentiate the two types of commands that could be issued |
| 451 | * Interface configuration command and Buffer update command */ |
| 452 | |
| 453 | #define AUDPP_CMD_PCM_INTF_CONFIG_CMD_V 0x0000 |
| 454 | #define AUDPP_CMD_PCM_INTF_BUFFER_CMD_V -1 |
| 455 | |
| 456 | #define AUDPP_CMD_PCM_INTF_RX_ENA_M 0x000F |
| 457 | #define AUDPP_CMD_PCM_INTF_RX_ENA_ARMTODSP_V 0x0008 |
| 458 | #define AUDPP_CMD_PCM_INTF_RX_ENA_DSPTOARM_V 0x0004 |
| 459 | |
| 460 | /* These flags control the enabling and disabling of the interface together |
| 461 | * with host interface bit mask. */ |
| 462 | |
| 463 | #define AUDPP_CMD_PCM_INTF_ENA_V -1 |
| 464 | #define AUDPP_CMD_PCM_INTF_DIS_V 0x0000 |
| 465 | |
| 466 | |
| 467 | #define AUDPP_CMD_PCM_INTF_FULL_DUPLEX 0x0 |
| 468 | #define AUDPP_CMD_PCM_INTF_HALF_DUPLEX_TODSP 0x1 |
| 469 | |
| 470 | |
| 471 | #define AUDPP_CMD_PCM_INTF_OBJECT_NUM 0x5 |
| 472 | #define AUDPP_CMD_PCM_INTF_COMMON_OBJECT_NUM 0x6 |
| 473 | |
| 474 | |
| 475 | typedef struct { |
| 476 | unsigned short cmd_id; |
| 477 | unsigned short object_num; |
| 478 | signed short config; |
| 479 | unsigned short intf_type; |
| 480 | |
| 481 | /* DSP -> ARM Configuration */ |
| 482 | unsigned short read_buf1LSW; |
| 483 | unsigned short read_buf1MSW; |
| 484 | unsigned short read_buf1_len; |
| 485 | |
| 486 | unsigned short read_buf2LSW; |
| 487 | unsigned short read_buf2MSW; |
| 488 | unsigned short read_buf2_len; |
| 489 | /* 0:HOST_PCM_INTF disable |
| 490 | ** 0xFFFF: HOST_PCM_INTF enable |
| 491 | */ |
| 492 | signed short dsp_to_arm_flag; |
| 493 | unsigned short partition_number; |
| 494 | |
| 495 | /* ARM -> DSP Configuration */ |
| 496 | unsigned short write_buf1LSW; |
| 497 | unsigned short write_buf1MSW; |
| 498 | unsigned short write_buf1_len; |
| 499 | |
| 500 | unsigned short write_buf2LSW; |
| 501 | unsigned short write_buf2MSW; |
| 502 | unsigned short write_buf2_len; |
| 503 | |
| 504 | /* 0:HOST_PCM_INTF disable |
| 505 | ** 0xFFFF: HOST_PCM_INTF enable |
| 506 | */ |
| 507 | signed short arm_to_rx_flag; |
| 508 | unsigned short weight_decoder_to_rx; |
| 509 | unsigned short weight_arm_to_rx; |
| 510 | |
| 511 | unsigned short partition_number_arm_to_dsp; |
| 512 | unsigned short sample_rate; |
| 513 | unsigned short channel_mode; |
| 514 | } __attribute__((packed)) audpp_cmd_pcm_intf; |
| 515 | |
| 516 | /* |
| 517 | ** BUFFER UPDATE COMMAND |
| 518 | */ |
| 519 | #define AUDPP_CMD_PCM_INTF_SEND_BUF_PARAMS_LEN \ |
| 520 | sizeof(audpp_cmd_pcm_intf_send_buffer) |
| 521 | |
| 522 | typedef struct { |
| 523 | unsigned short cmd_id; |
| 524 | unsigned short host_pcm_object; |
| 525 | /* set config = 0xFFFF for configuration*/ |
| 526 | signed short config; |
| 527 | unsigned short intf_type; |
| 528 | unsigned short dsp_to_arm_buf_id; |
| 529 | unsigned short arm_to_dsp_buf_id; |
| 530 | unsigned short arm_to_dsp_buf_len; |
| 531 | } __attribute__((packed)) audpp_cmd_pcm_intf_send_buffer; |
| 532 | |
Manish Dewangan | ca85972 | 2012-07-09 18:21:42 +0530 | [diff] [blame] | 533 | #define AUDPP_CMD_PP_FEAT_QUERY_PARAMS 0x0003 |
| 534 | |
| 535 | struct rtc_audpp_read_data { |
| 536 | unsigned short cmd_id; |
| 537 | unsigned short obj_id; |
| 538 | unsigned short feature_id; |
| 539 | unsigned short extbufsizemsw; |
| 540 | unsigned short extbufsizelsw; |
| 541 | unsigned short extpart; |
| 542 | unsigned short extbufstartmsw; |
| 543 | unsigned short extbufstartlsw; |
| 544 | } __packed ; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 545 | |
| 546 | /* |
| 547 | * Commands Related to uPAudPPCmd3Queue |
| 548 | */ |
| 549 | |
| 550 | /* |
| 551 | * Command Structure to configure post processing params (Commmon) |
| 552 | */ |
| 553 | |
| 554 | #define AUDPP_CMD_CFG_OBJECT_PARAMS 0x0000 |
| 555 | #define AUDPP_CMD_CFG_OBJECT_PARAMS_COMMON_LEN \ |
| 556 | sizeof(audpp_cmd_cfg_object_params_common) |
| 557 | |
| 558 | #define AUDPP_CMD_OBJ0_UPDATE 0x8000 |
| 559 | #define AUDPP_CMD_OBJ0_DONT_UPDATE 0x0000 |
| 560 | |
| 561 | #define AUDPP_CMD_OBJ1_UPDATE 0x8000 |
| 562 | #define AUDPP_CMD_OBJ1_DONT_UPDATE 0x0000 |
| 563 | |
| 564 | #define AUDPP_CMD_OBJ2_UPDATE 0x8000 |
| 565 | #define AUDPP_CMD_OBJ2_DONT_UPDATE 0x0000 |
| 566 | |
| 567 | #define AUDPP_CMD_OBJ3_UPDATE 0x8000 |
| 568 | #define AUDPP_CMD_OBJ3_DONT_UPDATE 0x0000 |
| 569 | |
| 570 | #define AUDPP_CMD_OBJ4_UPDATE 0x8000 |
| 571 | #define AUDPP_CMD_OBJ4_DONT_UPDATE 0x0000 |
| 572 | |
| 573 | #define AUDPP_CMD_HPCM_UPDATE 0x8000 |
| 574 | #define AUDPP_CMD_HPCM_DONT_UPDATE 0x0000 |
| 575 | |
| 576 | #define AUDPP_CMD_COMMON_CFG_UPDATE 0x8000 |
| 577 | #define AUDPP_CMD_COMMON_CFG_DONT_UPDATE 0x0000 |
| 578 | |
Manish Dewangan | fa8a6b6 | 2012-07-09 16:23:27 +0530 | [diff] [blame] | 579 | #define AUDPP_CMD_COPP_STREAM 0x0006 |
| 580 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 581 | typedef struct { |
| 582 | unsigned short cmd_id; |
| 583 | unsigned short obj0_cfg; |
| 584 | unsigned short obj1_cfg; |
| 585 | unsigned short obj2_cfg; |
| 586 | unsigned short obj3_cfg; |
| 587 | unsigned short obj4_cfg; |
| 588 | unsigned short host_pcm_obj_cfg; |
| 589 | unsigned short comman_cfg; |
| 590 | unsigned short command_type; |
| 591 | } __attribute__((packed)) audpp_cmd_cfg_object_params_common; |
| 592 | |
| 593 | /* |
| 594 | * Command Structure to configure post processing params (Volume) |
| 595 | */ |
| 596 | |
Manish Dewangan | fa8a6b6 | 2012-07-09 16:23:27 +0530 | [diff] [blame] | 597 | #define AUDPP_CMD_VOLUME_PAN 0 |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 598 | #define AUDPP_CMD_CFG_OBJECT_PARAMS_VOLUME_LEN \ |
| 599 | sizeof(audpp_cmd_cfg_object_params_volume) |
| 600 | |
| 601 | typedef struct { |
| 602 | audpp_cmd_cfg_object_params_common common; |
| 603 | unsigned short volume; |
| 604 | unsigned short pan; |
| 605 | } __attribute__((packed)) audpp_cmd_cfg_object_params_volume; |
| 606 | |
| 607 | /* |
| 608 | * Command Structure to configure post processing params (PCM Filter) --DOUBT |
| 609 | */ |
| 610 | |
| 611 | typedef struct { |
| 612 | unsigned short numerator_b0_filter_lsw; |
| 613 | unsigned short numerator_b0_filter_msw; |
| 614 | unsigned short numerator_b1_filter_lsw; |
| 615 | unsigned short numerator_b1_filter_msw; |
| 616 | unsigned short numerator_b2_filter_lsw; |
| 617 | unsigned short numerator_b2_filter_msw; |
| 618 | } __attribute__((packed)) numerator; |
| 619 | |
| 620 | typedef struct { |
| 621 | unsigned short denominator_a0_filter_lsw; |
| 622 | unsigned short denominator_a0_filter_msw; |
| 623 | unsigned short denominator_a1_filter_lsw; |
| 624 | unsigned short denominator_a1_filter_msw; |
| 625 | } __attribute__((packed)) denominator; |
| 626 | |
| 627 | typedef struct { |
| 628 | unsigned short shift_factor_0; |
| 629 | } __attribute__((packed)) shift_factor; |
| 630 | |
| 631 | typedef struct { |
| 632 | unsigned short pan_filter_0; |
| 633 | } __attribute__((packed)) pan; |
| 634 | |
| 635 | typedef struct { |
| 636 | numerator numerator_filter; |
| 637 | denominator denominator_filter; |
| 638 | shift_factor shift_factor_filter; |
| 639 | pan pan_filter; |
| 640 | } __attribute__((packed)) filter_1; |
| 641 | |
| 642 | typedef struct { |
| 643 | numerator numerator_filter[2]; |
| 644 | denominator denominator_filter[2]; |
| 645 | shift_factor shift_factor_filter[2]; |
| 646 | pan pan_filter[2]; |
| 647 | } __attribute__((packed)) filter_2; |
| 648 | |
| 649 | typedef struct { |
| 650 | numerator numerator_filter[3]; |
| 651 | denominator denominator_filter[3]; |
| 652 | shift_factor shift_factor_filter[3]; |
| 653 | pan pan_filter[3]; |
| 654 | } __attribute__((packed)) filter_3; |
| 655 | |
| 656 | typedef struct { |
| 657 | numerator numerator_filter[4]; |
| 658 | denominator denominator_filter[4]; |
| 659 | shift_factor shift_factor_filter[4]; |
| 660 | pan pan_filter[4]; |
| 661 | } __attribute__((packed)) filter_4; |
| 662 | |
Manish Dewangan | fa8a6b6 | 2012-07-09 16:23:27 +0530 | [diff] [blame] | 663 | #define AUDPP_CMD_IIR_TUNING_FILTER 1 |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 664 | #define AUDPP_CMD_CFG_OBJECT_PARAMS_PCM_LEN \ |
| 665 | sizeof(audpp_cmd_cfg_object_params_pcm) |
| 666 | |
| 667 | |
| 668 | typedef struct { |
| 669 | audpp_cmd_cfg_object_params_common common; |
| 670 | unsigned short active_flag; |
| 671 | unsigned short num_bands; |
| 672 | union { |
| 673 | filter_1 filter_1_params; |
| 674 | filter_2 filter_2_params; |
| 675 | filter_3 filter_3_params; |
| 676 | filter_4 filter_4_params; |
| 677 | } __attribute__((packed)) params_filter; |
| 678 | } __attribute__((packed)) audpp_cmd_cfg_object_params_pcm; |
| 679 | |
| 680 | |
| 681 | /* |
| 682 | * Command Structure to configure post processing parameters (equalizer) |
| 683 | */ |
| 684 | |
Manish Dewangan | fa8a6b6 | 2012-07-09 16:23:27 +0530 | [diff] [blame] | 685 | #define AUDPP_CMD_EQUALIZER 2 |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 686 | #define AUDPP_CMD_CFG_OBJECT_PARAMS_EQALIZER_LEN \ |
| 687 | sizeof(audpp_cmd_cfg_object_params_eqalizer) |
| 688 | |
| 689 | typedef struct { |
| 690 | unsigned short numerator_coeff_0_lsw; |
| 691 | unsigned short numerator_coeff_0_msw; |
| 692 | unsigned short numerator_coeff_1_lsw; |
| 693 | unsigned short numerator_coeff_1_msw; |
| 694 | unsigned short numerator_coeff_2_lsw; |
| 695 | unsigned short numerator_coeff_2_msw; |
| 696 | } __attribute__((packed)) eq_numerator; |
| 697 | |
| 698 | typedef struct { |
| 699 | unsigned short denominator_coeff_0_lsw; |
| 700 | unsigned short denominator_coeff_0_msw; |
| 701 | unsigned short denominator_coeff_1_lsw; |
| 702 | unsigned short denominator_coeff_1_msw; |
| 703 | } __attribute__((packed)) eq_denominator; |
| 704 | |
| 705 | typedef struct { |
| 706 | unsigned short shift_factor; |
| 707 | } __attribute__((packed)) eq_shiftfactor; |
| 708 | |
| 709 | typedef struct { |
| 710 | eq_numerator numerator; |
| 711 | eq_denominator denominator; |
| 712 | eq_shiftfactor shiftfactor; |
| 713 | } __attribute__((packed)) eq_coeff_1; |
| 714 | |
| 715 | typedef struct { |
| 716 | eq_numerator numerator[2]; |
| 717 | eq_denominator denominator[2]; |
| 718 | eq_shiftfactor shiftfactor[2]; |
| 719 | } __attribute__((packed)) eq_coeff_2; |
| 720 | |
| 721 | typedef struct { |
| 722 | eq_numerator numerator[3]; |
| 723 | eq_denominator denominator[3]; |
| 724 | eq_shiftfactor shiftfactor[3]; |
| 725 | } __attribute__((packed)) eq_coeff_3; |
| 726 | |
| 727 | typedef struct { |
| 728 | eq_numerator numerator[4]; |
| 729 | eq_denominator denominator[4]; |
| 730 | eq_shiftfactor shiftfactor[4]; |
| 731 | } __attribute__((packed)) eq_coeff_4; |
| 732 | |
| 733 | typedef struct { |
| 734 | eq_numerator numerator[5]; |
| 735 | eq_denominator denominator[5]; |
| 736 | eq_shiftfactor shiftfactor[5]; |
| 737 | } __attribute__((packed)) eq_coeff_5; |
| 738 | |
| 739 | typedef struct { |
| 740 | eq_numerator numerator[6]; |
| 741 | eq_denominator denominator[6]; |
| 742 | eq_shiftfactor shiftfactor[6]; |
| 743 | } __attribute__((packed)) eq_coeff_6; |
| 744 | |
| 745 | typedef struct { |
| 746 | eq_numerator numerator[7]; |
| 747 | eq_denominator denominator[7]; |
| 748 | eq_shiftfactor shiftfactor[7]; |
| 749 | } __attribute__((packed)) eq_coeff_7; |
| 750 | |
| 751 | typedef struct { |
| 752 | eq_numerator numerator[8]; |
| 753 | eq_denominator denominator[8]; |
| 754 | eq_shiftfactor shiftfactor[8]; |
| 755 | } __attribute__((packed)) eq_coeff_8; |
| 756 | |
| 757 | typedef struct { |
| 758 | eq_numerator numerator[9]; |
| 759 | eq_denominator denominator[9]; |
| 760 | eq_shiftfactor shiftfactor[9]; |
| 761 | } __attribute__((packed)) eq_coeff_9; |
| 762 | |
| 763 | typedef struct { |
| 764 | eq_numerator numerator[10]; |
| 765 | eq_denominator denominator[10]; |
| 766 | eq_shiftfactor shiftfactor[10]; |
| 767 | } __attribute__((packed)) eq_coeff_10; |
| 768 | |
| 769 | typedef struct { |
| 770 | eq_numerator numerator[11]; |
| 771 | eq_denominator denominator[11]; |
| 772 | eq_shiftfactor shiftfactor[11]; |
| 773 | } __attribute__((packed)) eq_coeff_11; |
| 774 | |
| 775 | typedef struct { |
| 776 | eq_numerator numerator[12]; |
| 777 | eq_denominator denominator[12]; |
| 778 | eq_shiftfactor shiftfactor[12]; |
| 779 | } __attribute__((packed)) eq_coeff_12; |
| 780 | |
| 781 | |
| 782 | typedef struct { |
| 783 | audpp_cmd_cfg_object_params_common common; |
| 784 | unsigned short eq_flag; |
| 785 | unsigned short num_bands; |
| 786 | union { |
| 787 | eq_coeff_1 eq_coeffs_1; |
| 788 | eq_coeff_2 eq_coeffs_2; |
| 789 | eq_coeff_3 eq_coeffs_3; |
| 790 | eq_coeff_4 eq_coeffs_4; |
| 791 | eq_coeff_5 eq_coeffs_5; |
| 792 | eq_coeff_6 eq_coeffs_6; |
| 793 | eq_coeff_7 eq_coeffs_7; |
| 794 | eq_coeff_8 eq_coeffs_8; |
| 795 | eq_coeff_9 eq_coeffs_9; |
| 796 | eq_coeff_10 eq_coeffs_10; |
| 797 | eq_coeff_11 eq_coeffs_11; |
| 798 | eq_coeff_12 eq_coeffs_12; |
| 799 | } __attribute__((packed)) eq_coeff; |
| 800 | } __attribute__((packed)) audpp_cmd_cfg_object_params_eqalizer; |
| 801 | |
| 802 | |
| 803 | /* |
| 804 | * Command Structure to configure post processing parameters (ADRC) |
| 805 | */ |
| 806 | |
Manish Dewangan | fa8a6b6 | 2012-07-09 16:23:27 +0530 | [diff] [blame] | 807 | #define AUDPP_CMD_ADRC 3 |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 808 | #define AUDPP_CMD_CFG_OBJECT_PARAMS_ADRC_LEN \ |
| 809 | sizeof(audpp_cmd_cfg_object_params_adrc) |
| 810 | |
| 811 | |
| 812 | #define AUDPP_CMD_ADRC_FLAG_DIS 0x0000 |
| 813 | #define AUDPP_CMD_ADRC_FLAG_ENA -1 |
| 814 | |
Manish Dewangan | fa8a6b6 | 2012-07-09 16:23:27 +0530 | [diff] [blame] | 815 | #define AUDPP_CMD_MBADRC 10 |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 816 | #define AUDPP_MAX_MBADRC_BANDS 5 |
| 817 | #define AUDPP_MBADRC_EXTERNAL_BUF_SIZE 196 |
| 818 | |
| 819 | struct adrc_config { |
| 820 | uint16_t subband_enable; |
| 821 | uint16_t adrc_sub_mute; |
| 822 | uint16_t rms_time; |
| 823 | uint16_t compression_th; |
| 824 | uint16_t compression_slope; |
| 825 | uint16_t attack_const_lsw; |
| 826 | uint16_t attack_const_msw; |
| 827 | uint16_t release_const_lsw; |
| 828 | uint16_t release_const_msw; |
| 829 | uint16_t makeup_gain; |
| 830 | }; |
| 831 | |
| 832 | typedef struct { |
| 833 | audpp_cmd_cfg_object_params_common common; |
| 834 | uint16_t enable; |
| 835 | uint16_t num_bands; |
| 836 | uint16_t down_samp_level; |
| 837 | uint16_t adrc_delay; |
| 838 | uint16_t ext_buf_size; |
| 839 | uint16_t ext_partition; |
| 840 | uint16_t ext_buf_msw; |
| 841 | uint16_t ext_buf_lsw; |
| 842 | struct adrc_config adrc_band[AUDPP_MAX_MBADRC_BANDS]; |
| 843 | } __attribute__((packed)) audpp_cmd_cfg_object_params_mbadrc; |
| 844 | |
| 845 | struct audpp_cmd_cfg_object_params_adrc { |
| 846 | unsigned short adrc_flag; |
| 847 | unsigned short compression_th; |
| 848 | unsigned short compression_slope; |
| 849 | unsigned short rms_time; |
| 850 | unsigned short attack_const_lsw; |
| 851 | unsigned short attack_const_msw; |
| 852 | unsigned short release_const_lsw; |
| 853 | unsigned short release_const_msw; |
| 854 | unsigned short adrc_delay; |
| 855 | }; |
| 856 | |
| 857 | /* |
| 858 | * Command Structure to configure post processing parameters(Spectrum Analizer) |
| 859 | */ |
| 860 | |
Manish Dewangan | fa8a6b6 | 2012-07-09 16:23:27 +0530 | [diff] [blame] | 861 | #define AUDPP_CMD_SPECTROGRAM 4 |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 862 | #define AUDPP_CMD_CFG_OBJECT_PARAMS_SPECTRAM_LEN \ |
| 863 | sizeof(audpp_cmd_cfg_object_params_spectram) |
| 864 | |
| 865 | |
| 866 | typedef struct { |
| 867 | audpp_cmd_cfg_object_params_common common; |
| 868 | unsigned short sample_interval; |
| 869 | unsigned short num_coeff; |
| 870 | } __attribute__((packed)) audpp_cmd_cfg_object_params_spectram; |
| 871 | |
| 872 | /* |
| 873 | * Command Structure to configure post processing parameters (QConcert) |
| 874 | */ |
| 875 | |
Manish Dewangan | fa8a6b6 | 2012-07-09 16:23:27 +0530 | [diff] [blame] | 876 | #define AUDPP_CMD_QCONCERT 5 |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 877 | #define AUDPP_CMD_CFG_OBJECT_PARAMS_QCONCERT_LEN \ |
| 878 | sizeof(audpp_cmd_cfg_object_params_qconcert) |
| 879 | |
| 880 | |
| 881 | #define AUDPP_CMD_QCON_ENA_FLAG_ENA -1 |
| 882 | #define AUDPP_CMD_QCON_ENA_FLAG_DIS 0x0000 |
| 883 | |
| 884 | #define AUDPP_CMD_QCON_OP_MODE_HEADPHONE -1 |
| 885 | #define AUDPP_CMD_QCON_OP_MODE_SPEAKER_FRONT 0x0000 |
| 886 | #define AUDPP_CMD_QCON_OP_MODE_SPEAKER_SIDE 0x0001 |
| 887 | #define AUDPP_CMD_QCON_OP_MODE_SPEAKER_DESKTOP 0x0002 |
| 888 | |
| 889 | #define AUDPP_CMD_QCON_GAIN_UNIT 0x7FFF |
| 890 | #define AUDPP_CMD_QCON_GAIN_SIX_DB 0x4027 |
| 891 | |
| 892 | |
| 893 | #define AUDPP_CMD_QCON_EXPANSION_MAX 0x7FFF |
| 894 | |
| 895 | |
| 896 | typedef struct { |
| 897 | audpp_cmd_cfg_object_params_common common; |
| 898 | signed short enable_flag; |
| 899 | signed short op_mode; |
| 900 | signed short gain; |
| 901 | signed short expansion; |
| 902 | signed short delay; |
| 903 | unsigned short stages_per_mode; |
| 904 | unsigned short reverb_enable; |
| 905 | unsigned short decay_msw; |
| 906 | unsigned short decay_lsw; |
| 907 | unsigned short decay_time_ratio_msw; |
| 908 | unsigned short decay_time_ratio_lsw; |
| 909 | unsigned short reflection_delay_time; |
| 910 | unsigned short late_reverb_gain; |
| 911 | unsigned short late_reverb_delay; |
| 912 | unsigned short delay_buff_size_msw; |
| 913 | unsigned short delay_buff_size_lsw; |
| 914 | unsigned short partition_num; |
| 915 | unsigned short delay_buff_start_msw; |
| 916 | unsigned short delay_buff_start_lsw; |
| 917 | } __attribute__((packed)) audpp_cmd_cfg_object_params_qconcert; |
| 918 | |
| 919 | /* |
| 920 | * Command Structure to configure post processing parameters (Side Chain) |
| 921 | */ |
| 922 | |
Manish Dewangan | fa8a6b6 | 2012-07-09 16:23:27 +0530 | [diff] [blame] | 923 | #define AUDPP_CMD_SIDECHAIN_TUNING_FILTER 6 |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 924 | #define AUDPP_CMD_CFG_OBJECT_PARAMS_SIDECHAIN_LEN \ |
| 925 | sizeof(audpp_cmd_cfg_object_params_sidechain) |
| 926 | |
| 927 | |
| 928 | #define AUDPP_CMD_SIDECHAIN_ACTIVE_FLAG_DIS 0x0000 |
| 929 | #define AUDPP_CMD_SIDECHAIN_ACTIVE_FLAG_ENA -1 |
| 930 | |
| 931 | typedef struct { |
| 932 | audpp_cmd_cfg_object_params_common common; |
| 933 | signed short active_flag; |
| 934 | unsigned short num_bands; |
| 935 | union { |
| 936 | filter_1 filter_1_params; |
| 937 | filter_2 filter_2_params; |
| 938 | filter_3 filter_3_params; |
| 939 | filter_4 filter_4_params; |
| 940 | } __attribute__((packed)) params_filter; |
| 941 | } __attribute__((packed)) audpp_cmd_cfg_object_params_sidechain; |
| 942 | |
| 943 | |
| 944 | /* |
| 945 | * Command Structure to configure post processing parameters (QAFX) |
| 946 | */ |
| 947 | |
Manish Dewangan | fa8a6b6 | 2012-07-09 16:23:27 +0530 | [diff] [blame] | 948 | #define AUDPP_CMD_QAFX 8 |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 949 | #define AUDPP_CMD_CFG_OBJECT_PARAMS_QAFX_LEN \ |
| 950 | sizeof(audpp_cmd_cfg_object_params_qafx) |
| 951 | |
| 952 | #define AUDPP_CMD_QAFX_ENA_DISA 0x0000 |
| 953 | #define AUDPP_CMD_QAFX_ENA_ENA_CFG -1 |
| 954 | #define AUDPP_CMD_QAFX_ENA_DIS_CFG 0x0001 |
| 955 | |
| 956 | #define AUDPP_CMD_QAFX_CMD_TYPE_ENV 0x0100 |
| 957 | #define AUDPP_CMD_QAFX_CMD_TYPE_OBJ 0x0010 |
| 958 | #define AUDPP_CMD_QAFX_CMD_TYPE_QUERY 0x1000 |
| 959 | |
| 960 | #define AUDPP_CMD_QAFX_CMDS_ENV_OP_MODE 0x0100 |
| 961 | #define AUDPP_CMD_QAFX_CMDS_ENV_LIS_POS 0x0101 |
| 962 | #define AUDPP_CMD_QAFX_CMDS_ENV_LIS_ORI 0x0102 |
| 963 | #define AUDPP_CMD_QAFX_CMDS_ENV_LIS_VEL 0X0103 |
| 964 | #define AUDPP_CMD_QAFX_CMDS_ENV_ENV_RES 0x0107 |
| 965 | |
| 966 | #define AUDPP_CMD_QAFX_CMDS_OBJ_SAMP_FREQ 0x0010 |
| 967 | #define AUDPP_CMD_QAFX_CMDS_OBJ_VOL 0x0011 |
| 968 | #define AUDPP_CMD_QAFX_CMDS_OBJ_DIST 0x0012 |
| 969 | #define AUDPP_CMD_QAFX_CMDS_OBJ_POS 0x0013 |
| 970 | #define AUDPP_CMD_QAFX_CMDS_OBJ_VEL 0x0014 |
| 971 | |
| 972 | |
| 973 | typedef struct { |
| 974 | audpp_cmd_cfg_object_params_common common; |
| 975 | signed short enable; |
| 976 | unsigned short command_type; |
| 977 | unsigned short num_commands; |
| 978 | unsigned short commands; |
| 979 | } __attribute__((packed)) audpp_cmd_cfg_object_params_qafx; |
| 980 | |
| 981 | /* |
| 982 | * Command Structure to enable , disable or configure the reverberation effect |
| 983 | * (Common) |
| 984 | */ |
| 985 | |
| 986 | #define AUDPP_CMD_REVERB_CONFIG 0x0001 |
| 987 | #define AUDPP_CMD_REVERB_CONFIG_COMMON_LEN \ |
| 988 | sizeof(audpp_cmd_reverb_config_common) |
| 989 | |
| 990 | #define AUDPP_CMD_ENA_ENA 0xFFFF |
| 991 | #define AUDPP_CMD_ENA_DIS 0x0000 |
| 992 | #define AUDPP_CMD_ENA_CFG 0x0001 |
| 993 | |
| 994 | #define AUDPP_CMD_CMD_TYPE_ENV 0x0104 |
| 995 | #define AUDPP_CMD_CMD_TYPE_OBJ 0x0015 |
| 996 | #define AUDPP_CMD_CMD_TYPE_QUERY 0x1000 |
| 997 | |
Sidipotu Ashok | 3144aa2 | 2012-03-16 10:55:24 +0530 | [diff] [blame] | 998 | #define SRS_PARAMS_MAX_G 8 |
| 999 | #define SRS_PARAMS_MAX_W 55 |
| 1000 | #define SRS_PARAMS_MAX_C 51 |
| 1001 | #define SRS_PARAMS_MAX_H 53 |
| 1002 | #define SRS_PARAMS_MAX_P 116 |
| 1003 | #define SRS_PARAMS_MAX_L 8 |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1004 | |
| 1005 | typedef struct { |
| 1006 | unsigned short cmd_id; |
| 1007 | unsigned short enable; |
| 1008 | unsigned short cmd_type; |
| 1009 | } __attribute__((packed)) audpp_cmd_reverb_config_common; |
| 1010 | |
| 1011 | /* |
| 1012 | * Command Structure to enable , disable or configure the reverberation effect |
| 1013 | * (ENV-0x0104) |
| 1014 | */ |
| 1015 | |
| 1016 | #define AUDPP_CMD_REVERB_CONFIG_ENV_104_LEN \ |
| 1017 | sizeof(audpp_cmd_reverb_config_env_104) |
| 1018 | |
| 1019 | typedef struct { |
| 1020 | audpp_cmd_reverb_config_common common; |
| 1021 | unsigned short env_gain; |
| 1022 | unsigned short decay_msw; |
| 1023 | unsigned short decay_lsw; |
| 1024 | unsigned short decay_timeratio_msw; |
| 1025 | unsigned short decay_timeratio_lsw; |
| 1026 | unsigned short delay_time; |
| 1027 | unsigned short reverb_gain; |
| 1028 | unsigned short reverb_delay; |
| 1029 | } __attribute__((packed)) audpp_cmd_reverb_config_env_104; |
| 1030 | |
| 1031 | /* |
| 1032 | * Command Structure to enable , disable or configure the reverberation effect |
| 1033 | * (ENV-0x0015) |
| 1034 | */ |
| 1035 | |
| 1036 | #define AUDPP_CMD_REVERB_CONFIG_ENV_15_LEN \ |
| 1037 | sizeof(audpp_cmd_reverb_config_env_15) |
| 1038 | |
| 1039 | typedef struct { |
| 1040 | audpp_cmd_reverb_config_common common; |
| 1041 | unsigned short object_num; |
| 1042 | unsigned short absolute_gain; |
| 1043 | } __attribute__((packed)) audpp_cmd_reverb_config_env_15; |
| 1044 | |
Sidipotu Ashok | 3144aa2 | 2012-03-16 10:55:24 +0530 | [diff] [blame] | 1045 | /* |
| 1046 | * Command Structure to configure post processing params (SRS TruMedia) |
| 1047 | */ |
| 1048 | struct audpp_cmd_cfg_object_params_srstm_g { |
| 1049 | audpp_cmd_cfg_object_params_common common; |
| 1050 | unsigned short v[SRS_PARAMS_MAX_G]; |
| 1051 | } __packed; |
| 1052 | struct audpp_cmd_cfg_object_params_srstm_w { |
| 1053 | audpp_cmd_cfg_object_params_common common; |
| 1054 | unsigned short v[SRS_PARAMS_MAX_W]; |
| 1055 | } __packed; |
| 1056 | struct audpp_cmd_cfg_object_params_srstm_c { |
| 1057 | audpp_cmd_cfg_object_params_common common; |
| 1058 | unsigned short v[SRS_PARAMS_MAX_C]; |
| 1059 | } __packed; |
| 1060 | struct audpp_cmd_cfg_object_params_srstm_h { |
| 1061 | audpp_cmd_cfg_object_params_common common; |
| 1062 | unsigned short v[SRS_PARAMS_MAX_H]; |
| 1063 | } __packed; |
| 1064 | struct audpp_cmd_cfg_object_params_srstm_p { |
| 1065 | audpp_cmd_cfg_object_params_common common; |
| 1066 | unsigned short v[SRS_PARAMS_MAX_P]; |
| 1067 | } __packed; |
| 1068 | struct audpp_cmd_cfg_object_params_srstm_l { |
| 1069 | audpp_cmd_cfg_object_params_common common; |
| 1070 | unsigned short v[SRS_PARAMS_MAX_L]; |
| 1071 | } __packed; |
Manish Dewangan | fa8a6b6 | 2012-07-09 16:23:27 +0530 | [diff] [blame] | 1072 | #define AUDPP_CMD_SAMPLING_FREQUENCY 7 |
| 1073 | #define AUDPP_CMD_QRUMBLE 9 |
Sriranjan Srikantam | 87a6c29 | 2013-01-25 16:39:58 +0530 | [diff] [blame] | 1074 | #define AUDPP_CMD_SRS 18 |
| 1075 | #define AUDPP_DISABLE_FEATS_LSW 2 |
| 1076 | #define AUDPP_DISABLE_FEATS_MSW 3 |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1077 | |
| 1078 | #endif /* QDSP5AUDPPCMDI_H */ |
| 1079 | |