Home | History | Annotate | Download | only in include
      1 /******************************************************************************
      2  *
      3  *  Copyright (C) 1999-2012 Broadcom Corporation
      4  *
      5  *  Licensed under the Apache License, Version 2.0 (the "License");
      6  *  you may not use this file except in compliance with the License.
      7  *  You may obtain a copy of the License at:
      8  *
      9  *  http://www.apache.org/licenses/LICENSE-2.0
     10  *
     11  *  Unless required by applicable law or agreed to in writing, software
     12  *  distributed under the License is distributed on an "AS IS" BASIS,
     13  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     14  *  See the License for the specific language governing permissions and
     15  *  limitations under the License.
     16  *
     17  ******************************************************************************/
     18 
     19 /******************************************************************************
     20  *
     21  *  This file contains sync message over UIPC
     22  *
     23  ******************************************************************************/
     24 
     25 #ifndef UIPC_MSG_H
     26 #define UIPC_MSG_H
     27 
     28 #include "bt_types.h"
     29 
     30 /****************************************************************************/
     31 /*                            UIPC version number: 1.0                      */
     32 /****************************************************************************/
     33 #define UIPC_VERSION_MAJOR  0x0001
     34 #define UIPC_VERSION_MINOR  0x0000
     35 
     36 
     37 /********************************
     38 
     39     UIPC Management Messages
     40 
     41 ********************************/
     42 
     43 /* tUIPC_STATUS codes*/
     44 enum
     45 {
     46     UIPC_STATUS_SUCCESS,
     47     UIPC_STATUS_FAIL
     48 };
     49 typedef UINT8 tUIPC_STATUS;
     50 
     51 /* op_code */
     52 #define UIPC_OPEN_REQ                   0x00
     53 #define UIPC_OPEN_RSP                   0x01
     54 #define UIPC_CLOSE_REQ                  0x02
     55 #define UIPC_CLOSE_RSP                  0x03
     56 
     57 /* Structure of UIPC_OPEN_REQ message */
     58 typedef struct
     59 {
     60     UINT8               opcode;         /* UIPC_OPEN_REQ */
     61 } tUIPC_OPEN_REQ;
     62 #define UIPC_OPEN_REQ_MSGLEN        (1)
     63 
     64 /* Structure of UIPC_OPEN_RSP message */
     65 typedef struct
     66 {
     67     UINT8               opcode;         /* UIPC_OPEN_RESP */
     68     tUIPC_STATUS        status;         /* UIPC_STATUS */
     69     UINT16              version_major;  /* UIPC_VERSION_MAJOR */
     70     UINT16              version_minor;  /* UIPC_VERSION_MINOR */
     71     UINT8               num_streams;    /* Number of simultaneous streams supported by the light stack */
     72 } tUIPC_OPEN_RSP;
     73 #define UIPC_OPEN_RSP_MSGLEN        (7)
     74 
     75 /* Structure of UIPC_CLOSE_REQ message */
     76 typedef struct t_uipc_close_req
     77 {
     78     UINT8               opcode;         /* UIPC_CLOSE_REQ */
     79 } tUIPC_CLOSE_REQ;
     80 #define UIPC_CLOSE_REQ_MSGLEN       (1)
     81 
     82 /* Structure of UIPC_CLOSE_RSP message, only for BTC, full stack may ignore it */
     83 typedef struct t_uipc_close_rsp
     84 {
     85     UINT8               opcode;         /* UIPC_CLOSE_RSP */
     86 } tUIPC_CLOSE_RSP;
     87 #define UIPC_CLOSE_RSP_MSGLEN       (1)
     88 
     89 /* UIPC management message structures */
     90 typedef union
     91 {
     92     UINT8               opcode;
     93     tUIPC_OPEN_REQ      open_req;
     94     tUIPC_OPEN_RSP      open_resp;
     95     tUIPC_CLOSE_REQ     close_req;
     96 } tUIPC_MSG;
     97 
     98 #define UIPC_MGMT_MSG_MAXLEN    (sizeof(tUIPC_MSG))
     99 
    100 #define IPC_LOG_MSG_LEN  100
    101 typedef struct t_uipc_log_msg
    102 {
    103     UINT32              trace_set_mask;
    104     UINT8               msg[IPC_LOG_MSG_LEN];
    105 } tUIPC_LOG_MSG;
    106 #define UIPC_LOG_MSGLEN       (IPC_LOG_MSG_LEN + 4)
    107 
    108 typedef struct
    109 {
    110     UINT8   opcode;     /* A2DP_START_REQ */
    111     UINT16  lcid;
    112     UINT16  curr_mtu;
    113 }tA2DP_START_REQ;
    114 
    115 typedef struct
    116 {
    117     UINT8   opcode;     /* A2DP_STOP_REQ */
    118     UINT16  lcid;
    119 }tA2DP_STOP_REQ;
    120 
    121 typedef struct
    122 {
    123     UINT8   opcode;     /* A2DP_SUSPEND_REQ */
    124     UINT16  lcid;
    125 }tA2DP_SUSPEND_REQ;
    126 
    127 typedef struct
    128 {
    129     UINT8   opcode;     /* A2DP_CLEANUP_REQ */
    130     UINT16  lcid;
    131     UINT16  curr_mtu;
    132 } tA2DP_CLEANUP_REQ;
    133 
    134 typedef struct
    135 {
    136     UINT8   opcode;     /* A2DP_START_RESP, A2DP_STOP_RESP, A2DP_CLEANUP_RESP, A2DP_SUSPEND_RESP */
    137     UINT16  lcid;
    138 }tA2DP_GENERIC_RESP;
    139 
    140 #define AUDIO_CODEC_NONE            0x0000
    141 #define AUDIO_CODEC_SBC_ENC         0x0001
    142 #define AUDIO_CODEC_SBC_DEC         0x0002
    143 #define AUDIO_CODEC_MP3_ENC         0x0004
    144 #define AUDIO_CODEC_MP3_DEC         0x0008
    145 #define AUDIO_CODEC_AAC_ENC         0x0010
    146 #define AUDIO_CODEC_AAC_DEC         0x0020
    147 #define AUDIO_CODEC_AAC_PLUS_ENC    0x0040
    148 #define AUDIO_CODEC_AAC_PLUS_DEC    0x0080
    149 #define AUDIO_CODEC_MP2_ENC         0x0100
    150 #define AUDIO_CODEC_MP2_DEC         0x0200
    151 #define AUDIO_CODEC_MP2_5_ENC       0x0400
    152 #define AUDIO_CODEC_MP2_5_DEC       0x0800
    153 
    154 typedef UINT16 tAUDIO_CODEC_TYPE;
    155 
    156 /* SBC CODEC Parameters */
    157 
    158 #define CODEC_INFO_SBC_SF_16K       0x00
    159 #define CODEC_INFO_SBC_SF_32K       0x01
    160 #define CODEC_INFO_SBC_SF_44K       0x02
    161 #define CODEC_INFO_SBC_SF_48K       0x03
    162 
    163 #define CODEC_INFO_SBC_BLOCK_4      0x00
    164 #define CODEC_INFO_SBC_BLOCK_8      0x01
    165 #define CODEC_INFO_SBC_BLOCK_12     0x02
    166 #define CODEC_INFO_SBC_BLOCK_16     0x03
    167 
    168 #define CODEC_INFO_SBC_CH_MONO      0x00
    169 #define CODEC_INFO_SBC_CH_DUAL      0x01
    170 #define CODEC_INFO_SBC_CH_STEREO    0x02
    171 #define CODEC_INFO_SBC_CH_JS        0x03
    172 
    173 #define CODEC_INFO_SBC_ALLOC_LOUDNESS   0x00
    174 #define CODEC_INFO_SBC_ALLOC_SNR        0x01
    175 
    176 #define CODEC_INFO_SBC_SUBBAND_4    0x00
    177 #define CODEC_INFO_SBC_SUBBAND_8    0x01
    178 
    179 /* MPEG audio version ID */
    180 #define CODEC_INFO_MP25_ID              0x00
    181 #define CODEC_INFO_RESERVE              0x01
    182 #define CODEC_INFO_MP2_ID               0x02
    183 #define CODEC_INFO_MP3_ID               0x03
    184 
    185 #define CODEC_INFO_MP3_PROTECTION_ON    0x00
    186 #define CODEC_INFO_MP3_PROTECTION_OFF   0x01
    187 
    188 #define CODEC_INFO_MP3_BR_IDX_FREE      0x00
    189 #define CODEC_INFO_MP3_BR_IDX_32K       0x01
    190 #define CODEC_INFO_MP3_BR_IDX_40K       0x02
    191 #define CODEC_INFO_MP3_BR_IDX_48K       0x03
    192 #define CODEC_INFO_MP3_BR_IDX_56K       0x04
    193 #define CODEC_INFO_MP3_BR_IDX_64K       0x05
    194 #define CODEC_INFO_MP3_BR_IDX_80K       0x06
    195 #define CODEC_INFO_MP3_BR_IDX_96K       0x07
    196 #define CODEC_INFO_MP3_BR_IDX_112K      0x08
    197 #define CODEC_INFO_MP3_BR_IDX_128K      0x09
    198 #define CODEC_INFO_MP3_BR_IDX_160K      0x0A
    199 #define CODEC_INFO_MP3_BR_IDX_192K      0x0B
    200 #define CODEC_INFO_MP3_BR_IDX_224K      0x0C
    201 #define CODEC_INFO_MP3_BR_IDX_256K      0x0D
    202 #define CODEC_INFO_MP3_BR_IDX_320K      0x0E
    203 
    204 #define CODEC_INFO_MP3_SF_44K           0x00
    205 #define CODEC_INFO_MP3_SF_48K           0x01
    206 #define CODEC_INFO_MP3_SF_32K           0x02
    207 
    208 #define CODEC_INFO_MP3_MODE_STEREO      0x00
    209 #define CODEC_INFO_MP3_MODE_JS          0x01
    210 #define CODEC_INFO_MP3_MODE_DUAL        0x02
    211 #define CODEC_INFO_MP3_MODE_SINGLE      0x03
    212 
    213 /* layer 3, type of joint stereo coding method (intensity and ms) */
    214 #define CODEC_INFO_MP3_MODE_EXT_OFF_OFF 0x00
    215 #define CODEC_INFO_MP3_MODE_EXT_ON_OFF  0x01
    216 #define CODEC_INFO_MP3_MODE_EXT_OFF_ON  0x02
    217 #define CODEC_INFO_MP3_MODE_EXT_ON_ON   0x03
    218 
    219 
    220 #define CODEC_INFO_MP2_PROTECTION_ON    0x00
    221 #define CODEC_INFO_MP2_PROTECTION_OFF   0x01
    222 
    223 #define CODEC_INFO_MP2_BR_IDX_FREE      0x00
    224 #define CODEC_INFO_MP2_BR_IDX_8K        0x01
    225 #define CODEC_INFO_MP2_BR_IDX_16K       0x02
    226 #define CODEC_INFO_MP2_BR_IDX_24K       0x03
    227 #define CODEC_INFO_MP2_BR_IDX_32K       0x04
    228 #define CODEC_INFO_MP2_BR_IDX_40K       0x05
    229 #define CODEC_INFO_MP2_BR_IDX_48K       0x06
    230 #define CODEC_INFO_MP2_BR_IDX_56K       0x07
    231 #define CODEC_INFO_MP2_BR_IDX_64K       0x08
    232 #define CODEC_INFO_MP2_BR_IDX_80K       0x09
    233 #define CODEC_INFO_MP2_BR_IDX_96K       0x0A
    234 #define CODEC_INFO_MP2_BR_IDX_112K      0x0B
    235 #define CODEC_INFO_MP2_BR_IDX_128K      0x0C
    236 #define CODEC_INFO_MP2_BR_IDX_144K      0x0D
    237 #define CODEC_INFO_MP2_BR_IDX_160K      0x0E
    238 
    239 #define CODEC_INFO_MP2_SF_22K           0x00
    240 #define CODEC_INFO_MP2_SF_24K           0x01
    241 #define CODEC_INFO_MP2_SF_16K           0x02
    242 
    243 #define CODEC_INFO_MP2_MODE_STEREO      0x00
    244 #define CODEC_INFO_MP2_MODE_JS          0x01
    245 #define CODEC_INFO_MP2_MODE_DUAL        0x02
    246 #define CODEC_INFO_MP2_MODE_SINGLE      0x03
    247 
    248 /* layer 3, type of joint stereo coding method (intensity and ms) */
    249 #define CODEC_INFO_MP2_MODE_EXT_OFF_OFF 0x00
    250 #define CODEC_INFO_MP2_MODE_EXT_ON_OFF  0x01
    251 #define CODEC_INFO_MP2_MODE_EXT_OFF_ON  0x02
    252 #define CODEC_INFO_MP2_MODE_EXT_ON_ON   0x03
    253 
    254 #define CODEC_INFO_MP2_SAMPLE_PER_FRAME     576
    255 
    256 /* mpeg 2.5 layer 3 decoder */
    257 
    258 #define CODEC_INFO_MP25_PROTECTION_ON   0x00
    259 #define CODEC_INFO_MP25_PROTECTION_OFF  0x01
    260 
    261 #define CODEC_INFO_MP25_BR_IDX_FREE     0x00
    262 #define CODEC_INFO_MP25_BR_IDX_8K       0x01
    263 #define CODEC_INFO_MP25_BR_IDX_16K      0x02
    264 #define CODEC_INFO_MP25_BR_IDX_24K      0x03
    265 #define CODEC_INFO_MP25_BR_IDX_32K      0x04
    266 #define CODEC_INFO_MP25_BR_IDX_40K      0x05
    267 #define CODEC_INFO_MP25_BR_IDX_48K      0x06
    268 #define CODEC_INFO_MP25_BR_IDX_56K      0x07
    269 #define CODEC_INFO_MP25_BR_IDX_64K      0x08
    270 #define CODEC_INFO_MP25_BR_IDX_80K      0x09
    271 #define CODEC_INFO_MP25_BR_IDX_96K      0x0A
    272 #define CODEC_INFO_MP25_BR_IDX_112K     0x0B
    273 #define CODEC_INFO_MP25_BR_IDX_128K     0x0C
    274 #define CODEC_INFO_MP25_BR_IDX_144K     0x0D
    275 #define CODEC_INFO_MP25_BR_IDX_160K     0x0E
    276 
    277 #define CODEC_INFO_MP25_SF_11K          0x00
    278 #define CODEC_INFO_MP25_SF_12K          0x01
    279 #define CODEC_INFO_MP25_SF_8K           0x02
    280 
    281 #define CODEC_INFO_MP25_MODE_STEREO     0x00
    282 #define CODEC_INFO_MP25_MODE_JS         0x01
    283 #define CODEC_INFO_MP25_MODE_DUAL       0x02
    284 #define CODEC_INFO_MP25_MODE_SINGLE     0x03
    285 
    286 /* layer 3, type of joint stereo coding method (intensity and ms) */
    287 #define CODEC_INFO_MP25_MODE_EXT_OFF_OFF 0x00
    288 #define CODEC_INFO_MP25_MODE_EXT_ON_OFF  0x01
    289 #define CODEC_INFO_MP25_MODE_EXT_OFF_ON  0x02
    290 #define CODEC_INFO_MP25_MODE_EXT_ON_ON   0x03
    291 
    292 #define CODEC_INFO_MP25_SAMPLE_PER_FRAME    576
    293 
    294 /* AAC/AAC+ CODEC Parameters */
    295 #define CODEC_INFO_AAC_SF_IDX_96K   0x0
    296 #define CODEC_INFO_AAC_SF_IDX_88K   0x1
    297 #define CODEC_INFO_AAC_SF_IDX_64K   0x2
    298 #define CODEC_INFO_AAC_SF_IDX_48K   0x3
    299 #define CODEC_INFO_AAC_SF_IDX_44K   0x4
    300 #define CODEC_INFO_AAC_SF_IDX_32K   0x5
    301 #define CODEC_INFO_AAC_SF_IDX_24K   0x6
    302 #define CODEC_INFO_AAC_SF_IDX_22K   0x7
    303 #define CODEC_INFO_AAC_SF_IDX_16K   0x8
    304 #define CODEC_INFO_AAC_SF_IDX_12K   0x9
    305 #define CODEC_INFO_AAC_SF_IDX_11K   0xA
    306 #define CODEC_INFO_AAC_SF_IDX_08K   0xB
    307 #define CODEC_INFO_AAC_SF_IDX_RESERVE   0xC
    308 
    309 #define CODEC_INFO_AAC_BR_RATE_48K  288000
    310 #define CODEC_INFO_AAC_BR_RATE_44K  264600
    311 #define CODEC_INFO_AAC_BR_RATE_32K  192000
    312 
    313 
    314 #define CODEC_INFO_AAC_1_CH           1         /*center front speaker */
    315 #define CODEC_INFO_AAC_2_CH           2         /*left, right front speaker */
    316 #define CODEC_INFO_AAC_3_CH           3         /*center front speaker, left right front speaker */
    317 #define CODEC_INFO_AAC_4_CH           4         /*center/rear front speaker, left/right front speaker */
    318 #define CODEC_INFO_AAC_5_CH           5         /*center, left, right front speaker, left/right surround */
    319 #define CODEC_INFO_AAC_6_CH           6         /*center, left, right front speaker, left/right surround, LFE */
    320 #define CODEC_INFO_AAC_7_CH           7         /*(left, right)center/left,right front speaker, left/right surround, LFE */
    321 
    322 
    323 typedef struct
    324 {
    325     UINT8   sampling_freq;
    326     UINT8   channel_mode;
    327     UINT8   block_length;
    328     UINT8   num_subbands;
    329     UINT8   alloc_method;
    330     UINT8   bitpool_size;   /* 2 - 250 */
    331 } tCODEC_INFO_SBC;
    332 
    333 typedef struct
    334 {
    335     UINT8   ch_mode;
    336     UINT8   sampling_freq;
    337     UINT8   bitrate_index;  /* 0 - 14 */
    338 } tCODEC_INFO_MP3;
    339 
    340 typedef struct
    341 {
    342     UINT8   ch_mode;
    343     UINT8   sampling_freq;
    344     UINT8   bitrate_index;  /* 0 - 14 */
    345 } tCODEC_INFO_MP2;
    346 
    347 
    348 typedef struct
    349 {
    350     UINT8   ch_mode;
    351     UINT8   sampling_freq;
    352     UINT8   bitrate_index;  /* 0 - 14 */
    353 } tCODEC_INFO_MP2_5;
    354 
    355 typedef struct
    356 {
    357     UINT16  sampling_freq;
    358     UINT8   channel_mode;   /* 0x02:mono, 0x01:dual */
    359     UINT32  bitrate;        /* 0 - 320K */
    360     UINT32  sbr_profile;        /* 1: ON, 0: OFF */
    361 } tCODEC_INFO_AAC;
    362 
    363 typedef union
    364 {
    365     tCODEC_INFO_SBC     sbc;
    366     tCODEC_INFO_MP3     mp3;
    367     tCODEC_INFO_MP2     mp2;
    368     tCODEC_INFO_MP2_5   mp2_5;
    369     tCODEC_INFO_AAC     aac;
    370 } tCODEC_INFO;
    371 
    372 typedef struct
    373 {
    374     UINT8               opcode;     /* AUDIO_CODEC_CONFIG_REQ */
    375     tAUDIO_CODEC_TYPE   codec_type;
    376     tCODEC_INFO         codec_info;
    377 } tAUDIO_CODEC_CONFIG_REQ;
    378 
    379 #define AUDIO_CONFIG_SUCCESS            0x00
    380 #define AUDIO_CONFIG_NOT_SUPPORTED      0x01
    381 #define AUDIO_CONFIG_FAIL_OUT_OF_MEMORY 0x02
    382 #define AUDIO_CONFIG_FAIL_CODEC_USED    0x03
    383 #define AUDIO_CONFIG_FAIL_ROUTE         0x04
    384 typedef UINT8 tAUDIO_CONFIG_STATUS;
    385 
    386 typedef struct
    387 {
    388     UINT8                   opcode; /* AUDIO_CODEC_CONFIG_RESP */
    389     tAUDIO_CONFIG_STATUS    status;
    390 } tAUDIO_CODEC_CONFIG_RESP;
    391 
    392 typedef struct
    393 {
    394     UINT8               opcode;     /* AUDIO_CODEC_SET_BITRATE_REQ */
    395     tAUDIO_CODEC_TYPE   codec_type;
    396     union
    397     {
    398         UINT8   sbc;
    399         UINT8   mp3;
    400         UINT32  aac;
    401     } codec_bitrate;
    402 } tAUDIO_CODEC_SET_BITRATE_REQ;
    403 
    404 #define AUDIO_ROUTE_SRC_FMRX        0x00
    405 #define AUDIO_ROUTE_SRC_I2S         0x01
    406 #define AUDIO_ROUTE_SRC_ADC         0x02
    407 #define AUDIO_ROUTE_SRC_HOST        0x03
    408 #define AUDIO_ROUTE_SRC_PTU         0x04
    409 #define AUDIO_ROUTE_SRC_BTSNK       0x05
    410 #define AUDIO_ROUTE_SRC_NONE        0x80
    411 #define MAX_AUDIO_ROUTE_SRC         6
    412 typedef UINT8 tAUDIO_ROUTE_SRC;
    413 
    414 #define AUDIO_ROUTE_MIX_NONE        0x00
    415 #define AUDIO_ROUTE_MIX_HOST        0x01
    416 #define AUDIO_ROUTE_MIX_PCM         0x02
    417 #define AUDIO_ROUTE_MIX_CHIRP       0x03
    418 #define AUDIO_ROUTE_MIX_I2S         0x04
    419 #define AUDIO_ROUTE_MIX_ADC         0x05
    420 #define AUDIO_ROUTE_MIX_RESERVED    0x06
    421 #define MAX_AUDIO_ROUTE_MIX         7
    422 typedef UINT8 tAUDIO_ROUTE_MIX;
    423 
    424 #define AUDIO_ROUTE_OUT_NONE        0x0000
    425 #define AUDIO_ROUTE_OUT_BTA2DP      0x0001
    426 #define AUDIO_ROUTE_OUT_FMTX        0x0002
    427 #define AUDIO_ROUTE_OUT_BTSCO       0x0004
    428 #define AUDIO_ROUTE_OUT_HOST        0x0008
    429 #define AUDIO_ROUTE_OUT_DAC         0x0010
    430 #define AUDIO_ROUTE_OUT_I2S         0x0020
    431 #define AUDIO_ROUTE_OUT_BTA2DP_DAC  0x0040
    432 #define AUDIO_ROUTE_OUT_BTA2DP_I2S  0x0080
    433 #define AUDIO_ROUTE_OUT_BTSCO_DAC   0x0100
    434 #define AUDIO_ROUTE_OUT_BTSCO_I2S   0x0200
    435 #define AUDIO_ROUTE_OUT_HOST_BTA2DP 0x0400
    436 #define AUDIO_ROUTE_OUT_HOST_BTSCO  0x0800
    437 #define AUDIO_ROUTE_OUT_HOST_DAC    0x1000
    438 #define AUDIO_ROUTE_OUT_HOST_I2S    0x2000
    439 #define AUDIO_ROUTE_OUT_DAC_I2S     0x4000
    440 #define AUDIO_ROUTE_OUT_RESERVED_2  0x8000
    441 
    442 #define MAX_AUDIO_SINGLE_ROUTE_OUT  6
    443 #define MAX_AUDIO_MULTI_ROUTE_OUT   16
    444 typedef UINT16 tAUDIO_MULTI_ROUTE_OUT;
    445 typedef UINT8  tAUDIO_ROUTE_OUT;
    446 
    447 #define AUDIO_ROUTE_SF_8K           0x00
    448 #define AUDIO_ROUTE_SF_16K          0x01
    449 #define AUDIO_ROUTE_SF_32K          0x02
    450 #define AUDIO_ROUTE_SF_44_1K        0x03
    451 #define AUDIO_ROUTE_SF_48K          0x04
    452 #define AUDIO_ROUTE_SF_11K          0x05
    453 #define AUDIO_ROUTE_SF_12K          0x06
    454 #define AUDIO_ROUTE_SF_22K          0x07
    455 #define AUDIO_ROUTE_SF_24K          0x08
    456 #define AUDIO_ROUTE_SF_NA           0xFF
    457 typedef UINT8 tAUDIO_ROUTE_SF;
    458 
    459 #define AUDIO_ROUTE_EQ_BASS_BOOST   0x00
    460 #define AUDIO_ROUTE_EQ_CLASSIC      0x01
    461 #define AUDIO_ROUTE_EQ_JAZZ         0x02
    462 #define AUDIO_ROUTE_EQ_LIVE         0x03
    463 #define AUDIO_ROUTE_EQ_NORMAL       0x04
    464 #define AUDIO_ROUTE_EQ_ROCK         0x05
    465 #define AUDIO_ROUTE_EQ_BYPASS       0x06
    466 
    467 #define AUDIO_ROUTE_DIGITAL_VOLUME_CONTROL  0x07
    468 
    469 #define AUDIO_ROUTE_EQ_CONFIG_GAIN  0xFF    /* Custion Gain Config */
    470 typedef UINT8 tAUDIO_ROUTE_EQ;
    471 
    472 typedef struct
    473 {
    474     UINT8               opcode;     /* AUDIO_ROUTE_CONFIG_REQ */
    475     tAUDIO_ROUTE_SRC    src;
    476     tAUDIO_ROUTE_SF     src_sf;
    477     tAUDIO_ROUTE_OUT    out;
    478     tAUDIO_ROUTE_SF     out_codec_sf;
    479     tAUDIO_ROUTE_SF     out_i2s_sf;
    480     tAUDIO_ROUTE_EQ     eq_mode;
    481 } tAUDIO_ROUTE_CONFIG_REQ;
    482 
    483 typedef struct
    484 {
    485     UINT8                   opcode; /* AUDIO_ROUTE_CONFIG_RESP */
    486     tAUDIO_CONFIG_STATUS    status;
    487 } tAUDIO_ROUTE_CONFIG_RESP;
    488 
    489 typedef struct
    490 {
    491     UINT16  amp[2];                 /* left/right 15 bit amplitude value        */
    492     UINT16  tone[2];                /* left/right 12 bit frequency 0 - 4096Hz   */
    493     UINT16  mark[2];                /* left/right 16 bit mark time 0 - 65535ms  */
    494     UINT16  space[2];               /* left/right 16 bit space time 0 - 65535ms */
    495 } tCHIRP_CONFIG;
    496 
    497 typedef struct
    498 {
    499     UINT8   pri_l;                  /* Primary Left scale : 0 ~ 255     */
    500     UINT8   mix_l;                  /* Mixing Left scale : 0 ~ 255      */
    501     UINT8   pri_r;                  /* Primary Right scale : 0 ~ 255    */
    502     UINT8   mix_r;                  /* Mixing Right scale : 0 ~ 255     */
    503 } tMIX_SCALE_CONFIG;
    504 
    505 /* For custon equalizer gain configuration */
    506 typedef struct
    507 {
    508     UINT32  audio_l_g0;         /* IIR biquad filter left ch gain 0 */
    509     UINT32  audio_l_g1;         /* IIR biquad filter left ch gain 1 */
    510     UINT32  audio_l_g2;         /* IIR biquad filter left ch gain 2 */
    511     UINT32  audio_l_g3;         /* IIR biquad filter left ch gain 3 */
    512     UINT32  audio_l_g4;         /* IIR biquad filter left ch gain 4 */
    513     UINT32  audio_l_gl;         /* IIR biquad filter left ch global gain  */
    514     UINT32  audio_r_g0;         /* IIR biquad filter left ch gain 0 */
    515     UINT32  audio_r_g1;         /* IIR biquad filter left ch gain 1 */
    516     UINT32  audio_r_g2;         /* IIR biquad filter left ch gain 2 */
    517     UINT32  audio_r_g3;         /* IIR biquad filter left ch gain 3 */
    518     UINT32  audio_r_g4;         /* IIR biquad filter left ch gain 4 */
    519     UINT32  audio_r_gl;         /* IIR biquad filter left ch global gain */
    520 } tEQ_GAIN_CONFIG;
    521 
    522 typedef struct
    523 {
    524     UINT8               opcode;     /* AUDIO_MIX_CONFIG_REQ */
    525     tAUDIO_ROUTE_MIX    mix_src;
    526     tAUDIO_ROUTE_SF     mix_src_sf;
    527     tMIX_SCALE_CONFIG   mix_scale;
    528     tCHIRP_CONFIG       chirp_config;
    529 } tAUDIO_MIX_CONFIG_REQ;
    530 
    531 typedef struct
    532 {
    533     UINT8                   opcode; /* AUDIO_MIX_CONFIG_RESP */
    534     tAUDIO_CONFIG_STATUS    status;
    535 } tAUDIO_MIX_CONFIG_RESP;
    536 
    537 
    538 typedef struct
    539 {
    540     UINT8   opcode;                 /* AUDIO_BURST_FRAMES_IND */
    541     UINT32  burst_size;             /* in bytes */
    542 } tAUDIO_BURST_FRAMES_IND;
    543 
    544 typedef struct
    545 {
    546     UINT8   opcode;                 /* AUDIO_BURST_END_IND */
    547 } tAUDIO_BURST_END_IND;
    548 
    549 typedef struct
    550 {
    551     UINT8   opcode;                 /* AUDIO_CODEC_FLUSH_REQ */
    552 } tAUDIO_CODEC_FLUSH_REQ;
    553 
    554 typedef struct
    555 {
    556     UINT8               opcode;     /* AUDIO_EQ_MODE_CONFIG_REQ */
    557     tAUDIO_ROUTE_EQ     eq_mode;
    558     tEQ_GAIN_CONFIG     filter_gain;    /* Valid only when eq_mode is 0xFF */
    559 } tAUDIO_EQ_MODE_CONFIG_REQ;
    560 
    561 typedef struct
    562 {
    563     UINT8               opcode;     /* AUDIO_SCALE_CONFIG_REQ */
    564     tMIX_SCALE_CONFIG   mix_scale;
    565 } tAUDIO_SCALE_CONFIG_REQ;
    566 
    567 #endif /* UIPC_MSG_H */
    568 
    569