Venkat Sudhir | 42a06e1 | 2012-12-13 16:16:05 -0800 | [diff] [blame] | 1 | /* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved. |
Bharath Ramachandramurthy | 2e3168f | 2012-05-03 16:29:09 -0700 | [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 | |
| 13 | |
| 14 | #ifndef _APR_AUDIO_V2_H_ |
| 15 | #define _APR_AUDIO_V2_H_ |
| 16 | |
| 17 | #include <mach/qdsp6v2/apr.h> |
| 18 | |
| 19 | #define ADSP_ADM_VERSION 0x00070000 |
| 20 | |
| 21 | #define ADM_CMD_SHARED_MEM_MAP_REGIONS 0x00010322 |
| 22 | #define ADM_CMDRSP_SHARED_MEM_MAP_REGIONS 0x00010323 |
| 23 | #define ADM_CMD_SHARED_MEM_UNMAP_REGIONS 0x00010324 |
| 24 | |
| 25 | #define ADM_CMD_MATRIX_MAP_ROUTINGS_V5 0x00010325 |
| 26 | |
| 27 | /* Enumeration for an audio Rx matrix ID.*/ |
| 28 | #define ADM_MATRIX_ID_AUDIO_RX 0 |
| 29 | |
| 30 | #define ADM_MATRIX_ID_AUDIO_TX 1 |
| 31 | |
| 32 | /* Enumeration for an audio Tx matrix ID.*/ |
| 33 | #define ADM_MATRIX_ID_AUDIOX 1 |
| 34 | |
| 35 | #define ADM_MAX_COPPS 5 |
| 36 | |
| 37 | |
| 38 | /* Session map node structure. |
| 39 | * Immediately following this structure are num_copps |
| 40 | * entries of COPP IDs. The COPP IDs are 16 bits, so |
| 41 | * there might be a padding 16-bit field if num_copps |
| 42 | * is odd. |
| 43 | */ |
| 44 | struct adm_session_map_node_v5 { |
| 45 | u16 session_id; |
| 46 | /* Handle of the ASM session to be routed. Supported values: 1 |
| 47 | * to 8. |
| 48 | */ |
| 49 | |
| 50 | |
| 51 | u16 num_copps; |
| 52 | /* Number of COPPs to which this session is to be routed. |
| 53 | Supported values: 0 < num_copps <= ADM_MAX_COPPS. |
| 54 | */ |
| 55 | } __packed; |
| 56 | |
| 57 | /* Payload of the #ADM_CMD_MATRIX_MAP_ROUTINGS_V5 command. |
| 58 | * Immediately following this structure are num_sessions of the session map |
| 59 | * node payload (adm_session_map_node_v5). |
| 60 | */ |
| 61 | |
| 62 | struct adm_cmd_matrix_map_routings_v5 { |
| 63 | struct apr_hdr hdr; |
| 64 | |
| 65 | u32 matrix_id; |
| 66 | /* Specifies whether the matrix ID is Audio Rx (0) or Audio Tx |
| 67 | * (1). Use the ADM_MATRIX_ID_AUDIO_RX or ADM_MATRIX_ID_AUDIOX |
| 68 | * macros to set this field. |
| 69 | */ |
| 70 | u32 num_sessions; |
| 71 | /* Number of sessions being updated by this command (optional).*/ |
| 72 | } __packed; |
| 73 | |
| 74 | /* This command allows a client to open a COPP/Voice Proc. TX module |
| 75 | * and sets up the device session: Matrix -> COPP -> AFE on the RX |
| 76 | * and AFE -> COPP -> Matrix on the TX. This enables PCM data to |
| 77 | * be transferred to/from the endpoint (AFEPortID). |
| 78 | * |
| 79 | * @return |
| 80 | * #ADM_CMDRSP_DEVICE_OPEN_V5 with the resulting status and |
| 81 | * COPP ID. |
| 82 | */ |
| 83 | #define ADM_CMD_DEVICE_OPEN_V5 0x00010326 |
| 84 | |
| 85 | /* Indicates that endpoint_id_2 is to be ignored.*/ |
| 86 | #define ADM_CMD_COPP_OPEN_END_POINT_ID_2_IGNORE 0xFFFF |
| 87 | |
| 88 | #define ADM_CMD_COPP_OPEN_MODE_OF_OPERATION_RX_PATH_COPP 1 |
| 89 | |
| 90 | #define ADM_CMD_COPP_OPEN_MODE_OF_OPERATIONX_PATH_LIVE_COPP 2 |
| 91 | |
| 92 | #define ADM_CMD_COPP_OPEN_MODE_OF_OPERATIONX_PATH_NON_LIVE_COPP 3 |
| 93 | |
| 94 | /* Indicates that an audio COPP is to send/receive a mono PCM |
| 95 | * stream to/from |
| 96 | * END_POINT_ID_1. |
| 97 | */ |
| 98 | #define ADM_CMD_COPP_OPEN_CHANNEL_CONFIG_MONO 1 |
| 99 | |
| 100 | /* Indicates that an audio COPP is to send/receive a |
| 101 | * stereo PCM stream to/from END_POINT_ID_1. |
| 102 | */ |
| 103 | #define ADM_CMD_COPP_OPEN_CHANNEL_CONFIG_STEREO 2 |
| 104 | |
| 105 | /* Sample rate is 8000 Hz.*/ |
| 106 | #define ADM_CMD_COPP_OPEN_SAMPLE_RATE_8K 8000 |
| 107 | |
| 108 | /* Sample rate is 16000 Hz.*/ |
| 109 | #define ADM_CMD_COPP_OPEN_SAMPLE_RATE_16K 16000 |
| 110 | |
| 111 | /* Sample rate is 48000 Hz.*/ |
| 112 | #define ADM_CMD_COPP_OPEN_SAMPLE_RATE_48K 48000 |
| 113 | |
| 114 | /* Definition for a COPP live input flag bitmask.*/ |
| 115 | #define ADM_BIT_MASK_COPP_LIVE_INPUT_FLAG (0x0001U) |
| 116 | |
| 117 | /* Definition for a COPP live shift value bitmask.*/ |
| 118 | #define ADM_SHIFT_COPP_LIVE_INPUT_FLAG 0 |
| 119 | |
| 120 | /* Definition for the COPP ID bitmask.*/ |
| 121 | #define ADM_BIT_MASK_COPP_ID (0x0000FFFFUL) |
| 122 | |
| 123 | /* Definition for the COPP ID shift value.*/ |
| 124 | #define ADM_SHIFT_COPP_ID 0 |
| 125 | |
| 126 | /* Definition for the service ID bitmask.*/ |
| 127 | #define ADM_BIT_MASK_SERVICE_ID (0x00FF0000UL) |
| 128 | |
| 129 | /* Definition for the service ID shift value.*/ |
| 130 | #define ADM_SHIFT_SERVICE_ID 16 |
| 131 | |
| 132 | /* Definition for the domain ID bitmask.*/ |
| 133 | #define ADM_BIT_MASK_DOMAIN_ID (0xFF000000UL) |
| 134 | |
| 135 | /* Definition for the domain ID shift value.*/ |
| 136 | #define ADM_SHIFT_DOMAIN_ID 24 |
| 137 | |
| 138 | /* ADM device open command payload of the |
| 139 | #ADM_CMD_DEVICE_OPEN_V5 command. |
| 140 | */ |
| 141 | struct adm_cmd_device_open_v5 { |
| 142 | struct apr_hdr hdr; |
| 143 | u16 flags; |
| 144 | /* Reserved for future use. Clients must set this field |
| 145 | * to zero. |
| 146 | */ |
| 147 | |
| 148 | u16 mode_of_operation; |
| 149 | /* Specifies whether the COPP must be opened on the Tx or Rx |
| 150 | * path. Use the ADM_CMD_COPP_OPEN_MODE_OF_OPERATION_* macros for |
| 151 | * supported values and interpretation. |
| 152 | * Supported values: |
| 153 | * - 0x1 -- Rx path COPP |
| 154 | * - 0x2 -- Tx path live COPP |
| 155 | * - 0x3 -- Tx path nonlive COPP |
| 156 | * Live connections cause sample discarding in the Tx device |
| 157 | * matrix if the destination output ports do not pull them |
| 158 | * fast enough. Nonlive connections queue the samples |
| 159 | * indefinitely. |
| 160 | */ |
| 161 | |
| 162 | u16 endpoint_id_1; |
| 163 | /* Logical and physical endpoint ID of the audio path. |
| 164 | * If the ID is a voice processor Tx block, it receives near |
| 165 | * samples. Supported values: Any pseudoport, AFE Rx port, |
| 166 | * or AFE Tx port For a list of valid IDs, refer to |
| 167 | * @xhyperref{Q4,[Q4]}. |
| 168 | * Q4 = Hexagon Multimedia: AFE Interface Specification |
| 169 | */ |
| 170 | |
| 171 | u16 endpoint_id_2; |
| 172 | /* Logical and physical endpoint ID 2 for a voice processor |
| 173 | * Tx block. |
| 174 | * This is not applicable to audio COPP. |
| 175 | * Supported values: |
| 176 | * - AFE Rx port |
| 177 | * - 0xFFFF -- Endpoint 2 is unavailable and the voice |
| 178 | * processor Tx |
| 179 | * block ignores this endpoint |
| 180 | * When the voice processor Tx block is created on the audio |
| 181 | * record path, |
| 182 | * it can receive far-end samples from an AFE Rx port if the |
| 183 | * voice call |
| 184 | * is active. The ID of the AFE port is provided in this |
| 185 | * field. |
| 186 | * For a list of valid IDs, refer @xhyperref{Q4,[Q4]}. |
| 187 | */ |
| 188 | |
| 189 | u32 topology_id; |
| 190 | /* Audio COPP topology ID; 32-bit GUID. */ |
| 191 | |
| 192 | u16 dev_num_channel; |
| 193 | /* Number of channels the audio COPP sends to/receives from |
| 194 | * the endpoint. |
| 195 | * Supported values: 1 to 8. |
| 196 | * The value is ignored for the voice processor Tx block, |
| 197 | * where channel |
| 198 | * configuration is derived from the topology ID. |
| 199 | */ |
| 200 | |
| 201 | u16 bit_width; |
| 202 | /* Bit width (in bits) that the audio COPP sends to/receives |
| 203 | * from the |
| 204 | * endpoint. The value is ignored for the voice processing |
| 205 | * Tx block, |
| 206 | * where the PCM width is 16 bits. |
| 207 | */ |
| 208 | |
| 209 | u32 sample_rate; |
| 210 | /* Sampling rate at which the audio COPP/voice processor |
| 211 | * Tx block |
| 212 | * interfaces with the endpoint. |
| 213 | * Supported values for voice processor Tx: 8000, 16000, |
| 214 | * 48000 Hz |
| 215 | * Supported values for audio COPP: >0 and <=192 kHz |
| 216 | */ |
| 217 | |
| 218 | u8 dev_channel_mapping[8]; |
| 219 | /* Array of channel mapping of buffers that the audio COPP |
| 220 | * sends to the endpoint. Channel[i] mapping describes channel |
| 221 | * I inside the buffer, where 0 < i < dev_num_channel. |
| 222 | * This value is relevent only for an audio Rx COPP. |
| 223 | * For the voice processor block and Tx audio block, this field |
| 224 | * is set to zero and is ignored. |
| 225 | */ |
| 226 | } __packed; |
| 227 | |
| 228 | /* |
| 229 | * This command allows the client to close a COPP and disconnect |
| 230 | * the device session. |
| 231 | */ |
| 232 | #define ADM_CMD_DEVICE_CLOSE_V5 0x00010327 |
| 233 | |
| 234 | /* Sets one or more parameters to a COPP. |
| 235 | */ |
| 236 | #define ADM_CMD_SET_PP_PARAMS_V5 0x00010328 |
| 237 | |
| 238 | /* Payload of the #ADM_CMD_SET_PP_PARAMS_V5 command. |
| 239 | * If the data_payload_addr_lsw and data_payload_addr_msw element |
| 240 | * are NULL, a series of adm_param_datastructures immediately |
| 241 | * follows, whose total size is data_payload_size bytes. |
| 242 | */ |
| 243 | struct adm_cmd_set_pp_params_v5 { |
| 244 | struct apr_hdr hdr; |
Ben Romberger | 2245fc3 | 2012-09-19 14:11:27 -0700 | [diff] [blame] | 245 | u32 payload_addr_lsw; |
Bharath Ramachandramurthy | 2e3168f | 2012-05-03 16:29:09 -0700 | [diff] [blame] | 246 | /* LSW of parameter data payload address.*/ |
Ben Romberger | 2245fc3 | 2012-09-19 14:11:27 -0700 | [diff] [blame] | 247 | u32 payload_addr_msw; |
Bharath Ramachandramurthy | 2e3168f | 2012-05-03 16:29:09 -0700 | [diff] [blame] | 248 | /* MSW of parameter data payload address.*/ |
| 249 | |
Ben Romberger | 2245fc3 | 2012-09-19 14:11:27 -0700 | [diff] [blame] | 250 | u32 mem_map_handle; |
Bharath Ramachandramurthy | 2e3168f | 2012-05-03 16:29:09 -0700 | [diff] [blame] | 251 | /* Memory map handle returned by ADM_CMD_SHARED_MEM_MAP_REGIONS |
| 252 | * command */ |
| 253 | /* If mem_map_handle is zero implies the message is in |
| 254 | * the payload */ |
| 255 | |
Ben Romberger | 2245fc3 | 2012-09-19 14:11:27 -0700 | [diff] [blame] | 256 | u32 payload_size; |
Bharath Ramachandramurthy | 2e3168f | 2012-05-03 16:29:09 -0700 | [diff] [blame] | 257 | /* Size in bytes of the variable payload accompanying this |
| 258 | * message or |
| 259 | * in shared memory. This is used for parsing the parameter |
| 260 | * payload. |
| 261 | */ |
| 262 | } __packed; |
| 263 | |
| 264 | /* Payload format for COPP parameter data. |
| 265 | * Immediately following this structure are param_size bytes |
| 266 | * of parameter |
| 267 | * data. |
| 268 | */ |
| 269 | struct adm_param_data_v5 { |
| 270 | u32 module_id; |
| 271 | /* Unique ID of the module. */ |
| 272 | u32 param_id; |
| 273 | /* Unique ID of the parameter. */ |
| 274 | u16 param_size; |
| 275 | /* Data size of the param_id/module_id combination. |
| 276 | This value is a |
| 277 | multiple of 4 bytes. */ |
| 278 | u16 reserved; |
| 279 | /* Reserved for future enhancements. |
| 280 | * This field must be set to zero. |
| 281 | */ |
| 282 | } __packed; |
| 283 | |
Ben Romberger | 564493d | 2012-12-04 20:48:28 -0800 | [diff] [blame] | 284 | /* Defined specifically for in-band use, includes params */ |
| 285 | struct adm_cmd_set_pp_params_inband_v5 { |
| 286 | struct apr_hdr hdr; |
| 287 | /* LSW of parameter data payload address.*/ |
| 288 | u32 payload_addr_lsw; |
| 289 | /* MSW of parameter data payload address.*/ |
| 290 | u32 payload_addr_msw; |
| 291 | /* Memory map handle returned by ADM_CMD_SHARED_MEM_MAP_REGIONS */ |
| 292 | /* command. If mem_map_handle is zero implies the message is in */ |
| 293 | /* the payload */ |
| 294 | u32 mem_map_handle; |
| 295 | /* Size in bytes of the variable payload accompanying this */ |
| 296 | /* message or in shared memory. This is used for parsing the */ |
| 297 | /* parameter payload. */ |
| 298 | u32 payload_size; |
| 299 | /* Parameters passed for in band payload */ |
| 300 | struct adm_param_data_v5 params; |
| 301 | } __packed; |
| 302 | |
| 303 | |
Bharath Ramachandramurthy | 2e3168f | 2012-05-03 16:29:09 -0700 | [diff] [blame] | 304 | /* Returns the status and COPP ID to an #ADM_CMD_DEVICE_OPEN_V5 command. |
| 305 | */ |
| 306 | #define ADM_CMDRSP_DEVICE_OPEN_V5 0x00010329 |
| 307 | |
| 308 | /* Payload of the #ADM_CMDRSP_DEVICE_OPEN_V5 message, |
| 309 | * which returns the |
| 310 | * status and COPP ID to an #ADM_CMD_DEVICE_OPEN_V5 command. |
| 311 | */ |
| 312 | struct adm_cmd_rsp_device_open_v5 { |
| 313 | u32 status; |
| 314 | /* Status message (error code).*/ |
| 315 | |
| 316 | u16 copp_id; |
| 317 | /* COPP ID: Supported values: 0 <= copp_id < ADM_MAX_COPPS*/ |
| 318 | |
| 319 | u16 reserved; |
| 320 | /* Reserved. This field must be set to zero.*/ |
| 321 | } __packed; |
| 322 | |
| 323 | /* This command allows a query of one COPP parameter. |
| 324 | */ |
| 325 | #define ADM_CMD_GET_PP_PARAMS_V5 0x0001032A |
| 326 | |
| 327 | /* Payload an #ADM_CMD_GET_PP_PARAMS_V5 command. |
| 328 | */ |
| 329 | struct adm_cmd_get_pp_params_v5 { |
| 330 | u32 data_payload_addr_lsw; |
| 331 | /* LSW of parameter data payload address.*/ |
| 332 | |
| 333 | u32 data_payload_addr_msw; |
| 334 | /* MSW of parameter data payload address.*/ |
| 335 | |
| 336 | /* If the mem_map_handle is non zero, |
| 337 | * on ACK, the ParamData payloads begin at |
| 338 | * the address specified (out-of-band). |
| 339 | */ |
| 340 | |
| 341 | u32 mem_map_handle; |
| 342 | /* Memory map handle returned |
| 343 | * by ADM_CMD_SHARED_MEM_MAP_REGIONS command. |
| 344 | * If the mem_map_handle is 0, it implies that |
| 345 | * the ACK's payload will contain the ParamData (in-band). |
| 346 | */ |
| 347 | |
| 348 | u32 module_id; |
| 349 | /* Unique ID of the module. */ |
| 350 | |
| 351 | u32 param_id; |
| 352 | /* Unique ID of the parameter. */ |
| 353 | |
| 354 | u16 param_max_size; |
| 355 | /* Maximum data size of the parameter |
| 356 | *ID/module ID combination. This |
| 357 | * field is a multiple of 4 bytes. |
| 358 | */ |
| 359 | u16 reserved; |
| 360 | /* Reserved for future enhancements. |
| 361 | * This field must be set to zero. |
| 362 | */ |
| 363 | } __packed; |
| 364 | |
| 365 | /* Returns parameter values |
| 366 | * in response to an #ADM_CMD_GET_PP_PARAMS_V5 command. |
| 367 | */ |
| 368 | #define ADM_CMDRSP_GET_PP_PARAMS_V5 0x0001032B |
| 369 | |
| 370 | /* Payload of the #ADM_CMDRSP_GET_PP_PARAMS_V5 message, |
| 371 | * which returns parameter values in response |
| 372 | * to an #ADM_CMD_GET_PP_PARAMS_V5 command. |
| 373 | * Immediately following this |
| 374 | * structure is the adm_param_data_v5 |
| 375 | * structure containing the pre/postprocessing |
| 376 | * parameter data. For an in-band |
| 377 | * scenario, the variable payload depends |
| 378 | * on the size of the parameter. |
| 379 | */ |
| 380 | struct adm_cmd_rsp_get_pp_params_v5 { |
| 381 | u32 status; |
| 382 | /* Status message (error code).*/ |
| 383 | } __packed; |
| 384 | |
| 385 | /* Allows a client to control the gains on various session-to-COPP paths. |
| 386 | */ |
| 387 | #define ADM_CMD_MATRIX_RAMP_GAINS_V5 0x0001032C |
| 388 | |
| 389 | /* Indicates that the target gain in the |
| 390 | * current adm_session_copp_gain_v5 |
| 391 | * structure is to be applied to all |
| 392 | * the session-to-COPP paths that exist for |
| 393 | * the specified session. |
| 394 | */ |
| 395 | #define ADM_CMD_MATRIX_RAMP_GAINS_COPP_ID_ALL_CONNECTED_COPPS 0xFFFF |
| 396 | |
| 397 | /* Indicates that the target gain is |
| 398 | * to be immediately applied to the |
| 399 | * specified session-to-COPP path, |
| 400 | * without a ramping fashion. |
| 401 | */ |
| 402 | #define ADM_CMD_MATRIX_RAMP_GAINS_RAMP_DURATION_IMMEDIATE 0x0000 |
| 403 | |
| 404 | /* Enumeration for a linear ramping curve.*/ |
| 405 | #define ADM_CMD_MATRIX_RAMP_GAINS_RAMP_CURVE_LINEAR 0x0000 |
| 406 | |
| 407 | /* Payload of the #ADM_CMD_MATRIX_RAMP_GAINS_V5 command. |
| 408 | * Immediately following this structure are num_gains of the |
| 409 | * adm_session_copp_gain_v5structure. |
| 410 | */ |
| 411 | struct adm_cmd_matrix_ramp_gains_v5 { |
| 412 | u32 matrix_id; |
| 413 | /* Specifies whether the matrix ID is Audio Rx (0) or Audio Tx (1). |
| 414 | * Use the ADM_MATRIX_ID_AUDIO_RX or ADM_MATRIX_ID_AUDIOX |
| 415 | * macros to set this field. |
| 416 | */ |
| 417 | |
| 418 | u16 num_gains; |
| 419 | /* Number of gains being applied. */ |
| 420 | |
| 421 | u16 reserved_for_align; |
| 422 | /* Reserved. This field must be set to zero.*/ |
| 423 | } __packed; |
| 424 | |
| 425 | /* Session-to-COPP path gain structure, used by the |
| 426 | * #ADM_CMD_MATRIX_RAMP_GAINS_V5 command. |
| 427 | * This structure specifies the target |
| 428 | * gain (per channel) that must be applied |
| 429 | * to a particular session-to-COPP path in |
| 430 | * the audio matrix. The structure can |
| 431 | * also be used to apply the gain globally |
| 432 | * to all session-to-COPP paths that |
| 433 | * exist for the given session. |
| 434 | * The aDSP uses device channel mapping to |
| 435 | * determine which channel gains to |
| 436 | * use from this command. For example, |
| 437 | * if the device is configured as stereo, |
| 438 | * the aDSP uses only target_gain_ch_1 and |
| 439 | * target_gain_ch_2, and it ignores |
| 440 | * the others. |
| 441 | */ |
| 442 | struct adm_session_copp_gain_v5 { |
| 443 | u16 session_id; |
| 444 | /* Handle of the ASM session. |
| 445 | * Supported values: 1 to 8. |
| 446 | */ |
| 447 | |
| 448 | u16 copp_id; |
| 449 | /* Handle of the COPP. Gain will be applied on the Session ID |
| 450 | * COPP ID path. |
| 451 | */ |
| 452 | |
| 453 | u16 ramp_duration; |
| 454 | /* Duration (in milliseconds) of the ramp over |
| 455 | * which target gains are |
| 456 | * to be applied. Use |
| 457 | * #ADM_CMD_MATRIX_RAMP_GAINS_RAMP_DURATION_IMMEDIATE |
| 458 | * to indicate that gain must be applied immediately. |
| 459 | */ |
| 460 | |
| 461 | u16 step_duration; |
| 462 | /* Duration (in milliseconds) of each step in the ramp. |
| 463 | * This parameter is ignored if ramp_duration is equal to |
| 464 | * #ADM_CMD_MATRIX_RAMP_GAINS_RAMP_DURATION_IMMEDIATE. |
| 465 | * Supported value: 1 |
| 466 | */ |
| 467 | |
| 468 | u16 ramp_curve; |
| 469 | /* Type of ramping curve. |
| 470 | * Supported value: #ADM_CMD_MATRIX_RAMP_GAINS_RAMP_CURVE_LINEAR |
| 471 | */ |
| 472 | |
| 473 | u16 reserved_for_align; |
| 474 | /* Reserved. This field must be set to zero. */ |
| 475 | |
| 476 | u16 target_gain_ch_1; |
| 477 | /* Target linear gain for channel 1 in Q13 format; */ |
| 478 | |
| 479 | u16 target_gain_ch_2; |
| 480 | /* Target linear gain for channel 2 in Q13 format; */ |
| 481 | |
| 482 | u16 target_gain_ch_3; |
| 483 | /* Target linear gain for channel 3 in Q13 format; */ |
| 484 | |
| 485 | u16 target_gain_ch_4; |
| 486 | /* Target linear gain for channel 4 in Q13 format; */ |
| 487 | |
| 488 | u16 target_gain_ch_5; |
| 489 | /* Target linear gain for channel 5 in Q13 format; */ |
| 490 | |
| 491 | u16 target_gain_ch_6; |
| 492 | /* Target linear gain for channel 6 in Q13 format; */ |
| 493 | |
| 494 | u16 target_gain_ch_7; |
| 495 | /* Target linear gain for channel 7 in Q13 format; */ |
| 496 | |
| 497 | u16 target_gain_ch_8; |
| 498 | /* Target linear gain for channel 8 in Q13 format; */ |
| 499 | } __packed; |
| 500 | |
| 501 | /* Allows to set mute/unmute on various session-to-COPP paths. |
| 502 | * For every session-to-COPP path (stream-device interconnection), |
| 503 | * mute/unmute can be set individually on the output channels. |
| 504 | */ |
| 505 | #define ADM_CMD_MATRIX_MUTE_V5 0x0001032D |
| 506 | |
| 507 | /* Indicates that mute/unmute in the |
| 508 | * current adm_session_copp_mute_v5structure |
| 509 | * is to be applied to all the session-to-COPP |
| 510 | * paths that exist for the specified session. |
| 511 | */ |
| 512 | #define ADM_CMD_MATRIX_MUTE_COPP_ID_ALL_CONNECTED_COPPS 0xFFFF |
| 513 | |
| 514 | /* Payload of the #ADM_CMD_MATRIX_MUTE_V5 command*/ |
| 515 | struct adm_cmd_matrix_mute_v5 { |
| 516 | u32 matrix_id; |
| 517 | /* Specifies whether the matrix ID is Audio Rx (0) or Audio Tx (1). |
| 518 | * Use the ADM_MATRIX_ID_AUDIO_RX or ADM_MATRIX_ID_AUDIOX |
| 519 | * macros to set this field. |
| 520 | */ |
| 521 | |
| 522 | u16 session_id; |
| 523 | /* Handle of the ASM session. |
| 524 | * Supported values: 1 to 8. |
| 525 | */ |
| 526 | |
| 527 | u16 copp_id; |
| 528 | /* Handle of the COPP. |
| 529 | * Use ADM_CMD_MATRIX_MUTE_COPP_ID_ALL_CONNECTED_COPPS |
| 530 | * to indicate that mute/unmute must be applied to |
| 531 | * all the COPPs connected to session_id. |
| 532 | * Supported values: |
| 533 | * - 0xFFFF -- Apply mute/unmute to all connected COPPs |
| 534 | * - Other values -- Valid COPP ID |
| 535 | */ |
| 536 | |
| 537 | u8 mute_flag_ch_1; |
| 538 | /* Mute flag for channel 1 is set to unmute (0) or mute (1). */ |
| 539 | |
| 540 | u8 mute_flag_ch_2; |
| 541 | /* Mute flag for channel 2 is set to unmute (0) or mute (1). */ |
| 542 | |
| 543 | u8 mute_flag_ch_3; |
| 544 | /* Mute flag for channel 3 is set to unmute (0) or mute (1). */ |
| 545 | |
| 546 | u8 mute_flag_ch_4; |
| 547 | /* Mute flag for channel 4 is set to unmute (0) or mute (1). */ |
| 548 | |
| 549 | u8 mute_flag_ch_5; |
| 550 | /* Mute flag for channel 5 is set to unmute (0) or mute (1). */ |
| 551 | |
| 552 | u8 mute_flag_ch_6; |
| 553 | /* Mute flag for channel 6 is set to unmute (0) or mute (1). */ |
| 554 | |
| 555 | u8 mute_flag_ch_7; |
| 556 | /* Mute flag for channel 7 is set to unmute (0) or mute (1). */ |
| 557 | |
| 558 | u8 mute_flag_ch_8; |
| 559 | /* Mute flag for channel 8 is set to unmute (0) or mute (1). */ |
| 560 | |
| 561 | u16 ramp_duration; |
| 562 | /* Period (in milliseconds) over which the soft mute/unmute will be |
| 563 | * applied. |
| 564 | * Supported values: 0 (Default) to 0xFFFF |
| 565 | * The default of 0 means mute/unmute will be applied immediately. |
| 566 | */ |
| 567 | |
| 568 | u16 reserved_for_align; |
| 569 | /* Clients must set this field to zero.*/ |
| 570 | } __packed; |
| 571 | |
| 572 | /* Allows a client to connect the desired stream to |
| 573 | * the desired AFE port through the stream router |
| 574 | * |
| 575 | * This command allows the client to connect specified session to |
| 576 | * specified AFE port. This is used for compressed streams only |
| 577 | * opened using the #ASM_STREAM_CMD_OPEN_WRITE_COMPRESSED or |
| 578 | * #ASM_STREAM_CMD_OPEN_READ_COMPRESSED command. |
| 579 | * |
| 580 | * @prerequisites |
| 581 | * Session ID and AFE Port ID must be valid. |
| 582 | * #ASM_STREAM_CMD_OPEN_WRITE_COMPRESSED or |
| 583 | * #ASM_STREAM_CMD_OPEN_READ_COMPRESSED |
| 584 | * must have been called on this session. |
| 585 | */ |
| 586 | |
| 587 | #define ADM_CMD_CONNECT_AFE_PORT_V5 0x0001032E |
| 588 | #define ADM_CMD_DISCONNECT_AFE_PORT_V5 0x0001032F |
| 589 | /* Enumeration for the Rx stream router ID.*/ |
| 590 | #define ADM_STRTR_ID_RX 0 |
| 591 | /* Enumeration for the Tx stream router ID.*/ |
| 592 | #define ADM_STRTR_IDX 1 |
| 593 | |
| 594 | /* Payload of the #ADM_CMD_CONNECT_AFE_PORT_V5 command.*/ |
| 595 | struct adm_cmd_connect_afe_port_v5 { |
Joonwoo Park | 6572ac5 | 2012-07-10 17:17:00 -0700 | [diff] [blame] | 596 | struct apr_hdr hdr; |
Bharath Ramachandramurthy | 2e3168f | 2012-05-03 16:29:09 -0700 | [diff] [blame] | 597 | u8 mode; |
| 598 | /* ID of the stream router (RX/TX). Use the |
| 599 | * ADM_STRTR_ID_RX or ADM_STRTR_IDX macros |
| 600 | * to set this field. |
| 601 | */ |
| 602 | |
| 603 | u8 session_id; |
| 604 | /* Session ID of the stream to connect */ |
| 605 | |
| 606 | u16 afe_port_id; |
| 607 | /* Port ID of the AFE port to connect to.*/ |
| 608 | u32 num_channels; |
| 609 | /* Number of device channels |
| 610 | * Supported values: 2(Audio Sample Packet), |
| 611 | * 8 (HBR Audio Stream Sample Packet) |
| 612 | */ |
| 613 | |
| 614 | u32 sampling_rate; |
| 615 | /* Device sampling rate |
| 616 | * Supported values: Any |
| 617 | */ |
| 618 | } __packed; |
| 619 | |
| 620 | |
| 621 | /* adsp_adm_api.h */ |
| 622 | |
| 623 | |
| 624 | /* Port ID. Update afe_get_port_index |
| 625 | * when a new port is added here. */ |
| 626 | #define PRIMARY_I2S_RX 0 /* index = 0 */ |
| 627 | #define PRIMARY_I2S_TX 1 /* index = 1 */ |
| 628 | #define PCM_RX 2 /* index = 2 */ |
| 629 | #define PCM_TX 3 /* index = 3 */ |
| 630 | #define SECONDARY_I2S_RX 4 /* index = 4 */ |
| 631 | #define SECONDARY_I2S_TX 5 /* index = 5 */ |
| 632 | #define MI2S_RX 6 /* index = 6 */ |
| 633 | #define MI2S_TX 7 /* index = 7 */ |
| 634 | #define HDMI_RX 8 /* index = 8 */ |
| 635 | #define RSVD_2 9 /* index = 9 */ |
| 636 | #define RSVD_3 10 /* index = 10 */ |
| 637 | #define DIGI_MIC_TX 11 /* index = 11 */ |
| 638 | #define VOICE_RECORD_RX 0x8003 /* index = 12 */ |
| 639 | #define VOICE_RECORD_TX 0x8004 /* index = 13 */ |
| 640 | #define VOICE_PLAYBACK_TX 0x8005 /* index = 14 */ |
| 641 | |
| 642 | /* Slimbus Multi channel port id pool */ |
| 643 | #define SLIMBUS_0_RX 0x4000 /* index = 15 */ |
| 644 | #define SLIMBUS_0_TX 0x4001 /* index = 16 */ |
| 645 | #define SLIMBUS_1_RX 0x4002 /* index = 17 */ |
| 646 | #define SLIMBUS_1_TX 0x4003 /* index = 18 */ |
| 647 | #define SLIMBUS_2_RX 0x4004 |
| 648 | #define SLIMBUS_2_TX 0x4005 |
| 649 | #define SLIMBUS_3_RX 0x4006 |
| 650 | #define SLIMBUS_3_TX 0x4007 |
| 651 | #define SLIMBUS_4_RX 0x4008 |
| 652 | #define SLIMBUS_4_TX 0x4009 /* index = 24 */ |
| 653 | #define INT_BT_SCO_RX 0x3000 /* index = 25 */ |
| 654 | #define INT_BT_SCO_TX 0x3001 /* index = 26 */ |
| 655 | #define INT_BT_A2DP_RX 0x3002 /* index = 27 */ |
| 656 | #define INT_FM_RX 0x3004 /* index = 28 */ |
| 657 | #define INT_FM_TX 0x3005 /* index = 29 */ |
| 658 | #define RT_PROXY_PORT_001_RX 0x2000 /* index = 30 */ |
| 659 | #define RT_PROXY_PORT_001_TX 0x2001 /* index = 31 */ |
| 660 | |
| 661 | #define AFE_PORT_INVALID 0xFFFF |
| 662 | #define SLIMBUS_INVALID AFE_PORT_INVALID |
| 663 | |
| 664 | #define AFE_PORT_CMD_START 0x000100ca |
| 665 | |
| 666 | #define AFE_EVENT_RTPORT_START 0 |
| 667 | #define AFE_EVENT_RTPORT_STOP 1 |
| 668 | #define AFE_EVENT_RTPORT_LOW_WM 2 |
| 669 | #define AFE_EVENT_RTPORT_HI_WM 3 |
| 670 | |
| 671 | #define ADSP_AFE_VERSION 0x00200000 |
| 672 | |
| 673 | /* Size of the range of port IDs for the audio interface. */ |
| 674 | #define AFE_PORT_ID_AUDIO_IF_PORT_RANGE_SIZE 0xF |
| 675 | |
| 676 | /* Size of the range of port IDs for internal BT-FM ports. */ |
| 677 | #define AFE_PORT_ID_INTERNAL_BT_FM_RANGE_SIZE 0x6 |
| 678 | |
| 679 | /* Size of the range of port IDs for SLIMbus<sup>® |
| 680 | * </sup> multichannel |
| 681 | * ports. |
| 682 | */ |
| 683 | #define AFE_PORT_ID_SLIMBUS_RANGE_SIZE 0xA |
| 684 | |
| 685 | /* Size of the range of port IDs for real-time proxy ports. */ |
| 686 | #define AFE_PORT_ID_RT_PROXY_PORT_RANGE_SIZE 0x2 |
| 687 | |
| 688 | /* Size of the range of port IDs for pseudoports. */ |
| 689 | #define AFE_PORT_ID_PSEUDOPORT_RANGE_SIZE 0x5 |
| 690 | |
| 691 | /* Start of the range of port IDs for the audio interface. */ |
| 692 | #define AFE_PORT_ID_AUDIO_IF_PORT_RANGE_START 0x1000 |
| 693 | |
| 694 | /* End of the range of port IDs for the audio interface. */ |
| 695 | #define AFE_PORT_ID_AUDIO_IF_PORT_RANGE_END \ |
| 696 | (AFE_PORT_ID_AUDIO_IF_PORT_RANGE_START +\ |
| 697 | AFE_PORT_ID_AUDIO_IF_PORT_RANGE_SIZE - 1) |
| 698 | |
| 699 | /* Start of the range of port IDs for real-time proxy ports. */ |
| 700 | #define AFE_PORT_ID_RT_PROXY_PORT_RANGE_START 0x2000 |
| 701 | |
| 702 | /* End of the range of port IDs for real-time proxy ports. */ |
| 703 | #define AFE_PORT_ID_RT_PROXY_PORT_RANGE_END \ |
| 704 | (AFE_PORT_ID_RT_PROXY_PORT_RANGE_START +\ |
| 705 | AFE_PORT_ID_RT_PROXY_PORT_RANGE_SIZE-1) |
| 706 | |
| 707 | /* Start of the range of port IDs for internal BT-FM devices. */ |
| 708 | #define AFE_PORT_ID_INTERNAL_BT_FM_RANGE_START 0x3000 |
| 709 | |
| 710 | /* End of the range of port IDs for internal BT-FM devices. */ |
| 711 | #define AFE_PORT_ID_INTERNAL_BT_FM_RANGE_END \ |
| 712 | (AFE_PORT_ID_INTERNAL_BT_FM_RANGE_START +\ |
| 713 | AFE_PORT_ID_INTERNAL_BT_FM_RANGE_SIZE-1) |
| 714 | |
| 715 | /* Start of the range of port IDs for SLIMbus devices. */ |
| 716 | #define AFE_PORT_ID_SLIMBUS_RANGE_START 0x4000 |
| 717 | |
| 718 | /* End of the range of port IDs for SLIMbus devices. */ |
| 719 | #define AFE_PORT_ID_SLIMBUS_RANGE_END \ |
| 720 | (AFE_PORT_ID_SLIMBUS_RANGE_START +\ |
| 721 | AFE_PORT_ID_SLIMBUS_RANGE_SIZE-1) |
| 722 | |
| 723 | /* Start of the range of port IDs for pseudoports. */ |
| 724 | #define AFE_PORT_ID_PSEUDOPORT_RANGE_START 0x8001 |
| 725 | |
| 726 | /* End of the range of port IDs for pseudoports. */ |
| 727 | #define AFE_PORT_ID_PSEUDOPORT_RANGE_END \ |
| 728 | (AFE_PORT_ID_PSEUDOPORT_RANGE_START +\ |
| 729 | AFE_PORT_ID_PSEUDOPORT_RANGE_SIZE-1) |
| 730 | |
| 731 | #define AFE_PORT_ID_PRIMARY_MI2S_RX 0x1000 |
| 732 | #define AFE_PORT_ID_PRIMARY_MI2S_TX 0x1001 |
| 733 | #define AFE_PORT_ID_SECONDARY_MI2S_RX 0x1002 |
| 734 | #define AFE_PORT_ID_SECONDARY_MI2S_TX 0x1003 |
Kiran Kandi | 3648bde | 2012-11-16 09:49:01 -0800 | [diff] [blame] | 735 | #define AFE_PORT_ID_TERTIARY_MI2S_RX 0x1004 |
| 736 | #define AFE_PORT_ID_TERTIARY_MI2S_TX 0x1005 |
Bharath Ramachandramurthy | 2e3168f | 2012-05-03 16:29:09 -0700 | [diff] [blame] | 737 | #define AFE_PORT_ID_QUATERNARY_MI2S_RX 0x1006 |
| 738 | #define AFE_PORT_ID_QUATERNARY_MI2S_TX 0x1007 |
| 739 | #define AUDIO_PORT_ID_I2S_RX 0x1008 |
| 740 | #define AFE_PORT_ID_DIGITAL_MIC_TX 0x1009 |
| 741 | #define AFE_PORT_ID_PRIMARY_PCM_RX 0x100A |
| 742 | #define AFE_PORT_ID_PRIMARY_PCM_TX 0x100B |
| 743 | #define AFE_PORT_ID_SECONDARY_PCM_RX 0x100C |
| 744 | #define AFE_PORT_ID_SECONDARY_PCM_TX 0x100D |
| 745 | #define AFE_PORT_ID_MULTICHAN_HDMI_RX 0x100E |
| 746 | #define AFE_PORT_ID_RT_PROXY_PORT_001_RX 0x2000 |
| 747 | #define AFE_PORT_ID_RT_PROXY_PORT_001_TX 0x2001 |
| 748 | #define AFE_PORT_ID_INTERNAL_BT_SCO_RX 0x3000 |
| 749 | #define AFE_PORT_ID_INTERNAL_BT_SCO_TX 0x3001 |
| 750 | #define AFE_PORT_ID_INTERNAL_BT_A2DP_RX 0x3002 |
| 751 | #define AFE_PORT_ID_INTERNAL_FM_RX 0x3004 |
| 752 | #define AFE_PORT_ID_INTERNAL_FM_TX 0x3005 |
| 753 | /* SLIMbus Rx port on channel 0. */ |
| 754 | #define AFE_PORT_ID_SLIMBUS_MULTI_CHAN_0_RX 0x4000 |
| 755 | /* SLIMbus Tx port on channel 0. */ |
| 756 | #define AFE_PORT_ID_SLIMBUS_MULTI_CHAN_0_TX 0x4001 |
| 757 | /* SLIMbus Rx port on channel 1. */ |
| 758 | #define AFE_PORT_ID_SLIMBUS_MULTI_CHAN_1_RX 0x4002 |
| 759 | /* SLIMbus Tx port on channel 1. */ |
| 760 | #define AFE_PORT_ID_SLIMBUS_MULTI_CHAN_1_TX 0x4003 |
| 761 | /* SLIMbus Rx port on channel 2. */ |
| 762 | #define AFE_PORT_ID_SLIMBUS_MULTI_CHAN_2_RX 0x4004 |
| 763 | /* SLIMbus Tx port on channel 2. */ |
| 764 | #define AFE_PORT_ID_SLIMBUS_MULTI_CHAN_2_TX 0x4005 |
| 765 | /* SLIMbus Rx port on channel 3. */ |
| 766 | #define AFE_PORT_ID_SLIMBUS_MULTI_CHAN_3_RX 0x4006 |
| 767 | /* SLIMbus Tx port on channel 3. */ |
| 768 | #define AFE_PORT_ID_SLIMBUS_MULTI_CHAN_3_TX 0x4007 |
| 769 | /* SLIMbus Rx port on channel 4. */ |
| 770 | #define AFE_PORT_ID_SLIMBUS_MULTI_CHAN_4_RX 0x4008 |
| 771 | /* SLIMbus Tx port on channel 4. */ |
| 772 | #define AFE_PORT_ID_SLIMBUS_MULTI_CHAN_4_TX 0x4009 |
| 773 | /* SLIMbus Rx port on channel 0. */ |
| 774 | #define AFE_PORT_ID_SLIMBUS_MULTI_CHAN_0_RX 0x4000 |
| 775 | /* SLIMbus Tx port on channel 0. */ |
| 776 | #define AFE_PORT_ID_SLIMBUS_MULTI_CHAN_0_TX 0x4001 |
| 777 | /* SLIMbus Rx port on channel 1. */ |
| 778 | #define AFE_PORT_ID_SLIMBUS_MULTI_CHAN_1_RX 0x4002 |
| 779 | /* SLIMbus Tx port on channel 1. */ |
| 780 | #define AFE_PORT_ID_SLIMBUS_MULTI_CHAN_1_TX 0x4003 |
| 781 | /* SLIMbus Rx port on channel 2. */ |
| 782 | #define AFE_PORT_ID_SLIMBUS_MULTI_CHAN_2_RX 0x4004 |
| 783 | /* SLIMbus Tx port on channel 2. */ |
| 784 | #define AFE_PORT_ID_SLIMBUS_MULTI_CHAN_2_TX 0x4005 |
| 785 | /* SLIMbus Rx port on channel 3. */ |
| 786 | #define AFE_PORT_ID_SLIMBUS_MULTI_CHAN_3_RX 0x4006 |
| 787 | /* SLIMbus Tx port on channel 3. */ |
| 788 | #define AFE_PORT_ID_SLIMBUS_MULTI_CHAN_3_TX 0x4007 |
| 789 | /* SLIMbus Rx port on channel 4. */ |
| 790 | #define AFE_PORT_ID_SLIMBUS_MULTI_CHAN_4_RX 0x4008 |
| 791 | /* SLIMbus Tx port on channel 4. */ |
| 792 | #define AFE_PORT_ID_SLIMBUS_MULTI_CHAN_4_TX 0x4009 |
| 793 | /* Generic pseudoport 1. */ |
| 794 | #define AFE_PORT_ID_PSEUDOPORT_01 0x8001 |
| 795 | /* Generic pseudoport 2. */ |
| 796 | #define AFE_PORT_ID_PSEUDOPORT_02 0x8002 |
| 797 | |
| 798 | /* @xreflabel{hdr:AfePortIdPrimaryAuxPcmTx} |
| 799 | Primary Aux PCM Tx port ID. |
| 800 | */ |
| 801 | #define AFE_PORT_ID_PRIMARY_PCM_TX 0x100B |
| 802 | /* Pseudoport that corresponds to the voice Rx path. |
| 803 | * For recording, the voice Rx path samples are written to this |
| 804 | * port and consumed by the audio path. |
| 805 | */ |
| 806 | |
| 807 | #define AFE_PORT_ID_VOICE_RECORD_RX 0x8003 |
| 808 | |
| 809 | /* Pseudoport that corresponds to the voice Tx path. |
| 810 | * For recording, the voice Tx path samples are written to this |
| 811 | * port and consumed by the audio path. |
| 812 | */ |
| 813 | |
| 814 | #define AFE_PORT_ID_VOICE_RECORD_TX 0x8004 |
| 815 | /* Pseudoport that corresponds to in-call voice delivery samples. |
| 816 | * During in-call audio delivery, the audio path delivers samples |
| 817 | * to this port from where the voice path delivers them on the |
| 818 | * Rx path. |
| 819 | */ |
| 820 | #define AFE_PORT_ID_VOICE_PLAYBACK_TX 0x8005 |
| 821 | #define AFE_PORT_ID_INVALID 0xFFFF |
| 822 | |
| 823 | #define AAC_ENC_MODE_AAC_LC 0x02 |
| 824 | #define AAC_ENC_MODE_AAC_P 0x05 |
| 825 | #define AAC_ENC_MODE_EAAC_P 0x1D |
| 826 | |
| 827 | #define AFE_PSEUDOPORT_CMD_START 0x000100cf |
| 828 | struct afe_pseudoport_start_command { |
| 829 | struct apr_hdr hdr; |
| 830 | u16 port_id; /* Pseudo Port 1 = 0x8000 */ |
| 831 | /* Pseudo Port 2 = 0x8001 */ |
| 832 | /* Pseudo Port 3 = 0x8002 */ |
| 833 | u16 timing; /* FTRT = 0 , AVTimer = 1, */ |
| 834 | } __packed; |
| 835 | |
| 836 | #define AFE_PSEUDOPORT_CMD_STOP 0x000100d0 |
| 837 | struct afe_pseudoport_stop_command { |
| 838 | struct apr_hdr hdr; |
| 839 | u16 port_id; /* Pseudo Port 1 = 0x8000 */ |
| 840 | /* Pseudo Port 2 = 0x8001 */ |
| 841 | /* Pseudo Port 3 = 0x8002 */ |
| 842 | u16 reserved; |
| 843 | } __packed; |
| 844 | |
| 845 | |
| 846 | #define AFE_MODULE_SIDETONE_IIR_FILTER 0x00010202 |
| 847 | #define AFE_PARAM_ID_ENABLE 0x00010203 |
| 848 | |
| 849 | /* Payload of the #AFE_PARAM_ID_ENABLE |
| 850 | * parameter, which enables or |
| 851 | * disables any module. |
| 852 | * The fixed size of this structure is four bytes. |
| 853 | */ |
| 854 | |
| 855 | struct afe_mod_enable_param { |
| 856 | u16 enable; |
| 857 | /* Enables (1) or disables (0) the module. */ |
| 858 | |
| 859 | u16 reserved; |
| 860 | /* This field must be set to zero. |
| 861 | */ |
| 862 | } __packed; |
| 863 | |
| 864 | /* ID of the configuration parameter used by the |
| 865 | * #AFE_MODULE_SIDETONE_IIR_FILTER module. |
| 866 | */ |
| 867 | #define AFE_PARAM_ID_SIDETONE_IIR_FILTER_CONFIG 0x00010204 |
| 868 | |
| 869 | struct afe_sidetone_iir_filter_config_params { |
| 870 | u16 num_biquad_stages; |
| 871 | /* Number of stages. |
| 872 | * Supported values: Minimum of 5 and maximum of 10 |
| 873 | */ |
| 874 | |
| 875 | u16 pregain; |
| 876 | /* Pregain for the compensating filter response. |
| 877 | * Supported values: Any number in Q13 format |
| 878 | */ |
| 879 | } __packed; |
| 880 | |
| 881 | #define AFE_MODULE_LOOPBACK 0x00010205 |
| 882 | #define AFE_PARAM_ID_LOOPBACK_GAIN_PER_PATH 0x00010206 |
| 883 | |
| 884 | /* Payload of the #AFE_PARAM_ID_LOOPBACK_GAIN_PER_PATH parameter, |
| 885 | * which gets/sets loopback gain of a port to an Rx port. |
| 886 | * The Tx port ID of the loopback is part of the set_param command. |
| 887 | */ |
| 888 | |
| 889 | /* Payload of the #AFE_PORT_CMD_SET_PARAM_V2 command's |
| 890 | * configuration/calibration settings for the AFE port. |
| 891 | */ |
| 892 | struct afe_port_cmd_set_param_v2 { |
| 893 | u16 port_id; |
| 894 | /* Port interface and direction (Rx or Tx) to start. |
| 895 | */ |
| 896 | |
| 897 | u16 payload_size; |
| 898 | /* Actual size of the payload in bytes. |
| 899 | * This is used for parsing the parameter payload. |
| 900 | * Supported values: > 0 |
| 901 | */ |
| 902 | |
| 903 | u32 payload_address_lsw; |
| 904 | /* LSW of 64 bit Payload address. |
| 905 | * Address should be 32-byte, |
| 906 | * 4kbyte aligned and must be contiguous memory. |
| 907 | */ |
| 908 | |
| 909 | u32 payload_address_msw; |
| 910 | /* MSW of 64 bit Payload address. |
| 911 | * In case of 32-bit shared memory address, |
| 912 | * this field must be set to zero. |
| 913 | * In case of 36-bit shared memory address, |
| 914 | * bit-4 to bit-31 must be set to zero. |
| 915 | * Address should be 32-byte, 4kbyte aligned |
| 916 | * and must be contiguous memory. |
| 917 | */ |
| 918 | |
| 919 | u32 mem_map_handle; |
| 920 | /* Memory map handle returned by |
| 921 | * AFE_SERVICE_CMD_SHARED_MEM_MAP_REGIONS commands. |
| 922 | * Supported Values: |
| 923 | * - NULL -- Message. The parameter data is in-band. |
| 924 | * - Non-NULL -- The parameter data is Out-band.Pointer to |
| 925 | * the physical address |
| 926 | * in shared memory of the payload data. |
| 927 | * An optional field is available if parameter |
| 928 | * data is in-band: |
| 929 | * afe_param_data_v2 param_data[...]. |
| 930 | * For detailed payload content, see the |
| 931 | * afe_port_param_data_v2 structure. |
| 932 | */ |
| 933 | } __packed; |
| 934 | |
| 935 | #define AFE_PORT_CMD_SET_PARAM_V2 0x000100EF |
| 936 | |
| 937 | struct afe_port_param_data_v2 { |
| 938 | u32 module_id; |
| 939 | /* ID of the module to be configured. |
| 940 | * Supported values: Valid module ID |
| 941 | */ |
| 942 | |
| 943 | u32 param_id; |
| 944 | /* ID of the parameter corresponding to the supported parameters |
| 945 | * for the module ID. |
| 946 | * Supported values: Valid parameter ID |
| 947 | */ |
| 948 | |
| 949 | u16 param_size; |
| 950 | /* Actual size of the data for the |
| 951 | * module_id/param_id pair. The size is a |
| 952 | * multiple of four bytes. |
| 953 | * Supported values: > 0 |
| 954 | */ |
| 955 | |
| 956 | u16 reserved; |
| 957 | /* This field must be set to zero. |
| 958 | */ |
| 959 | } __packed; |
| 960 | |
| 961 | struct afe_loopback_gain_per_path_param { |
| 962 | struct apr_hdr hdr; |
| 963 | struct afe_port_cmd_set_param_v2 param; |
| 964 | struct afe_port_param_data_v2 pdata; |
| 965 | u16 rx_port_id; |
| 966 | /* Rx port of the loopback. */ |
| 967 | |
| 968 | u16 gain; |
| 969 | /* Loopback gain per path of the port. |
| 970 | * Supported values: Any number in Q13 format |
| 971 | */ |
| 972 | } __packed; |
| 973 | |
| 974 | /* Parameter ID used to configure and enable/disable the |
| 975 | * loopback path. The difference with respect to the existing |
| 976 | * API, AFE_PORT_CMD_LOOPBACK, is that it allows Rx port to be |
| 977 | * configured as source port in loopback path. Port-id in |
| 978 | * AFE_PORT_CMD_SET_PARAM cmd is the source port whcih can be |
| 979 | * Tx or Rx port. In addition, we can configure the type of |
| 980 | * routing mode to handle different use cases. |
| 981 | */ |
| 982 | #define AFE_PARAM_ID_LOOPBACK_CONFIG 0x0001020B |
| 983 | #define AFE_API_VERSION_LOOPBACK_CONFIG 0x1 |
| 984 | |
| 985 | enum afe_loopback_routing_mode { |
| 986 | LB_MODE_DEFAULT = 1, |
| 987 | /* Regular loopback from source to destination port */ |
| 988 | LB_MODE_SIDETONE, |
| 989 | /* Sidetone feed from Tx source to Rx destination port */ |
| 990 | LB_MODE_EC_REF_VOICE_AUDIO, |
| 991 | /* Echo canceller reference, voice + audio + DTMF */ |
| 992 | LB_MODE_EC_REF_VOICE |
| 993 | /* Echo canceller reference, voice alone */ |
| 994 | } __packed; |
| 995 | |
| 996 | /* Payload of the #AFE_PARAM_ID_LOOPBACK_CONFIG , |
| 997 | * which enables/disables one AFE loopback. |
| 998 | */ |
| 999 | struct afe_loopback_cfg_v1 { |
| 1000 | struct apr_hdr hdr; |
| 1001 | struct afe_port_cmd_set_param_v2 param; |
| 1002 | struct afe_port_param_data_v2 pdata; |
| 1003 | u32 loopback_cfg_minor_version; |
| 1004 | /* Minor version used for tracking the version of the RMC module |
| 1005 | * configuration interface. |
| 1006 | * Supported values: #AFE_API_VERSION_LOOPBACK_CONFIG |
| 1007 | */ |
| 1008 | u16 dst_port_id; |
| 1009 | /* Destination Port Id. */ |
| 1010 | u16 routing_mode; |
| 1011 | /* Specifies data path type from src to dest port. |
| 1012 | * Supported values: |
| 1013 | * #LB_MODE_DEFAULT |
| 1014 | * #LB_MODE_SIDETONE |
| 1015 | * #LB_MODE_EC_REF_VOICE_AUDIO |
| 1016 | * #LB_MODE_EC_REF_VOICE_A |
| 1017 | * #LB_MODE_EC_REF_VOICE |
| 1018 | */ |
| 1019 | |
| 1020 | u16 enable; |
| 1021 | /* Specifies whether to enable (1) or |
| 1022 | * disable (0) an AFE loopback. |
| 1023 | */ |
| 1024 | u16 reserved; |
| 1025 | /* Reserved for 32-bit alignment. This field must be set to 0. |
| 1026 | */ |
| 1027 | |
| 1028 | } __packed; |
| 1029 | |
| 1030 | #define AFE_MODULE_SPEAKER_PROTECTION 0x00010209 |
| 1031 | #define AFE_PARAM_ID_SPKR_PROT_CONFIG 0x0001020a |
| 1032 | #define AFE_API_VERSION_SPKR_PROT_CONFIG 0x1 |
| 1033 | #define AFE_SPKR_PROT_EXCURSIONF_LEN 512 |
| 1034 | struct afe_spkr_prot_cfg_param_v1 { |
| 1035 | u32 spkr_prot_minor_version; |
| 1036 | /* |
| 1037 | * Minor version used for tracking the version of the |
| 1038 | * speaker protection module configuration interface. |
| 1039 | * Supported values: #AFE_API_VERSION_SPKR_PROT_CONFIG |
| 1040 | */ |
| 1041 | |
| 1042 | int16_t win_size; |
| 1043 | /* Analysis and synthesis window size (nWinSize). |
| 1044 | * Supported values: 1024, 512, 256 samples |
| 1045 | */ |
| 1046 | |
| 1047 | int16_t margin; |
| 1048 | /* Allowable margin for excursion prediction, |
| 1049 | * in L16Q15 format. This is a |
| 1050 | * control parameter to allow |
| 1051 | * for overestimation of peak excursion. |
| 1052 | */ |
| 1053 | |
| 1054 | int16_t spkr_exc_limit; |
| 1055 | /* Speaker excursion limit, in L16Q15 format.*/ |
| 1056 | |
| 1057 | int16_t spkr_resonance_freq; |
| 1058 | /* Resonance frequency of the speaker; used |
| 1059 | * to define a frequency range |
| 1060 | * for signal modification. |
| 1061 | * |
| 1062 | * Supported values: 0 to 2000 Hz */ |
| 1063 | |
| 1064 | int16_t limhresh; |
| 1065 | /* Threshold of the hard limiter; used to |
| 1066 | * prevent overshooting beyond a |
| 1067 | * signal level that was set by the limiter |
| 1068 | * prior to speaker protection. |
| 1069 | * Supported values: 0 to 32767 |
| 1070 | */ |
| 1071 | |
| 1072 | int16_t hpf_cut_off_freq; |
| 1073 | /* High pass filter cutoff frequency. |
| 1074 | * Supported values: 100, 200, 300 Hz |
| 1075 | */ |
| 1076 | |
| 1077 | int16_t hpf_enable; |
| 1078 | /* Specifies whether the high pass filter |
| 1079 | * is enabled (0) or disabled (1). |
| 1080 | */ |
| 1081 | |
| 1082 | int16_t reserved; |
| 1083 | /* This field must be set to zero. */ |
| 1084 | |
| 1085 | int32_t amp_gain; |
| 1086 | /* Amplifier gain in L32Q15 format. |
| 1087 | * This is the RMS voltage at the |
| 1088 | * loudspeaker when a 0dBFS tone |
| 1089 | * is played in the digital domain. |
| 1090 | */ |
| 1091 | |
| 1092 | int16_t excursionf[AFE_SPKR_PROT_EXCURSIONF_LEN]; |
| 1093 | /* Array of the excursion transfer function. |
| 1094 | * The peak excursion of the |
| 1095 | * loudspeaker diaphragm is |
| 1096 | * measured in millimeters for 1 Vrms Sine |
| 1097 | * tone at all FFT bin frequencies. |
| 1098 | * Supported values: Q15 format |
| 1099 | */ |
| 1100 | } __packed; |
| 1101 | |
| 1102 | |
| 1103 | #define AFE_SERVICE_CMD_REGISTER_RT_PORT_DRIVER 0x000100E0 |
| 1104 | |
| 1105 | /* Payload of the #AFE_SERVICE_CMD_REGISTER_RT_PORT_DRIVER |
| 1106 | * command, which registers a real-time port driver |
| 1107 | * with the AFE service. |
| 1108 | */ |
| 1109 | struct afe_service_cmd_register_rt_port_driver { |
| 1110 | struct apr_hdr hdr; |
| 1111 | u16 port_id; |
| 1112 | /* Port ID with which the real-time driver exchanges data |
| 1113 | * (registers for events). |
| 1114 | * Supported values: #AFE_PORT_ID_RT_PROXY_PORT_RANGE_START to |
| 1115 | * #AFE_PORT_ID_RT_PROXY_PORT_RANGE_END |
| 1116 | */ |
| 1117 | |
| 1118 | u16 reserved; |
| 1119 | /* This field must be set to zero. */ |
| 1120 | } __packed; |
| 1121 | |
| 1122 | #define AFE_SERVICE_CMD_UNREGISTER_RT_PORT_DRIVER 0x000100E1 |
| 1123 | |
| 1124 | /* Payload of the #AFE_SERVICE_CMD_UNREGISTER_RT_PORT_DRIVER |
| 1125 | * command, which unregisters a real-time port driver from |
| 1126 | * the AFE service. |
| 1127 | */ |
| 1128 | struct afe_service_cmd_unregister_rt_port_driver { |
| 1129 | struct apr_hdr hdr; |
| 1130 | u16 port_id; |
| 1131 | /* Port ID from which the real-time |
| 1132 | * driver unregisters for events. |
| 1133 | * Supported values: #AFE_PORT_ID_RT_PROXY_PORT_RANGE_START to |
| 1134 | * #AFE_PORT_ID_RT_PROXY_PORT_RANGE_END |
| 1135 | */ |
| 1136 | |
| 1137 | u16 reserved; |
| 1138 | /* This field must be set to zero. */ |
| 1139 | } __packed; |
| 1140 | |
| 1141 | #define AFE_EVENT_RT_PROXY_PORT_STATUS 0x00010105 |
| 1142 | #define AFE_EVENTYPE_RT_PROXY_PORT_START 0 |
| 1143 | #define AFE_EVENTYPE_RT_PROXY_PORT_STOP 1 |
| 1144 | #define AFE_EVENTYPE_RT_PROXY_PORT_LOW_WATER_MARK 2 |
| 1145 | #define AFE_EVENTYPE_RT_PROXY_PORT_HIGH_WATER_MARK 3 |
| 1146 | #define AFE_EVENTYPE_RT_PROXY_PORT_INVALID 0xFFFF |
| 1147 | |
| 1148 | /* Payload of the #AFE_EVENT_RT_PROXY_PORT_STATUS |
| 1149 | * message, which sends an event from the AFE service |
| 1150 | * to a registered client. |
| 1151 | */ |
| 1152 | struct afe_event_rt_proxy_port_status { |
| 1153 | u16 port_id; |
| 1154 | /* Port ID to which the event is sent. |
| 1155 | * Supported values: #AFE_PORT_ID_RT_PROXY_PORT_RANGE_START to |
| 1156 | * #AFE_PORT_ID_RT_PROXY_PORT_RANGE_END |
| 1157 | */ |
| 1158 | |
| 1159 | u16 eventype; |
| 1160 | /* Type of event. |
| 1161 | * Supported values: |
| 1162 | * - #AFE_EVENTYPE_RT_PROXY_PORT_START |
| 1163 | * - #AFE_EVENTYPE_RT_PROXY_PORT_STOP |
| 1164 | * - #AFE_EVENTYPE_RT_PROXY_PORT_LOW_WATER_MARK |
| 1165 | * - #AFE_EVENTYPE_RT_PROXY_PORT_HIGH_WATER_MARK |
| 1166 | */ |
| 1167 | } __packed; |
| 1168 | |
| 1169 | #define AFE_PORT_DATA_CMD_RT_PROXY_PORT_WRITE_V2 0x000100ED |
| 1170 | |
| 1171 | struct afe_port_data_cmd_rt_proxy_port_write_v2 { |
| 1172 | struct apr_hdr hdr; |
| 1173 | u16 port_id; |
| 1174 | /* Tx (mic) proxy port ID with which the real-time |
| 1175 | * driver exchanges data. |
| 1176 | * Supported values: #AFE_PORT_ID_RT_PROXY_PORT_RANGE_START to |
| 1177 | * #AFE_PORT_ID_RT_PROXY_PORT_RANGE_END |
| 1178 | */ |
| 1179 | |
| 1180 | u16 reserved; |
| 1181 | /* This field must be set to zero. */ |
| 1182 | |
| 1183 | u32 buffer_address_lsw; |
| 1184 | /* LSW Address of the buffer containing the |
| 1185 | * data from the real-time source |
| 1186 | * device on a client. |
| 1187 | */ |
| 1188 | |
| 1189 | u32 buffer_address_msw; |
| 1190 | /* MSW Address of the buffer containing the |
| 1191 | * data from the real-time source |
| 1192 | * device on a client. |
| 1193 | */ |
| 1194 | |
| 1195 | u32 mem_map_handle; |
| 1196 | /* A memory map handle encapsulating shared memory |
| 1197 | * attributes is returned if |
| 1198 | * AFE_SERVICE_CMD_SHARED_MEM_MAP_REGIONS |
| 1199 | * command is successful. |
| 1200 | * Supported Values: |
| 1201 | * - Any 32 bit value |
| 1202 | */ |
| 1203 | |
| 1204 | u32 available_bytes; |
| 1205 | /* Number of valid bytes available |
| 1206 | * in the buffer (including all |
| 1207 | * channels: number of bytes per |
| 1208 | * channel = availableBytesumChannels). |
| 1209 | * Supported values: > 0 |
| 1210 | * |
| 1211 | * This field must be equal to the frame |
| 1212 | * size specified in the #AFE_PORT_AUDIO_IF_CONFIG |
| 1213 | * command that was sent to configure this |
| 1214 | * port. |
| 1215 | */ |
| 1216 | } __packed; |
| 1217 | |
| 1218 | #define AFE_PORT_DATA_CMD_RT_PROXY_PORT_READ_V2 0x000100EE |
| 1219 | |
| 1220 | /* Payload of the |
| 1221 | * #AFE_PORT_DATA_CMD_RT_PROXY_PORT_READ_V2 command, which |
| 1222 | * delivers an empty buffer to the AFE service. On |
| 1223 | * acknowledgment, data is filled in the buffer. |
| 1224 | */ |
| 1225 | struct afe_port_data_cmd_rt_proxy_port_read_v2 { |
| 1226 | struct apr_hdr hdr; |
| 1227 | u16 port_id; |
| 1228 | /* Rx proxy port ID with which the real-time |
| 1229 | * driver exchanges data. |
| 1230 | * Supported values: #AFE_PORT_ID_RT_PROXY_PORT_RANGE_START to |
| 1231 | * #AFE_PORT_ID_RT_PROXY_PORT_RANGE_END |
| 1232 | * (This must be an Rx (speaker) port.) |
| 1233 | */ |
| 1234 | |
| 1235 | u16 reserved; |
| 1236 | /* This field must be set to zero. */ |
| 1237 | |
| 1238 | u32 buffer_address_lsw; |
| 1239 | /* LSW Address of the buffer containing the data sent from the AFE |
| 1240 | * service to a real-time sink device on the client. |
| 1241 | */ |
| 1242 | |
| 1243 | |
| 1244 | u32 buffer_address_msw; |
| 1245 | /* MSW Address of the buffer containing the data sent from the AFE |
| 1246 | * service to a real-time sink device on the client. |
| 1247 | */ |
| 1248 | |
| 1249 | u32 mem_map_handle; |
| 1250 | /* A memory map handle encapsulating shared memory attributes is |
| 1251 | * returned if AFE_SERVICE_CMD_SHARED_MEM_MAP_REGIONS command is |
| 1252 | * successful. |
| 1253 | * Supported Values: |
| 1254 | * - Any 32 bit value |
| 1255 | */ |
| 1256 | |
| 1257 | u32 available_bytes; |
| 1258 | /* Number of valid bytes available in the buffer (including all |
| 1259 | * channels). |
| 1260 | * Supported values: > 0 |
| 1261 | * This field must be equal to the frame size specified in the |
| 1262 | * #AFE_PORT_AUDIO_IF_CONFIG command that was sent to configure |
| 1263 | * this port. |
| 1264 | */ |
| 1265 | } __packed; |
| 1266 | |
| 1267 | /* This module ID is related to device configuring like I2S,PCM, |
| 1268 | * HDMI, SLIMBus etc. This module supports follwing parameter ids. |
| 1269 | * - #AFE_PARAM_ID_I2S_CONFIG |
| 1270 | * - #AFE_PARAM_ID_PCM_CONFIG |
| 1271 | * - #AFE_PARAM_ID_DIGI_MIC_CONFIG |
| 1272 | * - #AFE_PARAM_ID_HDMI_CONFIG |
| 1273 | * - #AFE_PARAM_ID_INTERNAL_BT_FM_CONFIG |
| 1274 | * - #AFE_PARAM_ID_SLIMBUS_CONFIG |
| 1275 | * - #AFE_PARAM_ID_RT_PROXY_CONFIG |
| 1276 | */ |
| 1277 | |
| 1278 | #define AFE_MODULE_AUDIO_DEV_INTERFACE 0x0001020C |
| 1279 | #define AFE_PORT_SAMPLE_RATE_8K 8000 |
| 1280 | #define AFE_PORT_SAMPLE_RATE_16K 16000 |
| 1281 | #define AFE_PORT_SAMPLE_RATE_48K 48000 |
| 1282 | #define AFE_PORT_SAMPLE_RATE_96K 96000 |
| 1283 | #define AFE_PORT_SAMPLE_RATE_192K 192000 |
| 1284 | #define AFE_LINEAR_PCM_DATA 0x0 |
| 1285 | #define AFE_NON_LINEAR_DATA 0x1 |
| 1286 | #define AFE_LINEAR_PCM_DATA_PACKED_60958 0x2 |
| 1287 | #define AFE_NON_LINEAR_DATA_PACKED_60958 0x3 |
| 1288 | |
| 1289 | /* This param id is used to configure I2S interface */ |
| 1290 | #define AFE_PARAM_ID_I2S_CONFIG 0x0001020D |
| 1291 | #define AFE_API_VERSION_I2S_CONFIG 0x1 |
| 1292 | /* Enumeration for setting the I2S configuration |
| 1293 | * channel_mode parameter to |
| 1294 | * serial data wire number 1-3 (SD3). |
| 1295 | */ |
| 1296 | #define AFE_PORT_I2S_SD0 0x1 |
| 1297 | #define AFE_PORT_I2S_SD1 0x2 |
| 1298 | #define AFE_PORT_I2S_SD2 0x3 |
| 1299 | #define AFE_PORT_I2S_SD3 0x4 |
| 1300 | #define AFE_PORT_I2S_QUAD01 0x5 |
| 1301 | #define AFE_PORT_I2S_QUAD23 0x6 |
| 1302 | #define AFE_PORT_I2S_6CHS 0x7 |
| 1303 | #define AFE_PORT_I2S_8CHS 0x8 |
| 1304 | #define AFE_PORT_I2S_MONO 0x0 |
| 1305 | #define AFE_PORT_I2S_STEREO 0x1 |
| 1306 | #define AFE_PORT_CONFIG_I2S_WS_SRC_EXTERNAL 0x0 |
| 1307 | #define AFE_PORT_CONFIG_I2S_WS_SRC_INTERNAL 0x1 |
| 1308 | |
| 1309 | /* Payload of the #AFE_PARAM_ID_I2S_CONFIG |
| 1310 | * command's (I2S configuration |
| 1311 | * parameter). |
| 1312 | */ |
| 1313 | struct afe_param_id_i2s_cfg { |
| 1314 | u32 i2s_cfg_minor_version; |
| 1315 | /* Minor version used for tracking the version of the I2S |
| 1316 | * configuration interface. |
| 1317 | * Supported values: #AFE_API_VERSION_I2S_CONFIG |
| 1318 | */ |
| 1319 | |
| 1320 | u16 bit_width; |
| 1321 | /* Bit width of the sample. |
| 1322 | * Supported values: 16, 24 |
| 1323 | */ |
| 1324 | |
| 1325 | u16 channel_mode; |
| 1326 | /* I2S lines and multichannel operation. |
| 1327 | * Supported values: |
| 1328 | * - #AFE_PORT_I2S_SD0 |
| 1329 | * - #AFE_PORT_I2S_SD1 |
| 1330 | * - #AFE_PORT_I2S_SD2 |
| 1331 | * - #AFE_PORT_I2S_SD3 |
| 1332 | * - #AFE_PORT_I2S_QUAD01 |
| 1333 | * - #AFE_PORT_I2S_QUAD23 |
| 1334 | * - #AFE_PORT_I2S_6CHS |
| 1335 | * - #AFE_PORT_I2S_8CHS |
| 1336 | */ |
| 1337 | |
| 1338 | u16 mono_stereo; |
| 1339 | /* Specifies mono or stereo. This applies only when |
| 1340 | * a single I2S line is used. |
| 1341 | * Supported values: |
| 1342 | * - #AFE_PORT_I2S_MONO |
| 1343 | * - #AFE_PORT_I2S_STEREO |
| 1344 | */ |
| 1345 | |
| 1346 | u16 ws_src; |
| 1347 | /* Word select source: internal or external. |
| 1348 | * Supported values: |
| 1349 | * - #AFE_PORT_CONFIG_I2S_WS_SRC_EXTERNAL |
| 1350 | * - #AFE_PORT_CONFIG_I2S_WS_SRC_INTERNAL |
| 1351 | */ |
| 1352 | |
| 1353 | u32 sample_rate; |
| 1354 | /* Sampling rate of the port. |
| 1355 | * Supported values: |
| 1356 | * - #AFE_PORT_SAMPLE_RATE_8K |
| 1357 | * - #AFE_PORT_SAMPLE_RATE_16K |
| 1358 | * - #AFE_PORT_SAMPLE_RATE_48K |
| 1359 | * - #AFE_PORT_SAMPLE_RATE_96K |
| 1360 | * - #AFE_PORT_SAMPLE_RATE_192K |
| 1361 | */ |
| 1362 | |
| 1363 | u16 data_format; |
| 1364 | /* data format |
| 1365 | * Supported values: |
| 1366 | * - #LINEAR_PCM_DATA |
| 1367 | * - #NON_LINEAR_DATA |
| 1368 | * - #LINEAR_PCM_DATA_PACKED_IN_60958 |
| 1369 | * - #NON_LINEAR_DATA_PACKED_IN_60958 |
| 1370 | */ |
| 1371 | u16 reserved; |
| 1372 | /* This field must be set to zero. */ |
| 1373 | } __packed; |
| 1374 | |
| 1375 | /* |
| 1376 | * This param id is used to configure PCM interface |
| 1377 | */ |
| 1378 | #define AFE_PARAM_ID_PCM_CONFIG 0x0001020E |
| 1379 | #define AFE_API_VERSION_PCM_CONFIG 0x1 |
| 1380 | /* Enumeration for the auxiliary PCM synchronization signal |
| 1381 | * provided by an external source. |
| 1382 | */ |
| 1383 | |
| 1384 | #define AFE_PORT_PCM_SYNC_SRC_EXTERNAL 0x0 |
| 1385 | /* Enumeration for the auxiliary PCM synchronization signal |
| 1386 | * provided by an internal source. |
| 1387 | */ |
| 1388 | #define AFE_PORT_PCM_SYNC_SRC_INTERNAL 0x1 |
| 1389 | /* Enumeration for the PCM configuration aux_mode parameter, |
| 1390 | * which configures the auxiliary PCM interface to use |
| 1391 | * short synchronization. |
| 1392 | */ |
| 1393 | #define AFE_PORT_PCM_AUX_MODE_PCM 0x0 |
| 1394 | /* |
| 1395 | * Enumeration for the PCM configuration aux_mode parameter, |
| 1396 | * which configures the auxiliary PCM interface to use long |
| 1397 | * synchronization. |
| 1398 | */ |
| 1399 | #define AFE_PORT_PCM_AUX_MODE_AUX 0x1 |
| 1400 | /* |
| 1401 | * Enumeration for setting the PCM configuration frame to 8. |
| 1402 | */ |
| 1403 | #define AFE_PORT_PCM_BITS_PER_FRAME_8 0x0 |
| 1404 | /* |
| 1405 | * Enumeration for setting the PCM configuration frame to 16. |
| 1406 | */ |
| 1407 | #define AFE_PORT_PCM_BITS_PER_FRAME_16 0x1 |
| 1408 | |
| 1409 | /* Enumeration for setting the PCM configuration frame to 32.*/ |
| 1410 | #define AFE_PORT_PCM_BITS_PER_FRAME_32 0x2 |
| 1411 | |
| 1412 | /* Enumeration for setting the PCM configuration frame to 64.*/ |
| 1413 | #define AFE_PORT_PCM_BITS_PER_FRAME_64 0x3 |
| 1414 | |
| 1415 | /* Enumeration for setting the PCM configuration frame to 128.*/ |
| 1416 | #define AFE_PORT_PCM_BITS_PER_FRAME_128 0x4 |
| 1417 | |
| 1418 | /* Enumeration for setting the PCM configuration frame to 256.*/ |
| 1419 | #define AFE_PORT_PCM_BITS_PER_FRAME_256 0x5 |
| 1420 | |
| 1421 | /* Enumeration for setting the PCM configuration |
| 1422 | * quantype parameter to A-law with no padding. |
| 1423 | */ |
| 1424 | #define AFE_PORT_PCM_ALAW_NOPADDING 0x0 |
| 1425 | |
| 1426 | /* Enumeration for setting the PCM configuration quantype |
| 1427 | * parameter to mu-law with no padding. |
| 1428 | */ |
| 1429 | #define AFE_PORT_PCM_MULAW_NOPADDING 0x1 |
| 1430 | /* Enumeration for setting the PCM configuration quantype |
| 1431 | * parameter to linear with no padding. |
| 1432 | */ |
| 1433 | #define AFE_PORT_PCM_LINEAR_NOPADDING 0x2 |
| 1434 | /* Enumeration for setting the PCM configuration quantype |
| 1435 | * parameter to A-law with padding. |
| 1436 | */ |
| 1437 | #define AFE_PORT_PCM_ALAW_PADDING 0x3 |
| 1438 | /* Enumeration for setting the PCM configuration quantype |
| 1439 | * parameter to mu-law with padding. |
| 1440 | */ |
| 1441 | #define AFE_PORT_PCM_MULAW_PADDING 0x4 |
| 1442 | /* Enumeration for setting the PCM configuration quantype |
| 1443 | * parameter to linear with padding. |
| 1444 | */ |
| 1445 | #define AFE_PORT_PCM_LINEAR_PADDING 0x5 |
| 1446 | /* Enumeration for disabling the PCM configuration |
| 1447 | * ctrl_data_out_enable parameter. |
| 1448 | * The PCM block is the only master. |
| 1449 | */ |
| 1450 | #define AFE_PORT_PCM_CTRL_DATA_OE_DISABLE 0x0 |
| 1451 | /* |
| 1452 | * Enumeration for enabling the PCM configuration |
| 1453 | * ctrl_data_out_enable parameter. The PCM block shares |
| 1454 | * the signal with other masters. |
| 1455 | */ |
| 1456 | #define AFE_PORT_PCM_CTRL_DATA_OE_ENABLE 0x1 |
| 1457 | |
| 1458 | /* Payload of the #AFE_PARAM_ID_PCM_CONFIG command's |
| 1459 | * (PCM configuration parameter). |
| 1460 | */ |
| 1461 | |
| 1462 | struct afe_param_id_pcm_cfg { |
| 1463 | u32 pcm_cfg_minor_version; |
| 1464 | /* Minor version used for tracking the version of the AUX PCM |
| 1465 | * configuration interface. |
| 1466 | * Supported values: #AFE_API_VERSION_PCM_CONFIG |
| 1467 | */ |
| 1468 | |
| 1469 | u16 aux_mode; |
| 1470 | /* PCM synchronization setting. |
| 1471 | * Supported values: |
| 1472 | * - #AFE_PORT_PCM_AUX_MODE_PCM |
| 1473 | * - #AFE_PORT_PCM_AUX_MODE_AUX |
| 1474 | */ |
| 1475 | |
| 1476 | u16 sync_src; |
| 1477 | /* Synchronization source. |
| 1478 | * Supported values: |
| 1479 | * - #AFE_PORT_PCM_SYNC_SRC_EXTERNAL |
| 1480 | * - #AFE_PORT_PCM_SYNC_SRC_INTERNAL |
| 1481 | */ |
| 1482 | |
| 1483 | u16 frame_setting; |
| 1484 | /* Number of bits per frame. |
| 1485 | * Supported values: |
| 1486 | * - #AFE_PORT_PCM_BITS_PER_FRAME_8 |
| 1487 | * - #AFE_PORT_PCM_BITS_PER_FRAME_16 |
| 1488 | * - #AFE_PORT_PCM_BITS_PER_FRAME_32 |
| 1489 | * - #AFE_PORT_PCM_BITS_PER_FRAME_64 |
| 1490 | * - #AFE_PORT_PCM_BITS_PER_FRAME_128 |
| 1491 | * - #AFE_PORT_PCM_BITS_PER_FRAME_256 |
| 1492 | */ |
| 1493 | |
| 1494 | u16 quantype; |
| 1495 | /* PCM quantization type. |
| 1496 | * Supported values: |
| 1497 | * - #AFE_PORT_PCM_ALAW_NOPADDING |
| 1498 | * - #AFE_PORT_PCM_MULAW_NOPADDING |
| 1499 | * - #AFE_PORT_PCM_LINEAR_NOPADDING |
| 1500 | * - #AFE_PORT_PCM_ALAW_PADDING |
| 1501 | * - #AFE_PORT_PCM_MULAW_PADDING |
| 1502 | * - #AFE_PORT_PCM_LINEAR_PADDING |
| 1503 | */ |
| 1504 | |
| 1505 | u16 ctrl_data_out_enable; |
| 1506 | /* Specifies whether the PCM block shares the data-out |
| 1507 | * signal to the drive with other masters. |
| 1508 | * Supported values: |
| 1509 | * - #AFE_PORT_PCM_CTRL_DATA_OE_DISABLE |
| 1510 | * - #AFE_PORT_PCM_CTRL_DATA_OE_ENABLE |
| 1511 | */ |
| 1512 | u16 reserved; |
| 1513 | /* This field must be set to zero. */ |
| 1514 | |
| 1515 | u32 sample_rate; |
| 1516 | /* Sampling rate of the port. |
| 1517 | * Supported values: |
| 1518 | * - #AFE_PORT_SAMPLE_RATE_8K |
| 1519 | * - #AFE_PORT_SAMPLE_RATE_16K |
| 1520 | */ |
| 1521 | |
| 1522 | u16 bit_width; |
| 1523 | /* Bit width of the sample. |
| 1524 | * Supported values: 16 |
| 1525 | */ |
| 1526 | |
| 1527 | u16 num_channels; |
| 1528 | /* Number of channels. |
| 1529 | * Supported values: 1 to 4 |
| 1530 | */ |
| 1531 | |
| 1532 | u16 slot_number_mapping[4]; |
| 1533 | /* Specifies the slot number for the each channel in |
| 1534 | * multi channel scenario. |
| 1535 | * Supported values: 1 to 32 |
| 1536 | */ |
| 1537 | } __packed; |
| 1538 | |
| 1539 | /* |
| 1540 | * This param id is used to configure DIGI MIC interface |
| 1541 | */ |
| 1542 | #define AFE_PARAM_ID_DIGI_MIC_CONFIG 0x0001020F |
| 1543 | /* This version information is used to handle the new |
| 1544 | * additions to the config interface in future in backward |
| 1545 | * compatible manner. |
| 1546 | */ |
| 1547 | #define AFE_API_VERSION_DIGI_MIC_CONFIG 0x1 |
| 1548 | |
| 1549 | /* Enumeration for setting the digital mic configuration |
| 1550 | * channel_mode parameter to left 0. |
| 1551 | */ |
| 1552 | |
| 1553 | #define AFE_PORT_DIGI_MIC_MODE_LEFT0 0x1 |
| 1554 | |
| 1555 | /*Enumeration for setting the digital mic configuration |
| 1556 | * channel_mode parameter to right 0. |
| 1557 | */ |
| 1558 | |
| 1559 | |
| 1560 | #define AFE_PORT_DIGI_MIC_MODE_RIGHT0 0x2 |
| 1561 | |
| 1562 | /* Enumeration for setting the digital mic configuration |
| 1563 | * channel_mode parameter to left 1. |
| 1564 | */ |
| 1565 | |
| 1566 | #define AFE_PORT_DIGI_MIC_MODE_LEFT1 0x3 |
| 1567 | |
| 1568 | /* Enumeration for setting the digital mic configuration |
| 1569 | * channel_mode parameter to right 1. |
| 1570 | */ |
| 1571 | |
| 1572 | #define AFE_PORT_DIGI_MIC_MODE_RIGHT1 0x4 |
| 1573 | |
| 1574 | /* Enumeration for setting the digital mic configuration |
| 1575 | * channel_mode parameter to stereo 0. |
| 1576 | */ |
| 1577 | #define AFE_PORT_DIGI_MIC_MODE_STEREO0 0x5 |
| 1578 | |
| 1579 | /* Enumeration for setting the digital mic configuration |
| 1580 | * channel_mode parameter to stereo 1. |
| 1581 | */ |
| 1582 | |
| 1583 | |
| 1584 | #define AFE_PORT_DIGI_MIC_MODE_STEREO1 0x6 |
| 1585 | |
| 1586 | /* Enumeration for setting the digital mic configuration |
| 1587 | * channel_mode parameter to quad. |
| 1588 | */ |
| 1589 | |
| 1590 | #define AFE_PORT_DIGI_MIC_MODE_QUAD 0x7 |
| 1591 | |
| 1592 | /* Payload of the #AFE_PARAM_ID_DIGI_MIC_CONFIG command's |
| 1593 | * (DIGI MIC configuration |
| 1594 | * parameter). |
| 1595 | */ |
| 1596 | struct afe_param_id_digi_mic_cfg { |
| 1597 | u32 digi_mic_cfg_minor_version; |
| 1598 | /* Minor version used for tracking the version of the DIGI Mic |
| 1599 | * configuration interface. |
| 1600 | * Supported values: #AFE_API_VERSION_DIGI_MIC_CONFIG |
| 1601 | */ |
| 1602 | |
| 1603 | u16 bit_width; |
| 1604 | /* Bit width of the sample. |
| 1605 | * Supported values: 16 |
| 1606 | */ |
| 1607 | |
| 1608 | u16 channel_mode; |
| 1609 | /* Digital mic and multichannel operation. |
| 1610 | * Supported values: |
| 1611 | * - #AFE_PORT_DIGI_MIC_MODE_LEFT0 |
| 1612 | * - #AFE_PORT_DIGI_MIC_MODE_RIGHT0 |
| 1613 | * - #AFE_PORT_DIGI_MIC_MODE_LEFT1 |
| 1614 | * - #AFE_PORT_DIGI_MIC_MODE_RIGHT1 |
| 1615 | * - #AFE_PORT_DIGI_MIC_MODE_STEREO0 |
| 1616 | * - #AFE_PORT_DIGI_MIC_MODE_STEREO1 |
| 1617 | * - #AFE_PORT_DIGI_MIC_MODE_QUAD |
| 1618 | */ |
| 1619 | |
| 1620 | u32 sample_rate; |
| 1621 | /* Sampling rate of the port. |
| 1622 | * Supported values: |
| 1623 | * - #AFE_PORT_SAMPLE_RATE_8K |
| 1624 | * - #AFE_PORT_SAMPLE_RATE_16K |
| 1625 | * - #AFE_PORT_SAMPLE_RATE_48K |
| 1626 | */ |
| 1627 | } __packed; |
| 1628 | |
| 1629 | /* |
| 1630 | * This param id is used to configure HDMI interface |
| 1631 | */ |
| 1632 | #define AFE_PARAM_ID_HDMI_CONFIG 0x00010210 |
| 1633 | |
| 1634 | /* This version information is used to handle the new |
| 1635 | * additions to the config interface in future in backward |
| 1636 | * compatible manner. |
| 1637 | */ |
| 1638 | #define AFE_API_VERSION_HDMI_CONFIG 0x1 |
| 1639 | |
| 1640 | /* Payload of the #AFE_PARAM_ID_HDMI_CONFIG command, |
| 1641 | * which configures a multichannel HDMI audio interface. |
| 1642 | */ |
| 1643 | struct afe_param_id_hdmi_multi_chan_audio_cfg { |
| 1644 | u32 hdmi_cfg_minor_version; |
| 1645 | /* Minor version used for tracking the version of the HDMI |
| 1646 | * configuration interface. |
| 1647 | * Supported values: #AFE_API_VERSION_HDMI_CONFIG |
| 1648 | */ |
| 1649 | |
Harmandeep Singh | 169f1d4 | 2012-10-01 19:19:38 -0700 | [diff] [blame] | 1650 | u16 datatype; |
Bharath Ramachandramurthy | 2e3168f | 2012-05-03 16:29:09 -0700 | [diff] [blame] | 1651 | /* data type |
| 1652 | * Supported values: |
| 1653 | * - #LINEAR_PCM_DATA |
| 1654 | * - #NON_LINEAR_DATA |
| 1655 | * - #LINEAR_PCM_DATA_PACKED_IN_60958 |
| 1656 | * - #NON_LINEAR_DATA_PACKED_IN_60958 |
| 1657 | */ |
| 1658 | |
| 1659 | u16 channel_allocation; |
| 1660 | /* HDMI channel allocation information for programming an HDMI |
| 1661 | * frame. The default is 0 (Stereo). |
| 1662 | * |
| 1663 | * This information is defined in the HDMI standard, CEA 861-D |
| 1664 | * (refer to @xhyperref{S1,[S1]}). The number of channels is also |
| 1665 | * inferred from this parameter. |
| 1666 | */ |
| 1667 | |
| 1668 | |
| 1669 | u32 sample_rate; |
| 1670 | /* Sampling rate of the port. |
| 1671 | * Supported values: |
| 1672 | * - #AFE_PORT_SAMPLE_RATE_8K |
| 1673 | * - #AFE_PORT_SAMPLE_RATE_16K |
| 1674 | * - #AFE_PORT_SAMPLE_RATE_48K |
| 1675 | * - #AFE_PORT_SAMPLE_RATE_96K |
| 1676 | * - 22050, 44100, 176400 for compressed streams |
| 1677 | */ |
| 1678 | |
| 1679 | u16 bit_width; |
| 1680 | /* Bit width of the sample. |
| 1681 | * Supported values: 16, 24 |
| 1682 | */ |
| 1683 | u16 reserved; |
| 1684 | /* This field must be set to zero. */ |
| 1685 | } __packed; |
| 1686 | |
| 1687 | /* |
| 1688 | * This param id is used to configure BT or FM(RIVA) interface |
| 1689 | */ |
| 1690 | #define AFE_PARAM_ID_INTERNAL_BT_FM_CONFIG 0x00010211 |
| 1691 | |
| 1692 | /* This version information is used to handle the new |
| 1693 | * additions to the config interface in future in backward |
| 1694 | * compatible manner. |
| 1695 | */ |
| 1696 | #define AFE_API_VERSION_INTERNAL_BT_FM_CONFIG 0x1 |
| 1697 | |
| 1698 | /* Payload of the #AFE_PARAM_ID_INTERNAL_BT_FM_CONFIG |
| 1699 | * command's BT voice/BT audio/FM configuration parameter. |
| 1700 | */ |
| 1701 | struct afe_param_id_internal_bt_fm_cfg { |
| 1702 | u32 bt_fm_cfg_minor_version; |
| 1703 | /* Minor version used for tracking the version of the BT and FM |
| 1704 | * configuration interface. |
| 1705 | * Supported values: #AFE_API_VERSION_INTERNAL_BT_FM_CONFIG |
| 1706 | */ |
| 1707 | |
| 1708 | u16 num_channels; |
| 1709 | /* Number of channels. |
| 1710 | * Supported values: 1 to 2 |
| 1711 | */ |
| 1712 | |
| 1713 | u16 bit_width; |
| 1714 | /* Bit width of the sample. |
| 1715 | * Supported values: 16 |
| 1716 | */ |
| 1717 | |
| 1718 | u32 sample_rate; |
| 1719 | /* Sampling rate of the port. |
| 1720 | * Supported values: |
| 1721 | * - #AFE_PORT_SAMPLE_RATE_8K (only for BTSCO) |
| 1722 | * - #AFE_PORT_SAMPLE_RATE_16K (only for BTSCO) |
| 1723 | * - #AFE_PORT_SAMPLE_RATE_48K (FM and A2DP) |
| 1724 | */ |
| 1725 | } __packed; |
| 1726 | |
| 1727 | /* This param id is used to configure SLIMBUS interface using |
| 1728 | * shared channel approach. |
| 1729 | */ |
| 1730 | |
| 1731 | |
| 1732 | #define AFE_PARAM_ID_SLIMBUS_CONFIG 0x00010212 |
| 1733 | |
| 1734 | /* This version information is used to handle the new |
| 1735 | * additions to the config interface in future in backward |
| 1736 | * compatible manner. |
| 1737 | */ |
| 1738 | #define AFE_API_VERSION_SLIMBUS_CONFIG 0x1 |
| 1739 | |
| 1740 | /* Enumeration for setting SLIMbus device ID 1. |
| 1741 | */ |
| 1742 | #define AFE_SLIMBUS_DEVICE_1 0x0 |
| 1743 | |
| 1744 | /* Enumeration for setting SLIMbus device ID 2. |
| 1745 | */ |
| 1746 | #define AFE_SLIMBUS_DEVICE_2 0x1 |
| 1747 | |
| 1748 | /* Enumeration for setting the SLIMbus data formats. |
| 1749 | */ |
| 1750 | #define AFE_SB_DATA_FORMAT_NOT_INDICATED 0x0 |
| 1751 | |
| 1752 | /* Enumeration for setting the maximum number of streams per |
| 1753 | * device. |
| 1754 | */ |
| 1755 | |
| 1756 | #define AFE_PORT_MAX_AUDIO_CHAN_CNT 0x8 |
| 1757 | |
| 1758 | /* Payload of the #AFE_PORT_CMD_SLIMBUS_CONFIG command's SLIMbus |
| 1759 | * port configuration parameter. |
| 1760 | */ |
| 1761 | |
| 1762 | struct afe_param_id_slimbus_cfg { |
| 1763 | u32 sb_cfg_minor_version; |
| 1764 | /* Minor version used for tracking the version of the SLIMBUS |
| 1765 | * configuration interface. |
| 1766 | * Supported values: #AFE_API_VERSION_SLIMBUS_CONFIG |
| 1767 | */ |
| 1768 | |
| 1769 | u16 slimbus_dev_id; |
| 1770 | /* SLIMbus hardware device ID, which is required to handle |
| 1771 | * multiple SLIMbus hardware blocks. |
| 1772 | * Supported values: - #AFE_SLIMBUS_DEVICE_1 - #AFE_SLIMBUS_DEVICE_2 |
| 1773 | */ |
| 1774 | |
| 1775 | |
| 1776 | u16 bit_width; |
| 1777 | /* Bit width of the sample. |
| 1778 | * Supported values: 16, 24 |
| 1779 | */ |
| 1780 | |
| 1781 | u16 data_format; |
| 1782 | /* Data format supported by the SLIMbus hardware. The default is |
| 1783 | * 0 (#AFE_SB_DATA_FORMAT_NOT_INDICATED), which indicates the |
| 1784 | * hardware does not perform any format conversions before the data |
| 1785 | * transfer. |
| 1786 | */ |
| 1787 | |
| 1788 | |
| 1789 | u16 num_channels; |
| 1790 | /* Number of channels. |
| 1791 | * Supported values: 1 to #AFE_PORT_MAX_AUDIO_CHAN_CNT |
| 1792 | */ |
| 1793 | |
| 1794 | u8 shared_ch_mapping[AFE_PORT_MAX_AUDIO_CHAN_CNT]; |
| 1795 | /* Mapping of shared channel IDs (128 to 255) to which the |
| 1796 | * master port is to be connected. |
| 1797 | * Shared_channel_mapping[i] represents the shared channel assigned |
| 1798 | * for audio channel i in multichannel audio data. |
| 1799 | */ |
| 1800 | |
| 1801 | u32 sample_rate; |
| 1802 | /* Sampling rate of the port. |
| 1803 | * Supported values: |
| 1804 | * - #AFE_PORT_SAMPLE_RATE_8K |
| 1805 | * - #AFE_PORT_SAMPLE_RATE_16K |
| 1806 | * - #AFE_PORT_SAMPLE_RATE_48K |
| 1807 | * - #AFE_PORT_SAMPLE_RATE_96K |
| 1808 | * - #AFE_PORT_SAMPLE_RATE_192K |
| 1809 | */ |
| 1810 | } __packed; |
| 1811 | |
| 1812 | /* |
| 1813 | * This param id is used to configure Real Time Proxy interface. |
| 1814 | */ |
| 1815 | #define AFE_PARAM_ID_RT_PROXY_CONFIG 0x00010213 |
| 1816 | |
| 1817 | /* This version information is used to handle the new |
| 1818 | * additions to the config interface in future in backward |
| 1819 | * compatible manner. |
| 1820 | */ |
| 1821 | #define AFE_API_VERSION_RT_PROXY_CONFIG 0x1 |
| 1822 | |
| 1823 | /* Payload of the #AFE_PARAM_ID_RT_PROXY_CONFIG |
| 1824 | * command (real-time proxy port configuration parameter). |
| 1825 | */ |
| 1826 | struct afe_param_id_rt_proxy_port_cfg { |
| 1827 | u32 rt_proxy_cfg_minor_version; |
| 1828 | /* Minor version used for tracking the version of rt-proxy |
| 1829 | * config interface. |
| 1830 | */ |
| 1831 | |
| 1832 | u16 bit_width; |
| 1833 | /* Bit width of the sample. |
| 1834 | * Supported values: 16 |
| 1835 | */ |
| 1836 | |
| 1837 | u16 interleaved; |
| 1838 | /* Specifies whether the data exchanged between the AFE |
| 1839 | * interface and real-time port is interleaved. |
| 1840 | * Supported values: - 0 -- Non-interleaved (samples from each |
| 1841 | * channel are contiguous in the buffer) - 1 -- Interleaved |
| 1842 | * (corresponding samples from each input channel are interleaved |
| 1843 | * within the buffer) |
| 1844 | */ |
| 1845 | |
| 1846 | |
| 1847 | u16 frame_size; |
| 1848 | /* Size of the frames that are used for PCM exchanges with this |
| 1849 | * port. |
| 1850 | * Supported values: > 0, in bytes |
| 1851 | * For example, 5 ms buffers of 16 bits and 16 kHz stereo samples |
| 1852 | * is 5 ms * 16 samples/ms * 2 bytes/sample * 2 channels = 320 |
| 1853 | * bytes. |
| 1854 | */ |
| 1855 | u16 jitter_allowance; |
| 1856 | /* Configures the amount of jitter that the port will allow. |
| 1857 | * Supported values: > 0 |
| 1858 | * For example, if +/-10 ms of jitter is anticipated in the timing |
| 1859 | * of sending frames to the port, and the configuration is 16 kHz |
| 1860 | * mono with 16-bit samples, this field is 10 ms * 16 samples/ms * 2 |
| 1861 | * bytes/sample = 320. |
| 1862 | */ |
| 1863 | |
| 1864 | u16 low_water_mark; |
| 1865 | /* Low watermark in bytes (including all channels). |
| 1866 | * Supported values: |
| 1867 | * - 0 -- Do not send any low watermark events |
| 1868 | * - > 0 -- Low watermark for triggering an event |
| 1869 | * If the number of bytes in an internal circular buffer is lower |
| 1870 | * than this low_water_mark parameter, a LOW_WATER_MARK event is |
| 1871 | * sent to applications (via the #AFE_EVENT_RT_PROXY_PORT_STATUS |
| 1872 | * event). |
| 1873 | * Use of watermark events is optional for debugging purposes. |
| 1874 | */ |
| 1875 | |
| 1876 | u16 high_water_mark; |
| 1877 | /* High watermark in bytes (including all channels). |
| 1878 | * Supported values: |
| 1879 | * - 0 -- Do not send any high watermark events |
| 1880 | * - > 0 -- High watermark for triggering an event |
| 1881 | * If the number of bytes in an internal circular buffer exceeds |
| 1882 | * TOTAL_CIRC_BUF_SIZE minus high_water_mark, a high watermark event |
| 1883 | * is sent to applications (via the #AFE_EVENT_RT_PROXY_PORT_STATUS |
| 1884 | * event). |
| 1885 | * The use of watermark events is optional and for debugging |
| 1886 | * purposes. |
| 1887 | */ |
| 1888 | |
| 1889 | |
| 1890 | u32 sample_rate; |
| 1891 | /* Sampling rate of the port. |
| 1892 | * Supported values: |
| 1893 | * - #AFE_PORT_SAMPLE_RATE_8K |
| 1894 | * - #AFE_PORT_SAMPLE_RATE_16K |
| 1895 | * - #AFE_PORT_SAMPLE_RATE_48K |
| 1896 | */ |
| 1897 | |
| 1898 | u16 num_channels; |
| 1899 | /* Number of channels. |
| 1900 | * Supported values: 1 to #AFE_PORT_MAX_AUDIO_CHAN_CNT |
| 1901 | */ |
| 1902 | |
| 1903 | u16 reserved; |
| 1904 | /* For 32 bit alignment. */ |
| 1905 | } __packed; |
| 1906 | |
Mohan Kumar Gubbihalli Lachma Naik | fd43440 | 2012-12-06 15:46:26 -0800 | [diff] [blame] | 1907 | |
| 1908 | /* This param id is used to configure the Pseudoport interface */ |
| 1909 | |
| 1910 | #define AFE_PARAM_ID_PSEUDO_PORT_CONFIG 0x00010219 |
| 1911 | |
| 1912 | /* Version information used to handle future additions to the configuration |
| 1913 | * interface (for backward compatibility). |
| 1914 | */ |
| 1915 | #define AFE_API_VERSION_PSEUDO_PORT_CONFIG 0x1 |
| 1916 | |
| 1917 | /* Enumeration for setting the timing_mode parameter to faster than real |
| 1918 | * time. |
| 1919 | */ |
| 1920 | #define AFE_PSEUDOPORT_TIMING_MODE_FTRT 0x0 |
| 1921 | |
| 1922 | /* Enumeration for setting the timing_mode parameter to real time using |
| 1923 | * timers. |
| 1924 | */ |
| 1925 | #define AFE_PSEUDOPORT_TIMING_MODE_TIMER 0x1 |
| 1926 | |
| 1927 | /* Payload of the AFE_PARAM_ID_PSEUDO_PORT_CONFIG parameter used by |
| 1928 | AFE_MODULE_AUDIO_DEV_INTERFACE. |
| 1929 | */ |
| 1930 | struct afe_param_id_pseudo_port_cfg { |
| 1931 | u32 pseud_port_cfg_minor_version; |
| 1932 | /* |
| 1933 | * Minor version used for tracking the version of the pseudoport |
| 1934 | * configuration interface. |
| 1935 | */ |
| 1936 | |
| 1937 | u16 bit_width; |
| 1938 | /* Bit width of the sample at values 16, 24 */ |
| 1939 | |
| 1940 | u16 num_channels; |
| 1941 | /* Number of channels at values 1 to 8 */ |
| 1942 | |
| 1943 | u16 data_format; |
| 1944 | /* Non-linear data format supported by the pseudoport (for future use). |
| 1945 | * At values #AFE_LINEAR_PCM_DATA |
| 1946 | */ |
| 1947 | |
| 1948 | u16 timing_mode; |
| 1949 | /* Indicates whether the pseudoport synchronizes to the clock or |
| 1950 | * operates faster than real time. |
| 1951 | * at values |
| 1952 | * - #AFE_PSEUDOPORT_TIMING_MODE_FTRT |
| 1953 | * - #AFE_PSEUDOPORT_TIMING_MODE_TIMER @tablebulletend |
| 1954 | */ |
| 1955 | |
| 1956 | u32 sample_rate; |
| 1957 | /* Sample rate at which the pseudoport will run. |
| 1958 | * at values |
| 1959 | * - #AFE_PORT_SAMPLE_RATE_8K |
| 1960 | * - #AFE_PORT_SAMPLE_RATE_32K |
| 1961 | * - #AFE_PORT_SAMPLE_RATE_48K |
| 1962 | * - #AFE_PORT_SAMPLE_RATE_96K |
| 1963 | * - #AFE_PORT_SAMPLE_RATE_192K @tablebulletend |
| 1964 | */ |
| 1965 | } __packed; |
| 1966 | |
| 1967 | |
Bharath Ramachandramurthy | 2e3168f | 2012-05-03 16:29:09 -0700 | [diff] [blame] | 1968 | union afe_port_config { |
| 1969 | struct afe_param_id_pcm_cfg pcm; |
| 1970 | struct afe_param_id_i2s_cfg i2s; |
| 1971 | struct afe_param_id_hdmi_multi_chan_audio_cfg hdmi_multi_ch; |
| 1972 | struct afe_param_id_slimbus_cfg slim_sch; |
| 1973 | struct afe_param_id_rt_proxy_port_cfg rtproxy; |
Phani Kumar Uppalapati | 6432794 | 2012-09-24 19:20:42 -0700 | [diff] [blame] | 1974 | struct afe_param_id_internal_bt_fm_cfg int_bt_fm; |
Mohan Kumar Gubbihalli Lachma Naik | fd43440 | 2012-12-06 15:46:26 -0800 | [diff] [blame] | 1975 | struct afe_param_id_pseudo_port_cfg pseudo_port; |
Bharath Ramachandramurthy | 2e3168f | 2012-05-03 16:29:09 -0700 | [diff] [blame] | 1976 | } __packed; |
| 1977 | |
Ben Romberger | 5e6452b | 2012-11-29 16:57:33 -0800 | [diff] [blame] | 1978 | struct afe_audioif_config_command_no_payload { |
| 1979 | struct apr_hdr hdr; |
| 1980 | struct afe_port_cmd_set_param_v2 param; |
| 1981 | } __packed; |
| 1982 | |
Bharath Ramachandramurthy | 2e3168f | 2012-05-03 16:29:09 -0700 | [diff] [blame] | 1983 | struct afe_audioif_config_command { |
| 1984 | struct apr_hdr hdr; |
| 1985 | struct afe_port_cmd_set_param_v2 param; |
| 1986 | struct afe_port_param_data_v2 pdata; |
| 1987 | union afe_port_config port; |
| 1988 | } __packed; |
| 1989 | |
| 1990 | #define AFE_PORT_CMD_DEVICE_START 0x000100E5 |
| 1991 | |
| 1992 | /* Payload of the #AFE_PORT_CMD_DEVICE_START.*/ |
| 1993 | struct afe_port_cmd_device_start { |
| 1994 | struct apr_hdr hdr; |
| 1995 | u16 port_id; |
| 1996 | /* Port interface and direction (Rx or Tx) to start. An even |
| 1997 | * number represents the Rx direction, and an odd number represents |
| 1998 | * the Tx direction. |
| 1999 | */ |
| 2000 | |
| 2001 | |
| 2002 | u16 reserved; |
| 2003 | /* Reserved for 32-bit alignment. This field must be set to 0.*/ |
| 2004 | |
| 2005 | } __packed; |
| 2006 | |
| 2007 | #define AFE_PORT_CMD_DEVICE_STOP 0x000100E6 |
| 2008 | |
| 2009 | /* Payload of the #AFE_PORT_CMD_DEVICE_STOP. |
| 2010 | */ |
| 2011 | struct afe_port_cmd_device_stop { |
| 2012 | struct apr_hdr hdr; |
| 2013 | u16 port_id; |
| 2014 | /* Port interface and direction (Rx or Tx) to start. An even |
| 2015 | * number represents the Rx direction, and an odd number represents |
| 2016 | * the Tx direction. |
| 2017 | */ |
| 2018 | |
| 2019 | u16 reserved; |
| 2020 | /* Reserved for 32-bit alignment. This field must be set to 0.*/ |
| 2021 | } __packed; |
| 2022 | |
| 2023 | #define AFE_SERVICE_CMD_SHARED_MEM_MAP_REGIONS 0x000100EA |
| 2024 | |
| 2025 | /* Memory map regions command payload used by the |
| 2026 | * #AFE_SERVICE_CMD_SHARED_MEM_MAP_REGIONS . |
| 2027 | * This structure allows clients to map multiple shared memory |
| 2028 | * regions in a single command. Following this structure are |
| 2029 | * num_regions of afe_service_shared_map_region_payload. |
| 2030 | */ |
| 2031 | struct afe_service_cmd_shared_mem_map_regions { |
| 2032 | struct apr_hdr hdr; |
| 2033 | u16 mem_pool_id; |
| 2034 | /* Type of memory on which this memory region is mapped. |
| 2035 | * Supported values: |
| 2036 | * - #ADSP_MEMORY_MAP_EBI_POOL |
| 2037 | * - #ADSP_MEMORY_MAP_SMI_POOL |
| 2038 | * - #ADSP_MEMORY_MAP_SHMEM8_4K_POOL |
| 2039 | * - Other values are reserved |
| 2040 | * |
| 2041 | * The memory pool ID implicitly defines the characteristics of the |
| 2042 | * memory. Characteristics may include alignment type, permissions, |
| 2043 | * etc. |
| 2044 | * |
| 2045 | * ADSP_MEMORY_MAP_EBI_POOL is External Buffer Interface type memory |
| 2046 | * ADSP_MEMORY_MAP_SMI_POOL is Shared Memory Interface type memory |
| 2047 | * ADSP_MEMORY_MAP_SHMEM8_4K_POOL is shared memory, byte |
| 2048 | * addressable, and 4 KB aligned. |
| 2049 | */ |
| 2050 | |
| 2051 | |
| 2052 | u16 num_regions; |
| 2053 | /* Number of regions to map. |
| 2054 | * Supported values: |
| 2055 | * - Any value greater than zero |
| 2056 | */ |
| 2057 | |
| 2058 | u32 property_flag; |
| 2059 | /* Configures one common property for all the regions in the |
| 2060 | * payload. |
| 2061 | * |
| 2062 | * Supported values: - 0x00000000 to 0x00000001 |
| 2063 | * |
| 2064 | * b0 - bit 0 indicates physical or virtual mapping 0 Shared memory |
| 2065 | * address provided in afe_service_shared_map_region_payloadis a |
| 2066 | * physical address. The shared memory needs to be mapped( hardware |
| 2067 | * TLB entry) and a software entry needs to be added for internal |
| 2068 | * book keeping. |
| 2069 | * |
| 2070 | * 1 Shared memory address provided in |
| 2071 | * afe_service_shared_map_region_payloadis a virtual address. The |
| 2072 | * shared memory must not be mapped (since hardware TLB entry is |
| 2073 | * already available) but a software entry needs to be added for |
| 2074 | * internal book keeping. This can be useful if two services with in |
| 2075 | * ADSP is communicating via APR. They can now directly communicate |
| 2076 | * via the Virtual address instead of Physical address. The virtual |
| 2077 | * regions must be contiguous. num_regions must be 1 in this case. |
| 2078 | * |
| 2079 | * b31-b1 - reserved bits. must be set to zero |
| 2080 | */ |
| 2081 | |
| 2082 | |
| 2083 | } __packed; |
| 2084 | /* Map region payload used by the |
| 2085 | * afe_service_shared_map_region_payloadstructure. |
| 2086 | */ |
| 2087 | struct afe_service_shared_map_region_payload { |
| 2088 | u32 shm_addr_lsw; |
| 2089 | /* least significant word of starting address in the memory |
| 2090 | * region to map. It must be contiguous memory, and it must be 4 KB |
| 2091 | * aligned. |
| 2092 | * Supported values: - Any 32 bit value |
| 2093 | */ |
| 2094 | |
| 2095 | |
| 2096 | u32 shm_addr_msw; |
| 2097 | /* most significant word of startng address in the memory region |
| 2098 | * to map. For 32 bit shared memory address, this field must be set |
| 2099 | * to zero. For 36 bit shared memory address, bit31 to bit 4 must be |
| 2100 | * set to zero |
| 2101 | * |
| 2102 | * Supported values: - For 32 bit shared memory address, this field |
| 2103 | * must be set to zero. - For 36 bit shared memory address, bit31 to |
| 2104 | * bit 4 must be set to zero - For 64 bit shared memory address, any |
| 2105 | * 32 bit value |
| 2106 | */ |
| 2107 | |
| 2108 | |
| 2109 | u32 mem_size_bytes; |
| 2110 | /* Number of bytes in the region. The aDSP will always map the |
| 2111 | * regions as virtual contiguous memory, but the memory size must be |
| 2112 | * in multiples of 4 KB to avoid gaps in the virtually contiguous |
| 2113 | * mapped memory. |
| 2114 | * |
| 2115 | * Supported values: - multiples of 4KB |
| 2116 | */ |
| 2117 | |
| 2118 | } __packed; |
| 2119 | |
| 2120 | #define AFE_SERVICE_CMDRSP_SHARED_MEM_MAP_REGIONS 0x000100EB |
| 2121 | struct afe_service_cmdrsp_shared_mem_map_regions { |
| 2122 | u32 mem_map_handle; |
| 2123 | /* A memory map handle encapsulating shared memory attributes is |
| 2124 | * returned iff AFE_SERVICE_CMD_SHARED_MEM_MAP_REGIONS command is |
| 2125 | * successful. In the case of failure , a generic APR error response |
| 2126 | * is returned to the client. |
| 2127 | * |
| 2128 | * Supported Values: - Any 32 bit value |
| 2129 | */ |
| 2130 | |
| 2131 | } __packed; |
| 2132 | #define AFE_SERVICE_CMD_SHARED_MEM_UNMAP_REGIONS 0x000100EC |
| 2133 | /* Memory unmap regions command payload used by the |
| 2134 | * #AFE_SERVICE_CMD_SHARED_MEM_UNMAP_REGIONS |
| 2135 | * |
| 2136 | * This structure allows clients to unmap multiple shared memory |
| 2137 | * regions in a single command. |
| 2138 | */ |
| 2139 | |
| 2140 | |
| 2141 | struct afe_service_cmd_shared_mem_unmap_regions { |
| 2142 | struct apr_hdr hdr; |
| 2143 | u32 mem_map_handle; |
| 2144 | /* memory map handle returned by |
| 2145 | * AFE_SERVICE_CMD_SHARED_MEM_MAP_REGIONS commands |
| 2146 | * |
| 2147 | * Supported Values: |
| 2148 | * - Any 32 bit value |
| 2149 | */ |
| 2150 | } __packed; |
| 2151 | |
| 2152 | #define AFE_PORT_CMD_GET_PARAM_V2 0x000100F0 |
| 2153 | |
| 2154 | /* Payload of the #AFE_PORT_CMD_GET_PARAM_V2 command, |
| 2155 | * which queries for one post/preprocessing parameter of a |
| 2156 | * stream. |
| 2157 | */ |
| 2158 | struct afe_port_cmd_get_param_v2 { |
| 2159 | |
| 2160 | struct apr_hdr hdr; |
| 2161 | u16 port_id; |
| 2162 | /* Port interface and direction (Rx or Tx) to start. */ |
| 2163 | |
| 2164 | u16 payload_size; |
| 2165 | /* Maximum data size of the parameter ID/module ID combination. |
| 2166 | * This is a multiple of four bytes |
| 2167 | * Supported values: > 0 |
| 2168 | */ |
| 2169 | |
| 2170 | u32 payload_address_lsw; |
| 2171 | /* LSW of 64 bit Payload address. Address should be 32-byte, |
| 2172 | * 4kbyte aligned and must be contig memory. |
| 2173 | */ |
| 2174 | |
| 2175 | |
| 2176 | u32 payload_address_msw; |
| 2177 | /* MSW of 64 bit Payload address. In case of 32-bit shared |
| 2178 | * memory address, this field must be set to zero. In case of 36-bit |
| 2179 | * shared memory address, bit-4 to bit-31 must be set to zero. |
| 2180 | * Address should be 32-byte, 4kbyte aligned and must be contiguous |
| 2181 | * memory. |
| 2182 | */ |
| 2183 | |
| 2184 | u32 mem_map_handle; |
| 2185 | /* Memory map handle returned by |
| 2186 | * AFE_SERVICE_CMD_SHARED_MEM_MAP_REGIONS commands. |
| 2187 | * Supported Values: - NULL -- Message. The parameter data is |
| 2188 | * in-band. - Non-NULL -- The parameter data is Out-band.Pointer to |
| 2189 | * - the physical address in shared memory of the payload data. |
| 2190 | * For detailed payload content, see the afe_port_param_data_v2 |
| 2191 | * structure |
| 2192 | */ |
| 2193 | |
| 2194 | |
| 2195 | u32 module_id; |
| 2196 | /* ID of the module to be queried. |
| 2197 | * Supported values: Valid module ID |
| 2198 | */ |
| 2199 | |
| 2200 | u32 param_id; |
| 2201 | /* ID of the parameter to be queried. |
| 2202 | * Supported values: Valid parameter ID |
| 2203 | */ |
| 2204 | } __packed; |
| 2205 | |
| 2206 | #define AFE_PORT_CMDRSP_GET_PARAM_V2 0x00010106 |
| 2207 | |
| 2208 | /* Payload of the #AFE_PORT_CMDRSP_GET_PARAM_V2 message, which |
| 2209 | * responds to an #AFE_PORT_CMD_GET_PARAM_V2 command. |
| 2210 | * |
| 2211 | * Immediately following this structure is the parameters structure |
| 2212 | * (afe_port_param_data) containing the response(acknowledgment) |
| 2213 | * parameter payload. This payload is included for an in-band |
| 2214 | * scenario. For an address/shared memory-based set parameter, this |
| 2215 | * payload is not needed. |
| 2216 | */ |
| 2217 | |
| 2218 | |
| 2219 | struct afe_port_cmdrsp_get_param_v2 { |
| 2220 | u32 status; |
| 2221 | } __packed; |
| 2222 | |
| 2223 | /* adsp_afe_service_commands.h */ |
| 2224 | |
| 2225 | #define ADSP_MEMORY_MAP_EBI_POOL 0 |
| 2226 | |
| 2227 | #define ADSP_MEMORY_MAP_SMI_POOL 1 |
| 2228 | #define ADSP_MEMORY_MAP_IMEM_POOL 2 |
| 2229 | #define ADSP_MEMORY_MAP_SHMEM8_4K_POOL 3 |
| 2230 | /* |
| 2231 | * Definition of virtual memory flag |
| 2232 | */ |
| 2233 | #define ADSP_MEMORY_MAP_VIRTUAL_MEMORY 1 |
| 2234 | |
| 2235 | /* |
| 2236 | * Definition of physical memory flag |
| 2237 | */ |
| 2238 | #define ADSP_MEMORY_MAP_PHYSICAL_MEMORY 0 |
| 2239 | |
| 2240 | |
| 2241 | #define DEFAULT_COPP_TOPOLOGY 0x00010be3 |
| 2242 | #define DEFAULT_POPP_TOPOLOGY 0x00010be4 |
| 2243 | #define VPM_TX_SM_ECNS_COPP_TOPOLOGY 0x00010F71 |
| 2244 | #define VPM_TX_DM_FLUENCE_COPP_TOPOLOGY 0x00010F72 |
| 2245 | #define VPM_TX_QMIC_FLUENCE_COPP_TOPOLOGY 0x00010F75 |
| 2246 | |
| 2247 | /* Memory map regions command payload used by the |
| 2248 | * #ASM_CMD_SHARED_MEM_MAP_REGIONS ,#ADM_CMD_SHARED_MEM_MAP_REGIONS |
| 2249 | * commands. |
| 2250 | * |
| 2251 | * This structure allows clients to map multiple shared memory |
| 2252 | * regions in a single command. Following this structure are |
| 2253 | * num_regions of avs_shared_map_region_payload. |
| 2254 | */ |
| 2255 | |
| 2256 | |
| 2257 | struct avs_cmd_shared_mem_map_regions { |
| 2258 | struct apr_hdr hdr; |
| 2259 | u16 mem_pool_id; |
| 2260 | /* Type of memory on which this memory region is mapped. |
| 2261 | * |
| 2262 | * Supported values: - #ADSP_MEMORY_MAP_EBI_POOL - |
| 2263 | * #ADSP_MEMORY_MAP_SMI_POOL - #ADSP_MEMORY_MAP_IMEM_POOL |
| 2264 | * (unsupported) - #ADSP_MEMORY_MAP_SHMEM8_4K_POOL - Other values |
| 2265 | * are reserved |
| 2266 | * |
| 2267 | * The memory ID implicitly defines the characteristics of the |
| 2268 | * memory. Characteristics may include alignment type, permissions, |
| 2269 | * etc. |
| 2270 | * |
| 2271 | * SHMEM8_4K is shared memory, byte addressable, and 4 KB aligned. |
| 2272 | */ |
| 2273 | |
| 2274 | |
| 2275 | u16 num_regions; |
| 2276 | /* Number of regions to map.*/ |
| 2277 | |
| 2278 | u32 property_flag; |
| 2279 | /* Configures one common property for all the regions in the |
| 2280 | * payload. No two regions in the same memory map regions cmd can |
| 2281 | * have differnt property. Supported values: - 0x00000000 to |
| 2282 | * 0x00000001 |
| 2283 | * |
| 2284 | * b0 - bit 0 indicates physical or virtual mapping 0 shared memory |
| 2285 | * address provided in avs_shared_map_regions_payload is physical |
| 2286 | * address. The shared memory needs to be mapped( hardware TLB |
| 2287 | * entry) |
| 2288 | * |
| 2289 | * and a software entry needs to be added for internal book keeping. |
| 2290 | * |
| 2291 | * 1 Shared memory address provided in MayPayload[usRegions] is |
| 2292 | * virtual address. The shared memory must not be mapped (since |
| 2293 | * hardware TLB entry is already available) but a software entry |
| 2294 | * needs to be added for internal book keeping. This can be useful |
| 2295 | * if two services with in ADSP is communicating via APR. They can |
| 2296 | * now directly communicate via the Virtual address instead of |
| 2297 | * Physical address. The virtual regions must be contiguous. |
| 2298 | * |
| 2299 | * b31-b1 - reserved bits. must be set to zero |
| 2300 | */ |
| 2301 | |
| 2302 | } __packed; |
| 2303 | |
| 2304 | struct avs_shared_map_region_payload { |
| 2305 | u32 shm_addr_lsw; |
| 2306 | /* least significant word of shared memory address of the memory |
| 2307 | * region to map. It must be contiguous memory, and it must be 4 KB |
| 2308 | * aligned. |
| 2309 | */ |
| 2310 | |
| 2311 | u32 shm_addr_msw; |
| 2312 | /* most significant word of shared memory address of the memory |
| 2313 | * region to map. For 32 bit shared memory address, this field must |
| 2314 | * tbe set to zero. For 36 bit shared memory address, bit31 to bit 4 |
| 2315 | * must be set to zero |
| 2316 | */ |
| 2317 | |
| 2318 | u32 mem_size_bytes; |
| 2319 | /* Number of bytes in the region. |
| 2320 | * |
| 2321 | * The aDSP will always map the regions as virtual contiguous |
| 2322 | * memory, but the memory size must be in multiples of 4 KB to avoid |
| 2323 | * gaps in the virtually contiguous mapped memory. |
| 2324 | */ |
| 2325 | |
| 2326 | } __packed; |
| 2327 | |
| 2328 | struct avs_cmd_shared_mem_unmap_regions { |
| 2329 | struct apr_hdr hdr; |
| 2330 | u32 mem_map_handle; |
| 2331 | /* memory map handle returned by ASM_CMD_SHARED_MEM_MAP_REGIONS |
| 2332 | * , ADM_CMD_SHARED_MEM_MAP_REGIONS, commands |
| 2333 | */ |
| 2334 | |
| 2335 | } __packed; |
| 2336 | |
| 2337 | /* Memory map command response payload used by the |
| 2338 | * #ASM_CMDRSP_SHARED_MEM_MAP_REGIONS |
| 2339 | * ,#ADM_CMDRSP_SHARED_MEM_MAP_REGIONS |
| 2340 | */ |
| 2341 | |
| 2342 | |
| 2343 | struct avs_cmdrsp_shared_mem_map_regions { |
| 2344 | u32 mem_map_handle; |
| 2345 | /* A memory map handle encapsulating shared memory attributes is |
| 2346 | * returned |
| 2347 | */ |
| 2348 | |
| 2349 | } __packed; |
| 2350 | |
| 2351 | /*adsp_audio_memmap_api.h*/ |
| 2352 | |
| 2353 | /* ASM related data structures */ |
| 2354 | struct asm_wma_cfg { |
| 2355 | u16 format_tag; |
| 2356 | u16 ch_cfg; |
| 2357 | u32 sample_rate; |
| 2358 | u32 avg_bytes_per_sec; |
| 2359 | u16 block_align; |
| 2360 | u16 valid_bits_per_sample; |
| 2361 | u32 ch_mask; |
| 2362 | u16 encode_opt; |
| 2363 | u16 adv_encode_opt; |
| 2364 | u32 adv_encode_opt2; |
| 2365 | u32 drc_peak_ref; |
| 2366 | u32 drc_peak_target; |
| 2367 | u32 drc_ave_ref; |
| 2368 | u32 drc_ave_target; |
| 2369 | } __packed; |
| 2370 | |
| 2371 | struct asm_wmapro_cfg { |
| 2372 | u16 format_tag; |
| 2373 | u16 ch_cfg; |
| 2374 | u32 sample_rate; |
| 2375 | u32 avg_bytes_per_sec; |
| 2376 | u16 block_align; |
| 2377 | u16 valid_bits_per_sample; |
| 2378 | u32 ch_mask; |
| 2379 | u16 encode_opt; |
| 2380 | u16 adv_encode_opt; |
| 2381 | u32 adv_encode_opt2; |
| 2382 | u32 drc_peak_ref; |
| 2383 | u32 drc_peak_target; |
| 2384 | u32 drc_ave_ref; |
| 2385 | u32 drc_ave_target; |
| 2386 | } __packed; |
| 2387 | |
| 2388 | struct asm_aac_cfg { |
| 2389 | u16 format; |
| 2390 | u16 aot; |
| 2391 | u16 ep_config; |
| 2392 | u16 section_data_resilience; |
| 2393 | u16 scalefactor_data_resilience; |
| 2394 | u16 spectral_data_resilience; |
| 2395 | u16 ch_cfg; |
| 2396 | u16 reserved; |
| 2397 | u32 sample_rate; |
| 2398 | } __packed; |
| 2399 | |
| 2400 | struct asm_softpause_params { |
| 2401 | u32 enable; |
| 2402 | u32 period; |
| 2403 | u32 step; |
| 2404 | u32 rampingcurve; |
| 2405 | } __packed; |
| 2406 | |
| 2407 | struct asm_softvolume_params { |
| 2408 | u32 period; |
| 2409 | u32 step; |
| 2410 | u32 rampingcurve; |
| 2411 | } __packed; |
| 2412 | |
| 2413 | #define ASM_END_POINT_DEVICE_MATRIX 0 |
Harmandeep Singh | eaf59b4 | 2012-06-05 21:46:02 -0700 | [diff] [blame] | 2414 | |
| 2415 | #define PCM_CHANNEL_NULL 0 |
| 2416 | |
Bharath Ramachandramurthy | 2e3168f | 2012-05-03 16:29:09 -0700 | [diff] [blame] | 2417 | /* Front left channel. */ |
| 2418 | #define PCM_CHANNEL_FL 1 |
| 2419 | |
| 2420 | /* Front right channel. */ |
| 2421 | #define PCM_CHANNEL_FR 2 |
| 2422 | |
| 2423 | /* Front center channel. */ |
| 2424 | #define PCM_CHANNEL_FC 3 |
| 2425 | |
| 2426 | /* Left surround channel.*/ |
| 2427 | #define PCM_CHANNEL_LS 4 |
| 2428 | |
| 2429 | /* Right surround channel.*/ |
| 2430 | #define PCM_CHANNEL_RS 5 |
| 2431 | |
| 2432 | /* Low frequency effect channel. */ |
| 2433 | #define PCM_CHANNEL_LFE 6 |
| 2434 | |
| 2435 | /* Center surround channel; Rear center channel. */ |
| 2436 | #define PCM_CHANNEL_CS 7 |
| 2437 | |
| 2438 | /* Left back channel; Rear left channel. */ |
| 2439 | #define PCM_CHANNEL_LB 8 |
| 2440 | |
| 2441 | /* Right back channel; Rear right channel. */ |
| 2442 | #define PCM_CHANNEL_RB 9 |
| 2443 | |
| 2444 | /* Top surround channel. */ |
| 2445 | #define PCM_CHANNELS 10 |
| 2446 | |
| 2447 | /* Center vertical height channel.*/ |
| 2448 | #define PCM_CHANNEL_CVH 11 |
| 2449 | |
| 2450 | /* Mono surround channel.*/ |
| 2451 | #define PCM_CHANNEL_MS 12 |
| 2452 | |
| 2453 | /* Front left of center. */ |
| 2454 | #define PCM_CHANNEL_FLC 13 |
| 2455 | |
| 2456 | /* Front right of center. */ |
| 2457 | #define PCM_CHANNEL_FRC 14 |
| 2458 | |
| 2459 | /* Rear left of center. */ |
| 2460 | #define PCM_CHANNEL_RLC 15 |
| 2461 | |
| 2462 | /* Rear right of center. */ |
| 2463 | #define PCM_CHANNEL_RRC 16 |
| 2464 | |
| 2465 | #define PCM_FORMAT_MAX_NUM_CHANNEL 8 |
| 2466 | |
| 2467 | #define ASM_MEDIA_FMT_MULTI_CHANNEL_PCM_V2 0x00010DA5 |
| 2468 | |
| 2469 | #define ASM_STREAM_POSTPROC_TOPO_ID_DEFAULT 0x00010BE4 |
| 2470 | |
| 2471 | #define ASM_MEDIA_FMT_EVRCB_FS 0x00010BEF |
| 2472 | |
| 2473 | #define ASM_MEDIA_FMT_EVRCWB_FS 0x00010BF0 |
| 2474 | |
| 2475 | #define ASM_MAX_EQ_BANDS 12 |
| 2476 | |
| 2477 | #define ASM_DATA_CMD_MEDIA_FMT_UPDATE_V2 0x00010D98 |
| 2478 | |
| 2479 | struct asm_data_cmd_media_fmt_update_v2 { |
| 2480 | u32 fmt_blk_size; |
| 2481 | /* Media format block size in bytes.*/ |
| 2482 | } __packed; |
| 2483 | |
| 2484 | struct asm_multi_channel_pcm_fmt_blk_v2 { |
| 2485 | struct apr_hdr hdr; |
| 2486 | struct asm_data_cmd_media_fmt_update_v2 fmt_blk; |
| 2487 | |
| 2488 | u16 num_channels; |
| 2489 | /* Number of channels. Supported values: 1 to 8 */ |
| 2490 | u16 bits_per_sample; |
| 2491 | /* Number of bits per sample per channel. * Supported values: |
| 2492 | * 16, 24 * When used for playback, the client must send 24-bit |
| 2493 | * samples packed in 32-bit words. The 24-bit samples must be placed |
| 2494 | * in the most significant 24 bits of the 32-bit word. When used for |
| 2495 | * recording, the aDSP sends 24-bit samples packed in 32-bit words. |
| 2496 | * The 24-bit samples are placed in the most significant 24 bits of |
| 2497 | * the 32-bit word. |
| 2498 | */ |
| 2499 | |
| 2500 | |
| 2501 | u32 sample_rate; |
| 2502 | /* Number of samples per second (in Hertz). |
| 2503 | * Supported values: 2000 to 48000 |
| 2504 | */ |
| 2505 | |
| 2506 | u16 is_signed; |
| 2507 | /* Flag that indicates the samples are signed (1). */ |
| 2508 | |
| 2509 | u16 reserved; |
| 2510 | /* reserved field for 32 bit alignment. must be set to zero. */ |
| 2511 | |
| 2512 | u8 channel_mapping[8]; |
| 2513 | /* Channel array of size 8. |
| 2514 | * Supported values: |
| 2515 | * - #PCM_CHANNEL_L |
| 2516 | * - #PCM_CHANNEL_R |
| 2517 | * - #PCM_CHANNEL_C |
| 2518 | * - #PCM_CHANNEL_LS |
| 2519 | * - #PCM_CHANNEL_RS |
| 2520 | * - #PCM_CHANNEL_LFE |
| 2521 | * - #PCM_CHANNEL_CS |
| 2522 | * - #PCM_CHANNEL_LB |
| 2523 | * - #PCM_CHANNEL_RB |
| 2524 | * - #PCM_CHANNELS |
| 2525 | * - #PCM_CHANNEL_CVH |
| 2526 | * - #PCM_CHANNEL_MS |
| 2527 | * - #PCM_CHANNEL_FLC |
| 2528 | * - #PCM_CHANNEL_FRC |
| 2529 | * - #PCM_CHANNEL_RLC |
| 2530 | * - #PCM_CHANNEL_RRC |
| 2531 | * |
| 2532 | * Channel[i] mapping describes channel I. Each element i of the |
| 2533 | * array describes channel I inside the buffer where 0 @le I < |
| 2534 | * num_channels. An unused channel is set to zero. |
| 2535 | */ |
| 2536 | } __packed; |
| 2537 | |
| 2538 | struct asm_stream_cmd_set_encdec_param { |
Harmandeep Singh | eaf59b4 | 2012-06-05 21:46:02 -0700 | [diff] [blame] | 2539 | u32 param_id; |
Bharath Ramachandramurthy | 2e3168f | 2012-05-03 16:29:09 -0700 | [diff] [blame] | 2540 | /* ID of the parameter. */ |
| 2541 | |
| 2542 | u32 param_size; |
| 2543 | /* Data size of this parameter, in bytes. The size is a multiple |
| 2544 | * of 4 bytes. |
| 2545 | */ |
| 2546 | |
| 2547 | } __packed; |
| 2548 | |
| 2549 | struct asm_enc_cfg_blk_param_v2 { |
| 2550 | u32 frames_per_buf; |
| 2551 | /* Number of encoded frames to pack into each buffer. |
| 2552 | * |
| 2553 | * @note1hang This is only guidance information for the aDSP. The |
| 2554 | * number of encoded frames put into each buffer (specified by the |
| 2555 | * client) is less than or equal to this number. |
| 2556 | */ |
| 2557 | |
| 2558 | u32 enc_cfg_blk_size; |
| 2559 | /* Size in bytes of the encoder configuration block that follows |
| 2560 | * this member. |
| 2561 | */ |
| 2562 | |
| 2563 | } __packed; |
| 2564 | |
| 2565 | /* @brief Multichannel PCM encoder configuration structure used |
| 2566 | * in the #ASM_STREAM_CMD_OPEN_READ_V2 command. |
| 2567 | */ |
| 2568 | |
| 2569 | struct asm_multi_channel_pcm_enc_cfg_v2 { |
| 2570 | struct apr_hdr hdr; |
| 2571 | struct asm_stream_cmd_set_encdec_param encdec; |
| 2572 | struct asm_enc_cfg_blk_param_v2 encblk; |
| 2573 | uint16_t num_channels; |
| 2574 | /*< Number of PCM channels. |
| 2575 | * |
| 2576 | * Supported values: - 0 -- Native mode - 1 -- 8 Native mode |
| 2577 | * indicates that encoding must be performed with the number of |
| 2578 | * channels at the input. |
| 2579 | */ |
| 2580 | |
| 2581 | uint16_t bits_per_sample; |
| 2582 | /*< Number of bits per sample per channel. |
| 2583 | * Supported values: 16, 24 |
| 2584 | */ |
| 2585 | |
| 2586 | uint32_t sample_rate; |
| 2587 | /*< Number of samples per second (in Hertz). |
| 2588 | * |
| 2589 | * Supported values: 0, 8000 to 48000 A value of 0 indicates the |
| 2590 | * native sampling rate. Encoding is performed at the input sampling |
| 2591 | * rate. |
| 2592 | */ |
| 2593 | |
| 2594 | uint16_t is_signed; |
| 2595 | /*< Specifies whether the samples are signed (1). Currently, |
| 2596 | * only signed samples are supported. |
| 2597 | */ |
| 2598 | |
| 2599 | uint16_t reserved; |
| 2600 | /*< reserved field for 32 bit alignment. must be set to zero.*/ |
| 2601 | |
| 2602 | |
| 2603 | uint8_t channel_mapping[8]; |
| 2604 | } __packed; |
| 2605 | |
| 2606 | #define ASM_MEDIA_FMT_MP3 0x00010BE9 |
| 2607 | #define ASM_MEDIA_FMT_AAC_V2 0x00010DA6 |
| 2608 | |
| 2609 | /* @xreflabel |
| 2610 | * {hdr:AsmMediaFmtDolbyAac} Media format ID for the |
| 2611 | * Dolby AAC decoder. This format ID is be used if the client wants |
| 2612 | * to use the Dolby AAC decoder to decode MPEG2 and MPEG4 AAC |
| 2613 | * contents. |
| 2614 | */ |
| 2615 | |
| 2616 | #define ASM_MEDIA_FMT_DOLBY_AAC 0x00010D86 |
| 2617 | |
| 2618 | /* Enumeration for the audio data transport stream AAC format. */ |
| 2619 | #define ASM_MEDIA_FMT_AAC_FORMAT_FLAG_ADTS 0 |
| 2620 | |
| 2621 | /* Enumeration for low overhead audio stream AAC format. */ |
| 2622 | #define ASM_MEDIA_FMT_AAC_FORMAT_FLAG_LOAS 1 |
| 2623 | |
| 2624 | /* Enumeration for the audio data interchange format |
| 2625 | * AAC format. |
| 2626 | */ |
| 2627 | #define ASM_MEDIA_FMT_AAC_FORMAT_FLAG_ADIF 2 |
| 2628 | |
| 2629 | /* Enumeration for the raw AAC format. */ |
| 2630 | #define ASM_MEDIA_FMT_AAC_FORMAT_FLAG_RAW 3 |
| 2631 | |
| 2632 | #define ASM_MEDIA_FMT_AAC_AOT_LC 2 |
| 2633 | #define ASM_MEDIA_FMT_AAC_AOT_SBR 5 |
| 2634 | #define ASM_MEDIA_FMT_AAC_AOT_PS 29 |
| 2635 | #define ASM_MEDIA_FMT_AAC_AOT_BSAC 22 |
| 2636 | |
| 2637 | struct asm_aac_fmt_blk_v2 { |
| 2638 | struct apr_hdr hdr; |
| 2639 | struct asm_data_cmd_media_fmt_update_v2 fmt_blk; |
| 2640 | |
| 2641 | u16 aac_fmt_flag; |
| 2642 | /* Bitstream format option. |
| 2643 | * Supported values: |
| 2644 | * - #ASM_MEDIA_FMT_AAC_FORMAT_FLAG_ADTS |
| 2645 | * - #ASM_MEDIA_FMT_AAC_FORMAT_FLAG_LOAS |
| 2646 | * - #ASM_MEDIA_FMT_AAC_FORMAT_FLAG_ADIF |
| 2647 | * - #ASM_MEDIA_FMT_AAC_FORMAT_FLAG_RAW |
| 2648 | */ |
| 2649 | |
| 2650 | u16 audio_objype; |
| 2651 | /* Audio Object Type (AOT) present in the AAC stream. |
| 2652 | * Supported values: |
| 2653 | * - #ASM_MEDIA_FMT_AAC_AOT_LC |
| 2654 | * - #ASM_MEDIA_FMT_AAC_AOT_SBR |
| 2655 | * - #ASM_MEDIA_FMT_AAC_AOT_BSAC |
| 2656 | * - #ASM_MEDIA_FMT_AAC_AOT_PS |
| 2657 | * - Otherwise -- Not supported |
| 2658 | */ |
| 2659 | |
| 2660 | u16 channel_config; |
| 2661 | /* Number of channels present in the AAC stream. |
| 2662 | * Supported values: |
| 2663 | * - 1 -- Mono |
| 2664 | * - 2 -- Stereo |
| 2665 | * - 6 -- 5.1 content |
| 2666 | */ |
| 2667 | |
Bharath Ramachandramurthy | 2e3168f | 2012-05-03 16:29:09 -0700 | [diff] [blame] | 2668 | u16 total_size_of_PCE_bits; |
| 2669 | /* greater or equal to zero. * -In case of RAW formats and |
| 2670 | * channel config = 0 (PCE), client can send * the bit stream |
| 2671 | * containing PCE immediately following this structure * (in-band). |
| 2672 | * -This number does not include bits included for 32 bit alignment. |
| 2673 | * -If zero, then the PCE info is assumed to be available in the |
| 2674 | * audio -bit stream & not in-band. |
| 2675 | */ |
| 2676 | |
| 2677 | u32 sample_rate; |
| 2678 | /* Number of samples per second (in Hertz). |
| 2679 | * |
| 2680 | * Supported values: 8000, 11025, 12000, 16000, 22050, 24000, 32000, |
| 2681 | * 44100, 48000 |
| 2682 | * |
| 2683 | * This field must be equal to the sample rate of the AAC-LC |
| 2684 | * decoder's output. - For MP4 or 3GP containers, this is indicated |
| 2685 | * by the samplingFrequencyIndex field in the AudioSpecificConfig |
| 2686 | * element. - For ADTS format, this is indicated by the |
| 2687 | * samplingFrequencyIndex in the ADTS fixed header. - For ADIF |
| 2688 | * format, this is indicated by the samplingFrequencyIndex in the |
| 2689 | * program_config_element present in the ADIF header. |
| 2690 | */ |
| 2691 | |
| 2692 | } __packed; |
| 2693 | |
| 2694 | struct asm_aac_enc_cfg_v2 { |
| 2695 | struct apr_hdr hdr; |
| 2696 | struct asm_stream_cmd_set_encdec_param encdec; |
| 2697 | struct asm_enc_cfg_blk_param_v2 encblk; |
| 2698 | |
| 2699 | u32 bit_rate; |
| 2700 | /* Encoding rate in bits per second. */ |
| 2701 | u32 enc_mode; |
| 2702 | /* Encoding mode. |
| 2703 | * Supported values: |
| 2704 | * - #ASM_MEDIA_FMT_AAC_AOT_LC |
| 2705 | * - #ASM_MEDIA_FMT_AAC_AOT_SBR |
| 2706 | * - #ASM_MEDIA_FMT_AAC_AOT_PS |
| 2707 | */ |
| 2708 | u16 aac_fmt_flag; |
| 2709 | /* AAC format flag. |
| 2710 | * Supported values: |
| 2711 | * - #ASM_MEDIA_FMT_AAC_FORMAT_FLAG_ADTS |
| 2712 | * - #ASM_MEDIA_FMT_AAC_FORMAT_FLAG_RAW |
| 2713 | */ |
| 2714 | u16 channel_cfg; |
| 2715 | /* Number of channels to encode. |
| 2716 | * Supported values: |
| 2717 | * - 0 -- Native mode |
| 2718 | * - 1 -- Mono |
| 2719 | * - 2 -- Stereo |
| 2720 | * - Other values are not supported. |
| 2721 | * @note1hang The eAAC+ encoder mode supports only stereo. |
| 2722 | * Native mode indicates that encoding must be performed with the |
| 2723 | * number of channels at the input. |
| 2724 | * The number of channels must not change during encoding. |
| 2725 | */ |
| 2726 | |
| 2727 | u32 sample_rate; |
| 2728 | /* Number of samples per second. |
| 2729 | * Supported values: - 0 -- Native mode - For other values, |
| 2730 | * Native mode indicates that encoding must be performed with the |
| 2731 | * sampling rate at the input. |
| 2732 | * The sampling rate must not change during encoding. |
| 2733 | */ |
| 2734 | |
| 2735 | } __packed; |
| 2736 | |
| 2737 | #define ASM_MEDIA_FMT_AMRNB_FS 0x00010BEB |
| 2738 | |
| 2739 | /* Enumeration for 4.75 kbps AMR-NB Encoding mode. */ |
| 2740 | #define ASM_MEDIA_FMT_AMRNB_FS_ENCODE_MODE_MR475 0 |
| 2741 | |
| 2742 | /* Enumeration for 5.15 kbps AMR-NB Encoding mode. */ |
| 2743 | #define ASM_MEDIA_FMT_AMRNB_FS_ENCODE_MODE_MR515 1 |
| 2744 | |
| 2745 | /* Enumeration for 5.90 kbps AMR-NB Encoding mode. */ |
| 2746 | #define ASM_MEDIA_FMT_AMRNB_FS_ENCODE_MODE_MMR59 2 |
| 2747 | |
| 2748 | /* Enumeration for 6.70 kbps AMR-NB Encoding mode. */ |
| 2749 | #define ASM_MEDIA_FMT_AMRNB_FS_ENCODE_MODE_MMR67 3 |
| 2750 | |
| 2751 | /* Enumeration for 7.40 kbps AMR-NB Encoding mode. */ |
| 2752 | #define ASM_MEDIA_FMT_AMRNB_FS_ENCODE_MODE_MMR74 4 |
| 2753 | |
| 2754 | /* Enumeration for 7.95 kbps AMR-NB Encoding mode. */ |
| 2755 | #define ASM_MEDIA_FMT_AMRNB_FS_ENCODE_MODE_MMR795 5 |
| 2756 | |
| 2757 | /* Enumeration for 10.20 kbps AMR-NB Encoding mode. */ |
| 2758 | #define ASM_MEDIA_FMT_AMRNB_FS_ENCODE_MODE_MMR102 6 |
| 2759 | |
| 2760 | /* Enumeration for 12.20 kbps AMR-NB Encoding mode. */ |
| 2761 | #define ASM_MEDIA_FMT_AMRNB_FS_ENCODE_MODE_MMR122 7 |
| 2762 | |
| 2763 | /* Enumeration for AMR-NB Discontinuous Transmission mode off. */ |
| 2764 | #define ASM_MEDIA_FMT_AMRNB_FS_DTX_MODE_OFF 0 |
| 2765 | |
| 2766 | /* Enumeration for AMR-NB DTX mode VAD1. */ |
| 2767 | #define ASM_MEDIA_FMT_AMRNB_FS_DTX_MODE_VAD1 1 |
| 2768 | |
| 2769 | /* Enumeration for AMR-NB DTX mode VAD2. */ |
| 2770 | #define ASM_MEDIA_FMT_AMRNB_FS_DTX_MODE_VAD2 2 |
| 2771 | |
| 2772 | /* Enumeration for AMR-NB DTX mode auto. |
| 2773 | */ |
| 2774 | #define ASM_MEDIA_FMT_AMRNB_FS_DTX_MODE_AUTO 3 |
| 2775 | |
| 2776 | struct asm_amrnb_enc_cfg { |
| 2777 | struct apr_hdr hdr; |
| 2778 | struct asm_stream_cmd_set_encdec_param encdec; |
| 2779 | struct asm_enc_cfg_blk_param_v2 encblk; |
| 2780 | |
| 2781 | u16 enc_mode; |
| 2782 | /* AMR-NB encoding rate. |
| 2783 | * Supported values: |
| 2784 | * Use the ASM_MEDIA_FMT_AMRNB_FS_ENCODE_MODE_* |
| 2785 | * macros |
| 2786 | */ |
| 2787 | |
| 2788 | u16 dtx_mode; |
| 2789 | /* Specifies whether DTX mode is disabled or enabled. |
| 2790 | * Supported values: |
| 2791 | * - #ASM_MEDIA_FMT_AMRNB_FS_DTX_MODE_OFF |
| 2792 | * - #ASM_MEDIA_FMT_AMRNB_FS_DTX_MODE_VAD1 |
| 2793 | */ |
| 2794 | } __packed; |
| 2795 | |
| 2796 | #define ASM_MEDIA_FMT_AMRWB_FS 0x00010BEC |
| 2797 | |
| 2798 | /* Enumeration for 6.6 kbps AMR-WB Encoding mode. */ |
| 2799 | #define ASM_MEDIA_FMT_AMRWB_FS_ENCODE_MODE_MR66 0 |
| 2800 | |
| 2801 | /* Enumeration for 8.85 kbps AMR-WB Encoding mode. */ |
| 2802 | #define ASM_MEDIA_FMT_AMRWB_FS_ENCODE_MODE_MR885 1 |
| 2803 | |
| 2804 | /* Enumeration for 12.65 kbps AMR-WB Encoding mode. */ |
| 2805 | #define ASM_MEDIA_FMT_AMRWB_FS_ENCODE_MODE_MR1265 2 |
| 2806 | |
| 2807 | /* Enumeration for 14.25 kbps AMR-WB Encoding mode. */ |
| 2808 | #define ASM_MEDIA_FMT_AMRWB_FS_ENCODE_MODE_MR1425 3 |
| 2809 | |
| 2810 | /* Enumeration for 15.85 kbps AMR-WB Encoding mode. */ |
| 2811 | #define ASM_MEDIA_FMT_AMRWB_FS_ENCODE_MODE_MR1585 4 |
| 2812 | |
| 2813 | /* Enumeration for 18.25 kbps AMR-WB Encoding mode. */ |
| 2814 | #define ASM_MEDIA_FMT_AMRWB_FS_ENCODE_MODE_MR1825 5 |
| 2815 | |
| 2816 | /* Enumeration for 19.85 kbps AMR-WB Encoding mode. */ |
| 2817 | #define ASM_MEDIA_FMT_AMRWB_FS_ENCODE_MODE_MR1985 6 |
| 2818 | |
| 2819 | /* Enumeration for 23.05 kbps AMR-WB Encoding mode. */ |
| 2820 | #define ASM_MEDIA_FMT_AMRWB_FS_ENCODE_MODE_MR2305 7 |
| 2821 | |
| 2822 | /* Enumeration for 23.85 kbps AMR-WB Encoding mode. |
| 2823 | */ |
| 2824 | #define ASM_MEDIA_FMT_AMRWB_FS_ENCODE_MODE_MR2385 8 |
| 2825 | |
| 2826 | struct asm_amrwb_enc_cfg { |
| 2827 | struct apr_hdr hdr; |
| 2828 | struct asm_stream_cmd_set_encdec_param encdec; |
| 2829 | struct asm_enc_cfg_blk_param_v2 encblk; |
| 2830 | |
| 2831 | u16 enc_mode; |
| 2832 | /* AMR-WB encoding rate. |
| 2833 | * Suupported values: |
| 2834 | * Use the ASM_MEDIA_FMT_AMRWB_FS_ENCODE_MODE_* |
| 2835 | * macros |
| 2836 | */ |
| 2837 | |
| 2838 | u16 dtx_mode; |
| 2839 | /* Specifies whether DTX mode is disabled or enabled. |
| 2840 | * Supported values: |
| 2841 | * - #ASM_MEDIA_FMT_AMRNB_FS_DTX_MODE_OFF |
| 2842 | * - #ASM_MEDIA_FMT_AMRNB_FS_DTX_MODE_VAD1 |
| 2843 | */ |
| 2844 | } __packed; |
| 2845 | |
| 2846 | #define ASM_MEDIA_FMT_V13K_FS 0x00010BED |
| 2847 | |
| 2848 | /* Enumeration for 14.4 kbps V13K Encoding mode. */ |
| 2849 | #define ASM_MEDIA_FMT_V13K_FS_ENCODE_MODE_MR1440 0 |
| 2850 | |
| 2851 | /* Enumeration for 12.2 kbps V13K Encoding mode. */ |
| 2852 | #define ASM_MEDIA_FMT_V13K_FS_ENCODE_MODE_MR1220 1 |
| 2853 | |
| 2854 | /* Enumeration for 11.2 kbps V13K Encoding mode. */ |
| 2855 | #define ASM_MEDIA_FMT_V13K_FS_ENCODE_MODE_MR1120 2 |
| 2856 | |
| 2857 | /* Enumeration for 9.0 kbps V13K Encoding mode. */ |
| 2858 | #define ASM_MEDIA_FMT_V13K_FS_ENCODE_MODE_MR90 3 |
| 2859 | |
| 2860 | /* Enumeration for 7.2 kbps V13K eEncoding mode. */ |
| 2861 | #define ASM_MEDIA_FMT_V13K_FS_ENCODE_MODE_MR720 4 |
| 2862 | |
| 2863 | /* Enumeration for 1/8 vocoder rate.*/ |
| 2864 | #define ASM_MEDIA_FMT_VOC_ONE_EIGHTH_RATE 1 |
| 2865 | |
| 2866 | /* Enumeration for 1/4 vocoder rate. */ |
| 2867 | #define ASM_MEDIA_FMT_VOC_ONE_FOURTH_RATE 2 |
| 2868 | |
| 2869 | /* Enumeration for 1/2 vocoder rate. */ |
| 2870 | #define ASM_MEDIA_FMT_VOC_HALF_RATE 3 |
| 2871 | |
| 2872 | /* Enumeration for full vocoder rate. |
| 2873 | */ |
| 2874 | #define ASM_MEDIA_FMT_VOC_FULL_RATE 4 |
| 2875 | |
| 2876 | struct asm_v13k_enc_cfg { |
| 2877 | struct apr_hdr hdr; |
| 2878 | struct asm_stream_cmd_set_encdec_param encdec; |
| 2879 | struct asm_enc_cfg_blk_param_v2 encblk; |
| 2880 | u16 max_rate; |
| 2881 | /* Maximum allowed encoder frame rate. |
| 2882 | * Supported values: |
| 2883 | * - #ASM_MEDIA_FMT_VOC_ONE_EIGHTH_RATE |
| 2884 | * - #ASM_MEDIA_FMT_VOC_ONE_FOURTH_RATE |
| 2885 | * - #ASM_MEDIA_FMT_VOC_HALF_RATE |
| 2886 | * - #ASM_MEDIA_FMT_VOC_FULL_RATE |
| 2887 | */ |
| 2888 | |
| 2889 | u16 min_rate; |
| 2890 | /* Minimum allowed encoder frame rate. |
| 2891 | * Supported values: |
| 2892 | * - #ASM_MEDIA_FMT_VOC_ONE_EIGHTH_RATE |
| 2893 | * - #ASM_MEDIA_FMT_VOC_ONE_FOURTH_RATE |
| 2894 | * - #ASM_MEDIA_FMT_VOC_HALF_RATE |
| 2895 | * - #ASM_MEDIA_FMT_VOC_FULL_RATE |
| 2896 | */ |
| 2897 | |
| 2898 | u16 reduced_rate_cmd; |
| 2899 | /* Reduced rate command, used to change |
| 2900 | * the average bitrate of the V13K |
| 2901 | * vocoder. |
| 2902 | * Supported values: |
| 2903 | * - #ASM_MEDIA_FMT_V13K_FS_ENCODE_MODE_MR1440 (Default) |
| 2904 | * - #ASM_MEDIA_FMT_V13K_FS_ENCODE_MODE_MR1220 |
| 2905 | * - #ASM_MEDIA_FMT_V13K_FS_ENCODE_MODE_MR1120 |
| 2906 | * - #ASM_MEDIA_FMT_V13K_FS_ENCODE_MODE_MR90 |
| 2907 | * - #ASM_MEDIA_FMT_V13K_FS_ENCODE_MODE_MR720 |
| 2908 | */ |
| 2909 | |
| 2910 | u16 rate_mod_cmd; |
| 2911 | /* Rate modulation command. Default = 0. |
| 2912 | *- If bit 0=1, rate control is enabled. |
| 2913 | *- If bit 1=1, the maximum number of consecutive full rate |
| 2914 | * frames is limited with numbers supplied in |
| 2915 | * bits 2 to 10. |
| 2916 | *- If bit 1=0, the minimum number of non-full rate frames |
| 2917 | * in between two full rate frames is forced to |
| 2918 | * the number supplied in bits 2 to 10. In both cases, if necessary, |
| 2919 | * half rate is used to substitute full rate. - Bits 15 to 10 are |
| 2920 | * reserved and must all be set to zero. |
| 2921 | */ |
| 2922 | |
| 2923 | } __packed; |
| 2924 | |
| 2925 | #define ASM_MEDIA_FMT_EVRC_FS 0x00010BEE |
| 2926 | |
| 2927 | /* EVRC encoder configuration structure used in the |
| 2928 | * #ASM_STREAM_CMD_OPEN_READ_V2 command. |
| 2929 | */ |
| 2930 | struct asm_evrc_enc_cfg { |
| 2931 | struct apr_hdr hdr; |
| 2932 | struct asm_stream_cmd_set_encdec_param encdec; |
| 2933 | struct asm_enc_cfg_blk_param_v2 encblk; |
| 2934 | u16 max_rate; |
| 2935 | /* Maximum allowed encoder frame rate. |
| 2936 | * Supported values: |
| 2937 | * - #ASM_MEDIA_FMT_VOC_ONE_EIGHTH_RATE |
| 2938 | * - #ASM_MEDIA_FMT_VOC_ONE_FOURTH_RATE |
| 2939 | * - #ASM_MEDIA_FMT_VOC_HALF_RATE |
| 2940 | * - #ASM_MEDIA_FMT_VOC_FULL_RATE |
| 2941 | */ |
| 2942 | |
| 2943 | u16 min_rate; |
| 2944 | /* Minimum allowed encoder frame rate. |
| 2945 | * Supported values: |
| 2946 | * - #ASM_MEDIA_FMT_VOC_ONE_EIGHTH_RATE |
| 2947 | * - #ASM_MEDIA_FMT_VOC_ONE_FOURTH_RATE |
| 2948 | * - #ASM_MEDIA_FMT_VOC_HALF_RATE |
| 2949 | * - #ASM_MEDIA_FMT_VOC_FULL_RATE |
| 2950 | */ |
| 2951 | |
| 2952 | u16 rate_mod_cmd; |
| 2953 | /* Rate modulation command. Default: 0. |
| 2954 | * - If bit 0=1, rate control is enabled. |
| 2955 | * - If bit 1=1, the maximum number of consecutive full rate frames |
| 2956 | * is limited with numbers supplied in bits 2 to 10. |
| 2957 | * |
| 2958 | * - If bit 1=0, the minimum number of non-full rate frames in |
| 2959 | * between two full rate frames is forced to the number supplied in |
| 2960 | * bits 2 to 10. In both cases, if necessary, half rate is used to |
| 2961 | * substitute full rate. |
| 2962 | * |
| 2963 | * - Bits 15 to 10 are reserved and must all be set to zero. |
| 2964 | */ |
| 2965 | |
| 2966 | u16 reserved; |
| 2967 | /* Reserved. Clients must set this field to zero. */ |
| 2968 | } __packed; |
| 2969 | |
| 2970 | #define ASM_MEDIA_FMT_WMA_V10PRO_V2 0x00010DA7 |
| 2971 | |
| 2972 | struct asm_wmaprov10_fmt_blk_v2 { |
| 2973 | struct apr_hdr hdr; |
| 2974 | struct asm_data_cmd_media_fmt_update_v2 fmtblk; |
| 2975 | |
| 2976 | u16 fmtag; |
| 2977 | /* WMA format type. |
| 2978 | * Supported values: |
| 2979 | * - 0x162 -- WMA 9 Pro |
| 2980 | * - 0x163 -- WMA 9 Pro Lossless |
| 2981 | * - 0x166 -- WMA 10 Pro |
| 2982 | * - 0x167 -- WMA 10 Pro Lossless |
| 2983 | */ |
| 2984 | |
| 2985 | u16 num_channels; |
| 2986 | /* Number of channels encoded in the input stream. |
| 2987 | * Supported values: 1 to 8 |
| 2988 | */ |
| 2989 | |
| 2990 | u32 sample_rate; |
| 2991 | /* Number of samples per second (in Hertz). |
| 2992 | * Supported values: 11025, 16000, 22050, 32000, 44100, 48000, |
| 2993 | * 88200, 96000 |
| 2994 | */ |
| 2995 | |
| 2996 | u32 avg_bytes_per_sec; |
| 2997 | /* Bitrate expressed as the average bytes per second. |
| 2998 | * Supported values: 2000 to 96000 |
| 2999 | */ |
| 3000 | |
| 3001 | u16 blk_align; |
| 3002 | /* Size of the bitstream packet size in bytes. WMA Pro files |
| 3003 | * have a payload of one block per bitstream packet. |
| 3004 | * Supported values: @le 13376 |
| 3005 | */ |
| 3006 | |
| 3007 | u16 bits_per_sample; |
| 3008 | /* Number of bits per sample in the encoded WMA stream. |
| 3009 | * Supported values: 16, 24 |
| 3010 | */ |
| 3011 | |
| 3012 | u32 channel_mask; |
| 3013 | /* Bit-packed double word (32-bits) that indicates the |
| 3014 | * recommended speaker positions for each source channel. |
| 3015 | */ |
| 3016 | |
| 3017 | u16 enc_options; |
| 3018 | /* Bit-packed word with values that indicate whether certain |
| 3019 | * features of the bitstream are used. |
| 3020 | * Supported values: - 0x0001 -- ENCOPT3_PURE_LOSSLESS - 0x0006 -- |
| 3021 | * ENCOPT3_FRM_SIZE_MOD - 0x0038 -- ENCOPT3_SUBFRM_DIV - 0x0040 -- |
| 3022 | * ENCOPT3_WRITE_FRAMESIZE_IN_HDR - 0x0080 -- |
| 3023 | * ENCOPT3_GENERATE_DRC_PARAMS - 0x0100 -- ENCOPT3_RTMBITS |
| 3024 | */ |
| 3025 | |
| 3026 | |
| 3027 | u16 usAdvancedEncodeOpt; |
| 3028 | /* Advanced encoding option. */ |
| 3029 | |
| 3030 | u32 advanced_enc_options2; |
| 3031 | /* Advanced encoding option 2. */ |
| 3032 | |
| 3033 | } __packed; |
| 3034 | |
| 3035 | #define ASM_MEDIA_FMT_WMA_V9_V2 0x00010DA8 |
| 3036 | struct asm_wmastdv9_fmt_blk_v2 { |
| 3037 | struct apr_hdr hdr; |
| 3038 | struct asm_data_cmd_media_fmt_update_v2 fmtblk; |
| 3039 | u16 fmtag; |
| 3040 | /* WMA format tag. |
| 3041 | * Supported values: 0x161 (WMA 9 standard) |
| 3042 | */ |
| 3043 | |
| 3044 | u16 num_channels; |
| 3045 | /* Number of channels in the stream. |
| 3046 | * Supported values: 1, 2 |
| 3047 | */ |
| 3048 | |
| 3049 | u32 sample_rate; |
| 3050 | /* Number of samples per second (in Hertz). |
| 3051 | * Supported values: 48000 |
| 3052 | */ |
| 3053 | |
| 3054 | u32 avg_bytes_per_sec; |
| 3055 | /* Bitrate expressed as the average bytes per second. */ |
| 3056 | |
| 3057 | u16 blk_align; |
| 3058 | /* Block align. All WMA files with a maximum packet size of |
| 3059 | * 13376 are supported. |
| 3060 | */ |
| 3061 | |
| 3062 | |
| 3063 | u16 bits_per_sample; |
| 3064 | /* Number of bits per sample in the output. |
| 3065 | * Supported values: 16 |
| 3066 | */ |
| 3067 | |
| 3068 | u32 channel_mask; |
| 3069 | /* Channel mask. |
| 3070 | * Supported values: |
| 3071 | * - 3 -- Stereo (front left/front right) |
| 3072 | * - 4 -- Mono (center) |
| 3073 | */ |
| 3074 | |
| 3075 | u16 enc_options; |
| 3076 | /* Options used during encoding. */ |
| 3077 | |
Harmandeep Singh | eaf59b4 | 2012-06-05 21:46:02 -0700 | [diff] [blame] | 3078 | u16 reserved; |
| 3079 | |
Bharath Ramachandramurthy | 2e3168f | 2012-05-03 16:29:09 -0700 | [diff] [blame] | 3080 | } __packed; |
| 3081 | |
| 3082 | #define ASM_MEDIA_FMT_WMA_V8 0x00010D91 |
| 3083 | |
| 3084 | struct asm_wmastdv8_enc_cfg { |
| 3085 | struct apr_hdr hdr; |
| 3086 | struct asm_stream_cmd_set_encdec_param encdec; |
| 3087 | struct asm_enc_cfg_blk_param_v2 encblk; |
| 3088 | u32 bit_rate; |
| 3089 | /* Encoding rate in bits per second. */ |
| 3090 | |
| 3091 | u32 sample_rate; |
| 3092 | /* Number of samples per second. |
| 3093 | * |
| 3094 | * Supported values: |
| 3095 | * - 0 -- Native mode |
| 3096 | * - Other Supported values are 22050, 32000, 44100, and 48000. |
| 3097 | * |
| 3098 | * Native mode indicates that encoding must be performed with the |
| 3099 | * sampling rate at the input. |
| 3100 | * The sampling rate must not change during encoding. |
| 3101 | */ |
| 3102 | |
| 3103 | u16 channel_cfg; |
| 3104 | /* Number of channels to encode. |
| 3105 | * Supported values: |
| 3106 | * - 0 -- Native mode |
| 3107 | * - 1 -- Mono |
| 3108 | * - 2 -- Stereo |
| 3109 | * - Other values are not supported. |
| 3110 | * |
| 3111 | * Native mode indicates that encoding must be performed with the |
| 3112 | * number of channels at the input. |
| 3113 | * The number of channels must not change during encoding. |
| 3114 | */ |
| 3115 | |
| 3116 | u16 reserved; |
| 3117 | /* Reserved. Clients must set this field to zero.*/ |
| 3118 | } __packed; |
| 3119 | |
| 3120 | #define ASM_MEDIA_FMT_AMR_WB_PLUS_V2 0x00010DA9 |
| 3121 | |
| 3122 | struct asm_amrwbplus_fmt_blk_v2 { |
| 3123 | struct apr_hdr hdr; |
| 3124 | struct asm_data_cmd_media_fmt_update_v2 fmtblk; |
| 3125 | u32 amr_frame_fmt; |
| 3126 | /* AMR frame format. |
| 3127 | * Supported values: |
| 3128 | * - 6 -- Transport Interface Format (TIF) |
| 3129 | * - Any other value -- File storage format (FSF) |
| 3130 | * |
| 3131 | * TIF stream contains 2-byte header for each frame within the |
| 3132 | * superframe. FSF stream contains one 2-byte header per superframe. |
| 3133 | */ |
| 3134 | |
| 3135 | } __packed; |
| 3136 | |
| 3137 | #define ASM_MEDIA_FMT_AC3_DEC 0x00010BF6 |
| 3138 | #define ASM_MEDIA_FMT_EAC3_DEC 0x00010C3C |
| 3139 | #define ASM_MEDIA_FMT_DTS 0x00010D88 |
| 3140 | |
| 3141 | /* Media format ID for adaptive transform acoustic coding. This |
| 3142 | * ID is used by the #ASM_STREAM_CMD_OPEN_WRITE_COMPRESSED command |
| 3143 | * only. |
| 3144 | */ |
| 3145 | |
| 3146 | #define ASM_MEDIA_FMT_ATRAC 0x00010D89 |
| 3147 | |
| 3148 | /* Media format ID for metadata-enhanced audio transmission. |
| 3149 | * This ID is used by the #ASM_STREAM_CMD_OPEN_WRITE_COMPRESSED |
| 3150 | * command only. |
| 3151 | */ |
| 3152 | |
| 3153 | #define ASM_MEDIA_FMT_MAT 0x00010D8A |
| 3154 | |
| 3155 | /* adsp_media_fmt.h */ |
| 3156 | |
| 3157 | #define ASM_DATA_CMD_WRITE_V2 0x00010DAB |
| 3158 | |
| 3159 | struct asm_data_cmd_write_v2 { |
| 3160 | struct apr_hdr hdr; |
| 3161 | u32 buf_addr_lsw; |
| 3162 | /* The 64 bit address msw-lsw should be a valid, mapped address. |
| 3163 | * 64 bit address should be a multiple of 32 bytes |
| 3164 | */ |
| 3165 | |
| 3166 | u32 buf_addr_msw; |
| 3167 | /* The 64 bit address msw-lsw should be a valid, mapped address. |
| 3168 | * 64 bit address should be a multiple of 32 bytes. |
| 3169 | * -Address of the buffer containing the data to be decoded. |
| 3170 | * The buffer should be aligned to a 32 byte boundary. |
| 3171 | * -In the case of 32 bit Shared memory address, msw field must |
| 3172 | * -be set to zero. |
| 3173 | * -In the case of 36 bit shared memory address, bit 31 to bit 4 |
| 3174 | * -of msw must be set to zero. |
| 3175 | */ |
| 3176 | u32 mem_map_handle; |
| 3177 | /* memory map handle returned by DSP through |
| 3178 | * ASM_CMD_SHARED_MEM_MAP_REGIONS command |
| 3179 | */ |
| 3180 | u32 buf_size; |
| 3181 | /* Number of valid bytes available in the buffer for decoding. The |
| 3182 | * first byte starts at buf_addr. |
| 3183 | */ |
| 3184 | |
| 3185 | u32 seq_id; |
| 3186 | /* Optional buffer sequence ID. */ |
| 3187 | |
| 3188 | u32 timestamp_lsw; |
| 3189 | /* Lower 32 bits of the 64-bit session time in microseconds of the |
| 3190 | * first buffer sample. |
| 3191 | */ |
| 3192 | |
| 3193 | u32 timestamp_msw; |
| 3194 | /* Upper 32 bits of the 64-bit session time in microseconds of the |
| 3195 | * first buffer sample. |
| 3196 | */ |
| 3197 | |
| 3198 | u32 flags; |
| 3199 | /* Bitfield of flags. |
| 3200 | * Supported values for bit 31: |
| 3201 | * - 1 -- Valid timestamp. |
| 3202 | * - 0 -- Invalid timestamp. |
| 3203 | * - Use #ASM_BIT_MASKIMESTAMP_VALID_FLAG as the bitmask and |
| 3204 | * #ASM_SHIFTIMESTAMP_VALID_FLAG as the shift value to set this bit. |
| 3205 | * Supported values for bit 30: |
| 3206 | * - 1 -- Last buffer. |
| 3207 | * - 0 -- Not the last buffer. |
| 3208 | * |
| 3209 | * Supported values for bit 29: |
| 3210 | * - 1 -- Continue the timestamp from the previous buffer. |
| 3211 | * - 0 -- Timestamp of the current buffer is not related |
| 3212 | * to the timestamp of the previous buffer. |
| 3213 | * - Use #ASM_BIT_MASKS_CONTINUE_FLAG and #ASM_SHIFTS_CONTINUE_FLAG |
| 3214 | * to set this bit. |
| 3215 | * |
| 3216 | * Supported values for bit 4: |
| 3217 | * - 1 -- End of the frame. |
| 3218 | * - 0 -- Not the end of frame, or this information is not known. |
| 3219 | * - Use #ASM_BIT_MASK_EOF_FLAG as the bitmask and #ASM_SHIFT_EOF_FLAG |
| 3220 | * as the shift value to set this bit. |
| 3221 | * |
| 3222 | * All other bits are reserved and must be set to 0. |
| 3223 | * |
| 3224 | * If bit 31=0 and bit 29=1: The timestamp of the first sample in |
| 3225 | * this buffer continues from the timestamp of the last sample in |
| 3226 | * the previous buffer. If there is no previous buffer (i.e., this |
| 3227 | * is the first buffer sent after opening the stream or after a |
| 3228 | * flush operation), or if the previous buffer does not have a valid |
| 3229 | * timestamp, the samples in the current buffer also do not have a |
| 3230 | * valid timestamp. They are played out as soon as possible. |
| 3231 | * |
| 3232 | * |
| 3233 | * If bit 31=0 and bit 29=0: No timestamp is associated with the |
| 3234 | * first sample in this buffer. The samples are played out as soon |
| 3235 | * as possible. |
| 3236 | * |
| 3237 | * |
| 3238 | * If bit 31=1 and bit 29 is ignored: The timestamp specified in |
| 3239 | * this payload is honored. |
| 3240 | * |
| 3241 | * |
| 3242 | * If bit 30=0: Not the last buffer in the stream. This is useful |
| 3243 | * in removing trailing samples. |
| 3244 | * |
| 3245 | * |
| 3246 | * For bit 4: The client can set this flag for every buffer sent in |
| 3247 | * which the last byte is the end of a frame. If this flag is set, |
| 3248 | * the buffer can contain data from multiple frames, but it should |
| 3249 | * always end at a frame boundary. Restrictions allow the aDSP to |
| 3250 | * detect an end of frame without requiring additional processing. |
| 3251 | */ |
| 3252 | |
| 3253 | } __packed; |
| 3254 | |
| 3255 | #define ASM_DATA_CMD_READ_V2 0x00010DAC |
| 3256 | |
| 3257 | struct asm_data_cmd_read_v2 { |
| 3258 | struct apr_hdr hdr; |
| 3259 | u32 buf_addr_lsw; |
| 3260 | /* the 64 bit address msw-lsw should be a valid mapped address |
| 3261 | * and should be a multiple of 32 bytes |
| 3262 | */ |
| 3263 | |
| 3264 | |
| 3265 | u32 buf_addr_msw; |
| 3266 | /* the 64 bit address msw-lsw should be a valid mapped address |
| 3267 | * and should be a multiple of 32 bytes. |
| 3268 | * - Address of the buffer where the DSP puts the encoded data, |
| 3269 | * potentially, at an offset specified by the uOffset field in |
| 3270 | * ASM_DATA_EVENT_READ_DONE structure. The buffer should be aligned |
| 3271 | * to a 32 byte boundary. |
| 3272 | *- In the case of 32 bit Shared memory address, msw field must |
| 3273 | *- be set to zero. |
| 3274 | *- In the case of 36 bit shared memory address, bit 31 to bit |
| 3275 | *- 4 of msw must be set to zero. |
| 3276 | */ |
| 3277 | u32 mem_map_handle; |
| 3278 | /* memory map handle returned by DSP through |
| 3279 | * ASM_CMD_SHARED_MEM_MAP_REGIONS command. |
| 3280 | */ |
| 3281 | |
| 3282 | u32 buf_size; |
| 3283 | /* Number of bytes available for the aDSP to write. The aDSP |
| 3284 | * starts writing from buf_addr. |
| 3285 | */ |
| 3286 | |
| 3287 | u32 seq_id; |
| 3288 | /* Optional buffer sequence ID. |
| 3289 | */ |
| 3290 | } __packed; |
| 3291 | |
| 3292 | #define ASM_DATA_CMD_EOS 0x00010BDB |
| 3293 | #define ASM_DATA_EVENT_RENDERED_EOS 0x00010C1C |
| 3294 | #define ASM_DATA_EVENT_EOS 0x00010BDD |
| 3295 | |
| 3296 | #define ASM_DATA_EVENT_WRITE_DONE_V2 0x00010D99 |
| 3297 | struct asm_data_event_write_done_v2 { |
| 3298 | u32 buf_addr_lsw; |
| 3299 | /* lsw of the 64 bit address */ |
| 3300 | u32 buf_addr_msw; |
| 3301 | /* msw of the 64 bit address. address given by the client in |
| 3302 | * ASM_DATA_CMD_WRITE_V2 command. |
| 3303 | */ |
| 3304 | u32 mem_map_handle; |
| 3305 | /* memory map handle in the ASM_DATA_CMD_WRITE_V2 */ |
| 3306 | |
| 3307 | u32 status; |
| 3308 | /* Status message (error code) that indicates whether the |
| 3309 | * referenced buffer has been successfully consumed. |
| 3310 | * Supported values: Refer to @xhyperref{Q3,[Q3]} |
| 3311 | */ |
| 3312 | } __packed; |
| 3313 | |
| 3314 | #define ASM_DATA_EVENT_READ_DONE_V2 0x00010D9A |
| 3315 | |
| 3316 | /* Definition of the frame metadata flag bitmask.*/ |
| 3317 | #define ASM_BIT_MASK_FRAME_METADATA_FLAG (0x40000000UL) |
| 3318 | |
| 3319 | /* Definition of the frame metadata flag shift value. */ |
| 3320 | #define ASM_SHIFT_FRAME_METADATA_FLAG 30 |
| 3321 | |
| 3322 | struct asm_data_event_read_done_v2 { |
| 3323 | u32 status; |
| 3324 | /* Status message (error code). |
| 3325 | * Supported values: Refer to @xhyperref{Q3,[Q3]} |
| 3326 | */ |
| 3327 | |
| 3328 | u32 buf_addr_lsw; |
| 3329 | /* 64 bit address msw-lsw is a valid, mapped address. 64 bit |
| 3330 | * address is a multiple of 32 bytes. |
| 3331 | */ |
| 3332 | |
| 3333 | u32 buf_addr_msw; |
| 3334 | /* 64 bit address msw-lsw is a valid, mapped address. 64 bit |
| 3335 | * address is a multiple of 32 bytes. |
| 3336 | * |
| 3337 | * -Same address provided by the client in ASM_DATA_CMD_READ_V2 |
| 3338 | * -In the case of 32 bit Shared memory address, msw field is set to |
| 3339 | * zero. |
| 3340 | * -In the case of 36 bit shared memory address, bit 31 to bit 4 |
| 3341 | * -of msw is set to zero. |
| 3342 | */ |
| 3343 | |
| 3344 | u32 mem_map_handle; |
| 3345 | /* memory map handle in the ASM_DATA_CMD_READ_V2 */ |
| 3346 | |
| 3347 | u32 enc_framesotal_size; |
| 3348 | /* Total size of the encoded frames in bytes. |
| 3349 | * Supported values: >0 |
| 3350 | */ |
| 3351 | |
| 3352 | u32 offset; |
| 3353 | /* Offset (from buf_addr) to the first byte of the first encoded |
| 3354 | * frame. All encoded frames are consecutive, starting from this |
| 3355 | * offset. |
| 3356 | * Supported values: > 0 |
| 3357 | */ |
| 3358 | |
| 3359 | u32 timestamp_lsw; |
| 3360 | /* Lower 32 bits of the 64-bit session time in microseconds of |
| 3361 | * the first sample in the buffer. If Bit 5 of mode_flags flag of |
| 3362 | * ASM_STREAM_CMD_OPEN_READ_V2 is 1 then the 64 bit timestamp is |
| 3363 | * absolute capture time otherwise it is relative session time. The |
| 3364 | * absolute timestamp doesnt reset unless the system is reset. |
| 3365 | */ |
| 3366 | |
| 3367 | |
| 3368 | u32 timestamp_msw; |
| 3369 | /* Upper 32 bits of the 64-bit session time in microseconds of |
| 3370 | * the first sample in the buffer. |
| 3371 | */ |
| 3372 | |
| 3373 | |
| 3374 | u32 flags; |
| 3375 | /* Bitfield of flags. Bit 30 indicates whether frame metadata is |
| 3376 | * present. If frame metadata is present, num_frames consecutive |
| 3377 | * instances of @xhyperref{hdr:FrameMetaData,Frame metadata} start |
| 3378 | * at the buffer address. |
| 3379 | * Supported values for bit 31: |
| 3380 | * - 1 -- Timestamp is valid. |
| 3381 | * - 0 -- Timestamp is invalid. |
| 3382 | * - Use #ASM_BIT_MASKIMESTAMP_VALID_FLAG and |
| 3383 | * #ASM_SHIFTIMESTAMP_VALID_FLAG to set this bit. |
| 3384 | * |
| 3385 | * Supported values for bit 30: |
| 3386 | * - 1 -- Frame metadata is present. |
| 3387 | * - 0 -- Frame metadata is absent. |
| 3388 | * - Use #ASM_BIT_MASK_FRAME_METADATA_FLAG and |
| 3389 | * #ASM_SHIFT_FRAME_METADATA_FLAG to set this bit. |
| 3390 | * |
| 3391 | * All other bits are reserved; the aDSP sets them to 0. |
| 3392 | */ |
| 3393 | |
| 3394 | u32 num_frames; |
| 3395 | /* Number of encoded frames in the buffer. */ |
| 3396 | |
| 3397 | u32 seq_id; |
| 3398 | /* Optional buffer sequence ID. */ |
| 3399 | } __packed; |
| 3400 | |
| 3401 | struct asm_data_read_buf_metadata_v2 { |
| 3402 | u32 offset; |
| 3403 | /* Offset from buf_addr in #ASM_DATA_EVENT_READ_DONE_PAYLOAD to |
| 3404 | * the frame associated with this metadata. |
| 3405 | * Supported values: > 0 |
| 3406 | */ |
| 3407 | |
| 3408 | u32 frm_size; |
| 3409 | /* Size of the encoded frame in bytes. |
| 3410 | * Supported values: > 0 |
| 3411 | */ |
| 3412 | |
| 3413 | u32 num_encoded_pcm_samples; |
| 3414 | /* Number of encoded PCM samples (per channel) in the frame |
| 3415 | * associated with this metadata. |
| 3416 | * Supported values: > 0 |
| 3417 | */ |
| 3418 | |
| 3419 | u32 timestamp_lsw; |
| 3420 | /* Lower 32 bits of the 64-bit session time in microseconds of the |
| 3421 | * first sample for this frame. |
| 3422 | * If Bit 5 of mode_flags flag of ASM_STREAM_CMD_OPEN_READ_V2 is 1 |
| 3423 | * then the 64 bit timestamp is absolute capture time otherwise it |
| 3424 | * is relative session time. The absolute timestamp doesnt reset |
| 3425 | * unless the system is reset. |
| 3426 | */ |
| 3427 | |
| 3428 | |
| 3429 | u32 timestamp_msw; |
| 3430 | /* Lower 32 bits of the 64-bit session time in microseconds of the |
| 3431 | * first sample for this frame. |
| 3432 | */ |
| 3433 | |
| 3434 | u32 flags; |
| 3435 | /* Frame flags. |
| 3436 | * Supported values for bit 31: |
| 3437 | * - 1 -- Time stamp is valid |
| 3438 | * - 0 -- Time stamp is not valid |
| 3439 | * - All other bits are reserved; the aDSP sets them to 0. |
| 3440 | */ |
| 3441 | } __packed; |
| 3442 | |
| 3443 | /* Notifies the client of a change in the data sampling rate or |
| 3444 | * Channel mode. This event is raised by the decoder service. The |
| 3445 | * event is enabled through the mode flags of |
| 3446 | * #ASM_STREAM_CMD_OPEN_WRITE_V2 or |
| 3447 | * #ASM_STREAM_CMD_OPEN_READWRITE_V2. - The decoder detects a change |
| 3448 | * in the output sampling frequency or the number/positioning of |
| 3449 | * output channels, or if it is the first frame decoded.The new |
| 3450 | * sampling frequency or the new channel configuration is |
| 3451 | * communicated back to the client asynchronously. |
| 3452 | */ |
| 3453 | |
| 3454 | #define ASM_DATA_EVENT_SR_CM_CHANGE_NOTIFY 0x00010C65 |
| 3455 | |
| 3456 | /* Payload of the #ASM_DATA_EVENT_SR_CM_CHANGE_NOTIFY event. |
| 3457 | * This event is raised when the following conditions are both true: |
| 3458 | * - The event is enabled through the mode_flags of |
| 3459 | * #ASM_STREAM_CMD_OPEN_WRITE_V2 or |
| 3460 | * #ASM_STREAM_CMD_OPEN_READWRITE_V2. - The decoder detects a change |
| 3461 | * in either the output sampling frequency or the number/positioning |
| 3462 | * of output channels, or if it is the first frame decoded. |
| 3463 | * This event is not raised (even if enabled) if the decoder is |
| 3464 | * MIDI, because |
| 3465 | */ |
| 3466 | |
| 3467 | |
| 3468 | struct asm_data_event_sr_cm_change_notify { |
| 3469 | u32 sample_rate; |
| 3470 | /* New sampling rate (in Hertz) after detecting a change in the |
| 3471 | * bitstream. |
| 3472 | * Supported values: 2000 to 48000 |
| 3473 | */ |
| 3474 | |
| 3475 | u16 num_channels; |
| 3476 | /* New number of channels after detecting a change in the |
| 3477 | * bitstream. |
| 3478 | * Supported values: 1 to 8 |
| 3479 | */ |
| 3480 | |
| 3481 | |
| 3482 | u16 reserved; |
| 3483 | /* Reserved for future use. This field must be set to 0.*/ |
| 3484 | |
| 3485 | u8 channel_mapping[8]; |
| 3486 | |
| 3487 | } __packed; |
| 3488 | |
| 3489 | /* Notifies the client of a data sampling rate or channel mode |
| 3490 | * change. This event is raised by the encoder service. |
| 3491 | * This event is raised when : |
| 3492 | * - Native mode encoding was requested in the encoder |
| 3493 | * configuration (i.e., the channel number was 0), the sample rate |
| 3494 | * was 0, or both were 0. |
| 3495 | * |
| 3496 | * - The input data frame at the encoder is the first one, or the |
| 3497 | * sampling rate/channel mode is different from the previous input |
| 3498 | * data frame. |
| 3499 | * |
| 3500 | */ |
| 3501 | #define ASM_DATA_EVENT_ENC_SR_CM_CHANGE_NOTIFY 0x00010BDE |
| 3502 | |
| 3503 | struct asm_data_event_enc_sr_cm_change_notify { |
| 3504 | u32 sample_rate; |
| 3505 | /* New sampling rate (in Hertz) after detecting a change in the |
| 3506 | * input data. |
| 3507 | * Supported values: 2000 to 48000 |
| 3508 | */ |
| 3509 | |
| 3510 | |
| 3511 | u16 num_channels; |
| 3512 | /* New number of channels after detecting a change in the input |
| 3513 | * data. Supported values: 1 to 8 |
| 3514 | */ |
| 3515 | |
| 3516 | |
| 3517 | u16 bits_per_sample; |
| 3518 | /* New bits per sample after detecting a change in the input |
| 3519 | * data. |
| 3520 | * Supported values: 16, 24 |
| 3521 | */ |
| 3522 | |
| 3523 | |
| 3524 | u8 channel_mapping[8]; |
| 3525 | |
| 3526 | } __packed; |
| 3527 | #define ASM_DATA_CMD_IEC_60958_FRAME_RATE 0x00010D87 |
| 3528 | |
| 3529 | |
| 3530 | /* Payload of the #ASM_DATA_CMD_IEC_60958_FRAME_RATE command, |
| 3531 | * which is used to indicate the IEC 60958 frame rate of a given |
| 3532 | * packetized audio stream. |
| 3533 | */ |
| 3534 | |
| 3535 | struct asm_data_cmd_iec_60958_frame_rate { |
| 3536 | u32 frame_rate; |
| 3537 | /* IEC 60958 frame rate of the incoming IEC 61937 packetized stream. |
| 3538 | * Supported values: Any valid frame rate |
| 3539 | */ |
| 3540 | } __packed; |
| 3541 | |
| 3542 | /* adsp_asm_data_commands.h*/ |
| 3543 | #define ASM_SVC_CMD_GET_STREAM_HANDLES 0x00010C0B |
| 3544 | |
| 3545 | #define ASM_SVC_CMDRSP_GET_STREAM_HANDLES 0x00010C1B |
| 3546 | |
| 3547 | /* Definition of the stream ID bitmask.*/ |
| 3548 | #define ASM_BIT_MASK_STREAM_ID (0x000000FFUL) |
| 3549 | |
| 3550 | /* Definition of the stream ID shift value.*/ |
| 3551 | #define ASM_SHIFT_STREAM_ID 0 |
| 3552 | |
| 3553 | /* Definition of the session ID bitmask.*/ |
| 3554 | #define ASM_BIT_MASK_SESSION_ID (0x0000FF00UL) |
| 3555 | |
| 3556 | /* Definition of the session ID shift value.*/ |
| 3557 | #define ASM_SHIFT_SESSION_ID 8 |
| 3558 | |
| 3559 | /* Definition of the service ID bitmask.*/ |
| 3560 | #define ASM_BIT_MASK_SERVICE_ID (0x00FF0000UL) |
| 3561 | |
| 3562 | /* Definition of the service ID shift value.*/ |
| 3563 | #define ASM_SHIFT_SERVICE_ID 16 |
| 3564 | |
| 3565 | /* Definition of the domain ID bitmask.*/ |
| 3566 | #define ASM_BIT_MASK_DOMAIN_ID (0xFF000000UL) |
| 3567 | |
| 3568 | /* Definition of the domain ID shift value.*/ |
| 3569 | #define ASM_SHIFT_DOMAIN_ID 24 |
| 3570 | |
| 3571 | /* Payload of the #ASM_SVC_CMDRSP_GET_STREAM_HANDLES message, |
| 3572 | * which returns a list of currently active stream handles. |
| 3573 | * Immediately following this structure are num_handles of uint32 |
| 3574 | * stream handles. |
| 3575 | */ |
| 3576 | |
| 3577 | |
| 3578 | struct asm_svc_cmdrsp_get_stream_handles { |
| 3579 | u32 num_handles; |
| 3580 | /* Number of active stream handles. */ |
| 3581 | } __packed; |
| 3582 | |
| 3583 | #define ASM_CMD_SHARED_MEM_MAP_REGIONS 0x00010D92 |
| 3584 | #define ASM_CMDRSP_SHARED_MEM_MAP_REGIONS 0x00010D93 |
| 3585 | #define ASM_CMD_SHARED_MEM_UNMAP_REGIONS 0x00010D94 |
| 3586 | |
| 3587 | /* adsp_asm_service_commands.h */ |
| 3588 | |
| 3589 | #define ASM_MAX_SESSION_ID (8) |
| 3590 | |
| 3591 | /* Maximum number of sessions.*/ |
| 3592 | #define ASM_MAX_NUM_SESSIONS ASM_MAX_SESSION_ID |
| 3593 | |
| 3594 | /* Maximum number of streams per session.*/ |
| 3595 | #define ASM_MAX_STREAMS_PER_SESSION (8) |
| 3596 | #define ASM_SESSION_CMD_RUN_V2 0x00010DAA |
| 3597 | #define ASM_SESSION_CMD_RUN_STARTIME_RUN_IMMEDIATE 0 |
| 3598 | #define ASM_SESSION_CMD_RUN_STARTIME_RUN_AT_ABSOLUTEIME 1 |
| 3599 | #define ASM_SESSION_CMD_RUN_STARTIME_RUN_AT_RELATIVEIME 2 |
| 3600 | #define ASM_SESSION_CMD_RUN_STARTIME_RUN_WITH_DELAY 3 |
| 3601 | |
| 3602 | #define ASM_BIT_MASK_RUN_STARTIME (0x00000003UL) |
| 3603 | |
| 3604 | /* Bit shift value used to specify the start time for the |
| 3605 | * ASM_SESSION_CMD_RUN_V2 command. |
| 3606 | */ |
| 3607 | #define ASM_SHIFT_RUN_STARTIME 0 |
| 3608 | struct asm_session_cmd_run_v2 { |
| 3609 | struct apr_hdr hdr; |
| 3610 | u32 flags; |
| 3611 | /* Specifies whether to run immediately or at a specific |
| 3612 | * rendering time or with a specified delay. Run with delay is |
| 3613 | * useful for delaying in case of ASM loopback opened through |
| 3614 | * ASM_STREAM_CMD_OPEN_LOOPBACK_V2. Use #ASM_BIT_MASK_RUN_STARTIME |
| 3615 | * and #ASM_SHIFT_RUN_STARTIME to set this 2-bit flag. |
| 3616 | * |
| 3617 | * |
| 3618 | *Bits 0 and 1 can take one of four possible values: |
| 3619 | * |
| 3620 | *- #ASM_SESSION_CMD_RUN_STARTIME_RUN_IMMEDIATE |
| 3621 | *- #ASM_SESSION_CMD_RUN_STARTIME_RUN_AT_ABSOLUTEIME |
| 3622 | *- #ASM_SESSION_CMD_RUN_STARTIME_RUN_AT_RELATIVEIME |
| 3623 | *- #ASM_SESSION_CMD_RUN_STARTIME_RUN_WITH_DELAY |
| 3624 | * |
| 3625 | *All other bits are reserved; clients must set them to zero. |
| 3626 | */ |
| 3627 | |
| 3628 | u32 time_lsw; |
| 3629 | /* Lower 32 bits of the time in microseconds used to align the |
| 3630 | * session origin time. When bits 0-1 of flags is |
| 3631 | * ASM_SESSION_CMD_RUN_START_RUN_WITH_DELAY, time lsw is the lsw of |
| 3632 | * the delay in us. For ASM_SESSION_CMD_RUN_START_RUN_WITH_DELAY, |
| 3633 | * maximum value of the 64 bit delay is 150 ms. |
| 3634 | */ |
| 3635 | |
| 3636 | u32 time_msw; |
| 3637 | /* Upper 32 bits of the time in microseconds used to align the |
| 3638 | * session origin time. When bits 0-1 of flags is |
| 3639 | * ASM_SESSION_CMD_RUN_START_RUN_WITH_DELAY, time msw is the msw of |
| 3640 | * the delay in us. For ASM_SESSION_CMD_RUN_START_RUN_WITH_DELAY, |
| 3641 | * maximum value of the 64 bit delay is 150 ms. |
| 3642 | */ |
| 3643 | |
| 3644 | } __packed; |
| 3645 | |
| 3646 | #define ASM_SESSION_CMD_PAUSE 0x00010BD3 |
| 3647 | #define ASM_SESSION_CMD_GET_SESSIONTIME_V3 0x00010D9D |
| 3648 | #define ASM_SESSION_CMD_REGISTER_FOR_RX_UNDERFLOW_EVENTS 0x00010BD5 |
| 3649 | |
| 3650 | struct asm_session_cmd_rgstr_rx_underflow { |
| 3651 | struct apr_hdr hdr; |
| 3652 | u16 enable_flag; |
| 3653 | /* Specifies whether a client is to receive events when an Rx |
| 3654 | * session underflows. |
| 3655 | * Supported values: |
| 3656 | * - 0 -- Do not send underflow events |
| 3657 | * - 1 -- Send underflow events |
| 3658 | */ |
| 3659 | u16 reserved; |
| 3660 | /* Reserved. This field must be set to zero.*/ |
| 3661 | } __packed; |
| 3662 | |
| 3663 | #define ASM_SESSION_CMD_REGISTER_FORX_OVERFLOW_EVENTS 0x00010BD6 |
| 3664 | |
| 3665 | struct asm_session_cmd_regx_overflow { |
| 3666 | struct apr_hdr hdr; |
| 3667 | u16 enable_flag; |
| 3668 | /* Specifies whether a client is to receive events when a Tx |
| 3669 | * session overflows. |
| 3670 | * Supported values: |
| 3671 | * - 0 -- Do not send overflow events |
| 3672 | * - 1 -- Send overflow events |
| 3673 | */ |
| 3674 | |
| 3675 | u16 reserved; |
| 3676 | /* Reserved. This field must be set to zero.*/ |
| 3677 | } __packed; |
| 3678 | |
| 3679 | #define ASM_SESSION_EVENT_RX_UNDERFLOW 0x00010C17 |
| 3680 | #define ASM_SESSION_EVENTX_OVERFLOW 0x00010C18 |
| 3681 | #define ASM_SESSION_CMDRSP_GET_SESSIONTIME_V3 0x00010D9E |
| 3682 | |
| 3683 | struct asm_session_cmdrsp_get_sessiontime_v3 { |
| 3684 | u32 status; |
| 3685 | /* Status message (error code). |
| 3686 | * Supported values: Refer to @xhyperref{Q3,[Q3]} |
| 3687 | */ |
| 3688 | |
| 3689 | u32 sessiontime_lsw; |
| 3690 | /* Lower 32 bits of the current session time in microseconds.*/ |
| 3691 | |
| 3692 | u32 sessiontime_msw; |
| 3693 | /* Upper 32 bits of the current session time in microseconds.*/ |
| 3694 | |
| 3695 | u32 absolutetime_lsw; |
| 3696 | /* Lower 32 bits in micro seconds of the absolute time at which |
| 3697 | * the * sample corresponding to the above session time gets |
| 3698 | * rendered * to hardware. This absolute time may be slightly in the |
| 3699 | * future or past. |
| 3700 | */ |
| 3701 | |
| 3702 | |
| 3703 | u32 absolutetime_msw; |
| 3704 | /* Upper 32 bits in micro seconds of the absolute time at which |
| 3705 | * the * sample corresponding to the above session time gets |
| 3706 | * rendered to * hardware. This absolute time may be slightly in the |
| 3707 | * future or past. |
| 3708 | */ |
| 3709 | |
| 3710 | } __packed; |
| 3711 | |
| 3712 | #define ASM_SESSION_CMD_ADJUST_SESSION_CLOCK_V2 0x00010D9F |
| 3713 | |
| 3714 | struct asm_session_cmd_adjust_session_clock_v2 { |
| 3715 | struct apr_hdr hdr; |
| 3716 | u32 adjustime_lsw; |
| 3717 | /* Lower 32 bits of the signed 64-bit quantity that specifies the |
| 3718 | * adjustment time in microseconds to the session clock. |
| 3719 | * |
| 3720 | * Positive values indicate advancement of the session clock. |
| 3721 | * Negative values indicate delay of the session clock. |
| 3722 | */ |
| 3723 | |
| 3724 | |
| 3725 | u32 adjustime_msw; |
| 3726 | /* Upper 32 bits of the signed 64-bit quantity that specifies |
| 3727 | * the adjustment time in microseconds to the session clock. |
| 3728 | * Positive values indicate advancement of the session clock. |
| 3729 | * Negative values indicate delay of the session clock. |
| 3730 | */ |
| 3731 | |
| 3732 | } __packed; |
| 3733 | |
| 3734 | #define ASM_SESSION_CMDRSP_ADJUST_SESSION_CLOCK_V2 0x00010DA0 |
| 3735 | |
| 3736 | struct asm_session_cmdrsp_adjust_session_clock_v2 { |
| 3737 | u32 status; |
| 3738 | /* Status message (error code). |
| 3739 | * Supported values: Refer to @xhyperref{Q3,[Q3]} |
| 3740 | * An error means the session clock is not adjusted. In this case, |
| 3741 | * the next two fields are irrelevant. |
| 3742 | */ |
| 3743 | |
| 3744 | |
| 3745 | u32 actual_adjustime_lsw; |
| 3746 | /* Lower 32 bits of the signed 64-bit quantity that specifies |
| 3747 | * the actual adjustment in microseconds performed by the aDSP. |
| 3748 | * A positive value indicates advancement of the session clock. A |
| 3749 | * negative value indicates delay of the session clock. |
| 3750 | */ |
| 3751 | |
| 3752 | |
| 3753 | u32 actual_adjustime_msw; |
| 3754 | /* Upper 32 bits of the signed 64-bit quantity that specifies |
| 3755 | * the actual adjustment in microseconds performed by the aDSP. |
| 3756 | * A positive value indicates advancement of the session clock. A |
| 3757 | * negative value indicates delay of the session clock. |
| 3758 | */ |
| 3759 | |
| 3760 | |
| 3761 | u32 cmd_latency_lsw; |
| 3762 | /* Lower 32 bits of the unsigned 64-bit quantity that specifies |
| 3763 | * the amount of time in microseconds taken to perform the session |
| 3764 | * clock adjustment. |
| 3765 | */ |
| 3766 | |
| 3767 | |
| 3768 | u32 cmd_latency_msw; |
| 3769 | /* Upper 32 bits of the unsigned 64-bit quantity that specifies |
| 3770 | * the amount of time in microseconds taken to perform the session |
| 3771 | * clock adjustment. |
| 3772 | */ |
| 3773 | |
| 3774 | } __packed; |
| 3775 | |
| 3776 | #define ASM_SESSION_CMD_GET_PATH_DELAY_V2 0x00010DAF |
| 3777 | #define ASM_SESSION_CMDRSP_GET_PATH_DELAY_V2 0x00010DB0 |
| 3778 | |
| 3779 | struct asm_session_cmdrsp_get_path_delay_v2 { |
| 3780 | u32 status; |
| 3781 | /* Status message (error code). Whether this get delay operation |
| 3782 | * is successful or not. Delay value is valid only if status is |
| 3783 | * success. |
| 3784 | * Supported values: Refer to @xhyperref{Q5,[Q5]} |
| 3785 | */ |
| 3786 | |
| 3787 | u32 audio_delay_lsw; |
| 3788 | /* Upper 32 bits of the aDSP delay in microseconds. */ |
| 3789 | |
| 3790 | u32 audio_delay_msw; |
| 3791 | /* Lower 32 bits of the aDSP delay in microseconds. */ |
| 3792 | |
| 3793 | } __packed; |
| 3794 | |
| 3795 | /* adsp_asm_session_command.h*/ |
| 3796 | #define ASM_STREAM_CMD_OPEN_WRITE_V2 0x00010D8F |
| 3797 | |
| 3798 | struct asm_stream_cmd_open_write_v2 { |
| 3799 | struct apr_hdr hdr; |
| 3800 | uint32_t mode_flags; |
| 3801 | /* Mode flags that configure the stream to notify the client |
| 3802 | * whenever it detects an SR/CM change at the input to its POPP. |
| 3803 | * Supported values for bits 0 to 1: |
| 3804 | * - Reserved; clients must set them to zero. |
| 3805 | * Supported values for bit 2: |
| 3806 | * - 0 -- SR/CM change notification event is disabled. |
| 3807 | * - 1 -- SR/CM change notification event is enabled. |
| 3808 | * - Use #ASM_BIT_MASK_SR_CM_CHANGE_NOTIFY_FLAG and |
| 3809 | * #ASM_SHIFT_SR_CM_CHANGE_NOTIFY_FLAG to set or get this bit. |
| 3810 | * |
| 3811 | * Supported values for bit 31: |
| 3812 | * - 0 -- Stream to be opened in on-Gapless mode. |
| 3813 | * - 1 -- Stream to be opened in Gapless mode. In Gapless mode, |
| 3814 | * successive streams must be opened with same session ID but |
| 3815 | * different stream IDs. |
| 3816 | * |
| 3817 | * - Use #ASM_BIT_MASK_GAPLESS_MODE_FLAG and |
| 3818 | * #ASM_SHIFT_GAPLESS_MODE_FLAG to set or get this bit. |
| 3819 | * |
| 3820 | * |
| 3821 | * @note1hang MIDI and DTMF streams cannot be opened in Gapless mode. |
| 3822 | */ |
| 3823 | |
| 3824 | uint16_t sink_endpointype; |
| 3825 | /*< Sink point type. |
| 3826 | * Supported values: |
| 3827 | * - 0 -- Device matrix |
| 3828 | * - Other values are reserved. |
| 3829 | * |
| 3830 | * The device matrix is the gateway to the hardware ports. |
| 3831 | */ |
| 3832 | |
| 3833 | uint16_t bits_per_sample; |
| 3834 | /*< Number of bits per sample processed by ASM modules. |
| 3835 | * Supported values: 16 and 24 bits per sample |
| 3836 | */ |
| 3837 | |
| 3838 | uint32_t postprocopo_id; |
| 3839 | /*< Specifies the topology (order of processing) of |
| 3840 | * postprocessing algorithms. <i>None</i> means no postprocessing. |
| 3841 | * Supported values: |
| 3842 | * - #ASM_STREAM_POSTPROCOPO_ID_DEFAULT |
| 3843 | * - #ASM_STREAM_POSTPROCOPO_ID_MCH_PEAK_VOL |
| 3844 | * - #ASM_STREAM_POSTPROCOPO_ID_NONE |
| 3845 | * |
| 3846 | * This field can also be enabled through SetParams flags. |
| 3847 | */ |
| 3848 | |
| 3849 | uint32_t dec_fmt_id; |
| 3850 | /*< Configuration ID of the decoder media format. |
| 3851 | * |
| 3852 | * Supported values: |
| 3853 | * - #ASM_MEDIA_FMT_MULTI_CHANNEL_PCM_V2 |
| 3854 | * - #ASM_MEDIA_FMT_ADPCM |
| 3855 | * - #ASM_MEDIA_FMT_MP3 |
| 3856 | * - #ASM_MEDIA_FMT_AAC_V2 |
| 3857 | * - #ASM_MEDIA_FMT_DOLBY_AAC |
| 3858 | * - #ASM_MEDIA_FMT_AMRNB_FS |
| 3859 | * - #ASM_MEDIA_FMT_AMRWB_FS |
| 3860 | * - #ASM_MEDIA_FMT_AMR_WB_PLUS_V2 |
| 3861 | * - #ASM_MEDIA_FMT_V13K_FS |
| 3862 | * - #ASM_MEDIA_FMT_EVRC_FS |
| 3863 | * - #ASM_MEDIA_FMT_EVRCB_FS |
| 3864 | * - #ASM_MEDIA_FMT_EVRCWB_FS |
| 3865 | * - #ASM_MEDIA_FMT_SBC |
| 3866 | * - #ASM_MEDIA_FMT_WMA_V10PRO_V2 |
| 3867 | * - #ASM_MEDIA_FMT_WMA_V9_V2 |
| 3868 | * - #ASM_MEDIA_FMT_AC3_DEC |
| 3869 | * - #ASM_MEDIA_FMT_EAC3_DEC |
| 3870 | * - #ASM_MEDIA_FMT_G711_ALAW_FS |
| 3871 | * - #ASM_MEDIA_FMT_G711_MLAW_FS |
| 3872 | * - #ASM_MEDIA_FMT_G729A_FS |
| 3873 | * - #ASM_MEDIA_FMT_FR_FS |
| 3874 | * - #ASM_MEDIA_FMT_VORBIS |
| 3875 | * - #ASM_MEDIA_FMT_FLAC |
| 3876 | * - #ASM_MEDIA_FMT_EXAMPLE |
| 3877 | */ |
| 3878 | } __packed; |
| 3879 | |
| 3880 | #define ASM_STREAM_CMD_OPEN_READ_V2 0x00010D8C |
| 3881 | /* Definition of the timestamp type flag bitmask */ |
| 3882 | #define ASM_BIT_MASKIMESTAMPYPE_FLAG (0x00000020UL) |
| 3883 | |
| 3884 | /* Definition of the timestamp type flag shift value. */ |
| 3885 | #define ASM_SHIFTIMESTAMPYPE_FLAG 5 |
| 3886 | |
| 3887 | /* Relative timestamp is identified by this value.*/ |
| 3888 | #define ASM_RELATIVEIMESTAMP 0 |
| 3889 | |
| 3890 | /* Absolute timestamp is identified by this value.*/ |
| 3891 | #define ASM_ABSOLUTEIMESTAMP 1 |
| 3892 | |
| 3893 | |
| 3894 | struct asm_stream_cmd_open_read_v2 { |
| 3895 | struct apr_hdr hdr; |
| 3896 | u32 mode_flags; |
| 3897 | /* Mode flags that indicate whether meta information per encoded |
| 3898 | * frame is to be provided. |
| 3899 | * Supported values for bit 4: |
| 3900 | * |
| 3901 | * - 0 -- Return data buffer contains all encoded frames only; it |
| 3902 | * does not contain frame metadata. |
| 3903 | * |
| 3904 | * - 1 -- Return data buffer contains an array of metadata and |
| 3905 | * encoded frames. |
| 3906 | * |
| 3907 | * - Use #ASM_BIT_MASK_META_INFO_FLAG as the bitmask and |
| 3908 | * #ASM_SHIFT_META_INFO_FLAG as the shift value for this bit. |
| 3909 | * |
| 3910 | * |
| 3911 | * Supported values for bit 5: |
| 3912 | * |
| 3913 | * - ASM_RELATIVEIMESTAMP -- ASM_DATA_EVENT_READ_DONE_V2 will have |
| 3914 | * - relative time-stamp. |
| 3915 | * - ASM_ABSOLUTEIMESTAMP -- ASM_DATA_EVENT_READ_DONE_V2 will |
| 3916 | * - have absolute time-stamp. |
| 3917 | * |
| 3918 | * - Use #ASM_BIT_MASKIMESTAMPYPE_FLAG as the bitmask and |
| 3919 | * #ASM_SHIFTIMESTAMPYPE_FLAG as the shift value for this bit. |
| 3920 | * |
| 3921 | * All other bits are reserved; clients must set them to zero. |
| 3922 | */ |
| 3923 | |
| 3924 | u32 src_endpointype; |
| 3925 | /* Specifies the endpoint providing the input samples. |
| 3926 | * Supported values: |
| 3927 | * - 0 -- Device matrix |
| 3928 | * - All other values are reserved; clients must set them to zero. |
| 3929 | * Otherwise, an error is returned. |
| 3930 | * The device matrix is the gateway from the tunneled Tx ports. |
| 3931 | */ |
| 3932 | |
| 3933 | u32 preprocopo_id; |
| 3934 | /* Specifies the topology (order of processing) of preprocessing |
| 3935 | * algorithms. <i>None</i> means no preprocessing. |
| 3936 | * Supported values: |
| 3937 | * - #ASM_STREAM_PREPROCOPO_ID_DEFAULT |
| 3938 | * - #ASM_STREAM_PREPROCOPO_ID_NONE |
| 3939 | * |
| 3940 | * This field can also be enabled through SetParams flags. |
| 3941 | */ |
| 3942 | |
| 3943 | u32 enc_cfg_id; |
| 3944 | /* Media configuration ID for encoded output. |
| 3945 | * Supported values: |
| 3946 | * - #ASM_MEDIA_FMT_MULTI_CHANNEL_PCM_V2 |
| 3947 | * - #ASM_MEDIA_FMT_AAC_V2 |
| 3948 | * - #ASM_MEDIA_FMT_AMRNB_FS |
| 3949 | * - #ASM_MEDIA_FMT_AMRWB_FS |
| 3950 | * - #ASM_MEDIA_FMT_V13K_FS |
| 3951 | * - #ASM_MEDIA_FMT_EVRC_FS |
| 3952 | * - #ASM_MEDIA_FMT_EVRCB_FS |
| 3953 | * - #ASM_MEDIA_FMT_EVRCWB_FS |
| 3954 | * - #ASM_MEDIA_FMT_SBC |
| 3955 | * - #ASM_MEDIA_FMT_G711_ALAW_FS |
| 3956 | * - #ASM_MEDIA_FMT_G711_MLAW_FS |
| 3957 | * - #ASM_MEDIA_FMT_G729A_FS |
| 3958 | * - #ASM_MEDIA_FMT_EXAMPLE |
| 3959 | * - #ASM_MEDIA_FMT_WMA_V8 |
| 3960 | */ |
| 3961 | |
| 3962 | u16 bits_per_sample; |
| 3963 | /* Number of bits per sample processed by ASM modules. |
| 3964 | * Supported values: 16 and 24 bits per sample |
| 3965 | */ |
| 3966 | |
| 3967 | u16 reserved; |
| 3968 | /* Reserved for future use. This field must be set to zero.*/ |
| 3969 | } __packed; |
| 3970 | |
| 3971 | #define ASM_POPP_OUTPUT_SR_NATIVE_RATE 0 |
| 3972 | |
| 3973 | /* Enumeration for the maximum sampling rate at the POPP output.*/ |
| 3974 | #define ASM_POPP_OUTPUT_SR_MAX_RATE 48000 |
| 3975 | |
| 3976 | #define ASM_STREAM_CMD_OPEN_READWRITE_V2 0x00010D8D |
| 3977 | #define ASM_STREAM_CMD_OPEN_READWRITE_V2 0x00010D8D |
| 3978 | #define ASM_STREAM_CMD_OPEN_READ_V2 0x00010D8C |
| 3979 | |
| 3980 | struct asm_stream_cmd_open_readwrite_v2 { |
| 3981 | struct apr_hdr hdr; |
| 3982 | u32 mode_flags; |
| 3983 | /* Mode flags. |
| 3984 | * Supported values for bit 2: |
| 3985 | * - 0 -- SR/CM change notification event is disabled. |
| 3986 | * - 1 -- SR/CM change notification event is enabled. Use |
| 3987 | * #ASM_BIT_MASK_SR_CM_CHANGE_NOTIFY_FLAG and |
| 3988 | * #ASM_SHIFT_SR_CM_CHANGE_NOTIFY_FLAG to set or |
| 3989 | * getting this flag. |
| 3990 | * |
| 3991 | * Supported values for bit 4: |
| 3992 | * - 0 -- Return read data buffer contains all encoded frames only; it |
| 3993 | * does not contain frame metadata. |
| 3994 | * - 1 -- Return read data buffer contains an array of metadata and |
| 3995 | * encoded frames. |
| 3996 | * |
| 3997 | * All other bits are reserved; clients must set them to zero. |
| 3998 | */ |
| 3999 | |
| 4000 | u32 postprocopo_id; |
| 4001 | /* Specifies the topology (order of processing) of postprocessing |
| 4002 | * algorithms. <i>None</i> means no postprocessing. |
| 4003 | * |
| 4004 | * Supported values: |
| 4005 | * - #ASM_STREAM_POSTPROCOPO_ID_DEFAULT |
| 4006 | * - #ASM_STREAM_POSTPROCOPO_ID_MCH_PEAK_VOL |
| 4007 | * - #ASM_STREAM_POSTPROCOPO_ID_NONE |
| 4008 | */ |
| 4009 | |
| 4010 | u32 dec_fmt_id; |
| 4011 | /* Specifies the media type of the input data. PCM indicates that |
| 4012 | * no decoding must be performed, e.g., this is an NT encoder |
| 4013 | * session. |
| 4014 | * Supported values: |
| 4015 | * - #ASM_MEDIA_FMT_MULTI_CHANNEL_PCM_V2 |
| 4016 | * - #ASM_MEDIA_FMT_ADPCM |
| 4017 | * - #ASM_MEDIA_FMT_MP3 |
| 4018 | * - #ASM_MEDIA_FMT_AAC_V2 |
| 4019 | * - #ASM_MEDIA_FMT_DOLBY_AAC |
| 4020 | * - #ASM_MEDIA_FMT_AMRNB_FS |
| 4021 | * - #ASM_MEDIA_FMT_AMRWB_FS |
| 4022 | * - #ASM_MEDIA_FMT_V13K_FS |
| 4023 | * - #ASM_MEDIA_FMT_EVRC_FS |
| 4024 | * - #ASM_MEDIA_FMT_EVRCB_FS |
| 4025 | * - #ASM_MEDIA_FMT_EVRCWB_FS |
| 4026 | * - #ASM_MEDIA_FMT_SBC |
| 4027 | * - #ASM_MEDIA_FMT_WMA_V10PRO_V2 |
| 4028 | * - #ASM_MEDIA_FMT_WMA_V9_V2 |
| 4029 | * - #ASM_MEDIA_FMT_AMR_WB_PLUS_V2 |
| 4030 | * - #ASM_MEDIA_FMT_AC3_DEC |
| 4031 | * - #ASM_MEDIA_FMT_G711_ALAW_FS |
| 4032 | * - #ASM_MEDIA_FMT_G711_MLAW_FS |
| 4033 | * - #ASM_MEDIA_FMT_G729A_FS |
| 4034 | * - #ASM_MEDIA_FMT_EXAMPLE |
| 4035 | */ |
| 4036 | |
| 4037 | u32 enc_cfg_id; |
| 4038 | /* Specifies the media type for the output of the stream. PCM |
| 4039 | * indicates that no encoding must be performed, e.g., this is an NT |
| 4040 | * decoder session. |
| 4041 | * Supported values: |
| 4042 | * - #ASM_MEDIA_FMT_MULTI_CHANNEL_PCM_V2 |
| 4043 | * - #ASM_MEDIA_FMT_AAC_V2 |
| 4044 | * - #ASM_MEDIA_FMT_AMRNB_FS |
| 4045 | * - #ASM_MEDIA_FMT_AMRWB_FS |
| 4046 | * - #ASM_MEDIA_FMT_V13K_FS |
| 4047 | * - #ASM_MEDIA_FMT_EVRC_FS |
| 4048 | * - #ASM_MEDIA_FMT_EVRCB_FS |
| 4049 | * - #ASM_MEDIA_FMT_EVRCWB_FS |
| 4050 | * - #ASM_MEDIA_FMT_SBC |
| 4051 | * - #ASM_MEDIA_FMT_G711_ALAW_FS |
| 4052 | * - #ASM_MEDIA_FMT_G711_MLAW_FS |
| 4053 | * - #ASM_MEDIA_FMT_G729A_FS |
| 4054 | * - #ASM_MEDIA_FMT_EXAMPLE |
| 4055 | * - #ASM_MEDIA_FMT_WMA_V8 |
| 4056 | */ |
| 4057 | |
| 4058 | u16 bits_per_sample; |
| 4059 | /* Number of bits per sample processed by ASM modules. |
| 4060 | * Supported values: 16 and 24 bits per sample |
| 4061 | */ |
| 4062 | |
| 4063 | u16 reserved; |
| 4064 | /* Reserved for future use. This field must be set to zero.*/ |
| 4065 | |
| 4066 | } __packed; |
| 4067 | |
| 4068 | #define ASM_STREAM_CMD_OPEN_LOOPBACK_V2 0x00010D8E |
| 4069 | struct asm_stream_cmd_open_loopback_v2 { |
| 4070 | struct apr_hdr hdr; |
| 4071 | u32 mode_flags; |
| 4072 | /* Mode flags. |
| 4073 | * Bit 0-31: reserved; client should set these bits to 0 |
| 4074 | */ |
| 4075 | u16 src_endpointype; |
| 4076 | /* Endpoint type. 0 = Tx Matrix */ |
| 4077 | u16 sink_endpointype; |
| 4078 | /* Endpoint type. 0 = Rx Matrix */ |
| 4079 | u32 postprocopo_id; |
| 4080 | /* Postprocessor topology ID. Specifies the topology of |
| 4081 | * postprocessing algorithms. |
| 4082 | */ |
| 4083 | |
| 4084 | u16 bits_per_sample; |
| 4085 | /* The number of bits per sample processed by ASM modules |
| 4086 | * Supported values: 16 and 24 bits per sample |
| 4087 | */ |
| 4088 | u16 reserved; |
| 4089 | /* Reserved for future use. This field must be set to zero. */ |
| 4090 | } __packed; |
| 4091 | |
| 4092 | #define ASM_STREAM_CMD_CLOSE 0x00010BCD |
| 4093 | #define ASM_STREAM_CMD_FLUSH 0x00010BCE |
| 4094 | |
| 4095 | |
| 4096 | #define ASM_STREAM_CMD_FLUSH_READBUFS 0x00010C09 |
| 4097 | #define ASM_STREAM_CMD_SET_PP_PARAMS_V2 0x00010DA1 |
| 4098 | |
| 4099 | struct asm_stream_cmd_set_pp_params_v2 { |
| 4100 | u32 data_payload_addr_lsw; |
| 4101 | /* LSW of parameter data payload address. Supported values: any. */ |
| 4102 | u32 data_payload_addr_msw; |
| 4103 | /* MSW of Parameter data payload address. Supported values: any. |
| 4104 | * - Must be set to zero for in-band data. |
| 4105 | * - In the case of 32 bit Shared memory address, msw field must be |
| 4106 | * - set to zero. |
| 4107 | * - In the case of 36 bit shared memory address, bit 31 to bit 4 of |
| 4108 | * msw |
| 4109 | * |
| 4110 | * - must be set to zero. |
| 4111 | */ |
| 4112 | u32 mem_map_handle; |
| 4113 | /* Supported Values: Any. |
| 4114 | * memory map handle returned by DSP through |
| 4115 | * ASM_CMD_SHARED_MEM_MAP_REGIONS |
| 4116 | * command. |
| 4117 | * if mmhandle is NULL, the ParamData payloads are within the |
| 4118 | * message payload (in-band). |
| 4119 | * If mmhandle is non-NULL, the ParamData payloads begin at the |
| 4120 | * address specified in the address msw and lsw (out-of-band). |
| 4121 | */ |
| 4122 | |
| 4123 | u32 data_payload_size; |
| 4124 | /* Size in bytes of the variable payload accompanying the |
| 4125 | message, or in shared memory. This field is used for parsing the |
| 4126 | parameter payload. */ |
| 4127 | |
| 4128 | } __packed; |
| 4129 | |
| 4130 | |
| 4131 | struct asm_stream_param_data_v2 { |
| 4132 | u32 module_id; |
| 4133 | /* Unique module ID. */ |
| 4134 | |
| 4135 | u32 param_id; |
| 4136 | /* Unique parameter ID. */ |
| 4137 | |
| 4138 | u16 param_size; |
| 4139 | /* Data size of the param_id/module_id combination. This is |
| 4140 | * a multiple of 4 bytes. |
| 4141 | */ |
| 4142 | |
| 4143 | u16 reserved; |
| 4144 | /* Reserved for future enhancements. This field must be set to |
| 4145 | * zero. |
| 4146 | */ |
| 4147 | |
| 4148 | } __packed; |
| 4149 | |
| 4150 | #define ASM_STREAM_CMD_GET_PP_PARAMS_V2 0x00010DA2 |
| 4151 | |
| 4152 | struct asm_stream_cmd_get_pp_params_v2 { |
| 4153 | u32 data_payload_addr_lsw; |
| 4154 | /* LSW of the parameter data payload address. */ |
| 4155 | u32 data_payload_addr_msw; |
| 4156 | /* MSW of the parameter data payload address. |
| 4157 | * - Size of the shared memory, if specified, shall be large enough |
| 4158 | * to contain the whole ParamData payload, including Module ID, |
| 4159 | * Param ID, Param Size, and Param Values |
| 4160 | * - Must be set to zero for in-band data |
| 4161 | * - In the case of 32 bit Shared memory address, msw field must be |
| 4162 | * set to zero. |
| 4163 | * - In the case of 36 bit shared memory address, bit 31 to bit 4 of |
| 4164 | * msw must be set to zero. |
| 4165 | */ |
| 4166 | |
| 4167 | u32 mem_map_handle; |
| 4168 | /* Supported Values: Any. |
| 4169 | * memory map handle returned by DSP through ASM_CMD_SHARED_MEM_MAP_REGIONS |
| 4170 | * command. |
| 4171 | * if mmhandle is NULL, the ParamData payloads in the ACK are within the |
| 4172 | * message payload (in-band). |
| 4173 | * If mmhandle is non-NULL, the ParamData payloads in the ACK begin at the |
| 4174 | * address specified in the address msw and lsw. |
| 4175 | * (out-of-band). |
| 4176 | */ |
| 4177 | |
| 4178 | u32 module_id; |
| 4179 | /* Unique module ID. */ |
| 4180 | |
| 4181 | u32 param_id; |
| 4182 | /* Unique parameter ID. */ |
| 4183 | |
| 4184 | u16 param_max_size; |
| 4185 | /* Maximum data size of the module_id/param_id combination. This |
| 4186 | * is a multiple of 4 bytes. |
| 4187 | */ |
| 4188 | |
| 4189 | |
| 4190 | u16 reserved; |
| 4191 | /* Reserved for backward compatibility. Clients must set this |
| 4192 | * field to zero. |
| 4193 | */ |
| 4194 | |
| 4195 | } __packed; |
| 4196 | |
| 4197 | #define ASM_STREAM_CMD_SET_ENCDEC_PARAM 0x00010C10 |
| 4198 | |
| 4199 | #define ASM_PARAM_ID_ENCDEC_BITRATE 0x00010C13 |
| 4200 | |
| 4201 | struct asm_bitrate_param { |
| 4202 | u32 bitrate; |
| 4203 | /* Maximum supported bitrate. Only the AAC encoder is supported.*/ |
| 4204 | |
| 4205 | } __packed; |
| 4206 | |
| 4207 | #define ASM_PARAM_ID_ENCDEC_ENC_CFG_BLK_V2 0x00010DA3 |
| 4208 | #define ASM_PARAM_ID_AAC_SBR_PS_FLAG 0x00010C63 |
| 4209 | |
| 4210 | /* Flag to turn off both SBR and PS processing, if they are |
| 4211 | * present in the bitstream. |
| 4212 | */ |
| 4213 | |
| 4214 | #define ASM_AAC_SBR_OFF_PS_OFF (2) |
| 4215 | |
| 4216 | /* Flag to turn on SBR but turn off PS processing,if they are |
| 4217 | * present in the bitstream. |
| 4218 | */ |
| 4219 | |
| 4220 | #define ASM_AAC_SBR_ON_PS_OFF (1) |
| 4221 | |
| 4222 | /* Flag to turn on both SBR and PS processing, if they are |
| 4223 | * present in the bitstream (default behavior). |
| 4224 | */ |
| 4225 | |
| 4226 | |
| 4227 | #define ASM_AAC_SBR_ON_PS_ON (0) |
| 4228 | |
| 4229 | /* Structure for an AAC SBR PS processing flag. */ |
| 4230 | |
| 4231 | /* Payload of the #ASM_PARAM_ID_AAC_SBR_PS_FLAG parameter in the |
| 4232 | * #ASM_STREAM_CMD_SET_ENCDEC_PARAM command. |
| 4233 | */ |
| 4234 | struct asm_aac_sbr_ps_flag_param { |
| 4235 | struct apr_hdr hdr; |
| 4236 | struct asm_stream_cmd_set_encdec_param encdec; |
| 4237 | struct asm_enc_cfg_blk_param_v2 encblk; |
| 4238 | |
| 4239 | u32 sbr_ps_flag; |
| 4240 | /* Control parameter to enable or disable SBR/PS processing in |
| 4241 | * the AAC bitstream. Use the following macros to set this field: |
| 4242 | * - #ASM_AAC_SBR_OFF_PS_OFF -- Turn off both SBR and PS |
| 4243 | * processing, if they are present in the bitstream. |
| 4244 | * - #ASM_AAC_SBR_ON_PS_OFF -- Turn on SBR processing, but not PS |
| 4245 | * processing, if they are present in the bitstream. |
| 4246 | * - #ASM_AAC_SBR_ON_PS_ON -- Turn on both SBR and PS processing, |
| 4247 | * if they are present in the bitstream (default behavior). |
| 4248 | * - All other values are invalid. |
| 4249 | * Changes are applied to the next decoded frame. |
| 4250 | */ |
| 4251 | } __packed; |
| 4252 | |
| 4253 | #define ASM_PARAM_ID_AAC_DUAL_MONO_MAPPING 0x00010C64 |
| 4254 | |
| 4255 | /* First single channel element in a dual mono bitstream.*/ |
| 4256 | #define ASM_AAC_DUAL_MONO_MAP_SCE_1 (1) |
| 4257 | |
| 4258 | /* Second single channel element in a dual mono bitstream.*/ |
| 4259 | #define ASM_AAC_DUAL_MONO_MAP_SCE_2 (2) |
| 4260 | |
| 4261 | /* Structure for AAC decoder dual mono channel mapping. */ |
| 4262 | |
| 4263 | |
| 4264 | struct asm_aac_dual_mono_mapping_param { |
| 4265 | struct apr_hdr hdr; |
| 4266 | struct asm_stream_cmd_set_encdec_param encdec; |
| 4267 | struct asm_enc_cfg_blk_param_v2 encblk; |
| 4268 | u16 left_channel_sce; |
| 4269 | u16 right_channel_sce; |
| 4270 | |
| 4271 | } __packed; |
| 4272 | |
| 4273 | #define ASM_STREAM_CMDRSP_GET_PP_PARAMS_V2 0x00010DA4 |
| 4274 | |
| 4275 | struct asm_stream_cmdrsp_get_pp_params_v2 { |
| 4276 | u32 status; |
| 4277 | } __packed; |
| 4278 | |
| 4279 | #define ASM_PARAM_ID_AC3_KARAOKE_MODE 0x00010D73 |
| 4280 | |
| 4281 | /* Enumeration for both vocals in a karaoke stream.*/ |
| 4282 | #define AC3_KARAOKE_MODE_NO_VOCAL (0) |
| 4283 | |
| 4284 | /* Enumeration for only the left vocal in a karaoke stream.*/ |
| 4285 | #define AC3_KARAOKE_MODE_LEFT_VOCAL (1) |
| 4286 | |
| 4287 | /* Enumeration for only the right vocal in a karaoke stream.*/ |
| 4288 | #define AC3_KARAOKE_MODE_RIGHT_VOCAL (2) |
| 4289 | |
| 4290 | /* Enumeration for both vocal channels in a karaoke stream.*/ |
| 4291 | #define AC3_KARAOKE_MODE_BOTH_VOCAL (3) |
| 4292 | #define ASM_PARAM_ID_AC3_DRC_MODE 0x00010D74 |
| 4293 | /* Enumeration for the Custom Analog mode.*/ |
| 4294 | #define AC3_DRC_MODE_CUSTOM_ANALOG (0) |
| 4295 | |
| 4296 | /* Enumeration for the Custom Digital mode.*/ |
| 4297 | #define AC3_DRC_MODE_CUSTOM_DIGITAL (1) |
| 4298 | /* Enumeration for the Line Out mode (light compression).*/ |
| 4299 | #define AC3_DRC_MODE_LINE_OUT (2) |
| 4300 | |
| 4301 | /* Enumeration for the RF remodulation mode (heavy compression).*/ |
| 4302 | #define AC3_DRC_MODE_RF_REMOD (3) |
| 4303 | #define ASM_PARAM_ID_AC3_DUAL_MONO_MODE 0x00010D75 |
| 4304 | |
| 4305 | /* Enumeration for playing dual mono in stereo mode.*/ |
| 4306 | #define AC3_DUAL_MONO_MODE_STEREO (0) |
| 4307 | |
| 4308 | /* Enumeration for playing left mono.*/ |
| 4309 | #define AC3_DUAL_MONO_MODE_LEFT_MONO (1) |
| 4310 | |
| 4311 | /* Enumeration for playing right mono.*/ |
| 4312 | #define AC3_DUAL_MONO_MODE_RIGHT_MONO (2) |
| 4313 | |
| 4314 | /* Enumeration for mixing both dual mono channels and playing them.*/ |
| 4315 | #define AC3_DUAL_MONO_MODE_MIXED_MONO (3) |
| 4316 | #define ASM_PARAM_ID_AC3_STEREO_DOWNMIX_MODE 0x00010D76 |
| 4317 | |
| 4318 | /* Enumeration for using the Downmix mode indicated in the bitstream. */ |
| 4319 | |
| 4320 | #define AC3_STEREO_DOWNMIX_MODE_AUTO_DETECT (0) |
| 4321 | |
| 4322 | /* Enumeration for Surround Compatible mode (preserves the |
| 4323 | * surround information). |
| 4324 | */ |
| 4325 | |
| 4326 | #define AC3_STEREO_DOWNMIX_MODE_LT_RT (1) |
| 4327 | /* Enumeration for Mono Compatible mode (if the output is to be |
| 4328 | * further downmixed to mono). |
| 4329 | */ |
| 4330 | |
| 4331 | #define AC3_STEREO_DOWNMIX_MODE_LO_RO (2) |
| 4332 | |
| 4333 | /* ID of the AC3 PCM scale factor parameter in the |
| 4334 | * #ASM_STREAM_CMD_SET_ENCDEC_PARAM command. |
| 4335 | */ |
| 4336 | #define ASM_PARAM_ID_AC3_PCM_SCALEFACTOR 0x00010D78 |
| 4337 | |
| 4338 | /* ID of the AC3 DRC boost scale factor parameter in the |
| 4339 | * #ASM_STREAM_CMD_SET_ENCDEC_PARAM command. |
| 4340 | */ |
| 4341 | #define ASM_PARAM_ID_AC3_DRC_BOOST_SCALEFACTOR 0x00010D79 |
| 4342 | |
| 4343 | /* ID of the AC3 DRC cut scale factor parameter in the |
| 4344 | * #ASM_STREAM_CMD_SET_ENCDEC_PARAM command. |
| 4345 | */ |
| 4346 | #define ASM_PARAM_ID_AC3_DRC_CUT_SCALEFACTOR 0x00010D7A |
| 4347 | |
| 4348 | /* Structure for AC3 Generic Parameter. */ |
| 4349 | |
| 4350 | /* Payload of the AC3 parameters in the |
| 4351 | * #ASM_STREAM_CMD_SET_ENCDEC_PARAM command. |
| 4352 | */ |
| 4353 | struct asm_ac3_generic_param { |
| 4354 | struct apr_hdr hdr; |
| 4355 | struct asm_stream_cmd_set_encdec_param encdec; |
| 4356 | struct asm_enc_cfg_blk_param_v2 encblk; |
| 4357 | u32 generic_parameter; |
| 4358 | /* AC3 generic parameter. Select from one of the following |
| 4359 | * possible values. |
| 4360 | * |
| 4361 | * For #ASM_PARAM_ID_AC3_KARAOKE_MODE, supported values are: |
| 4362 | * - AC3_KARAOKE_MODE_NO_VOCAL |
| 4363 | * - AC3_KARAOKE_MODE_LEFT_VOCAL |
| 4364 | * - AC3_KARAOKE_MODE_RIGHT_VOCAL |
| 4365 | * - AC3_KARAOKE_MODE_BOTH_VOCAL |
| 4366 | * |
| 4367 | * For #ASM_PARAM_ID_AC3_DRC_MODE, supported values are: |
| 4368 | * - AC3_DRC_MODE_CUSTOM_ANALOG |
| 4369 | * - AC3_DRC_MODE_CUSTOM_DIGITAL |
| 4370 | * - AC3_DRC_MODE_LINE_OUT |
| 4371 | * - AC3_DRC_MODE_RF_REMOD |
| 4372 | * |
| 4373 | * For #ASM_PARAM_ID_AC3_DUAL_MONO_MODE, supported values are: |
| 4374 | * - AC3_DUAL_MONO_MODE_STEREO |
| 4375 | * - AC3_DUAL_MONO_MODE_LEFT_MONO |
| 4376 | * - AC3_DUAL_MONO_MODE_RIGHT_MONO |
| 4377 | * - AC3_DUAL_MONO_MODE_MIXED_MONO |
| 4378 | * |
| 4379 | * For #ASM_PARAM_ID_AC3_STEREO_DOWNMIX_MODE, supported values are: |
| 4380 | * - AC3_STEREO_DOWNMIX_MODE_AUTO_DETECT |
| 4381 | * - AC3_STEREO_DOWNMIX_MODE_LT_RT |
| 4382 | * - AC3_STEREO_DOWNMIX_MODE_LO_RO |
| 4383 | * |
| 4384 | * For #ASM_PARAM_ID_AC3_PCM_SCALEFACTOR, supported values are |
| 4385 | * 0 to 1 in Q31 format. |
| 4386 | * |
| 4387 | * For #ASM_PARAM_ID_AC3_DRC_BOOST_SCALEFACTOR, supported values are |
| 4388 | * 0 to 1 in Q31 format. |
| 4389 | * |
| 4390 | * For #ASM_PARAM_ID_AC3_DRC_CUT_SCALEFACTOR, supported values are |
| 4391 | * 0 to 1 in Q31 format. |
| 4392 | */ |
| 4393 | } __packed; |
| 4394 | |
| 4395 | /* Enumeration for Raw mode (no downmixing), which specifies |
| 4396 | * that all channels in the bitstream are to be played out as is |
| 4397 | * without any downmixing. (Default) |
| 4398 | */ |
| 4399 | |
| 4400 | #define WMAPRO_CHANNEL_MASK_RAW (-1) |
| 4401 | |
| 4402 | /* Enumeration for setting the channel mask to 0. The 7.1 mode |
| 4403 | * (Home Theater) is assigned. |
| 4404 | */ |
| 4405 | |
| 4406 | |
| 4407 | #define WMAPRO_CHANNEL_MASK_ZERO 0x0000 |
| 4408 | |
| 4409 | /* Speaker layout mask for one channel (Home Theater, mono). |
| 4410 | * - Speaker front center |
| 4411 | */ |
| 4412 | #define WMAPRO_CHANNEL_MASK_1_C 0x0004 |
| 4413 | |
| 4414 | /* Speaker layout mask for two channels (Home Theater, stereo). |
| 4415 | * - Speaker front left |
| 4416 | * - Speaker front right |
| 4417 | */ |
| 4418 | #define WMAPRO_CHANNEL_MASK_2_L_R 0x0003 |
| 4419 | |
| 4420 | /* Speaker layout mask for three channels (Home Theater). |
| 4421 | * - Speaker front left |
| 4422 | * - Speaker front right |
| 4423 | * - Speaker front center |
| 4424 | */ |
| 4425 | #define WMAPRO_CHANNEL_MASK_3_L_C_R 0x0007 |
| 4426 | |
| 4427 | /* Speaker layout mask for two channels (stereo). |
| 4428 | * - Speaker back left |
| 4429 | * - Speaker back right |
| 4430 | */ |
| 4431 | #define WMAPRO_CHANNEL_MASK_2_Bl_Br 0x0030 |
| 4432 | |
| 4433 | /* Speaker layout mask for four channels. |
| 4434 | * - Speaker front left |
| 4435 | * - Speaker front right |
| 4436 | * - Speaker back left |
| 4437 | * - Speaker back right |
| 4438 | */ |
| 4439 | #define WMAPRO_CHANNEL_MASK_4_L_R_Bl_Br 0x0033 |
| 4440 | |
| 4441 | /* Speaker layout mask for four channels (Home Theater). |
| 4442 | * - Speaker front left |
| 4443 | * - Speaker front right |
| 4444 | * - Speaker front center |
| 4445 | * - Speaker back center |
| 4446 | */ |
| 4447 | #define WMAPRO_CHANNEL_MASK_4_L_R_C_Bc_HT 0x0107 |
| 4448 | /* Speaker layout mask for five channels. |
| 4449 | * - Speaker front left |
| 4450 | * - Speaker front right |
| 4451 | * - Speaker front center |
| 4452 | * - Speaker back left |
| 4453 | * - Speaker back right |
| 4454 | */ |
| 4455 | #define WMAPRO_CHANNEL_MASK_5_L_C_R_Bl_Br 0x0037 |
| 4456 | |
| 4457 | /* Speaker layout mask for five channels (5 mode, Home Theater). |
| 4458 | * - Speaker front left |
| 4459 | * - Speaker front right |
| 4460 | * - Speaker front center |
| 4461 | * - Speaker side left |
| 4462 | * - Speaker side right |
| 4463 | */ |
| 4464 | #define WMAPRO_CHANNEL_MASK_5_L_C_R_Sl_Sr_HT 0x0607 |
| 4465 | /* Speaker layout mask for six channels (5.1 mode). |
| 4466 | * - Speaker front left |
| 4467 | * - Speaker front right |
| 4468 | * - Speaker front center |
| 4469 | * - Speaker low frequency |
| 4470 | * - Speaker back left |
| 4471 | * - Speaker back right |
| 4472 | */ |
| 4473 | #define WMAPRO_CHANNEL_MASK_5DOT1_L_C_R_Bl_Br_SLF 0x003F |
| 4474 | /* Speaker layout mask for six channels (5.1 mode, Home Theater). |
| 4475 | * - Speaker front left |
| 4476 | * - Speaker front right |
| 4477 | * - Speaker front center |
| 4478 | * - Speaker low frequency |
| 4479 | * - Speaker side left |
| 4480 | * - Speaker side right |
| 4481 | */ |
| 4482 | #define WMAPRO_CHANNEL_MASK_5DOT1_L_C_R_Sl_Sr_SLF_HT 0x060F |
| 4483 | /* Speaker layout mask for six channels (5.1 mode, no LFE). |
| 4484 | * - Speaker front left |
| 4485 | * - Speaker front right |
| 4486 | * - Speaker front center |
| 4487 | * - Speaker back left |
| 4488 | * - Speaker back right |
| 4489 | * - Speaker back center |
| 4490 | */ |
| 4491 | #define WMAPRO_CHANNEL_MASK_5DOT1_L_C_R_Bl_Br_Bc 0x0137 |
| 4492 | /* Speaker layout mask for six channels (5.1 mode, Home Theater, |
| 4493 | * no LFE). |
| 4494 | * - Speaker front left |
| 4495 | * - Speaker front right |
| 4496 | * - Speaker front center |
| 4497 | * - Speaker back center |
| 4498 | * - Speaker side left |
| 4499 | * - Speaker side right |
| 4500 | */ |
| 4501 | #define WMAPRO_CHANNEL_MASK_5DOT1_L_C_R_Sl_Sr_Bc_HT 0x0707 |
| 4502 | |
| 4503 | /* Speaker layout mask for seven channels (6.1 mode). |
| 4504 | * - Speaker front left |
| 4505 | * - Speaker front right |
| 4506 | * - Speaker front center |
| 4507 | * - Speaker low frequency |
| 4508 | * - Speaker back left |
| 4509 | * - Speaker back right |
| 4510 | * - Speaker back center |
| 4511 | */ |
| 4512 | #define WMAPRO_CHANNEL_MASK_6DOT1_L_C_R_Bl_Br_Bc_SLF 0x013F |
| 4513 | |
| 4514 | /* Speaker layout mask for seven channels (6.1 mode, Home |
| 4515 | * Theater). |
| 4516 | * - Speaker front left |
| 4517 | * - Speaker front right |
| 4518 | * - Speaker front center |
| 4519 | * - Speaker low frequency |
| 4520 | * - Speaker back center |
| 4521 | * - Speaker side left |
| 4522 | * - Speaker side right |
| 4523 | */ |
| 4524 | #define WMAPRO_CHANNEL_MASK_6DOT1_L_C_R_Sl_Sr_Bc_SLF_HT 0x070F |
| 4525 | |
| 4526 | /* Speaker layout mask for seven channels (6.1 mode, no LFE). |
| 4527 | * - Speaker front left |
| 4528 | * - Speaker front right |
| 4529 | * - Speaker front center |
| 4530 | * - Speaker back left |
| 4531 | * - Speaker back right |
| 4532 | * - Speaker front left of center |
| 4533 | * - Speaker front right of center |
| 4534 | */ |
| 4535 | #define WMAPRO_CHANNEL_MASK_6DOT1_L_C_R_Bl_Br_SFLOC_SFROC 0x00F7 |
| 4536 | |
| 4537 | /* Speaker layout mask for seven channels (6.1 mode, Home |
| 4538 | * Theater, no LFE). |
| 4539 | * - Speaker front left |
| 4540 | * - Speaker front right |
| 4541 | * - Speaker front center |
| 4542 | * - Speaker side left |
| 4543 | * - Speaker side right |
| 4544 | * - Speaker front left of center |
| 4545 | * - Speaker front right of center |
| 4546 | */ |
| 4547 | #define WMAPRO_CHANNEL_MASK_6DOT1_L_C_R_Sl_Sr_SFLOC_SFROC_HT 0x0637 |
| 4548 | |
| 4549 | /* Speaker layout mask for eight channels (7.1 mode). |
| 4550 | * - Speaker front left |
| 4551 | * - Speaker front right |
| 4552 | * - Speaker front center |
| 4553 | * - Speaker back left |
| 4554 | * - Speaker back right |
| 4555 | * - Speaker low frequency |
| 4556 | * - Speaker front left of center |
| 4557 | * - Speaker front right of center |
| 4558 | */ |
| 4559 | #define WMAPRO_CHANNEL_MASK_7DOT1_L_C_R_Bl_Br_SLF_SFLOC_SFROC \ |
| 4560 | 0x00FF |
| 4561 | |
| 4562 | /* Speaker layout mask for eight channels (7.1 mode, Home Theater). |
| 4563 | * - Speaker front left |
| 4564 | * - Speaker front right |
| 4565 | * - Speaker front center |
| 4566 | * - Speaker side left |
| 4567 | * - Speaker side right |
| 4568 | * - Speaker low frequency |
| 4569 | * - Speaker front left of center |
| 4570 | * - Speaker front right of center |
| 4571 | * |
| 4572 | */ |
| 4573 | #define WMAPRO_CHANNEL_MASK_7DOT1_L_C_R_Sl_Sr_SLF_SFLOC_SFROC_HT \ |
| 4574 | 0x063F |
| 4575 | |
| 4576 | #define ASM_PARAM_ID_DEC_OUTPUT_CHAN_MAP 0x00010D82 |
| 4577 | |
| 4578 | /* Maximum number of decoder output channels.*/ |
| 4579 | #define MAX_CHAN_MAP_CHANNELS 16 |
| 4580 | |
| 4581 | /* Structure for decoder output channel mapping. */ |
| 4582 | |
| 4583 | /* Payload of the #ASM_PARAM_ID_DEC_OUTPUT_CHAN_MAP parameter in the |
| 4584 | * #ASM_STREAM_CMD_SET_ENCDEC_PARAM command. |
| 4585 | */ |
| 4586 | struct asm_dec_out_chan_map_param { |
| 4587 | struct apr_hdr hdr; |
| 4588 | struct asm_stream_cmd_set_encdec_param encdec; |
Bharath Ramachandramurthy | 2e3168f | 2012-05-03 16:29:09 -0700 | [diff] [blame] | 4589 | u32 num_channels; |
| 4590 | /* Number of decoder output channels. |
| 4591 | * Supported values: 0 to #MAX_CHAN_MAP_CHANNELS |
| 4592 | * |
| 4593 | * A value of 0 indicates native channel mapping, which is valid |
| 4594 | * only for NT mode. This means the output of the decoder is to be |
| 4595 | * preserved as is. |
| 4596 | */ |
| 4597 | u8 channel_mapping[MAX_CHAN_MAP_CHANNELS]; |
| 4598 | } __packed; |
| 4599 | |
| 4600 | #define ASM_STREAM_CMD_OPEN_WRITE_COMPRESSED 0x00010D84 |
| 4601 | |
| 4602 | /* Bitmask for the IEC 61937 enable flag.*/ |
| 4603 | #define ASM_BIT_MASK_IEC_61937_STREAM_FLAG (0x00000001UL) |
| 4604 | |
| 4605 | /* Shift value for the IEC 61937 enable flag.*/ |
| 4606 | #define ASM_SHIFT_IEC_61937_STREAM_FLAG 0 |
| 4607 | |
| 4608 | /* Bitmask for the IEC 60958 enable flag.*/ |
| 4609 | #define ASM_BIT_MASK_IEC_60958_STREAM_FLAG (0x00000002UL) |
| 4610 | |
| 4611 | /* Shift value for the IEC 60958 enable flag.*/ |
| 4612 | #define ASM_SHIFT_IEC_60958_STREAM_FLAG 1 |
| 4613 | |
| 4614 | /* Payload format for open write compressed comand */ |
| 4615 | |
| 4616 | /* Payload format for the #ASM_STREAM_CMD_OPEN_WRITE_COMPRESSED |
| 4617 | * comand, which opens a stream for a given session ID and stream ID |
| 4618 | * to be rendered in the compressed format. |
| 4619 | */ |
| 4620 | |
| 4621 | struct asm_stream_cmd_open_write_compressed { |
| 4622 | struct apr_hdr hdr; |
| 4623 | u32 flags; |
| 4624 | /* Mode flags that configure the stream for a specific format. |
| 4625 | * Supported values: |
| 4626 | * - Bit 0 -- IEC 61937 compatibility |
| 4627 | * - 0 -- Stream is not in IEC 61937 format |
| 4628 | * - 1 -- Stream is in IEC 61937 format |
| 4629 | * - Bit 1 -- IEC 60958 compatibility |
| 4630 | * - 0 -- Stream is not in IEC 60958 format |
| 4631 | * - 1 -- Stream is in IEC 60958 format |
| 4632 | * - Bits 2 to 31 -- 0 (Reserved) |
| 4633 | * |
| 4634 | * For the same stream, bit 0 cannot be set to 0 and bit 1 cannot |
| 4635 | * be set to 1. A compressed stream connot have IEC 60958 |
| 4636 | * packetization applied without IEC 61937 packetization. |
| 4637 | * @note1hang Currently, IEC 60958 packetized input streams are not |
| 4638 | * supported. |
| 4639 | */ |
| 4640 | |
| 4641 | |
| 4642 | u32 fmt_id; |
| 4643 | /* Specifies the media type of the HDMI stream to be opened. |
| 4644 | * Supported values: |
| 4645 | * - #ASM_MEDIA_FMT_AC3_DEC |
| 4646 | * - #ASM_MEDIA_FMT_EAC3_DEC |
| 4647 | * - #ASM_MEDIA_FMT_DTS |
| 4648 | * - #ASM_MEDIA_FMT_ATRAC |
| 4649 | * - #ASM_MEDIA_FMT_MAT |
| 4650 | * |
| 4651 | * @note1hang This field must be set to a valid media type even if |
| 4652 | * IEC 61937 packetization is not performed by the aDSP. |
| 4653 | */ |
| 4654 | |
| 4655 | } __packed; |
| 4656 | |
| 4657 | #define ASM_STREAM_CMD_OPEN_READ_COMPRESSED 0x00010D95 |
| 4658 | |
| 4659 | struct asm_stream_cmd_open_read_compressed { |
| 4660 | struct apr_hdr hdr; |
| 4661 | u32 mode_flags; |
| 4662 | /* Mode flags that indicate whether meta information per encoded |
| 4663 | * frame is to be provided. |
| 4664 | * Supported values for bit 4: |
| 4665 | * - 0 -- Return data buffer contains all encoded frames only; it does |
| 4666 | * not contain frame metadata. |
| 4667 | * - 1 -- Return data buffer contains an array of metadata and encoded |
| 4668 | * frames. |
| 4669 | * - Use #ASM_BIT_MASK_META_INFO_FLAG to set the bitmask and |
| 4670 | * #ASM_SHIFT_META_INFO_FLAG to set the shift value for this bit. |
| 4671 | * All other bits are reserved; clients must set them to zero. |
| 4672 | */ |
| 4673 | |
| 4674 | u32 frames_per_buf; |
| 4675 | /* Indicates the number of frames that need to be returned per |
| 4676 | * read buffer |
| 4677 | * Supported values: should be greater than 0 |
| 4678 | */ |
| 4679 | |
| 4680 | } __packed; |
| 4681 | |
| 4682 | /* adsp_asm_stream_commands.h*/ |
| 4683 | |
| 4684 | |
| 4685 | /* adsp_asm_api.h (no changes)*/ |
| 4686 | #define ASM_STREAM_POSTPROCOPO_ID_DEFAULT \ |
| 4687 | 0x00010BE4 |
| 4688 | #define ASM_STREAM_POSTPROCOPO_ID_PEAKMETER \ |
| 4689 | 0x00010D83 |
| 4690 | #define ASM_STREAM_POSTPROCOPO_ID_NONE \ |
| 4691 | 0x00010C68 |
| 4692 | #define ASM_STREAM_POSTPROCOPO_ID_MCH_PEAK_VOL \ |
| 4693 | 0x00010D8B |
| 4694 | #define ASM_STREAM_PREPROCOPO_ID_DEFAULT \ |
| 4695 | ASM_STREAM_POSTPROCOPO_ID_DEFAULT |
| 4696 | #define ASM_STREAM_PREPROCOPO_ID_NONE \ |
| 4697 | ASM_STREAM_POSTPROCOPO_ID_NONE |
| 4698 | #define ADM_CMD_COPP_OPENOPOLOGY_ID_NONE_AUDIO_COPP \ |
| 4699 | 0x00010312 |
| 4700 | #define ADM_CMD_COPP_OPENOPOLOGY_ID_SPEAKER_MONO_AUDIO_COPP \ |
| 4701 | 0x00010313 |
| 4702 | #define ADM_CMD_COPP_OPENOPOLOGY_ID_SPEAKER_STEREO_AUDIO_COPP \ |
| 4703 | 0x00010314 |
| 4704 | #define ADM_CMD_COPP_OPENOPOLOGY_ID_SPEAKER_STEREO_IIR_AUDIO_COPP\ |
| 4705 | 0x00010704 |
| 4706 | #define ADM_CMD_COPP_OPENOPOLOGY_ID_SPEAKER_MONO_AUDIO_COPP_MBDRCV2\ |
| 4707 | 0x0001070D |
| 4708 | #define ADM_CMD_COPP_OPENOPOLOGY_ID_SPEAKER_STEREO_AUDIO_COPP_MBDRCV2\ |
| 4709 | 0x0001070E |
| 4710 | #define ADM_CMD_COPP_OPENOPOLOGY_ID_SPEAKER_STEREO_IIR_AUDIO_COPP_MBDRCV2\ |
| 4711 | 0x0001070F |
| 4712 | #define ADM_CMD_COPP_OPENOPOLOGY_ID_SPEAKER_MCH_PEAK_VOL \ |
| 4713 | 0x0001031B |
| 4714 | #define ADM_CMD_COPP_OPENOPOLOGY_ID_MIC_MONO_AUDIO_COPP 0x00010315 |
| 4715 | #define ADM_CMD_COPP_OPENOPOLOGY_ID_MIC_STEREO_AUDIO_COPP 0x00010316 |
| 4716 | #define AUDPROC_COPPOPOLOGY_ID_MCHAN_IIR_AUDIO 0x00010715 |
| 4717 | #define ADM_CMD_COPP_OPENOPOLOGY_ID_DEFAULT_AUDIO_COPP 0x00010BE3 |
| 4718 | #define ADM_CMD_COPP_OPENOPOLOGY_ID_PEAKMETER_AUDIO_COPP 0x00010317 |
| 4719 | #define AUDPROC_MODULE_ID_AIG 0x00010716 |
| 4720 | #define AUDPROC_PARAM_ID_AIG_ENABLE 0x00010717 |
| 4721 | #define AUDPROC_PARAM_ID_AIG_CONFIG 0x00010718 |
| 4722 | |
| 4723 | struct Audio_AigParam { |
| 4724 | uint16_t mode; |
| 4725 | /*< Mode word for enabling AIG/SIG mode . |
| 4726 | * Byte offset: 0 |
| 4727 | */ |
| 4728 | int16_t staticGainL16Q12; |
| 4729 | /*< Static input gain when aigMode is set to 1. |
| 4730 | * Byte offset: 2 |
| 4731 | */ |
| 4732 | int16_t initialGainDBL16Q7; |
| 4733 | /*<Initial value that the adaptive gain update starts from dB |
| 4734 | * Q7 Byte offset: 4 |
| 4735 | */ |
| 4736 | int16_t idealRMSDBL16Q7; |
| 4737 | /*<Average RMS level that AIG attempts to achieve Q8.7 |
| 4738 | * Byte offset: 6 |
| 4739 | */ |
| 4740 | int32_t noiseGateL32; |
| 4741 | /*Threshold below which signal is considered as noise and AIG |
| 4742 | * Byte offset: 8 |
| 4743 | */ |
| 4744 | int32_t minGainL32Q15; |
| 4745 | /*Minimum gain that can be provided by AIG Q16.15 |
| 4746 | * Byte offset: 12 |
| 4747 | */ |
| 4748 | int32_t maxGainL32Q15; |
| 4749 | /*Maximum gain that can be provided by AIG Q16.15 |
| 4750 | * Byte offset: 16 |
| 4751 | */ |
| 4752 | uint32_t gainAtRtUL32Q31; |
| 4753 | /*Attack/release time for AIG update Q1.31 |
| 4754 | * Byte offset: 20 |
| 4755 | */ |
| 4756 | uint32_t longGainAtRtUL32Q31; |
| 4757 | /*Long attack/release time while updating gain for |
| 4758 | * noise/silence Q1.31 Byte offset: 24 |
| 4759 | */ |
| 4760 | |
| 4761 | uint32_t rmsTavUL32Q32; |
| 4762 | /* RMS smoothing time constant used for long-term RMS estimate |
| 4763 | * Q0.32 Byte offset: 28 |
| 4764 | */ |
| 4765 | |
| 4766 | uint32_t gainUpdateStartTimMsUL32Q0; |
| 4767 | /* The waiting time before which AIG starts to apply adaptive |
| 4768 | * gain update Q32.0 Byte offset: 32 |
| 4769 | */ |
| 4770 | |
| 4771 | } __packed; |
| 4772 | |
| 4773 | |
| 4774 | #define ADM_MODULE_ID_EANS 0x00010C4A |
| 4775 | #define ADM_PARAM_ID_EANS_ENABLE 0x00010C4B |
| 4776 | #define ADM_PARAM_ID_EANS_PARAMS 0x00010C4C |
| 4777 | |
| 4778 | struct adm_eans_enable { |
| 4779 | |
| 4780 | uint32_t enable_flag; |
| 4781 | /*< Specifies whether EANS is disabled (0) or enabled |
| 4782 | * (nonzero). |
| 4783 | * This is supported only for sampling rates of 8, 12, 16, 24, 32, |
| 4784 | * and 48 kHz. It is not supported for sampling rates of 11.025, |
| 4785 | * 22.05, or 44.1 kHz. |
| 4786 | */ |
| 4787 | |
| 4788 | } __packed; |
| 4789 | |
| 4790 | |
| 4791 | struct adm_eans_params { |
| 4792 | int16_t eans_mode; |
| 4793 | /*< Mode word for enabling/disabling submodules. |
| 4794 | * Byte offset: 0 |
| 4795 | */ |
| 4796 | |
| 4797 | int16_t eans_input_gain; |
| 4798 | /*< Q2.13 input gain to the EANS module. |
| 4799 | * Byte offset: 2 |
| 4800 | */ |
| 4801 | |
| 4802 | int16_t eans_output_gain; |
| 4803 | /*< Q2.13 output gain to the EANS module. |
| 4804 | * Byte offset: 4 |
| 4805 | */ |
| 4806 | |
| 4807 | int16_t eansarget_ns; |
| 4808 | /*< Target noise suppression level in dB. |
| 4809 | * Byte offset: 6 |
| 4810 | */ |
| 4811 | |
| 4812 | int16_t eans_s_alpha; |
| 4813 | /*< Q3.12 over-subtraction factor for stationary noise |
| 4814 | * suppression. |
| 4815 | * Byte offset: 8 |
| 4816 | */ |
| 4817 | |
| 4818 | int16_t eans_n_alpha; |
| 4819 | /* < Q3.12 over-subtraction factor for nonstationary noise |
| 4820 | * suppression. |
| 4821 | * Byte offset: 10 |
| 4822 | */ |
| 4823 | |
| 4824 | int16_t eans_n_alphamax; |
| 4825 | /*< Q3.12 maximum over-subtraction factor for nonstationary |
| 4826 | * noise suppression. |
| 4827 | * Byte offset: 12 |
| 4828 | */ |
| 4829 | int16_t eans_e_alpha; |
| 4830 | /*< Q15 scaling factor for excess noise suppression. |
| 4831 | * Byte offset: 14 |
| 4832 | */ |
| 4833 | |
| 4834 | int16_t eans_ns_snrmax; |
| 4835 | /*< Upper boundary in dB for SNR estimation. |
| 4836 | * Byte offset: 16 |
| 4837 | */ |
| 4838 | |
| 4839 | int16_t eans_sns_block; |
| 4840 | /*< Quarter block size for stationary noise suppression. |
| 4841 | * Byte offset: 18 |
| 4842 | */ |
| 4843 | |
| 4844 | int16_t eans_ns_i; |
| 4845 | /*< Initialization block size for noise suppression. |
| 4846 | * Byte offset: 20 |
| 4847 | */ |
| 4848 | int16_t eans_np_scale; |
| 4849 | /*< Power scale factor for nonstationary noise update. |
| 4850 | * Byte offset: 22 |
| 4851 | */ |
| 4852 | |
| 4853 | int16_t eans_n_lambda; |
| 4854 | /*< Smoothing factor for higher level nonstationary noise |
| 4855 | * update. |
| 4856 | * Byte offset: 24 |
| 4857 | */ |
| 4858 | |
| 4859 | int16_t eans_n_lambdaf; |
| 4860 | /*< Medium averaging factor for noise update. |
| 4861 | * Byte offset: 26 |
| 4862 | */ |
| 4863 | |
| 4864 | int16_t eans_gs_bias; |
| 4865 | /*< Bias factor in dB for gain calculation. |
| 4866 | * Byte offset: 28 |
| 4867 | */ |
| 4868 | |
| 4869 | int16_t eans_gs_max; |
| 4870 | /*< SNR lower boundary in dB for aggressive gain calculation. |
| 4871 | * Byte offset: 30 |
| 4872 | */ |
| 4873 | |
| 4874 | int16_t eans_s_alpha_hb; |
| 4875 | /*< Q3.12 over-subtraction factor for high-band stationary |
| 4876 | * noise suppression. |
| 4877 | * Byte offset: 32 |
| 4878 | */ |
| 4879 | |
| 4880 | int16_t eans_n_alphamax_hb; |
| 4881 | /*< Q3.12 maximum over-subtraction factor for high-band |
| 4882 | * nonstationary noise suppression. |
| 4883 | * Byte offset: 34 |
| 4884 | */ |
| 4885 | |
| 4886 | int16_t eans_e_alpha_hb; |
| 4887 | /*< Q15 scaling factor for high-band excess noise suppression. |
| 4888 | * Byte offset: 36 |
| 4889 | */ |
| 4890 | |
| 4891 | int16_t eans_n_lambda0; |
| 4892 | /*< Smoothing factor for nonstationary noise update during |
| 4893 | * speech activity. |
| 4894 | * Byte offset: 38 |
| 4895 | */ |
| 4896 | |
| 4897 | int16_t thresh; |
| 4898 | /*< Threshold for generating a binary VAD decision. |
| 4899 | * Byte offset: 40 |
| 4900 | */ |
| 4901 | |
| 4902 | int16_t pwr_scale; |
| 4903 | /*< Indirect lower boundary of the noise level estimate. |
| 4904 | * Byte offset: 42 |
| 4905 | */ |
| 4906 | |
| 4907 | int16_t hangover_max; |
| 4908 | /*< Avoids mid-speech clipping and reliably detects weak speech |
| 4909 | * bursts at the end of speech activity. |
| 4910 | * Byte offset: 44 |
| 4911 | */ |
| 4912 | |
| 4913 | int16_t alpha_snr; |
| 4914 | /*< Controls responsiveness of the VAD. |
| 4915 | * Byte offset: 46 |
| 4916 | */ |
| 4917 | |
| 4918 | int16_t snr_diff_max; |
| 4919 | /*< Maximum SNR difference. Decreasing this parameter value may |
| 4920 | * help in making correct decisions during abrupt changes; however, |
| 4921 | * decreasing too much may increase false alarms during long |
| 4922 | * pauses/silences. |
| 4923 | * Byte offset: 48 |
| 4924 | */ |
| 4925 | |
| 4926 | int16_t snr_diff_min; |
| 4927 | /*< Minimum SNR difference. Decreasing this parameter value may |
| 4928 | * help in making correct decisions during abrupt changes; however, |
| 4929 | * decreasing too much may increase false alarms during long |
| 4930 | * pauses/silences. |
| 4931 | * Byte offset: 50 |
| 4932 | */ |
| 4933 | |
| 4934 | int16_t init_length; |
| 4935 | /*< Defines the number of frames for which a noise level |
| 4936 | * estimate is set to a fixed value. |
| 4937 | * Byte offset: 52 |
| 4938 | */ |
| 4939 | |
| 4940 | int16_t max_val; |
| 4941 | /*< Defines the upper limit of the noise level. |
| 4942 | * Byte offset: 54 |
| 4943 | */ |
| 4944 | |
| 4945 | int16_t init_bound; |
| 4946 | /*< Defines the initial bounding value for the noise level |
| 4947 | * estimate. This is used during the initial segment defined by the |
| 4948 | * init_length parameter. |
| 4949 | * Byte offset: 56 |
| 4950 | */ |
| 4951 | |
| 4952 | int16_t reset_bound; |
| 4953 | /*< Reset boundary for noise tracking. |
| 4954 | * Byte offset: 58 |
| 4955 | */ |
| 4956 | |
| 4957 | int16_t avar_scale; |
| 4958 | /*< Defines the bias factor in noise estimation. |
| 4959 | * Byte offset: 60 |
| 4960 | */ |
| 4961 | |
| 4962 | int16_t sub_nc; |
| 4963 | /*< Defines the window length for noise estimation. |
| 4964 | * Byte offset: 62 |
| 4965 | */ |
| 4966 | |
| 4967 | int16_t spow_min; |
| 4968 | /*< Defines the minimum signal power required to update the |
| 4969 | * boundaries for the noise floor estimate. |
| 4970 | * Byte offset: 64 |
| 4971 | */ |
| 4972 | |
| 4973 | int16_t eans_gs_fast; |
| 4974 | /*< Fast smoothing factor for postprocessor gain. |
| 4975 | * Byte offset: 66 |
| 4976 | */ |
| 4977 | |
| 4978 | int16_t eans_gs_med; |
| 4979 | /*< Medium smoothing factor for postprocessor gain. |
| 4980 | * Byte offset: 68 |
| 4981 | */ |
| 4982 | |
| 4983 | int16_t eans_gs_slow; |
| 4984 | /*< Slow smoothing factor for postprocessor gain. |
| 4985 | * Byte offset: 70 |
| 4986 | */ |
| 4987 | |
| 4988 | int16_t eans_swb_salpha; |
| 4989 | /*< Q3.12 super wideband aggressiveness factor for stationary |
| 4990 | * noise suppression. |
| 4991 | * Byte offset: 72 |
| 4992 | */ |
| 4993 | |
| 4994 | int16_t eans_swb_nalpha; |
| 4995 | /*< Q3.12 super wideband aggressiveness factor for |
| 4996 | * nonstationary noise suppression. |
| 4997 | * Byte offset: 74 |
| 4998 | */ |
| 4999 | } __packed; |
| 5000 | #define ADM_MODULE_IDX_MIC_GAIN_CTRL 0x00010C35 |
| 5001 | |
| 5002 | /* @addtogroup audio_pp_param_ids |
| 5003 | * ID of the Tx mic gain control parameter used by the |
| 5004 | * #ADM_MODULE_IDX_MIC_GAIN_CTRL module. |
| 5005 | * @messagepayload |
| 5006 | * @structure{admx_mic_gain} |
| 5007 | * @tablespace |
| 5008 | * @inputtable{Audio_Postproc_ADM_PARAM_IDX_MIC_GAIN.tex} |
| 5009 | */ |
| 5010 | #define ADM_PARAM_IDX_MIC_GAIN 0x00010C36 |
| 5011 | |
| 5012 | /* Structure for a Tx mic gain parameter for the mic gain |
| 5013 | * control module. |
| 5014 | */ |
| 5015 | |
| 5016 | |
| 5017 | /* @brief Payload of the #ADM_PARAM_IDX_MIC_GAIN parameter in the |
| 5018 | * Tx Mic Gain Control module. |
| 5019 | */ |
| 5020 | struct admx_mic_gain { |
| 5021 | uint16_t tx_mic_gain; |
| 5022 | /*< Linear gain in Q13 format. */ |
| 5023 | |
| 5024 | uint16_t reserved; |
| 5025 | /*< Clients must set this field to zero. */ |
| 5026 | } __packed; |
| 5027 | |
| 5028 | /* end_addtogroup audio_pp_param_ids */ |
| 5029 | |
| 5030 | /* @ingroup audio_pp_module_ids |
| 5031 | * ID of the Rx Codec Gain Control module. |
| 5032 | * |
| 5033 | * This module supports the following parameter ID: |
| 5034 | * - #ADM_PARAM_ID_RX_CODEC_GAIN |
| 5035 | */ |
| 5036 | #define ADM_MODULE_ID_RX_CODEC_GAIN_CTRL 0x00010C37 |
| 5037 | |
| 5038 | /* @addtogroup audio_pp_param_ids |
| 5039 | * ID of the Rx codec gain control parameter used by the |
| 5040 | * #ADM_MODULE_ID_RX_CODEC_GAIN_CTRL module. |
| 5041 | * |
| 5042 | * @messagepayload |
| 5043 | * @structure{adm_rx_codec_gain} |
| 5044 | * @tablespace |
| 5045 | * @inputtable{Audio_Postproc_ADM_PARAM_ID_RX_CODEC_GAIN.tex} |
| 5046 | */ |
| 5047 | #define ADM_PARAM_ID_RX_CODEC_GAIN 0x00010C38 |
| 5048 | |
| 5049 | /* Structure for the Rx common codec gain control module. */ |
| 5050 | |
| 5051 | |
| 5052 | /* @brief Payload of the #ADM_PARAM_ID_RX_CODEC_GAIN parameter |
| 5053 | * in the Rx Codec Gain Control module. |
| 5054 | */ |
| 5055 | |
| 5056 | |
| 5057 | struct adm_rx_codec_gain { |
| 5058 | uint16_t rx_codec_gain; |
| 5059 | /*< Linear gain in Q13 format. */ |
| 5060 | |
| 5061 | uint16_t reserved; |
| 5062 | /*< Clients must set this field to zero.*/ |
| 5063 | } __packed; |
| 5064 | |
| 5065 | /* end_addtogroup audio_pp_param_ids */ |
| 5066 | |
| 5067 | /* @ingroup audio_pp_module_ids |
| 5068 | * ID of the HPF Tuning Filter module on the Tx path. |
| 5069 | * This module supports the following parameter IDs: |
| 5070 | * - #ADM_PARAM_ID_HPF_IIRX_FILTER_ENABLE_CONFIG |
| 5071 | * - #ADM_PARAM_ID_HPF_IIRX_FILTER_PRE_GAIN |
| 5072 | * - #ADM_PARAM_ID_HPF_IIRX_FILTER_CONFIG_PARAMS |
| 5073 | */ |
| 5074 | #define ADM_MODULE_ID_HPF_IIRX_FILTER 0x00010C3D |
| 5075 | |
| 5076 | /* @addtogroup audio_pp_param_ids */ |
| 5077 | /* ID of the Tx HPF IIR filter enable parameter used by the |
| 5078 | * #ADM_MODULE_ID_HPF_IIRX_FILTER module. |
| 5079 | * @parspace Message payload |
| 5080 | * @structure{adm_hpfx_iir_filter_enable_cfg} |
| 5081 | * @tablespace |
| 5082 | * @inputtable{Audio_Postproc_ADM_PARAM_ID_HPF_IIRX_FILTER_ENABLE_CONFIG.tex} |
| 5083 | */ |
| 5084 | #define ADM_PARAM_ID_HPF_IIRX_FILTER_ENABLE_CONFIG 0x00010C3E |
| 5085 | |
| 5086 | /* ID of the Tx HPF IIR filter pregain parameter used by the |
| 5087 | * #ADM_MODULE_ID_HPF_IIRX_FILTER module. |
| 5088 | * @parspace Message payload |
| 5089 | * @structure{adm_hpfx_iir_filter_pre_gain} |
| 5090 | * @tablespace |
| 5091 | * @inputtable{Audio_Postproc_ADM_PARAM_ID_HPF_IIRX_FILTER_PRE_GAIN.tex} |
| 5092 | */ |
| 5093 | #define ADM_PARAM_ID_HPF_IIRX_FILTER_PRE_GAIN 0x00010C3F |
| 5094 | |
| 5095 | /* ID of the Tx HPF IIR filter configuration parameters used by the |
| 5096 | * #ADM_MODULE_ID_HPF_IIRX_FILTER module. |
| 5097 | * @parspace Message payload |
| 5098 | * @structure{adm_hpfx_iir_filter_cfg_params} |
| 5099 | * @tablespace |
| 5100 | * @inputtable{Audio_Postproc_ADM_PARAM_ID_HPF_IIRX_FILTER_CONFIG_PA |
| 5101 | * RAMS.tex} |
| 5102 | */ |
| 5103 | #define ADM_PARAM_ID_HPF_IIRX_FILTER_CONFIG_PARAMS 0x00010C40 |
| 5104 | |
| 5105 | /* Structure for enabling a configuration parameter for |
| 5106 | * the HPF IIR tuning filter module on the Tx path. |
| 5107 | */ |
| 5108 | |
| 5109 | /* @brief Payload of the #ADM_PARAM_ID_HPF_IIRX_FILTER_ENABLE_CONFIG |
| 5110 | * parameter in the Tx path HPF Tuning Filter module. |
| 5111 | */ |
| 5112 | struct adm_hpfx_iir_filter_enable_cfg { |
| 5113 | uint32_t enable_flag; |
| 5114 | /*< Specifies whether the HPF tuning filter is disabled (0) or |
| 5115 | * enabled (nonzero). |
| 5116 | */ |
| 5117 | } __packed; |
| 5118 | |
| 5119 | |
| 5120 | /* Structure for the pregain parameter for the HPF |
| 5121 | IIR tuning filter module on the Tx path. */ |
| 5122 | |
| 5123 | |
| 5124 | /* @brief Payload of the #ADM_PARAM_ID_HPF_IIRX_FILTER_PRE_GAIN parameter |
| 5125 | * in the Tx path HPF Tuning Filter module. |
| 5126 | */ |
| 5127 | struct adm_hpfx_iir_filter_pre_gain { |
| 5128 | uint16_t pre_gain; |
| 5129 | /*< Linear gain in Q13 format. */ |
| 5130 | |
| 5131 | uint16_t reserved; |
| 5132 | /*< Clients must set this field to zero.*/ |
| 5133 | } __packed; |
| 5134 | |
| 5135 | |
| 5136 | /* Structure for the configuration parameter for the |
| 5137 | HPF IIR tuning filter module on the Tx path. */ |
| 5138 | |
| 5139 | |
| 5140 | /* @brief Payload of the #ADM_PARAM_ID_HPF_IIRX_FILTER_CONFIG_PARAMS |
| 5141 | * parameters in the Tx path HPF Tuning Filter module. \n |
| 5142 | * \n |
| 5143 | * This structure is followed by tuning filter coefficients as follows: \n |
| 5144 | * - Sequence of int32_t FilterCoeffs. |
| 5145 | * Each band has five coefficients, each in int32_t format in the order of |
| 5146 | * b0, b1, b2, a1, a2. |
| 5147 | * - Sequence of int16_t NumShiftFactor. |
| 5148 | * One int16_t per band. The numerator shift factor is related to the Q |
| 5149 | * factor of the filter coefficients. |
| 5150 | * - Sequence of uint16_t PanSetting. |
| 5151 | * One uint16_t for each band to indicate application of the filter to |
| 5152 | * left (0), right (1), or both (2) channels. |
| 5153 | */ |
| 5154 | struct adm_hpfx_iir_filter_cfg_params { |
| 5155 | uint16_t num_biquad_stages; |
| 5156 | /*< Number of bands. |
| 5157 | * Supported values: 0 to 20 |
| 5158 | */ |
| 5159 | |
| 5160 | uint16_t reserved; |
| 5161 | /*< Clients must set this field to zero.*/ |
| 5162 | } __packed; |
| 5163 | |
| 5164 | /* end_addtogroup audio_pp_module_ids */ |
| 5165 | |
| 5166 | /* @addtogroup audio_pp_module_ids */ |
| 5167 | /* ID of the Tx path IIR Tuning Filter module. |
| 5168 | * This module supports the following parameter IDs: |
| 5169 | * - #ADM_PARAM_IDX_IIR_FILTER_ENABLE_CONFIG |
| 5170 | */ |
| 5171 | #define ADM_MODULE_IDX_IIR_FILTER 0x00010C41 |
| 5172 | |
| 5173 | /* ID of the Rx path IIR Tuning Filter module for the left channel. |
| 5174 | * The parameter IDs of the IIR tuning filter module |
| 5175 | * (#ASM_MODULE_ID_IIRUNING_FILTER) are used for the left IIR Rx tuning |
| 5176 | * filter. |
| 5177 | * |
| 5178 | * Pan parameters are not required for this per-channel IIR filter; the pan |
| 5179 | * parameters are ignored by this module. |
| 5180 | */ |
| 5181 | #define ADM_MODULE_ID_LEFT_IIRUNING_FILTER 0x00010705 |
| 5182 | |
| 5183 | /* ID of the the Rx path IIR Tuning Filter module for the right |
| 5184 | * channel. |
| 5185 | * The parameter IDs of the IIR tuning filter module |
| 5186 | * (#ASM_MODULE_ID_IIRUNING_FILTER) are used for the right IIR Rx |
| 5187 | * tuning filter. |
| 5188 | * |
| 5189 | * Pan parameters are not required for this per-channel IIR filter; |
| 5190 | * the pan parameters are ignored by this module. |
| 5191 | */ |
| 5192 | #define ADM_MODULE_ID_RIGHT_IIRUNING_FILTER 0x00010706 |
| 5193 | |
| 5194 | /* end_addtogroup audio_pp_module_ids */ |
| 5195 | |
| 5196 | /* @addtogroup audio_pp_param_ids */ |
| 5197 | |
| 5198 | /* ID of the Tx IIR filter enable parameter used by the |
| 5199 | * #ADM_MODULE_IDX_IIR_FILTER module. |
| 5200 | * @parspace Message payload |
| 5201 | * @structure{admx_iir_filter_enable_cfg} |
| 5202 | * @tablespace |
| 5203 | * @inputtable{Audio_Postproc_ADM_PARAM_IDX_IIR_FILTER_ENABLE_CONFIG.tex} |
| 5204 | */ |
| 5205 | #define ADM_PARAM_IDX_IIR_FILTER_ENABLE_CONFIG 0x00010C42 |
| 5206 | |
| 5207 | /* ID of the Tx IIR filter pregain parameter used by the |
| 5208 | * #ADM_MODULE_IDX_IIR_FILTER module. |
| 5209 | * @parspace Message payload |
| 5210 | * @structure{admx_iir_filter_pre_gain} |
| 5211 | * @tablespace |
| 5212 | * @inputtable{Audio_Postproc_ADM_PARAM_IDX_IIR_FILTER_PRE_GAIN.tex} |
| 5213 | */ |
| 5214 | #define ADM_PARAM_IDX_IIR_FILTER_PRE_GAIN 0x00010C43 |
| 5215 | |
| 5216 | /* ID of the Tx IIR filter configuration parameters used by the |
| 5217 | * #ADM_MODULE_IDX_IIR_FILTER module. |
| 5218 | * @parspace Message payload |
| 5219 | * @structure{admx_iir_filter_cfg_params} |
| 5220 | * @tablespace |
| 5221 | * @inputtable{Audio_Postproc_ADM_PARAM_IDX_IIR_FILTER_CONFIG_PARAMS.tex} |
| 5222 | */ |
| 5223 | #define ADM_PARAM_IDX_IIR_FILTER_CONFIG_PARAMS 0x00010C44 |
| 5224 | |
| 5225 | /* Structure for enabling the configuration parameter for the |
| 5226 | * IIR filter module on the Tx path. |
| 5227 | */ |
| 5228 | |
| 5229 | /* @brief Payload of the #ADM_PARAM_IDX_IIR_FILTER_ENABLE_CONFIG |
| 5230 | * parameter in the Tx Path IIR Tuning Filter module. |
| 5231 | */ |
| 5232 | |
| 5233 | struct admx_iir_filter_enable_cfg { |
| 5234 | uint32_t enable_flag; |
| 5235 | /*< Specifies whether the IIR tuning filter is disabled (0) or |
| 5236 | * enabled (nonzero). |
| 5237 | */ |
| 5238 | |
| 5239 | } __packed; |
| 5240 | |
| 5241 | |
| 5242 | /* Structure for the pregain parameter for the |
| 5243 | * IIR filter module on the Tx path. |
| 5244 | */ |
| 5245 | |
| 5246 | |
| 5247 | /* @brief Payload of the #ADM_PARAM_IDX_IIR_FILTER_PRE_GAIN |
| 5248 | * parameter in the Tx Path IIR Tuning Filter module. |
| 5249 | */ |
| 5250 | |
| 5251 | struct admx_iir_filter_pre_gain { |
| 5252 | uint16_t pre_gain; |
| 5253 | /*< Linear gain in Q13 format. */ |
| 5254 | |
| 5255 | uint16_t reserved; |
| 5256 | /*< Clients must set this field to zero.*/ |
| 5257 | } __packed; |
| 5258 | |
| 5259 | |
| 5260 | /* Structure for the configuration parameter for the |
| 5261 | * IIR filter module on the Tx path. |
| 5262 | */ |
| 5263 | |
| 5264 | |
| 5265 | /* @brief Payload of the #ADM_PARAM_IDX_IIR_FILTER_CONFIG_PARAMS |
| 5266 | * parameter in the Tx Path IIR Tuning Filter module. \n |
| 5267 | * \n |
| 5268 | * This structure is followed by the HPF IIR filter coefficients on |
| 5269 | * the Tx path as follows: \n |
| 5270 | * - Sequence of int32_t ulFilterCoeffs. Each band has five |
| 5271 | * coefficients, each in int32_t format in the order of b0, b1, b2, |
| 5272 | * a1, a2. |
| 5273 | * - Sequence of int16_t sNumShiftFactor. One int16_t per band. The |
| 5274 | * numerator shift factor is related to the Q factor of the filter |
| 5275 | * coefficients. |
| 5276 | * - Sequence of uint16_t usPanSetting. One uint16_t for each band |
| 5277 | * to indicate if the filter is applied to left (0), right (1), or |
| 5278 | * both (2) channels. |
| 5279 | */ |
| 5280 | struct admx_iir_filter_cfg_params { |
| 5281 | uint16_t num_biquad_stages; |
| 5282 | /*< Number of bands. |
| 5283 | * Supported values: 0 to 20 |
| 5284 | */ |
| 5285 | |
| 5286 | uint16_t reserved; |
| 5287 | /*< Clients must set this field to zero.*/ |
| 5288 | } __packed; |
| 5289 | |
| 5290 | /* end_addtogroup audio_pp_module_ids */ |
| 5291 | |
| 5292 | /* @ingroup audio_pp_module_ids |
| 5293 | * ID of the QEnsemble module. |
| 5294 | * This module supports the following parameter IDs: |
| 5295 | * - #ADM_PARAM_ID_QENSEMBLE_ENABLE |
| 5296 | * - #ADM_PARAM_ID_QENSEMBLE_BACKGAIN |
| 5297 | * - #ADM_PARAM_ID_QENSEMBLE_SET_NEW_ANGLE |
| 5298 | */ |
| 5299 | #define ADM_MODULE_ID_QENSEMBLE 0x00010C59 |
| 5300 | |
| 5301 | /* @addtogroup audio_pp_param_ids */ |
| 5302 | /* ID of the QEnsemble enable parameter used by the |
| 5303 | * #ADM_MODULE_ID_QENSEMBLE module. |
| 5304 | * @messagepayload |
| 5305 | * @structure{adm_qensemble_enable} |
| 5306 | * @tablespace |
| 5307 | * @inputtable{Audio_Postproc_ADM_PARAM_ID_QENSEMBLE_ENABLE.tex} |
| 5308 | */ |
| 5309 | #define ADM_PARAM_ID_QENSEMBLE_ENABLE 0x00010C60 |
| 5310 | |
| 5311 | /* ID of the QEnsemble back gain parameter used by the |
| 5312 | * #ADM_MODULE_ID_QENSEMBLE module. |
| 5313 | * @messagepayload |
| 5314 | * @structure{adm_qensemble_param_backgain} |
| 5315 | * @tablespace |
| 5316 | * @inputtable{Audio_Postproc_ADM_PARAM_ID_QENSEMBLE_BACKGAIN.tex} |
| 5317 | */ |
| 5318 | #define ADM_PARAM_ID_QENSEMBLE_BACKGAIN 0x00010C61 |
| 5319 | |
| 5320 | /* ID of the QEnsemble new angle parameter used by the |
| 5321 | * #ADM_MODULE_ID_QENSEMBLE module. |
| 5322 | * @messagepayload |
| 5323 | * @structure{adm_qensemble_param_set_new_angle} |
| 5324 | * @tablespace |
| 5325 | * @inputtable{Audio_Postproc_ADM_PARAM_ID_QENSEMBLE_SET_NEW_ANGLE.tex} |
| 5326 | */ |
| 5327 | #define ADM_PARAM_ID_QENSEMBLE_SET_NEW_ANGLE 0x00010C62 |
| 5328 | |
| 5329 | /* Structure for enabling the configuration parameter for the |
| 5330 | * QEnsemble module. |
| 5331 | */ |
| 5332 | |
| 5333 | |
| 5334 | /* @brief Payload of the #ADM_PARAM_ID_QENSEMBLE_ENABLE |
| 5335 | * parameter used by the QEnsemble module. |
| 5336 | */ |
| 5337 | struct adm_qensemble_enable { |
| 5338 | uint32_t enable_flag; |
| 5339 | /*< Specifies whether the QEnsemble module is disabled (0) or enabled |
| 5340 | * (nonzero). |
| 5341 | */ |
| 5342 | } __packed; |
| 5343 | |
| 5344 | |
| 5345 | /* Structure for the background gain for the QEnsemble module. */ |
| 5346 | |
| 5347 | |
| 5348 | /* @brief Payload of the #ADM_PARAM_ID_QENSEMBLE_BACKGAIN |
| 5349 | * parameter used by |
| 5350 | * the QEnsemble module. |
| 5351 | */ |
| 5352 | struct adm_qensemble_param_backgain { |
| 5353 | int16_t back_gain; |
| 5354 | /*< Linear gain in Q15 format. |
| 5355 | * Supported values: 0 to 32767 |
| 5356 | */ |
| 5357 | |
| 5358 | uint16_t reserved; |
| 5359 | /*< Clients must set this field to zero.*/ |
| 5360 | } __packed; |
| 5361 | /* Structure for setting a new angle for the QEnsemble module. */ |
| 5362 | |
| 5363 | |
| 5364 | /* @brief Payload of the #ADM_PARAM_ID_QENSEMBLE_SET_NEW_ANGLE |
| 5365 | * parameter used |
| 5366 | * by the QEnsemble module. |
| 5367 | */ |
| 5368 | struct adm_qensemble_param_set_new_angle { |
| 5369 | int16_t new_angle; |
| 5370 | /*< New angle in degrees. |
| 5371 | * Supported values: 0 to 359 |
| 5372 | */ |
| 5373 | |
| 5374 | int16_t time_ms; |
| 5375 | /*< Transition time in milliseconds to set the new angle. |
| 5376 | * Supported values: 0 to 32767 |
| 5377 | */ |
| 5378 | } __packed; |
| 5379 | |
| 5380 | /* end_addtogroup audio_pp_module_ids */ |
| 5381 | |
| 5382 | /* @ingroup audio_pp_module_ids |
| 5383 | * ID of the Volume Control module pre/postprocessing block. |
| 5384 | * This module supports the following parameter IDs: |
| 5385 | * - #ASM_PARAM_ID_VOL_CTRL_MASTER_GAIN |
| 5386 | * - #ASM_PARAM_ID_VOL_CTRL_LR_CHANNEL_GAIN |
| 5387 | * - #ASM_PARAM_ID_VOL_CTRL_MUTE_CONFIG |
| 5388 | * - #ASM_PARAM_ID_SOFT_VOL_STEPPING_PARAMETERS |
| 5389 | * - #ASM_PARAM_ID_SOFT_PAUSE_PARAMETERS |
| 5390 | * - #ASM_PARAM_ID_MULTICHANNEL_GAIN |
| 5391 | * - #ASM_PARAM_ID_MULTICHANNEL_MUTE |
| 5392 | */ |
| 5393 | #define ASM_MODULE_ID_VOL_CTRL 0x00010BFE |
| 5394 | |
| 5395 | /* @addtogroup audio_pp_param_ids */ |
| 5396 | /* ID of the master gain parameter used by the #ASM_MODULE_ID_VOL_CTRL |
| 5397 | * module. |
| 5398 | * @messagepayload |
| 5399 | * @structure{asm_volume_ctrl_master_gain} |
| 5400 | * @tablespace |
| 5401 | * @inputtable{Audio_Postproc_ASM_PARAM_ID_VOL_CTRL_MASTER_GAIN.tex} |
| 5402 | */ |
| 5403 | #define ASM_PARAM_ID_VOL_CTRL_MASTER_GAIN 0x00010BFF |
| 5404 | |
| 5405 | /* ID of the left/right channel gain parameter used by the |
| 5406 | * #ASM_MODULE_ID_VOL_CTRL module. |
| 5407 | * @messagepayload |
| 5408 | * @structure{asm_volume_ctrl_lr_chan_gain} |
| 5409 | * @tablespace |
| 5410 | * @inputtable{Audio_Postproc_ASM_PARAM_ID_VOL_CTRL_LR_CHANNEL_GAIN.tex} |
| 5411 | */ |
| 5412 | #define ASM_PARAM_ID_VOL_CTRL_LR_CHANNEL_GAIN 0x00010C00 |
| 5413 | |
| 5414 | /* ID of the mute configuration parameter used by the |
| 5415 | * #ASM_MODULE_ID_VOL_CTRL module. |
| 5416 | * @messagepayload |
| 5417 | * @structure{asm_volume_ctrl_mute_config} |
| 5418 | * @tablespace |
| 5419 | * @inputtable{Audio_Postproc_ASM_PARAM_ID_VOL_CTRL_MUTE_CONFIG.tex} |
| 5420 | */ |
| 5421 | #define ASM_PARAM_ID_VOL_CTRL_MUTE_CONFIG 0x00010C01 |
| 5422 | |
| 5423 | /* ID of the soft stepping volume parameters used by the |
| 5424 | * #ASM_MODULE_ID_VOL_CTRL module. |
| 5425 | * @messagepayload |
| 5426 | * @structure{asm_soft_step_volume_params} |
| 5427 | * @tablespace |
| 5428 | * @inputtable{Audio_Postproc_ASM_PARAM_ID_SOFT_VOL_STEPPING_PARAMET |
| 5429 | * ERS.tex} |
| 5430 | */ |
| 5431 | #define ASM_PARAM_ID_SOFT_VOL_STEPPING_PARAMETERS 0x00010C29 |
| 5432 | |
| 5433 | /* ID of the soft pause parameters used by the #ASM_MODULE_ID_VOL_CTRL |
| 5434 | * module. |
| 5435 | */ |
| 5436 | #define ASM_PARAM_ID_SOFT_PAUSE_PARAMETERS 0x00010D6A |
| 5437 | |
| 5438 | /* ID of the multiple-channel volume control parameters used by the |
| 5439 | * #ASM_MODULE_ID_VOL_CTRL module. |
| 5440 | */ |
| 5441 | #define ASM_PARAM_ID_MULTICHANNEL_GAIN 0x00010713 |
| 5442 | |
| 5443 | /* ID of the multiple-channel mute configuration parameters used by the |
| 5444 | * #ASM_MODULE_ID_VOL_CTRL module. |
| 5445 | */ |
| 5446 | |
| 5447 | #define ASM_PARAM_ID_MULTICHANNEL_MUTE 0x00010714 |
| 5448 | |
| 5449 | /* Structure for the master gain parameter for a volume control |
| 5450 | * module. |
| 5451 | */ |
| 5452 | |
| 5453 | |
| 5454 | /* @brief Payload of the #ASM_PARAM_ID_VOL_CTRL_MASTER_GAIN |
| 5455 | * parameter used by the Volume Control module. |
| 5456 | */ |
| 5457 | |
| 5458 | |
| 5459 | |
| 5460 | struct asm_volume_ctrl_master_gain { |
| 5461 | struct apr_hdr hdr; |
| 5462 | struct asm_stream_cmd_set_pp_params_v2 param; |
| 5463 | struct asm_stream_param_data_v2 data; |
| 5464 | uint16_t master_gain; |
| 5465 | /*< Linear gain in Q13 format. */ |
| 5466 | |
| 5467 | uint16_t reserved; |
| 5468 | /*< Clients must set this field to zero. |
| 5469 | */ |
| 5470 | } __packed; |
| 5471 | |
| 5472 | |
| 5473 | /* Structure for the left/right channel gain parameter for a |
| 5474 | * volume control module. |
| 5475 | */ |
| 5476 | |
| 5477 | |
| 5478 | /* @brief Payload of the #ASM_PARAM_ID_VOL_CTRL_LR_CHANNEL_GAIN |
| 5479 | * parameters used by the Volume Control module. |
| 5480 | */ |
| 5481 | |
| 5482 | |
| 5483 | |
| 5484 | struct asm_volume_ctrl_lr_chan_gain { |
| 5485 | struct apr_hdr hdr; |
| 5486 | struct asm_stream_cmd_set_pp_params_v2 param; |
| 5487 | struct asm_stream_param_data_v2 data; |
| 5488 | |
| 5489 | uint16_t l_chan_gain; |
| 5490 | /*< Linear gain in Q13 format for the left channel. */ |
| 5491 | |
| 5492 | uint16_t r_chan_gain; |
| 5493 | /*< Linear gain in Q13 format for the right channel.*/ |
| 5494 | } __packed; |
| 5495 | |
| 5496 | |
| 5497 | /* Structure for the mute configuration parameter for a |
| 5498 | volume control module. */ |
| 5499 | |
| 5500 | |
| 5501 | /* @brief Payload of the #ASM_PARAM_ID_VOL_CTRL_MUTE_CONFIG |
| 5502 | * parameter used by the Volume Control module. |
| 5503 | */ |
| 5504 | |
| 5505 | |
| 5506 | struct asm_volume_ctrl_mute_config { |
| 5507 | struct apr_hdr hdr; |
| 5508 | struct asm_stream_cmd_set_pp_params_v2 param; |
| 5509 | struct asm_stream_param_data_v2 data; |
| 5510 | uint32_t mute_flag; |
| 5511 | /*< Specifies whether mute is disabled (0) or enabled (nonzero).*/ |
| 5512 | |
| 5513 | } __packed; |
| 5514 | |
| 5515 | /* |
| 5516 | * Supported parameters for a soft stepping linear ramping curve. |
| 5517 | */ |
| 5518 | #define ASM_PARAM_SVC_RAMPINGCURVE_LINEAR 0 |
| 5519 | |
| 5520 | /* |
| 5521 | * Exponential ramping curve. |
| 5522 | */ |
| 5523 | #define ASM_PARAM_SVC_RAMPINGCURVE_EXP 1 |
| 5524 | |
| 5525 | /* |
| 5526 | * Logarithmic ramping curve. |
| 5527 | */ |
| 5528 | #define ASM_PARAM_SVC_RAMPINGCURVE_LOG 2 |
| 5529 | |
| 5530 | /* Structure for holding soft stepping volume parameters. */ |
| 5531 | |
| 5532 | |
| 5533 | /* Payload of the #ASM_PARAM_ID_SOFT_VOL_STEPPING_PARAMETERS |
| 5534 | * parameters used by the Volume Control module. |
| 5535 | */ |
| 5536 | struct asm_soft_step_volume_params { |
| 5537 | struct apr_hdr hdr; |
| 5538 | struct asm_stream_cmd_set_pp_params_v2 param; |
| 5539 | struct asm_stream_param_data_v2 data; |
| 5540 | uint32_t period; |
| 5541 | /*< Period in milliseconds. |
| 5542 | * Supported values: 0 to 15000 |
| 5543 | */ |
| 5544 | |
| 5545 | uint32_t step; |
| 5546 | /*< Step in microseconds. |
| 5547 | * Supported values: 0 to 15000000 |
| 5548 | */ |
| 5549 | |
| 5550 | uint32_t ramping_curve; |
| 5551 | /*< Ramping curve type. |
| 5552 | * Supported values: |
| 5553 | * - #ASM_PARAM_SVC_RAMPINGCURVE_LINEAR |
| 5554 | * - #ASM_PARAM_SVC_RAMPINGCURVE_EXP |
| 5555 | * - #ASM_PARAM_SVC_RAMPINGCURVE_LOG |
| 5556 | */ |
| 5557 | } __packed; |
| 5558 | |
| 5559 | |
| 5560 | /* Structure for holding soft pause parameters. */ |
| 5561 | |
| 5562 | |
| 5563 | /* Payload of the #ASM_PARAM_ID_SOFT_PAUSE_PARAMETERS |
| 5564 | * parameters used by the Volume Control module. |
| 5565 | */ |
| 5566 | |
| 5567 | |
| 5568 | struct asm_soft_pause_params { |
| 5569 | struct apr_hdr hdr; |
| 5570 | struct asm_stream_cmd_set_pp_params_v2 param; |
| 5571 | struct asm_stream_param_data_v2 data; |
| 5572 | uint32_t enable_flag; |
| 5573 | /*< Specifies whether soft pause is disabled (0) or enabled |
| 5574 | * (nonzero). |
| 5575 | */ |
| 5576 | |
| 5577 | |
| 5578 | |
| 5579 | uint32_t period; |
| 5580 | /*< Period in milliseconds. |
| 5581 | * Supported values: 0 to 15000 |
| 5582 | */ |
| 5583 | |
| 5584 | uint32_t step; |
| 5585 | /*< Step in microseconds. |
| 5586 | * Supported values: 0 to 15000000 |
| 5587 | */ |
| 5588 | |
| 5589 | uint32_t ramping_curve; |
| 5590 | /*< Ramping curve. |
| 5591 | * Supported values: |
| 5592 | * - #ASM_PARAM_SVC_RAMPINGCURVE_LINEAR |
| 5593 | * - #ASM_PARAM_SVC_RAMPINGCURVE_EXP |
| 5594 | * - #ASM_PARAM_SVC_RAMPINGCURVE_LOG |
| 5595 | */ |
| 5596 | } __packed; |
| 5597 | |
| 5598 | |
| 5599 | /* Maximum number of channels.*/ |
| 5600 | #define VOLUME_CONTROL_MAX_CHANNELS 8 |
| 5601 | |
| 5602 | /* Structure for holding one channel type - gain pair. */ |
| 5603 | |
| 5604 | |
| 5605 | /* Payload of the #ASM_PARAM_ID_MULTICHANNEL_GAIN channel |
| 5606 | * type/gain pairs used by the Volume Control module. \n \n This |
| 5607 | * structure immediately follows the |
| 5608 | * asm_volume_ctrl_multichannel_gain structure. |
| 5609 | */ |
| 5610 | |
| 5611 | |
| 5612 | struct asm_volume_ctrl_channelype_gain_pair { |
| 5613 | struct apr_hdr hdr; |
| 5614 | struct asm_stream_cmd_set_pp_params_v2 param; |
| 5615 | struct asm_stream_param_data_v2 data; |
| 5616 | uint8_t channelype; |
| 5617 | /*< Channel type for which the gain setting is to be applied. |
| 5618 | * Supported values: |
| 5619 | * - #PCM_CHANNEL_L |
| 5620 | * - #PCM_CHANNEL_R |
| 5621 | * - #PCM_CHANNEL_C |
| 5622 | * - #PCM_CHANNEL_LS |
| 5623 | * - #PCM_CHANNEL_RS |
| 5624 | * - #PCM_CHANNEL_LFE |
| 5625 | * - #PCM_CHANNEL_CS |
| 5626 | * - #PCM_CHANNEL_LB |
| 5627 | * - #PCM_CHANNEL_RB |
| 5628 | * - #PCM_CHANNELS |
| 5629 | * - #PCM_CHANNEL_CVH |
| 5630 | * - #PCM_CHANNEL_MS |
| 5631 | * - #PCM_CHANNEL_FLC |
| 5632 | * - #PCM_CHANNEL_FRC |
| 5633 | * - #PCM_CHANNEL_RLC |
| 5634 | * - #PCM_CHANNEL_RRC |
| 5635 | */ |
| 5636 | |
| 5637 | uint8_t reserved1; |
| 5638 | /*< Clients must set this field to zero. */ |
| 5639 | |
| 5640 | uint8_t reserved2; |
| 5641 | /*< Clients must set this field to zero. */ |
| 5642 | |
| 5643 | uint8_t reserved3; |
| 5644 | /*< Clients must set this field to zero. */ |
| 5645 | |
| 5646 | uint32_t gain; |
| 5647 | /*< Gain value for this channel in Q28 format. |
| 5648 | * Supported values: Any |
| 5649 | */ |
| 5650 | } __packed; |
| 5651 | |
| 5652 | |
| 5653 | /* Structure for the multichannel gain command */ |
| 5654 | |
| 5655 | |
| 5656 | /* Payload of the #ASM_PARAM_ID_MULTICHANNEL_GAIN |
| 5657 | * parameters used by the Volume Control module. |
| 5658 | */ |
| 5659 | |
| 5660 | |
| 5661 | struct asm_volume_ctrl_multichannel_gain { |
| 5662 | struct apr_hdr hdr; |
| 5663 | struct asm_stream_cmd_set_pp_params_v2 param; |
| 5664 | struct asm_stream_param_data_v2 data; |
| 5665 | uint32_t num_channels; |
| 5666 | /*< Number of channels for which gain values are provided. Any |
| 5667 | * channels present in the data for which gain is not provided are |
| 5668 | * set to unity gain. |
| 5669 | * Supported values: 1 to 8 |
| 5670 | */ |
| 5671 | |
| 5672 | |
| 5673 | struct asm_volume_ctrl_channelype_gain_pair |
| 5674 | gain_data[VOLUME_CONTROL_MAX_CHANNELS]; |
| 5675 | /*< Array of channel type/gain pairs.*/ |
| 5676 | } __packed; |
| 5677 | |
| 5678 | |
| 5679 | /* Structure for holding one channel type - mute pair. */ |
| 5680 | |
| 5681 | |
| 5682 | /* Payload of the #ASM_PARAM_ID_MULTICHANNEL_MUTE channel |
| 5683 | * type/mute setting pairs used by the Volume Control module. \n \n |
| 5684 | * This structure immediately follows the |
| 5685 | * asm_volume_ctrl_multichannel_mute structure. |
| 5686 | */ |
| 5687 | |
| 5688 | |
| 5689 | struct asm_volume_ctrl_channelype_mute_pair { |
| 5690 | struct apr_hdr hdr; |
| 5691 | struct asm_stream_cmd_set_pp_params_v2 param; |
| 5692 | struct asm_stream_param_data_v2 data; |
| 5693 | uint8_t channelype; |
| 5694 | /*< Channel type for which the mute setting is to be applied. |
| 5695 | * Supported values: |
| 5696 | * - #PCM_CHANNEL_L |
| 5697 | * - #PCM_CHANNEL_R |
| 5698 | * - #PCM_CHANNEL_C |
| 5699 | * - #PCM_CHANNEL_LS |
| 5700 | * - #PCM_CHANNEL_RS |
| 5701 | * - #PCM_CHANNEL_LFE |
| 5702 | * - #PCM_CHANNEL_CS |
| 5703 | * - #PCM_CHANNEL_LB |
| 5704 | * - #PCM_CHANNEL_RB |
| 5705 | * - #PCM_CHANNELS |
| 5706 | * - #PCM_CHANNEL_CVH |
| 5707 | * - #PCM_CHANNEL_MS |
| 5708 | * - #PCM_CHANNEL_FLC |
| 5709 | * - #PCM_CHANNEL_FRC |
| 5710 | * - #PCM_CHANNEL_RLC |
| 5711 | * - #PCM_CHANNEL_RRC |
| 5712 | */ |
| 5713 | |
| 5714 | uint8_t reserved1; |
| 5715 | /*< Clients must set this field to zero. */ |
| 5716 | |
| 5717 | uint8_t reserved2; |
| 5718 | /*< Clients must set this field to zero. */ |
| 5719 | |
| 5720 | uint8_t reserved3; |
| 5721 | /*< Clients must set this field to zero. */ |
| 5722 | |
| 5723 | uint32_t mute; |
| 5724 | /*< Mute setting for this channel. |
| 5725 | * Supported values: |
| 5726 | * - 0 = Unmute |
| 5727 | * - Nonzero = Mute |
| 5728 | */ |
| 5729 | } __packed; |
| 5730 | |
| 5731 | |
| 5732 | /* Structure for the multichannel mute command */ |
| 5733 | |
| 5734 | |
| 5735 | /* @brief Payload of the #ASM_PARAM_ID_MULTICHANNEL_MUTE |
| 5736 | * parameters used by the Volume Control module. |
| 5737 | */ |
| 5738 | |
| 5739 | |
| 5740 | struct asm_volume_ctrl_multichannel_mute { |
| 5741 | struct apr_hdr hdr; |
| 5742 | struct asm_stream_cmd_set_pp_params_v2 param; |
| 5743 | struct asm_stream_param_data_v2 data; |
| 5744 | uint32_t num_channels; |
| 5745 | /*< Number of channels for which mute configuration is |
| 5746 | * provided. Any channels present in the data for which mute |
| 5747 | * configuration is not provided are set to unmute. |
| 5748 | * Supported values: 1 to 8 |
| 5749 | */ |
| 5750 | |
| 5751 | struct asm_volume_ctrl_channelype_mute_pair |
| 5752 | mute_data[VOLUME_CONTROL_MAX_CHANNELS]; |
| 5753 | /*< Array of channel type/mute setting pairs.*/ |
| 5754 | } __packed; |
| 5755 | /* end_addtogroup audio_pp_param_ids */ |
| 5756 | |
| 5757 | /* audio_pp_module_ids |
| 5758 | * ID of the IIR Tuning Filter module. |
| 5759 | * This module supports the following parameter IDs: |
| 5760 | * - #ASM_PARAM_ID_IIRUNING_FILTER_ENABLE_CONFIG |
| 5761 | * - #ASM_PARAM_ID_IIRUNING_FILTER_PRE_GAIN |
| 5762 | * - #ASM_PARAM_ID_IIRUNING_FILTER_CONFIG_PARAMS |
| 5763 | */ |
| 5764 | #define ASM_MODULE_ID_IIRUNING_FILTER 0x00010C02 |
| 5765 | |
| 5766 | /* @addtogroup audio_pp_param_ids */ |
| 5767 | /* ID of the IIR tuning filter enable parameter used by the |
| 5768 | * #ASM_MODULE_ID_IIRUNING_FILTER module. |
| 5769 | * @messagepayload |
| 5770 | * @structure{asm_iiruning_filter_enable} |
| 5771 | * @tablespace |
| 5772 | * @inputtable{Audio_Postproc_ASM_PARAM_ID_IIRUNING_FILTER_ENABLE_CO |
| 5773 | * NFIG.tex} |
| 5774 | */ |
| 5775 | #define ASM_PARAM_ID_IIRUNING_FILTER_ENABLE_CONFIG 0x00010C03 |
| 5776 | |
| 5777 | /* ID of the IIR tuning filter pregain parameter used by the |
| 5778 | * #ASM_MODULE_ID_IIRUNING_FILTER module. |
| 5779 | */ |
| 5780 | #define ASM_PARAM_ID_IIRUNING_FILTER_PRE_GAIN 0x00010C04 |
| 5781 | |
| 5782 | /* ID of the IIR tuning filter configuration parameters used by the |
| 5783 | * #ASM_MODULE_ID_IIRUNING_FILTER module. |
| 5784 | */ |
| 5785 | #define ASM_PARAM_ID_IIRUNING_FILTER_CONFIG_PARAMS 0x00010C05 |
| 5786 | |
| 5787 | /* Structure for an enable configuration parameter for an |
| 5788 | * IIR tuning filter module. |
| 5789 | */ |
| 5790 | |
| 5791 | |
| 5792 | /* @brief Payload of the #ASM_PARAM_ID_IIRUNING_FILTER_ENABLE_CONFIG |
| 5793 | * parameter used by the IIR Tuning Filter module. |
| 5794 | */ |
| 5795 | struct asm_iiruning_filter_enable { |
| 5796 | uint32_t enable_flag; |
| 5797 | /*< Specifies whether the IIR tuning filter is disabled (0) or |
| 5798 | * enabled (1). |
| 5799 | */ |
| 5800 | } __packed; |
| 5801 | |
| 5802 | /* Structure for the pregain parameter for an IIR tuning filter module. */ |
| 5803 | |
| 5804 | |
| 5805 | /* Payload of the #ASM_PARAM_ID_IIRUNING_FILTER_PRE_GAIN |
| 5806 | * parameters used by the IIR Tuning Filter module. |
| 5807 | */ |
| 5808 | struct asm_iiruning_filter_pregain { |
| 5809 | uint16_t pregain; |
| 5810 | /*< Linear gain in Q13 format. */ |
| 5811 | |
| 5812 | uint16_t reserved; |
| 5813 | /*< Clients must set this field to zero.*/ |
| 5814 | } __packed; |
| 5815 | |
| 5816 | /* Structure for the configuration parameter for an IIR tuning filter |
| 5817 | * module. |
| 5818 | */ |
| 5819 | |
| 5820 | |
| 5821 | /* @brief Payload of the #ASM_PARAM_ID_IIRUNING_FILTER_CONFIG_PARAMS |
| 5822 | * parameters used by the IIR Tuning Filter module. \n |
| 5823 | * \n |
| 5824 | * This structure is followed by the IIR filter coefficients: \n |
| 5825 | * - Sequence of int32_t FilterCoeffs \n |
| 5826 | * Five coefficients for each band. Each coefficient is in int32_t format, in |
| 5827 | * the order of b0, b1, b2, a1, a2. |
| 5828 | * - Sequence of int16_t NumShiftFactor \n |
| 5829 | * One int16_t per band. The numerator shift factor is related to the Q |
| 5830 | * factor of the filter coefficients. |
| 5831 | * - Sequence of uint16_t PanSetting \n |
| 5832 | * One uint16_t per band, indicating if the filter is applied to left (0), |
| 5833 | * right (1), or both (2) channels. |
| 5834 | */ |
| 5835 | struct asm_iir_filter_config_params { |
| 5836 | uint16_t num_biquad_stages; |
| 5837 | /*< Number of bands. |
| 5838 | * Supported values: 0 to 20 |
| 5839 | */ |
| 5840 | |
| 5841 | uint16_t reserved; |
| 5842 | /*< Clients must set this field to zero.*/ |
| 5843 | } __packed; |
| 5844 | |
| 5845 | /* audio_pp_module_ids |
| 5846 | * ID of the Multiband Dynamic Range Control (MBDRC) module on the Tx/Rx |
| 5847 | * paths. |
| 5848 | * This module supports the following parameter IDs: |
| 5849 | * - #ASM_PARAM_ID_MBDRC_ENABLE |
| 5850 | * - #ASM_PARAM_ID_MBDRC_CONFIG_PARAMS |
| 5851 | */ |
| 5852 | #define ASM_MODULE_ID_MBDRC 0x00010C06 |
| 5853 | |
| 5854 | /* audio_pp_param_ids */ |
| 5855 | /* ID of the MBDRC enable parameter used by the #ASM_MODULE_ID_MBDRC module. |
| 5856 | * @messagepayload |
| 5857 | * @structure{asm_mbdrc_enable} |
| 5858 | * @tablespace |
| 5859 | * @inputtable{Audio_Postproc_ASM_PARAM_ID_MBDRC_ENABLE.tex} |
| 5860 | */ |
| 5861 | #define ASM_PARAM_ID_MBDRC_ENABLE 0x00010C07 |
| 5862 | |
| 5863 | /* ID of the MBDRC configuration parameters used by the |
| 5864 | * #ASM_MODULE_ID_MBDRC module. |
| 5865 | * @messagepayload |
| 5866 | * @structure{asm_mbdrc_config_params} |
| 5867 | * @tablespace |
| 5868 | * @inputtable{Audio_Postproc_ASM_PARAM_ID_MBDRC_CONFIG_PARAMS.tex} |
| 5869 | * |
| 5870 | * @parspace Sub-band DRC configuration parameters |
| 5871 | * @structure{asm_subband_drc_config_params} |
| 5872 | * @tablespace |
| 5873 | * @inputtable{Audio_Postproc_ASM_PARAM_ID_MBDRC_CONFIG_PARAMS_subband_DRC.tex} |
| 5874 | * |
| 5875 | * @keep{6} |
| 5876 | * To obtain legacy ADRC from MBDRC, use the calibration tool to: |
| 5877 | * |
| 5878 | * - Enable MBDRC (EnableFlag = TRUE) |
| 5879 | * - Set number of bands to 1 (uiNumBands = 1) |
| 5880 | * - Enable the first MBDRC band (DrcMode[0] = DRC_ENABLED = 1) |
| 5881 | * - Clear the first band mute flag (MuteFlag[0] = 0) |
| 5882 | * - Set the first band makeup gain to unity (compMakeUpGain[0] = 0x2000) |
| 5883 | * - Use the legacy ADRC parameters to calibrate the rest of the MBDRC |
| 5884 | * parameters. |
| 5885 | */ |
| 5886 | #define ASM_PARAM_ID_MBDRC_CONFIG_PARAMS 0x00010C08 |
| 5887 | |
| 5888 | /* end_addtogroup audio_pp_param_ids */ |
| 5889 | |
| 5890 | /* audio_pp_module_ids |
| 5891 | * ID of the MMBDRC module version 2 pre/postprocessing block. |
| 5892 | * This module differs from the original MBDRC (#ASM_MODULE_ID_MBDRC) in |
| 5893 | * the length of the filters used in each sub-band. |
| 5894 | * This module supports the following parameter ID: |
| 5895 | * - #ASM_PARAM_ID_MBDRC_CONFIG_PARAMS_IMPROVED_FILTBANK_V2 |
| 5896 | */ |
| 5897 | #define ASM_MODULE_ID_MBDRCV2 0x0001070B |
| 5898 | |
| 5899 | /* @addtogroup audio_pp_param_ids */ |
| 5900 | /* ID of the configuration parameters used by the |
| 5901 | * #ASM_MODULE_ID_MBDRCV2 module for the improved filter structure |
| 5902 | * of the MBDRC v2 pre/postprocessing block. |
| 5903 | * The update to this configuration structure from the original |
| 5904 | * MBDRC is the number of filter coefficients in the filter |
| 5905 | * structure. The sequence for is as follows: |
| 5906 | * - 1 band = 0 FIR coefficient + 1 mute flag + uint16_t padding |
| 5907 | * - 2 bands = 141 FIR coefficients + 2 mute flags + uint16_t padding |
| 5908 | * - 3 bands = 141+81 FIR coefficients + 3 mute flags + uint16_t padding |
| 5909 | * - 4 bands = 141+81+61 FIR coefficients + 4 mute flags + uint16_t |
| 5910 | * padding |
| 5911 | * - 5 bands = 141+81+61+61 FIR coefficients + 5 mute flags + |
| 5912 | * uint16_t padding |
| 5913 | * This block uses the same parameter structure as |
| 5914 | * #ASM_PARAM_ID_MBDRC_CONFIG_PARAMS. |
| 5915 | */ |
| 5916 | #define ASM_PARAM_ID_MBDRC_CONFIG_PARAMS_IMPROVED_FILTBANK_V2 \ |
| 5917 | 0x0001070C |
| 5918 | |
| 5919 | /* Structure for the enable parameter for an MBDRC module. */ |
| 5920 | |
| 5921 | |
| 5922 | /* Payload of the #ASM_PARAM_ID_MBDRC_ENABLE parameter used by the |
| 5923 | * MBDRC module. |
| 5924 | */ |
| 5925 | struct asm_mbdrc_enable { |
| 5926 | uint32_t enable_flag; |
| 5927 | /*< Specifies whether MBDRC is disabled (0) or enabled (nonzero).*/ |
| 5928 | } __packed; |
| 5929 | |
| 5930 | /* Structure for the configuration parameters for an MBDRC module. */ |
| 5931 | |
| 5932 | |
| 5933 | /* Payload of the #ASM_PARAM_ID_MBDRC_CONFIG_PARAMS |
| 5934 | * parameters used by the MBDRC module. \n \n Following this |
| 5935 | * structure is the payload for sub-band DRC configuration |
| 5936 | * parameters (asm_subband_drc_config_params). This sub-band |
| 5937 | * structure must be repeated for each band. |
| 5938 | */ |
| 5939 | |
| 5940 | |
| 5941 | struct asm_mbdrc_config_params { |
| 5942 | uint16_t num_bands; |
| 5943 | /*< Number of bands. |
| 5944 | * Supported values: 1 to 5 |
| 5945 | */ |
| 5946 | |
| 5947 | int16_t limiterhreshold; |
| 5948 | /*< Threshold in decibels for the limiter output. |
| 5949 | * Supported values: -72 to 18 \n |
| 5950 | * Recommended value: 3994 (-0.22 db in Q3.12 format) |
| 5951 | */ |
| 5952 | |
| 5953 | int16_t limiter_makeup_gain; |
| 5954 | /*< Makeup gain in decibels for the limiter output. |
| 5955 | * Supported values: -42 to 42 \n |
| 5956 | * Recommended value: 256 (0 dB in Q7.8 format) |
| 5957 | */ |
| 5958 | |
| 5959 | int16_t limiter_gc; |
| 5960 | /*< Limiter gain recovery coefficient. |
| 5961 | * Supported values: 0.5 to 0.99 \n |
| 5962 | * Recommended value: 32440 (0.99 in Q15 format) |
| 5963 | */ |
| 5964 | |
| 5965 | int16_t limiter_delay; |
| 5966 | /*< Limiter delay in samples. |
| 5967 | * Supported values: 0 to 10 \n |
| 5968 | * Recommended value: 262 (0.008 samples in Q15 format) |
| 5969 | */ |
| 5970 | |
| 5971 | int16_t limiter_max_wait; |
| 5972 | /*< Maximum limiter waiting time in samples. |
| 5973 | * Supported values: 0 to 10 \n |
| 5974 | * Recommended value: 262 (0.008 samples in Q15 format) |
| 5975 | */ |
| 5976 | } __packed; |
| 5977 | |
| 5978 | /* DRC configuration structure for each sub-band of an MBDRC module. */ |
| 5979 | |
| 5980 | |
| 5981 | /* Payload of the #ASM_PARAM_ID_MBDRC_CONFIG_PARAMS DRC |
| 5982 | * configuration parameters for each sub-band in the MBDRC module. |
| 5983 | * After this DRC structure is configured for valid bands, the next |
| 5984 | * MBDRC setparams expects the sequence of sub-band MBDRC filter |
| 5985 | * coefficients (the length depends on the number of bands) plus the |
| 5986 | * mute flag for that band plus uint16_t padding. |
| 5987 | * |
| 5988 | * @keep{10} |
| 5989 | * The filter coefficient and mute flag are of type int16_t: |
| 5990 | * - FIR coefficient = int16_t firFilter |
| 5991 | * - Mute flag = int16_t fMuteFlag |
| 5992 | * |
| 5993 | * The sequence is as follows: |
| 5994 | * - 1 band = 0 FIR coefficient + 1 mute flag + uint16_t padding |
| 5995 | * - 2 bands = 97 FIR coefficients + 2 mute flags + uint16_t padding |
| 5996 | * - 3 bands = 97+33 FIR coefficients + 3 mute flags + uint16_t padding |
| 5997 | * - 4 bands = 97+33+33 FIR coefficients + 4 mute flags + uint16_t padding |
| 5998 | * - 5 bands = 97+33+33+33 FIR coefficients + 5 mute flags + uint16_t padding |
| 5999 | * |
| 6000 | * For improved filterbank, the sequence is as follows: |
| 6001 | * - 1 band = 0 FIR coefficient + 1 mute flag + uint16_t padding |
| 6002 | * - 2 bands = 141 FIR coefficients + 2 mute flags + uint16_t padding |
| 6003 | * - 3 bands = 141+81 FIR coefficients + 3 mute flags + uint16_t padding |
| 6004 | * - 4 bands = 141+81+61 FIR coefficients + 4 mute flags + uint16_t padding |
| 6005 | * - 5 bands = 141+81+61+61 FIR coefficients + 5 mute flags + uint16_t padding |
| 6006 | */ |
| 6007 | struct asm_subband_drc_config_params { |
| 6008 | int16_t drc_stereo_linked_flag; |
| 6009 | /*< Specifies whether all stereo channels have the same applied |
| 6010 | * dynamics (1) or if they process their dynamics independently (0). |
| 6011 | * Supported values: |
| 6012 | * - 0 -- Not linked |
| 6013 | * - 1 -- Linked |
| 6014 | */ |
| 6015 | |
| 6016 | int16_t drc_mode; |
| 6017 | /*< Specifies whether DRC mode is bypassed for sub-bands. |
| 6018 | * Supported values: |
| 6019 | * - 0 -- Disabled |
| 6020 | * - 1 -- Enabled |
| 6021 | */ |
| 6022 | |
| 6023 | int16_t drc_down_sample_level; |
| 6024 | /*< DRC down sample level. |
| 6025 | * Supported values: @ge 1 |
| 6026 | */ |
| 6027 | |
| 6028 | int16_t drc_delay; |
| 6029 | /*< DRC delay in samples. |
| 6030 | * Supported values: 0 to 1200 |
| 6031 | */ |
| 6032 | |
| 6033 | uint16_t drc_rmsime_avg_const; |
| 6034 | /*< RMS signal energy time-averaging constant. |
| 6035 | * Supported values: 0 to 2^16-1 |
| 6036 | */ |
| 6037 | |
| 6038 | uint16_t drc_makeup_gain; |
| 6039 | /*< DRC makeup gain in decibels. |
| 6040 | * Supported values: 258 to 64917 |
| 6041 | */ |
| 6042 | /* Down expander settings */ |
| 6043 | int16_t down_expdrhreshold; |
| 6044 | /*< Down expander threshold. |
| 6045 | * Supported Q7 format values: 1320 to up_cmpsrhreshold |
| 6046 | */ |
| 6047 | |
| 6048 | int16_t down_expdr_slope; |
| 6049 | /*< Down expander slope. |
| 6050 | * Supported Q8 format values: -32768 to 0. |
| 6051 | */ |
| 6052 | |
| 6053 | uint32_t down_expdr_attack; |
| 6054 | /*< Down expander attack constant. |
| 6055 | * Supported Q31 format values: 196844 to 2^31. |
| 6056 | */ |
| 6057 | |
| 6058 | uint32_t down_expdr_release; |
| 6059 | /*< Down expander release constant. |
| 6060 | * Supported Q31 format values: 19685 to 2^31 |
| 6061 | */ |
| 6062 | |
| 6063 | uint16_t down_expdr_hysteresis; |
| 6064 | /*< Down expander hysteresis constant. |
| 6065 | * Supported Q14 format values: 1 to 32690 |
| 6066 | */ |
| 6067 | |
| 6068 | uint16_t reserved; |
| 6069 | /*< Clients must set this field to zero. */ |
| 6070 | |
| 6071 | int32_t down_expdr_min_gain_db; |
| 6072 | /*< Down expander minimum gain. |
| 6073 | * Supported Q23 format values: -805306368 to 0. |
| 6074 | */ |
| 6075 | |
| 6076 | /* Up compressor settings */ |
| 6077 | |
| 6078 | int16_t up_cmpsrhreshold; |
| 6079 | /*< Up compressor threshold. |
| 6080 | * Supported Q7 format values: down_expdrhreshold to |
| 6081 | * down_cmpsrhreshold. |
| 6082 | */ |
| 6083 | |
| 6084 | uint16_t up_cmpsr_slope; |
| 6085 | /*< Up compressor slope. |
| 6086 | * Supported Q16 format values: 0 to 64881. |
| 6087 | */ |
| 6088 | |
| 6089 | uint32_t up_cmpsr_attack; |
| 6090 | /*< Up compressor attack constant. |
| 6091 | * Supported Q31 format values: 196844 to 2^31. |
| 6092 | */ |
| 6093 | |
| 6094 | uint32_t up_cmpsr_release; |
| 6095 | /*< Up compressor release constant. |
| 6096 | * Supported Q31 format values: 19685 to 2^31. |
| 6097 | */ |
| 6098 | |
| 6099 | uint16_t up_cmpsr_hysteresis; |
| 6100 | /*< Up compressor hysteresis constant. |
| 6101 | * Supported Q14 format values: 1 to 32690. |
| 6102 | */ |
| 6103 | |
| 6104 | /* Down compressor settings */ |
| 6105 | |
| 6106 | int16_t down_cmpsrhreshold; |
| 6107 | /*< Down compressor threshold. |
| 6108 | * Supported Q7 format values: up_cmpsrhreshold to 11560. |
| 6109 | */ |
| 6110 | |
| 6111 | uint16_t down_cmpsr_slope; |
| 6112 | /*< Down compressor slope. |
| 6113 | * Supported Q16 format values: 0 to 64881. |
| 6114 | */ |
| 6115 | |
| 6116 | uint16_t reserved1; |
| 6117 | /*< Clients must set this field to zero. */ |
| 6118 | |
| 6119 | uint32_t down_cmpsr_attack; |
| 6120 | /*< Down compressor attack constant. |
| 6121 | * Supported Q31 format values: 196844 to 2^31. |
| 6122 | */ |
| 6123 | |
| 6124 | uint32_t down_cmpsr_release; |
| 6125 | /*< Down compressor release constant. |
| 6126 | * Supported Q31 format values: 19685 to 2^31. |
| 6127 | */ |
| 6128 | |
| 6129 | uint16_t down_cmpsr_hysteresis; |
| 6130 | /*< Down compressor hysteresis constant. |
| 6131 | * Supported Q14 values: 1 to 32690. |
| 6132 | */ |
| 6133 | |
| 6134 | uint16_t reserved2; |
| 6135 | /*< Clients must set this field to zero.*/ |
| 6136 | } __packed; |
| 6137 | |
| 6138 | #define ASM_MODULE_ID_EQUALIZER 0x00010C27 |
| 6139 | #define ASM_PARAM_ID_EQUALIZER_PARAMETERS 0x00010C28 |
| 6140 | |
| 6141 | #define ASM_MAX_EQ_BANDS 12 |
| 6142 | |
| 6143 | struct asm_eq_per_band_params { |
| 6144 | uint32_t band_idx; |
| 6145 | /*< Band index. |
| 6146 | * Supported values: 0 to 11 |
| 6147 | */ |
| 6148 | |
| 6149 | uint32_t filterype; |
| 6150 | /*< Type of filter. |
| 6151 | * Supported values: |
| 6152 | * - #ASM_PARAM_EQYPE_NONE |
| 6153 | * - #ASM_PARAM_EQ_BASS_BOOST |
| 6154 | * - #ASM_PARAM_EQ_BASS_CUT |
| 6155 | * - #ASM_PARAM_EQREBLE_BOOST |
| 6156 | * - #ASM_PARAM_EQREBLE_CUT |
| 6157 | * - #ASM_PARAM_EQ_BAND_BOOST |
| 6158 | * - #ASM_PARAM_EQ_BAND_CUT |
| 6159 | */ |
| 6160 | |
| 6161 | uint32_t center_freq_hz; |
| 6162 | /*< Filter band center frequency in Hertz. */ |
| 6163 | |
| 6164 | int32_t filter_gain; |
| 6165 | /*< Filter band initial gain. |
| 6166 | * Supported values: +12 to -12 dB in 1 dB increments |
| 6167 | */ |
| 6168 | |
| 6169 | int32_t q_factor; |
| 6170 | /*< Filter band quality factor expressed as a Q8 number, i.e., a |
| 6171 | * fixed-point number with q factor of 8. For example, 3000/(2^8). |
| 6172 | */ |
| 6173 | } __packed; |
| 6174 | |
| 6175 | struct asm_eq_params { |
| 6176 | struct apr_hdr hdr; |
| 6177 | struct asm_stream_cmd_set_pp_params_v2 param; |
| 6178 | struct asm_stream_param_data_v2 data; |
| 6179 | uint32_t enable_flag; |
| 6180 | /*< Specifies whether the equalizer module is disabled (0) or enabled |
| 6181 | * (nonzero). |
| 6182 | */ |
| 6183 | |
| 6184 | uint32_t num_bands; |
| 6185 | /*< Number of bands. |
| 6186 | * Supported values: 1 to 12 |
| 6187 | */ |
| 6188 | struct asm_eq_per_band_params eq_bands[ASM_MAX_EQ_BANDS]; |
| 6189 | |
| 6190 | } __packed; |
| 6191 | |
| 6192 | /* No equalizer effect.*/ |
| 6193 | #define ASM_PARAM_EQYPE_NONE 0 |
| 6194 | |
| 6195 | /* Bass boost equalizer effect.*/ |
| 6196 | #define ASM_PARAM_EQ_BASS_BOOST 1 |
| 6197 | |
| 6198 | /*Bass cut equalizer effect.*/ |
| 6199 | #define ASM_PARAM_EQ_BASS_CUT 2 |
| 6200 | |
| 6201 | /* Treble boost equalizer effect */ |
| 6202 | #define ASM_PARAM_EQREBLE_BOOST 3 |
| 6203 | |
| 6204 | /* Treble cut equalizer effect.*/ |
| 6205 | #define ASM_PARAM_EQREBLE_CUT 4 |
| 6206 | |
| 6207 | /* Band boost equalizer effect.*/ |
| 6208 | #define ASM_PARAM_EQ_BAND_BOOST 5 |
| 6209 | |
| 6210 | /* Band cut equalizer effect.*/ |
| 6211 | #define ASM_PARAM_EQ_BAND_CUT 6 |
| 6212 | |
Ben Romberger | a64e528 | 2012-11-12 21:49:06 -0800 | [diff] [blame] | 6213 | /* Voice get & set params */ |
| 6214 | #define VOICE_CMD_SET_PARAM 0x0001133D |
| 6215 | #define VOICE_CMD_GET_PARAM 0x0001133E |
| 6216 | #define VOICE_EVT_GET_PARAM_ACK 0x00011008 |
| 6217 | |
Bharath Ramachandramurthy | 2e3168f | 2012-05-03 16:29:09 -0700 | [diff] [blame] | 6218 | |
Ben Romberger | 564493d | 2012-12-04 20:48:28 -0800 | [diff] [blame] | 6219 | /* SRS TRUMEDIA start */ |
| 6220 | /* topology */ |
| 6221 | #define SRS_TRUMEDIA_TOPOLOGY_ID 0x00010D90 |
| 6222 | /* module */ |
| 6223 | #define SRS_TRUMEDIA_MODULE_ID 0x10005010 |
| 6224 | /* parameters */ |
| 6225 | #define SRS_TRUMEDIA_PARAMS 0x10005011 |
| 6226 | #define SRS_TRUMEDIA_PARAMS_WOWHD 0x10005012 |
| 6227 | #define SRS_TRUMEDIA_PARAMS_CSHP 0x10005013 |
| 6228 | #define SRS_TRUMEDIA_PARAMS_HPF 0x10005014 |
| 6229 | #define SRS_TRUMEDIA_PARAMS_PEQ 0x10005015 |
| 6230 | #define SRS_TRUMEDIA_PARAMS_HL 0x10005016 |
| 6231 | |
| 6232 | #define SRS_ID_GLOBAL 0x00000001 |
| 6233 | #define SRS_ID_WOWHD 0x00000002 |
| 6234 | #define SRS_ID_CSHP 0x00000003 |
| 6235 | #define SRS_ID_HPF 0x00000004 |
| 6236 | #define SRS_ID_PEQ 0x00000005 |
| 6237 | #define SRS_ID_HL 0x00000006 |
| 6238 | |
| 6239 | #define SRS_CMD_UPLOAD 0x7FFF0000 |
| 6240 | #define SRS_PARAM_INDEX_MASK 0x80000000 |
| 6241 | #define SRS_PARAM_OFFSET_MASK 0x3FFF0000 |
| 6242 | #define SRS_PARAM_VALUE_MASK 0x0000FFFF |
| 6243 | |
| 6244 | struct srs_trumedia_params_GLOBAL { |
| 6245 | uint8_t v1; |
| 6246 | uint8_t v2; |
| 6247 | uint8_t v3; |
| 6248 | uint8_t v4; |
| 6249 | uint8_t v5; |
| 6250 | uint8_t v6; |
| 6251 | uint8_t v7; |
| 6252 | uint8_t v8; |
| 6253 | } __packed; |
| 6254 | |
| 6255 | struct srs_trumedia_params_WOWHD { |
| 6256 | uint32_t v1; |
| 6257 | uint16_t v2; |
| 6258 | uint16_t v3; |
| 6259 | uint16_t v4; |
| 6260 | uint16_t v5; |
| 6261 | uint16_t v6; |
| 6262 | uint16_t v7; |
| 6263 | uint16_t v8; |
| 6264 | uint16_t v____A1; |
| 6265 | uint32_t v9; |
| 6266 | uint16_t v10; |
| 6267 | uint16_t v11; |
| 6268 | uint32_t v12[16]; |
| 6269 | } __packed; |
| 6270 | |
| 6271 | struct srs_trumedia_params_CSHP { |
| 6272 | uint32_t v1; |
| 6273 | uint16_t v2; |
| 6274 | uint16_t v3; |
| 6275 | uint16_t v4; |
| 6276 | uint16_t v5; |
| 6277 | uint16_t v6; |
| 6278 | uint16_t v____A1; |
| 6279 | uint32_t v7; |
| 6280 | uint16_t v8; |
| 6281 | uint16_t v9; |
| 6282 | uint32_t v10[16]; |
| 6283 | } __packed; |
| 6284 | |
| 6285 | struct srs_trumedia_params_HPF { |
| 6286 | uint32_t v1; |
| 6287 | uint32_t v2[26]; |
| 6288 | } __packed; |
| 6289 | |
| 6290 | struct srs_trumedia_params_PEQ { |
| 6291 | uint32_t v1; |
| 6292 | uint16_t v2; |
| 6293 | uint16_t v3; |
| 6294 | uint16_t v4; |
| 6295 | uint16_t v____A1; |
| 6296 | uint32_t v5[26]; |
| 6297 | uint32_t v6[26]; |
| 6298 | } __packed; |
| 6299 | |
| 6300 | struct srs_trumedia_params_HL { |
| 6301 | uint16_t v1; |
| 6302 | uint16_t v2; |
| 6303 | uint16_t v3; |
| 6304 | uint16_t v____A1; |
| 6305 | int32_t v4; |
| 6306 | uint32_t v5; |
| 6307 | uint16_t v6; |
| 6308 | uint16_t v____A2; |
| 6309 | uint32_t v7; |
| 6310 | } __packed; |
| 6311 | |
| 6312 | struct srs_trumedia_params { |
| 6313 | struct srs_trumedia_params_GLOBAL global; |
| 6314 | struct srs_trumedia_params_WOWHD wowhd; |
| 6315 | struct srs_trumedia_params_CSHP cshp; |
| 6316 | struct srs_trumedia_params_HPF hpf; |
| 6317 | struct srs_trumedia_params_PEQ peq; |
| 6318 | struct srs_trumedia_params_HL hl; |
| 6319 | } __packed; |
| 6320 | /* SRS TruMedia end */ |
| 6321 | |
| 6322 | |
| 6323 | |
Bharath Ramachandramurthy | 2e3168f | 2012-05-03 16:29:09 -0700 | [diff] [blame] | 6324 | /* ERROR CODES */ |
| 6325 | /* Success. The operation completed with no errors. */ |
| 6326 | #define ADSP_EOK 0x00000000 |
| 6327 | /* General failure. */ |
| 6328 | #define ADSP_EFAILED 0x00000001 |
| 6329 | /* Bad operation parameter. */ |
| 6330 | #define ADSP_EBADPARAM 0x00000002 |
| 6331 | /* Unsupported routine or operation. */ |
| 6332 | #define ADSP_EUNSUPPORTED 0x00000003 |
| 6333 | /* Unsupported version. */ |
| 6334 | #define ADSP_EVERSION 0x00000004 |
| 6335 | /* Unexpected problem encountered. */ |
| 6336 | #define ADSP_EUNEXPECTED 0x00000005 |
| 6337 | /* Unhandled problem occurred. */ |
| 6338 | #define ADSP_EPANIC 0x00000006 |
| 6339 | /* Unable to allocate resource. */ |
| 6340 | #define ADSP_ENORESOURCE 0x00000007 |
| 6341 | /* Invalid handle. */ |
| 6342 | #define ADSP_EHANDLE 0x00000008 |
| 6343 | /* Operation is already processed. */ |
| 6344 | #define ADSP_EALREADY 0x00000009 |
| 6345 | /* Operation is not ready to be processed. */ |
| 6346 | #define ADSP_ENOTREADY 0x0000000A |
| 6347 | /* Operation is pending completion. */ |
| 6348 | #define ADSP_EPENDING 0x0000000B |
| 6349 | /* Operation could not be accepted or processed. */ |
| 6350 | #define ADSP_EBUSY 0x0000000C |
| 6351 | /* Operation aborted due to an error. */ |
| 6352 | #define ADSP_EABORTED 0x0000000D |
| 6353 | /* Operation preempted by a higher priority. */ |
| 6354 | #define ADSP_EPREEMPTED 0x0000000E |
| 6355 | /* Operation requests intervention to complete. */ |
| 6356 | #define ADSP_ECONTINUE 0x0000000F |
| 6357 | /* Operation requests immediate intervention to complete. */ |
| 6358 | #define ADSP_EIMMEDIATE 0x00000010 |
| 6359 | /* Operation is not implemented. */ |
| 6360 | #define ADSP_ENOTIMPL 0x00000011 |
| 6361 | /* Operation needs more data or resources. */ |
| 6362 | #define ADSP_ENEEDMORE 0x00000012 |
| 6363 | /* Operation does not have memory. */ |
| 6364 | #define ADSP_ENOMEMORY 0x00000014 |
| 6365 | /* Item does not exist. */ |
| 6366 | #define ADSP_ENOTEXIST 0x00000015 |
| 6367 | /* Operation is finished. */ |
| 6368 | #define ADSP_ETERMINATED 0x00011174 |
| 6369 | |
| 6370 | /*bharath, adsp_error_codes.h */ |
| 6371 | |
Venkat Sudhir | 42a06e1 | 2012-12-13 16:16:05 -0800 | [diff] [blame] | 6372 | /* LPASS clock for I2S Interface */ |
| 6373 | |
| 6374 | /* Supported OSR clock values */ |
| 6375 | #define Q6AFE_LPASS_OSR_CLK_12_P288_MHZ 0xBB8000 |
| 6376 | #define Q6AFE_LPASS_OSR_CLK_8_P192_MHZ 0x7D0000 |
| 6377 | #define Q6AFE_LPASS_OSR_CLK_6_P144_MHZ 0x5DC000 |
| 6378 | #define Q6AFE_LPASS_OSR_CLK_4_P096_MHZ 0x3E8000 |
| 6379 | #define Q6AFE_LPASS_OSR_CLK_3_P072_MHZ 0x2EE000 |
| 6380 | #define Q6AFE_LPASS_OSR_CLK_2_P048_MHZ 0x1F4000 |
| 6381 | #define Q6AFE_LPASS_OSR_CLK_1_P536_MHZ 0x177000 |
| 6382 | #define Q6AFE_LPASS_OSR_CLK_1_P024_MHZ 0xFA000 |
| 6383 | #define Q6AFE_LPASS_OSR_CLK_768_kHZ 0xBB800 |
| 6384 | #define Q6AFE_LPASS_OSR_CLK_512_kHZ 0x7D000 |
| 6385 | #define Q6AFE_LPASS_OSR_CLK_DISABLE 0x0 |
| 6386 | |
| 6387 | /* Supported Bit clock values */ |
| 6388 | #define Q6AFE_LPASS_IBIT_CLK_8_P192_MHZ 0x7D0000 |
| 6389 | #define Q6AFE_LPASS_IBIT_CLK_6_P144_MHZ 0x5DC000 |
| 6390 | #define Q6AFE_LPASS_IBIT_CLK_4_P096_MHZ 0x3E8000 |
| 6391 | #define Q6AFE_LPASS_IBIT_CLK_3_P072_MHZ 0x2EE000 |
| 6392 | #define Q6AFE_LPASS_IBIT_CLK_2_P048_MHZ 0x1F4000 |
| 6393 | #define Q6AFE_LPASS_IBIT_CLK_1_P536_MHZ 0x177000 |
| 6394 | #define Q6AFE_LPASS_IBIT_CLK_1_P024_MHZ 0xFA000 |
| 6395 | #define Q6AFE_LPASS_IBIT_CLK_768_KHZ 0xBB800 |
| 6396 | #define Q6AFE_LPASS_IBIT_CLK_512_KHZ 0x7D000 |
| 6397 | #define Q6AFE_LPASS_IBIT_CLK_DISABLE 0x0 |
| 6398 | |
| 6399 | /* Supported LPASS CLK sources */ |
| 6400 | #define Q6AFE_LPASS_CLK_SRC_EXTERNAL 0 |
| 6401 | #define Q6AFE_LPASS_CLK_SRC_INTERNAL 1 |
| 6402 | |
| 6403 | /* Supported LPASS CLK root*/ |
| 6404 | #define Q6AFE_LPASS_CLK_ROOT_DEFAULT 0 |
| 6405 | |
| 6406 | enum afe_lpass_clk_mode { |
| 6407 | Q6AFE_LPASS_MODE_BOTH_INVALID, |
| 6408 | Q6AFE_LPASS_MODE_CLK1_VALID, |
| 6409 | Q6AFE_LPASS_MODE_CLK2_VALID, |
| 6410 | Q6AFE_LPASS_MODE_BOTH_VALID, |
| 6411 | } __packed; |
| 6412 | |
| 6413 | struct afe_clk_cfg { |
| 6414 | /* Minor version used for tracking the version of the I2S |
| 6415 | * configuration interface. |
| 6416 | * Supported values: #AFE_API_VERSION_I2S_CONFIG |
| 6417 | */ |
| 6418 | u32 i2s_cfg_minor_version; |
| 6419 | |
| 6420 | /* clk value 1 in MHz. */ |
| 6421 | u32 clk_val1; |
| 6422 | |
| 6423 | /* clk value 2 in MHz. */ |
| 6424 | u32 clk_val2; |
| 6425 | |
| 6426 | /* clk_src |
| 6427 | * #Q6AFE_LPASS_CLK_SRC_EXTERNAL |
| 6428 | * #Q6AFE_LPASS_CLK_SRC_INTERNAL |
| 6429 | */ |
| 6430 | |
| 6431 | u16 clk_src; |
| 6432 | |
| 6433 | /* clk_root -0 for default */ |
| 6434 | u16 clk_root; |
| 6435 | |
| 6436 | /* clk_set_mode |
| 6437 | * #Q6AFE_LPASS_MODE_BOTH_INVALID |
| 6438 | * #Q6AFE_LPASS_MODE_CLK1_VALID |
| 6439 | * #Q6AFE_LPASS_MODE_CLK2_VALID |
| 6440 | * #Q6AFE_LPASS_MODE_BOTH_VALID |
| 6441 | */ |
| 6442 | u16 clk_set_mode; |
| 6443 | |
| 6444 | /* This param id is used to configure I2S clk */ |
| 6445 | u16 reserved; |
| 6446 | } __packed; |
| 6447 | |
| 6448 | /* This param id is used to configure I2S clk */ |
| 6449 | #define AFE_PARAM_ID_LPAIF_CLK_CONFIG 0x00010238 |
| 6450 | |
| 6451 | |
| 6452 | struct afe_lpass_clk_config_command { |
| 6453 | struct apr_hdr hdr; |
| 6454 | struct afe_port_cmd_set_param_v2 param; |
| 6455 | struct afe_port_param_data_v2 pdata; |
| 6456 | struct afe_clk_cfg clk_cfg; |
| 6457 | } __packed; |
| 6458 | |
| 6459 | enum afe_lpass_digital_clk_src { |
| 6460 | Q6AFE_LPASS_DIGITAL_ROOT_INVALID, |
| 6461 | Q6AFE_LPASS_DIGITAL_ROOT_PRI_MI2S_OSR, |
| 6462 | Q6AFE_LPASS_DIGITAL_ROOT_SEC_MI2S_OSR, |
| 6463 | Q6AFE_LPASS_DIGITAL_ROOT_TER_MI2S_OSR, |
| 6464 | Q6AFE_LPASS_DIGITAL_ROOT_QUAD_MI2S_OSR, |
| 6465 | Q6AFE_LPASS_DIGITAL_ROOT_CDC_ROOT_CLK, |
| 6466 | } __packed; |
| 6467 | |
| 6468 | /* This param id is used to configure internal clk */ |
| 6469 | #define AFE_PARAM_ID_INTERNAL_DIGIATL_CDC_CLK_CONFIG 0x00010239 |
| 6470 | |
| 6471 | struct afe_digital_clk_cfg { |
| 6472 | /* Minor version used for tracking the version of the I2S |
| 6473 | * configuration interface. |
| 6474 | * Supported values: #AFE_API_VERSION_I2S_CONFIG |
| 6475 | */ |
| 6476 | u32 i2s_cfg_minor_version; |
| 6477 | |
| 6478 | /* clk value in MHz. */ |
| 6479 | u32 clk_val; |
| 6480 | |
| 6481 | /* INVALID |
| 6482 | * PRI_MI2S_OSR |
| 6483 | * SEC_MI2S_OSR |
| 6484 | * TER_MI2S_OSR |
| 6485 | * QUAD_MI2S_OSR |
| 6486 | * DIGT_CDC_ROOT |
| 6487 | */ |
| 6488 | u16 clk_root; |
| 6489 | |
| 6490 | /* This field must be set to zero. */ |
| 6491 | u16 reserved; |
| 6492 | } __packed; |
| 6493 | |
| 6494 | |
| 6495 | struct afe_lpass_digital_clk_config_command { |
| 6496 | struct apr_hdr hdr; |
| 6497 | struct afe_port_cmd_set_param_v2 param; |
| 6498 | struct afe_port_param_data_v2 pdata; |
| 6499 | struct afe_digital_clk_cfg clk_cfg; |
| 6500 | } __packed; |
| 6501 | |
Venkat Sudhir | 6edf963 | 2013-01-14 15:08:13 -0800 | [diff] [blame^] | 6502 | /* |
| 6503 | * Opcode for AFE to start DTMF. |
| 6504 | */ |
| 6505 | #define AFE_PORTS_CMD_DTMF_CTL 0x00010102 |
| 6506 | |
| 6507 | /** DTMF payload.*/ |
| 6508 | struct afe_dtmf_generation_command { |
| 6509 | struct apr_hdr hdr; |
| 6510 | |
| 6511 | /* |
| 6512 | * Duration of the DTMF tone in ms. |
| 6513 | * -1 -> continuous, |
| 6514 | * 0 -> disable |
| 6515 | */ |
| 6516 | int64_t duration_in_ms; |
| 6517 | |
| 6518 | /* |
| 6519 | * The DTMF high tone frequency. |
| 6520 | */ |
| 6521 | uint16_t high_freq; |
| 6522 | |
| 6523 | /* |
| 6524 | * The DTMF low tone frequency. |
| 6525 | */ |
| 6526 | uint16_t low_freq; |
| 6527 | |
| 6528 | /* |
| 6529 | * The DTMF volume setting |
| 6530 | */ |
| 6531 | uint16_t gain; |
| 6532 | |
| 6533 | /* |
| 6534 | * The number of ports to enable/disable on. |
| 6535 | */ |
| 6536 | uint16_t num_ports; |
| 6537 | |
| 6538 | /* |
| 6539 | * The Destination ports - array . |
| 6540 | * For DTMF on multiple ports, portIds needs to |
| 6541 | * be populated numPorts times. |
| 6542 | */ |
| 6543 | uint16_t port_ids; |
| 6544 | |
| 6545 | /* |
| 6546 | * variable for 32 bit alignment of APR packet. |
| 6547 | */ |
| 6548 | uint16_t reserved; |
| 6549 | } __packed; |
Venkat Sudhir | 42a06e1 | 2012-12-13 16:16:05 -0800 | [diff] [blame] | 6550 | |
Bharath Ramachandramurthy | 2e3168f | 2012-05-03 16:29:09 -0700 | [diff] [blame] | 6551 | #endif /*_APR_AUDIO_V2_H_ */ |