10b966c5eSopenharmony_ci/****************************************************************************** 20b966c5eSopenharmony_ci * 30b966c5eSopenharmony_ci * Copyright (C) 1999-2012 Broadcom Corporation 40b966c5eSopenharmony_ci * 50b966c5eSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 60b966c5eSopenharmony_ci * you may not use this file except in compliance with the License. 70b966c5eSopenharmony_ci * You may obtain a copy of the License at: 80b966c5eSopenharmony_ci * 90b966c5eSopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 100b966c5eSopenharmony_ci * 110b966c5eSopenharmony_ci * Unless required by applicable law or agreed to in writing, software 120b966c5eSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 130b966c5eSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 140b966c5eSopenharmony_ci * See the License for the specific language governing permissions and 150b966c5eSopenharmony_ci * limitations under the License. 160b966c5eSopenharmony_ci * 170b966c5eSopenharmony_ci ******************************************************************************/ 180b966c5eSopenharmony_ci 190b966c5eSopenharmony_ci/****************************************************************************** 200b966c5eSopenharmony_ci * 210b966c5eSopenharmony_ci * This file contains sync message over UIPC 220b966c5eSopenharmony_ci * 230b966c5eSopenharmony_ci ******************************************************************************/ 240b966c5eSopenharmony_ci 250b966c5eSopenharmony_ci#ifndef BT_VENDOR_UIPC_MSG_H 260b966c5eSopenharmony_ci#define BT_VENDOR_UIPC_MSG_H 270b966c5eSopenharmony_ci 280b966c5eSopenharmony_ci#include "bt_types.h" 290b966c5eSopenharmony_ci 300b966c5eSopenharmony_ci/****************************************************************************/ 310b966c5eSopenharmony_ci/* UIPC version number: 1.0 */ 320b966c5eSopenharmony_ci/****************************************************************************/ 330b966c5eSopenharmony_ci#define UIPC_VERSION_MAJOR 0x0001 340b966c5eSopenharmony_ci#define UIPC_VERSION_MINOR 0x0000 350b966c5eSopenharmony_ci 360b966c5eSopenharmony_ci/******************************** 370b966c5eSopenharmony_ci 380b966c5eSopenharmony_ci UIPC Management Messages 390b966c5eSopenharmony_ci 400b966c5eSopenharmony_ci********************************/ 410b966c5eSopenharmony_ci 420b966c5eSopenharmony_ci/* tUIPC_STATUS codes */ 430b966c5eSopenharmony_cienum { 440b966c5eSopenharmony_ci UIPC_STATUS_SUCCESS, 450b966c5eSopenharmony_ci UIPC_STATUS_FAIL 460b966c5eSopenharmony_ci}; 470b966c5eSopenharmony_ci 480b966c5eSopenharmony_ci/* op_code */ 490b966c5eSopenharmony_ci#define UIPC_OPEN_REQ 0x00 500b966c5eSopenharmony_ci#define UIPC_OPEN_RSP 0x01 510b966c5eSopenharmony_ci#define UIPC_CLOSE_REQ 0x02 520b966c5eSopenharmony_ci#define UIPC_CLOSE_RSP 0x03 530b966c5eSopenharmony_ci 540b966c5eSopenharmony_ci#pragma pack(push) /* push current alignment to stack */ 550b966c5eSopenharmony_ci#pragma pack(1) /* set alignment to 1 byte boundary to allow for offset mappings */ 560b966c5eSopenharmony_ci 570b966c5eSopenharmony_ci/* Structure of UIPC_OPEN_REQ message */ 580b966c5eSopenharmony_citypedef struct { 590b966c5eSopenharmony_ci uint8_t opcode; /* UIPC_OPEN_REQ */ 600b966c5eSopenharmony_ci} tUIPC_OPEN_REQ; 610b966c5eSopenharmony_ci#define UIPC_OPEN_REQ_MSGLEN (1) 620b966c5eSopenharmony_ci 630b966c5eSopenharmony_ci/* Structure of UIPC_OPEN_RSP message */ 640b966c5eSopenharmony_citypedef struct { 650b966c5eSopenharmony_ci uint8_t opcode; /* UIPC_OPEN_RESP */ 660b966c5eSopenharmony_ci uint8_t status; /* UIPC_STATUS */ 670b966c5eSopenharmony_ci uint16_t version_major; /* UIPC_VERSION_MAJOR */ 680b966c5eSopenharmony_ci uint16_t version_minor; /* UIPC_VERSION_MINOR */ 690b966c5eSopenharmony_ci uint8_t num_streams; /* Number of simultaneous streams supported by the light stack */ 700b966c5eSopenharmony_ci} tUIPC_OPEN_RSP; 710b966c5eSopenharmony_ci#define UIPC_OPEN_RSP_MSGLEN (7) 720b966c5eSopenharmony_ci 730b966c5eSopenharmony_ci/* Structure of UIPC_CLOSE_REQ message */ 740b966c5eSopenharmony_citypedef struct t_uipc_close_req { 750b966c5eSopenharmony_ci uint8_t opcode; /* UIPC_CLOSE_REQ */ 760b966c5eSopenharmony_ci} tUIPC_CLOSE_REQ; 770b966c5eSopenharmony_ci#define UIPC_CLOSE_REQ_MSGLEN (1) 780b966c5eSopenharmony_ci 790b966c5eSopenharmony_ci/* Structure of UIPC_CLOSE_RSP message, only for BTC, full stack may ignore it */ 800b966c5eSopenharmony_citypedef struct t_uipc_close_rsp { 810b966c5eSopenharmony_ci uint8_t opcode; /* UIPC_CLOSE_RSP */ 820b966c5eSopenharmony_ci} tUIPC_CLOSE_RSP; 830b966c5eSopenharmony_ci#define UIPC_CLOSE_RSP_MSGLEN (1) 840b966c5eSopenharmony_ci 850b966c5eSopenharmony_ci/* UIPC management message structures */ 860b966c5eSopenharmony_citypedef union { 870b966c5eSopenharmony_ci uint8_t opcode; 880b966c5eSopenharmony_ci tUIPC_OPEN_REQ open_req; 890b966c5eSopenharmony_ci tUIPC_OPEN_RSP open_resp; 900b966c5eSopenharmony_ci tUIPC_CLOSE_REQ close_req; 910b966c5eSopenharmony_ci} tUIPC_MSG; 920b966c5eSopenharmony_ci 930b966c5eSopenharmony_ci#define UIPC_MGMT_MSG_MAXLEN (sizeof(tUIPC_MSG)) 940b966c5eSopenharmony_ci 950b966c5eSopenharmony_ci#define IPC_LOG_MSG_LEN 100 960b966c5eSopenharmony_citypedef struct t_uipc_log_msg { 970b966c5eSopenharmony_ci uint32_t trace_set_mask; 980b966c5eSopenharmony_ci uint8_t msg[IPC_LOG_MSG_LEN]; 990b966c5eSopenharmony_ci} tUIPC_LOG_MSG; 1000b966c5eSopenharmony_ci#define UIPC_LOG_MSGLEN (IPC_LOG_MSG_LEN + 4) 1010b966c5eSopenharmony_ci 1020b966c5eSopenharmony_ci/******************************** 1030b966c5eSopenharmony_ci 1040b966c5eSopenharmony_ci H5 Sync Message 1050b966c5eSopenharmony_ci 1060b966c5eSopenharmony_ci********************************/ 1070b966c5eSopenharmony_ci 1080b966c5eSopenharmony_ci/* op_code */ 1090b966c5eSopenharmony_ci#define SLIP_SYNC_TO_LITE_REQ 0 1100b966c5eSopenharmony_ci#define SLIP_SYNC_TO_LITE_RESP 1 1110b966c5eSopenharmony_ci#define SLIP_SYNC_TO_FULL_REQ 2 1120b966c5eSopenharmony_ci#define SLIP_SYNC_TO_FULL_RESP 3 1130b966c5eSopenharmony_ci#define SLIP_SYNC_NOTIFY 4 1140b966c5eSopenharmony_ci 1150b966c5eSopenharmony_ci/* status */ 1160b966c5eSopenharmony_ci#define SLIP_SYNC_SUCCESS 0 1170b966c5eSopenharmony_ci#define SLIP_SYNC_FAILURE 1 1180b966c5eSopenharmony_ci 1190b966c5eSopenharmony_citypedef struct { 1200b966c5eSopenharmony_ci uint8_t op_code; 1210b966c5eSopenharmony_ci uint8_t status; 1220b966c5eSopenharmony_ci uint16_t acl_pkt_size; 1230b966c5eSopenharmony_ci uint8_t state; 1240b966c5eSopenharmony_ci uint8_t lp_state; /* Low Power state */ 1250b966c5eSopenharmony_ci uint8_t next_seqno; /* next send seq */ 1260b966c5eSopenharmony_ci uint8_t ack; /* next ack seq, expected seq from peer */ 1270b966c5eSopenharmony_ci uint8_t sent_ack; /* last sent ack */ 1280b966c5eSopenharmony_ci uint8_t sliding_window_size; /* window size */ 1290b966c5eSopenharmony_ci bool oof_flow_control; /* Out of Frame SW Flow Control */ 1300b966c5eSopenharmony_ci bool data_integrity_type; /* Level of Data Integrity Check */ 1310b966c5eSopenharmony_ci uint8_t rx_state; /* rx state for incoming packet processing */ 1320b966c5eSopenharmony_ci} tSLIP_SYNC_INFO; 1330b966c5eSopenharmony_ci 1340b966c5eSopenharmony_ci/******************************** 1350b966c5eSopenharmony_ci 1360b966c5eSopenharmony_ci L2CAP Sync Message 1370b966c5eSopenharmony_ci 1380b966c5eSopenharmony_ci********************************/ 1390b966c5eSopenharmony_ci 1400b966c5eSopenharmony_ci/* op_code */ 1410b966c5eSopenharmony_ci#define L2C_SYNC_TO_LITE_REQ 0 1420b966c5eSopenharmony_ci#define L2C_SYNC_TO_LITE_RESP 1 1430b966c5eSopenharmony_ci#define L2C_REMOVE_TO_LITE_REQ 2 1440b966c5eSopenharmony_ci#define L2C_REMOVE_TO_LITE_RESP 3 1450b966c5eSopenharmony_ci#define L2C_FLUSH_TO_FULL_IND 4 1460b966c5eSopenharmony_ci 1470b966c5eSopenharmony_ci/* status */ 1480b966c5eSopenharmony_ci#define L2C_SYNC_SUCCESS 0 1490b966c5eSopenharmony_ci#define L2C_SYNC_FAILURE 1 1500b966c5eSopenharmony_ci 1510b966c5eSopenharmony_citypedef struct t_l2c_stream_info { 1520b966c5eSopenharmony_ci uint16_t local_cid; /* Local CID */ 1530b966c5eSopenharmony_ci uint16_t remote_cid; /* Remote CID */ 1540b966c5eSopenharmony_ci uint16_t out_mtu; /* Max MTU we will send */ 1550b966c5eSopenharmony_ci uint16_t handle; /* The handle used with LM */ 1560b966c5eSopenharmony_ci uint16_t link_xmit_quota; /* Num outstanding pkts allowed */ 1570b966c5eSopenharmony_ci bool is_flushable; /* TRUE if flushable channel */ 1580b966c5eSopenharmony_ci} tL2C_STREAM_INFO; 1590b966c5eSopenharmony_ci 1600b966c5eSopenharmony_citypedef struct t_l2c_sync_to_lite_req { 1610b966c5eSopenharmony_ci uint8_t op_code; /* L2C_SYNC_TO_LITE_REQ */ 1620b966c5eSopenharmony_ci uint16_t light_xmit_quota; /* Total quota for light stack */ 1630b966c5eSopenharmony_ci uint16_t acl_data_size; /* Max ACL data size across HCI transport */ 1640b966c5eSopenharmony_ci uint16_t non_flushable_pbf; /* L2CAP_PKT_START_NON_FLUSHABLE if controller supports */ 1650b966c5eSopenharmony_ci /* Otherwise, L2CAP_PKT_START */ 1660b966c5eSopenharmony_ci uint8_t multi_av_data_cong_start; /* Multi-AV queue size to start congestion */ 1670b966c5eSopenharmony_ci uint8_t multi_av_data_cong_end; /* Multi-AV queue size to end congestion */ 1680b966c5eSopenharmony_ci uint8_t multi_av_data_cong_discard; /* Multi-AV queue size to discard */ 1690b966c5eSopenharmony_ci uint8_t num_stream; 1700b966c5eSopenharmony_ci tL2C_STREAM_INFO stream; 1710b966c5eSopenharmony_ci} tL2C_SYNC_TO_LITE_REQ; 1720b966c5eSopenharmony_ci 1730b966c5eSopenharmony_citypedef struct t_l2c_sync_to_lite_resp_stream { 1740b966c5eSopenharmony_ci uint16_t lcid; 1750b966c5eSopenharmony_ci uint8_t status; 1760b966c5eSopenharmony_ci} tL2C_SYNC_TO_LITE_RESP_STREAM; 1770b966c5eSopenharmony_ci 1780b966c5eSopenharmony_citypedef struct t_l2c_sync_to_lite_resp { 1790b966c5eSopenharmony_ci uint8_t op_code; /* L2C_SYNC_TO_LITE_RESP */ 1800b966c5eSopenharmony_ci uint16_t light_xmit_unacked; /* unacked packet more than quota in light stack */ 1810b966c5eSopenharmony_ci uint8_t num_stream; 1820b966c5eSopenharmony_ci tL2C_SYNC_TO_LITE_RESP_STREAM stream; 1830b966c5eSopenharmony_ci} tL2C_SYNC_TO_LITE_RESP; 1840b966c5eSopenharmony_ci 1850b966c5eSopenharmony_citypedef struct t_l2c_remove_to_lite_req { 1860b966c5eSopenharmony_ci uint8_t op_code; /* L2C_REMOVE_TO_LITE_REQ */ 1870b966c5eSopenharmony_ci uint16_t light_xmit_quota; /* Total quota for light stack */ 1880b966c5eSopenharmony_ci uint8_t num_stream; 1890b966c5eSopenharmony_ci uint16_t lcid; 1900b966c5eSopenharmony_ci} tL2C_REMOVE_TO_LITE_REQ; 1910b966c5eSopenharmony_ci 1920b966c5eSopenharmony_citypedef tL2C_SYNC_TO_LITE_RESP tL2C_REMOVE_TO_LITE_RESP; 1930b966c5eSopenharmony_citypedef tL2C_REMOVE_TO_LITE_REQ tL2C_FLUSH_TO_FULL_IND; 1940b966c5eSopenharmony_ci 1950b966c5eSopenharmony_citypedef union t_l2c_sync_msg { 1960b966c5eSopenharmony_ci uint8_t op_code; 1970b966c5eSopenharmony_ci tL2C_SYNC_TO_LITE_REQ sync_req; 1980b966c5eSopenharmony_ci tL2C_SYNC_TO_LITE_RESP sync_resp; 1990b966c5eSopenharmony_ci tL2C_REMOVE_TO_LITE_REQ remove_req; 2000b966c5eSopenharmony_ci tL2C_REMOVE_TO_LITE_RESP remove_resp; 2010b966c5eSopenharmony_ci tL2C_FLUSH_TO_FULL_IND flush_ind; 2020b966c5eSopenharmony_ci} tL2C_SYNC_MSG; 2030b966c5eSopenharmony_ci 2040b966c5eSopenharmony_ci/******************************** 2050b966c5eSopenharmony_ci 2060b966c5eSopenharmony_ci AVDTP Sync Message 2070b966c5eSopenharmony_ci 2080b966c5eSopenharmony_ci********************************/ 2090b966c5eSopenharmony_ci 2100b966c5eSopenharmony_ci/* op_code */ 2110b966c5eSopenharmony_ci#define AVDT_SYNC_TO_LITE_REQ 0 2120b966c5eSopenharmony_ci#define AVDT_SYNC_TO_LITE_RESP 1 2130b966c5eSopenharmony_ci#define AVDT_RESYNC_TO_LITE_REQ 2 2140b966c5eSopenharmony_ci#define AVDT_RESYNC_TO_LITE_RESP 3 2150b966c5eSopenharmony_ci#define AVDT_SYNC_TO_FULL_REQ 4 2160b966c5eSopenharmony_ci#define AVDT_SYNC_TO_FULL_RESP 5 2170b966c5eSopenharmony_ci#define AVDT_REMOVE_TO_LITE_REQ 6 2180b966c5eSopenharmony_ci#define AVDT_REMOVE_TO_LITE_RESP 7 2190b966c5eSopenharmony_ci#define AVDT_SYNC_TO_BTC_LITE_REQ 8 2200b966c5eSopenharmony_ci#define AVDT_SYNC_TO_BTC_LITE_RESP 9 2210b966c5eSopenharmony_ci 2220b966c5eSopenharmony_ci/* status */ 2230b966c5eSopenharmony_ci#define AVDT_SYNC_SUCCESS 0 2240b966c5eSopenharmony_ci#define AVDT_SYNC_FAILURE 1 2250b966c5eSopenharmony_ci 2260b966c5eSopenharmony_citypedef struct { 2270b966c5eSopenharmony_ci uint16_t lcid; 2280b966c5eSopenharmony_ci uint32_t ssrc; 2290b966c5eSopenharmony_ci} tAVDT_SYNC_TO_BTC_LITE_REQ_STREAM; 2300b966c5eSopenharmony_ci 2310b966c5eSopenharmony_citypedef struct { 2320b966c5eSopenharmony_ci uint8_t opcode; /* AVDT_SYNC_TO_BTC_LITE_REQ */ 2330b966c5eSopenharmony_ci uint8_t num_stream; 2340b966c5eSopenharmony_ci tAVDT_SYNC_TO_BTC_LITE_REQ_STREAM stream; 2350b966c5eSopenharmony_ci} tAVDT_SYNC_TO_BTC_LITE_REQ; 2360b966c5eSopenharmony_ci 2370b966c5eSopenharmony_citypedef struct { 2380b966c5eSopenharmony_ci uint8_t opcode; /* AVDT_SYNC_TO_BTC_LITE_RESP */ 2390b966c5eSopenharmony_ci uint8_t status; 2400b966c5eSopenharmony_ci} tAVDT_SYNC_TO_BTC_LITE_RESP; 2410b966c5eSopenharmony_ci 2420b966c5eSopenharmony_citypedef struct t_avdt_scb_sync_info { 2430b966c5eSopenharmony_ci uint8_t handle; /* SCB handle */ 2440b966c5eSopenharmony_ci BD_ADDR peer_addr; /* BD address of peer */ 2450b966c5eSopenharmony_ci uint16_t local_cid; /* Local CID */ 2460b966c5eSopenharmony_ci uint16_t peer_mtu; /* L2CAP mtu of the peer device */ 2470b966c5eSopenharmony_ci uint8_t mux_tsid_media; /* TSID for media transport session */ 2480b966c5eSopenharmony_ci uint16_t media_seq; /* media packet sequence number */ 2490b966c5eSopenharmony_ci} tAVDT_SCB_SYNC_INFO; 2500b966c5eSopenharmony_ci 2510b966c5eSopenharmony_citypedef struct t_avdt_sync_info { 2520b966c5eSopenharmony_ci uint8_t op_code; 2530b966c5eSopenharmony_ci uint8_t status; 2540b966c5eSopenharmony_ci tAVDT_SCB_SYNC_INFO scb_info; 2550b966c5eSopenharmony_ci} tAVDT_SYNC_INFO; 2560b966c5eSopenharmony_ci 2570b966c5eSopenharmony_citypedef union t_avdt_sync_msg { 2580b966c5eSopenharmony_ci uint8_t op_code; 2590b966c5eSopenharmony_ci tAVDT_SYNC_INFO sync_info; 2600b966c5eSopenharmony_ci tAVDT_SYNC_TO_BTC_LITE_REQ btc_sync_req; 2610b966c5eSopenharmony_ci tAVDT_SYNC_TO_BTC_LITE_RESP btc_sync_resp; 2620b966c5eSopenharmony_ci} tAVDT_SYNC_MSG; 2630b966c5eSopenharmony_ci 2640b966c5eSopenharmony_ci/******************************** 2650b966c5eSopenharmony_ci 2660b966c5eSopenharmony_ci BTA AV Sync Message 2670b966c5eSopenharmony_ci 2680b966c5eSopenharmony_ci********************************/ 2690b966c5eSopenharmony_ci 2700b966c5eSopenharmony_ci/* op_code for MM light stack */ 2710b966c5eSopenharmony_ci#define BTA_AV_SYNC_TO_LITE_REQ 0 2720b966c5eSopenharmony_ci#define BTA_AV_SYNC_TO_LITE_RESP 1 2730b966c5eSopenharmony_ci#define BTA_AV_STR_START_TO_LITE_REQ 2 2740b966c5eSopenharmony_ci#define BTA_AV_STR_START_TO_LITE_RESP 3 2750b966c5eSopenharmony_ci#define BTA_AV_STR_STOP_TO_LITE_REQ 4 2760b966c5eSopenharmony_ci#define BTA_AV_STR_STOP_TO_LITE_RESP 5 2770b966c5eSopenharmony_ci#define BTA_AV_STR_CLEANUP_TO_LITE_REQ 6 2780b966c5eSopenharmony_ci#define BTA_AV_STR_CLEANUP_TO_LITE_RESP 7 2790b966c5eSopenharmony_ci#define BTA_AV_STR_SUSPEND_TO_LITE_REQ 8 2800b966c5eSopenharmony_ci#define BTA_AV_STR_SUSPEND_TO_LITE_RESP 9 2810b966c5eSopenharmony_ci#define BTA_AV_SYNC_ERROR_RESP 10 2820b966c5eSopenharmony_ci 2830b966c5eSopenharmony_ci/* op_code for BTC light stack */ 2840b966c5eSopenharmony_ci#define A2DP_START_REQ 11 2850b966c5eSopenharmony_ci#define A2DP_START_RESP 12 2860b966c5eSopenharmony_ci#define A2DP_STOP_REQ 13 2870b966c5eSopenharmony_ci#define A2DP_STOP_RESP 14 2880b966c5eSopenharmony_ci#define A2DP_CLEANUP_REQ 15 2890b966c5eSopenharmony_ci#define A2DP_CLEANUP_RESP 16 2900b966c5eSopenharmony_ci#define A2DP_SUSPEND_REQ 17 2910b966c5eSopenharmony_ci#define A2DP_SUSPEND_RESP 18 2920b966c5eSopenharmony_ci 2930b966c5eSopenharmony_ci#define A2DP_JITTER_DONE_IND 41 /* For BTSNK */ 2940b966c5eSopenharmony_ci 2950b966c5eSopenharmony_ci#define AUDIO_CODEC_CONFIG_REQ 19 2960b966c5eSopenharmony_ci#define AUDIO_CODEC_CONFIG_RESP 20 2970b966c5eSopenharmony_ci#define AUDIO_CODEC_SET_BITRATE_REQ 21 2980b966c5eSopenharmony_ci#define AUDIO_CODEC_FLUSH_REQ 22 2990b966c5eSopenharmony_ci#define AUDIO_ROUTE_CONFIG_REQ 23 3000b966c5eSopenharmony_ci#define AUDIO_ROUTE_CONFIG_RESP 24 3010b966c5eSopenharmony_ci#define AUDIO_MIX_CONFIG_REQ 25 3020b966c5eSopenharmony_ci#define AUDIO_MIX_CONFIG_RESP 26 3030b966c5eSopenharmony_ci#define AUDIO_BURST_FRAMES_IND 27 3040b966c5eSopenharmony_ci#define AUDIO_BURST_END_IND 28 3050b966c5eSopenharmony_ci#define AUDIO_EQ_MODE_CONFIG_REQ 29 3060b966c5eSopenharmony_ci#define AUDIO_SCALE_CONFIG_REQ 30 3070b966c5eSopenharmony_ci 3080b966c5eSopenharmony_ci/* For TIVO, only applicable for I2S -> DAC */ 3090b966c5eSopenharmony_ci#define AUDIO_SUB_ROUTE_REQ 51 3100b966c5eSopenharmony_ci#define AUDIO_SUB_ROUTE_RESP 52 3110b966c5eSopenharmony_ci 3120b966c5eSopenharmony_citypedef struct { 3130b966c5eSopenharmony_ci uint8_t opcode; /* A2DP_START_REQ */ 3140b966c5eSopenharmony_ci uint16_t lcid; 3150b966c5eSopenharmony_ci uint16_t curr_mtu; 3160b966c5eSopenharmony_ci} tA2DP_START_REQ; 3170b966c5eSopenharmony_ci 3180b966c5eSopenharmony_citypedef struct { 3190b966c5eSopenharmony_ci uint8_t opcode; /* A2DP_STOP_REQ */ 3200b966c5eSopenharmony_ci uint16_t lcid; 3210b966c5eSopenharmony_ci} tA2DP_STOP_REQ; 3220b966c5eSopenharmony_ci 3230b966c5eSopenharmony_citypedef struct { 3240b966c5eSopenharmony_ci uint8_t opcode; /* A2DP_SUSPEND_REQ */ 3250b966c5eSopenharmony_ci uint16_t lcid; 3260b966c5eSopenharmony_ci} tA2DP_SUSPEND_REQ; 3270b966c5eSopenharmony_ci 3280b966c5eSopenharmony_citypedef struct { 3290b966c5eSopenharmony_ci uint8_t opcode; /* A2DP_CLEANUP_REQ */ 3300b966c5eSopenharmony_ci uint16_t lcid; 3310b966c5eSopenharmony_ci uint16_t curr_mtu; 3320b966c5eSopenharmony_ci} tA2DP_CLEANUP_REQ; 3330b966c5eSopenharmony_ci 3340b966c5eSopenharmony_citypedef struct { 3350b966c5eSopenharmony_ci uint8_t opcode; /* A2DP_START_RESP, A2DP_STOP_RESP, A2DP_CLEANUP_RESP, A2DP_SUSPEND_RESP */ 3360b966c5eSopenharmony_ci uint16_t lcid; 3370b966c5eSopenharmony_ci} tA2DP_GENERIC_RESP; 3380b966c5eSopenharmony_ci 3390b966c5eSopenharmony_ci#define AUDIO_CODEC_NONE 0x0000 3400b966c5eSopenharmony_ci#define AUDIO_CODEC_SBC_ENC 0x0001 3410b966c5eSopenharmony_ci#define AUDIO_CODEC_SBC_DEC 0x0002 3420b966c5eSopenharmony_ci#define AUDIO_CODEC_MP3_ENC 0x0004 3430b966c5eSopenharmony_ci#define AUDIO_CODEC_MP3_DEC 0x0008 3440b966c5eSopenharmony_ci#define AUDIO_CODEC_AAC_ENC 0x0010 3450b966c5eSopenharmony_ci#define AUDIO_CODEC_AAC_DEC 0x0020 3460b966c5eSopenharmony_ci#define AUDIO_CODEC_AAC_PLUS_ENC 0x0040 3470b966c5eSopenharmony_ci#define AUDIO_CODEC_AAC_PLUS_DEC 0x0080 3480b966c5eSopenharmony_ci#define AUDIO_CODEC_MP2_ENC 0x0100 3490b966c5eSopenharmony_ci#define AUDIO_CODEC_MP2_DEC 0x0200 3500b966c5eSopenharmony_ci#define AUDIO_CODEC_MP2_5_ENC 0x0400 3510b966c5eSopenharmony_ci#define AUDIO_CODEC_MP2_5_DEC 0x0800 3520b966c5eSopenharmony_ci 3530b966c5eSopenharmony_ci/* SBC CODEC Parameters */ 3540b966c5eSopenharmony_ci 3550b966c5eSopenharmony_ci#define CODEC_INFO_SBC_SF_16K 0x00 3560b966c5eSopenharmony_ci#define CODEC_INFO_SBC_SF_32K 0x01 3570b966c5eSopenharmony_ci#define CODEC_INFO_SBC_SF_44K 0x02 3580b966c5eSopenharmony_ci#define CODEC_INFO_SBC_SF_48K 0x03 3590b966c5eSopenharmony_ci 3600b966c5eSopenharmony_ci#define CODEC_INFO_SBC_BLOCK_4 0x00 3610b966c5eSopenharmony_ci#define CODEC_INFO_SBC_BLOCK_8 0x01 3620b966c5eSopenharmony_ci#define CODEC_INFO_SBC_BLOCK_12 0x02 3630b966c5eSopenharmony_ci#define CODEC_INFO_SBC_BLOCK_16 0x03 3640b966c5eSopenharmony_ci 3650b966c5eSopenharmony_ci#define CODEC_INFO_SBC_CH_MONO 0x00 3660b966c5eSopenharmony_ci#define CODEC_INFO_SBC_CH_DUAL 0x01 3670b966c5eSopenharmony_ci#define CODEC_INFO_SBC_CH_STEREO 0x02 3680b966c5eSopenharmony_ci#define CODEC_INFO_SBC_CH_JS 0x03 3690b966c5eSopenharmony_ci 3700b966c5eSopenharmony_ci#define CODEC_INFO_SBC_ALLOC_LOUDNESS 0x00 3710b966c5eSopenharmony_ci#define CODEC_INFO_SBC_ALLOC_SNR 0x01 3720b966c5eSopenharmony_ci 3730b966c5eSopenharmony_ci#define CODEC_INFO_SBC_SUBBAND_4 0x00 3740b966c5eSopenharmony_ci#define CODEC_INFO_SBC_SUBBAND_8 0x01 3750b966c5eSopenharmony_ci 3760b966c5eSopenharmony_ci/* MPEG audio version ID */ 3770b966c5eSopenharmony_ci#define CODEC_INFO_MP25_ID 0x00 3780b966c5eSopenharmony_ci#define CODEC_INFO_RESERVE 0x01 3790b966c5eSopenharmony_ci#define CODEC_INFO_MP2_ID 0x02 3800b966c5eSopenharmony_ci#define CODEC_INFO_MP3_ID 0x03 3810b966c5eSopenharmony_ci 3820b966c5eSopenharmony_ci#define CODEC_INFO_MP3_PROTECTION_ON 0x00 3830b966c5eSopenharmony_ci#define CODEC_INFO_MP3_PROTECTION_OFF 0x01 3840b966c5eSopenharmony_ci 3850b966c5eSopenharmony_ci#define CODEC_INFO_MP3_BR_IDX_FREE 0x00 3860b966c5eSopenharmony_ci#define CODEC_INFO_MP3_BR_IDX_32K 0x01 3870b966c5eSopenharmony_ci#define CODEC_INFO_MP3_BR_IDX_40K 0x02 3880b966c5eSopenharmony_ci#define CODEC_INFO_MP3_BR_IDX_48K 0x03 3890b966c5eSopenharmony_ci#define CODEC_INFO_MP3_BR_IDX_56K 0x04 3900b966c5eSopenharmony_ci#define CODEC_INFO_MP3_BR_IDX_64K 0x05 3910b966c5eSopenharmony_ci#define CODEC_INFO_MP3_BR_IDX_80K 0x06 3920b966c5eSopenharmony_ci#define CODEC_INFO_MP3_BR_IDX_96K 0x07 3930b966c5eSopenharmony_ci#define CODEC_INFO_MP3_BR_IDX_112K 0x08 3940b966c5eSopenharmony_ci#define CODEC_INFO_MP3_BR_IDX_128K 0x09 3950b966c5eSopenharmony_ci#define CODEC_INFO_MP3_BR_IDX_160K 0x0A 3960b966c5eSopenharmony_ci#define CODEC_INFO_MP3_BR_IDX_192K 0x0B 3970b966c5eSopenharmony_ci#define CODEC_INFO_MP3_BR_IDX_224K 0x0C 3980b966c5eSopenharmony_ci#define CODEC_INFO_MP3_BR_IDX_256K 0x0D 3990b966c5eSopenharmony_ci#define CODEC_INFO_MP3_BR_IDX_320K 0x0E 4000b966c5eSopenharmony_ci 4010b966c5eSopenharmony_ci#define CODEC_INFO_MP3_SF_44K 0x00 4020b966c5eSopenharmony_ci#define CODEC_INFO_MP3_SF_48K 0x01 4030b966c5eSopenharmony_ci#define CODEC_INFO_MP3_SF_32K 0x02 4040b966c5eSopenharmony_ci 4050b966c5eSopenharmony_ci#define CODEC_INFO_MP3_MODE_STEREO 0x00 4060b966c5eSopenharmony_ci#define CODEC_INFO_MP3_MODE_JS 0x01 4070b966c5eSopenharmony_ci#define CODEC_INFO_MP3_MODE_DUAL 0x02 4080b966c5eSopenharmony_ci#define CODEC_INFO_MP3_MODE_SINGLE 0x03 4090b966c5eSopenharmony_ci 4100b966c5eSopenharmony_ci/* layer 3, type of joint stereo coding method (intensity and ms) */ 4110b966c5eSopenharmony_ci#define CODEC_INFO_MP3_MODE_EXT_OFF_OFF 0x00 4120b966c5eSopenharmony_ci#define CODEC_INFO_MP3_MODE_EXT_ON_OFF 0x01 4130b966c5eSopenharmony_ci#define CODEC_INFO_MP3_MODE_EXT_OFF_ON 0x02 4140b966c5eSopenharmony_ci#define CODEC_INFO_MP3_MODE_EXT_ON_ON 0x03 4150b966c5eSopenharmony_ci 4160b966c5eSopenharmony_ci#define CODEC_INFO_MP2_PROTECTION_ON 0x00 4170b966c5eSopenharmony_ci#define CODEC_INFO_MP2_PROTECTION_OFF 0x01 4180b966c5eSopenharmony_ci 4190b966c5eSopenharmony_ci#define CODEC_INFO_MP2_BR_IDX_FREE 0x00 4200b966c5eSopenharmony_ci#define CODEC_INFO_MP2_BR_IDX_8K 0x01 4210b966c5eSopenharmony_ci#define CODEC_INFO_MP2_BR_IDX_16K 0x02 4220b966c5eSopenharmony_ci#define CODEC_INFO_MP2_BR_IDX_24K 0x03 4230b966c5eSopenharmony_ci#define CODEC_INFO_MP2_BR_IDX_32K 0x04 4240b966c5eSopenharmony_ci#define CODEC_INFO_MP2_BR_IDX_40K 0x05 4250b966c5eSopenharmony_ci#define CODEC_INFO_MP2_BR_IDX_48K 0x06 4260b966c5eSopenharmony_ci#define CODEC_INFO_MP2_BR_IDX_56K 0x07 4270b966c5eSopenharmony_ci#define CODEC_INFO_MP2_BR_IDX_64K 0x08 4280b966c5eSopenharmony_ci#define CODEC_INFO_MP2_BR_IDX_80K 0x09 4290b966c5eSopenharmony_ci#define CODEC_INFO_MP2_BR_IDX_96K 0x0A 4300b966c5eSopenharmony_ci#define CODEC_INFO_MP2_BR_IDX_112K 0x0B 4310b966c5eSopenharmony_ci#define CODEC_INFO_MP2_BR_IDX_128K 0x0C 4320b966c5eSopenharmony_ci#define CODEC_INFO_MP2_BR_IDX_144K 0x0D 4330b966c5eSopenharmony_ci#define CODEC_INFO_MP2_BR_IDX_160K 0x0E 4340b966c5eSopenharmony_ci 4350b966c5eSopenharmony_ci#define CODEC_INFO_MP2_SF_22K 0x00 4360b966c5eSopenharmony_ci#define CODEC_INFO_MP2_SF_24K 0x01 4370b966c5eSopenharmony_ci#define CODEC_INFO_MP2_SF_16K 0x02 4380b966c5eSopenharmony_ci 4390b966c5eSopenharmony_ci#define CODEC_INFO_MP2_MODE_STEREO 0x00 4400b966c5eSopenharmony_ci#define CODEC_INFO_MP2_MODE_JS 0x01 4410b966c5eSopenharmony_ci#define CODEC_INFO_MP2_MODE_DUAL 0x02 4420b966c5eSopenharmony_ci#define CODEC_INFO_MP2_MODE_SINGLE 0x03 4430b966c5eSopenharmony_ci 4440b966c5eSopenharmony_ci/* layer 3, type of joint stereo coding method (intensity and ms) */ 4450b966c5eSopenharmony_ci#define CODEC_INFO_MP2_MODE_EXT_OFF_OFF 0x00 4460b966c5eSopenharmony_ci#define CODEC_INFO_MP2_MODE_EXT_ON_OFF 0x01 4470b966c5eSopenharmony_ci#define CODEC_INFO_MP2_MODE_EXT_OFF_ON 0x02 4480b966c5eSopenharmony_ci#define CODEC_INFO_MP2_MODE_EXT_ON_ON 0x03 4490b966c5eSopenharmony_ci 4500b966c5eSopenharmony_ci#define CODEC_INFO_MP2_SAMPLE_PER_FRAME 576 4510b966c5eSopenharmony_ci 4520b966c5eSopenharmony_ci/* mpeg 2.5 layer 3 decoder */ 4530b966c5eSopenharmony_ci 4540b966c5eSopenharmony_ci#define CODEC_INFO_MP25_PROTECTION_ON 0x00 4550b966c5eSopenharmony_ci#define CODEC_INFO_MP25_PROTECTION_OFF 0x01 4560b966c5eSopenharmony_ci 4570b966c5eSopenharmony_ci#define CODEC_INFO_MP25_BR_IDX_FREE 0x00 4580b966c5eSopenharmony_ci#define CODEC_INFO_MP25_BR_IDX_8K 0x01 4590b966c5eSopenharmony_ci#define CODEC_INFO_MP25_BR_IDX_16K 0x02 4600b966c5eSopenharmony_ci#define CODEC_INFO_MP25_BR_IDX_24K 0x03 4610b966c5eSopenharmony_ci#define CODEC_INFO_MP25_BR_IDX_32K 0x04 4620b966c5eSopenharmony_ci#define CODEC_INFO_MP25_BR_IDX_40K 0x05 4630b966c5eSopenharmony_ci#define CODEC_INFO_MP25_BR_IDX_48K 0x06 4640b966c5eSopenharmony_ci#define CODEC_INFO_MP25_BR_IDX_56K 0x07 4650b966c5eSopenharmony_ci#define CODEC_INFO_MP25_BR_IDX_64K 0x08 4660b966c5eSopenharmony_ci#define CODEC_INFO_MP25_BR_IDX_80K 0x09 4670b966c5eSopenharmony_ci#define CODEC_INFO_MP25_BR_IDX_96K 0x0A 4680b966c5eSopenharmony_ci#define CODEC_INFO_MP25_BR_IDX_112K 0x0B 4690b966c5eSopenharmony_ci#define CODEC_INFO_MP25_BR_IDX_128K 0x0C 4700b966c5eSopenharmony_ci#define CODEC_INFO_MP25_BR_IDX_144K 0x0D 4710b966c5eSopenharmony_ci#define CODEC_INFO_MP25_BR_IDX_160K 0x0E 4720b966c5eSopenharmony_ci 4730b966c5eSopenharmony_ci#define CODEC_INFO_MP25_SF_11K 0x00 4740b966c5eSopenharmony_ci#define CODEC_INFO_MP25_SF_12K 0x01 4750b966c5eSopenharmony_ci#define CODEC_INFO_MP25_SF_8K 0x02 4760b966c5eSopenharmony_ci 4770b966c5eSopenharmony_ci#define CODEC_INFO_MP25_MODE_STEREO 0x00 4780b966c5eSopenharmony_ci#define CODEC_INFO_MP25_MODE_JS 0x01 4790b966c5eSopenharmony_ci#define CODEC_INFO_MP25_MODE_DUAL 0x02 4800b966c5eSopenharmony_ci#define CODEC_INFO_MP25_MODE_SINGLE 0x03 4810b966c5eSopenharmony_ci 4820b966c5eSopenharmony_ci/* layer 3, type of joint stereo coding method (intensity and ms) */ 4830b966c5eSopenharmony_ci#define CODEC_INFO_MP25_MODE_EXT_OFF_OFF 0x00 4840b966c5eSopenharmony_ci#define CODEC_INFO_MP25_MODE_EXT_ON_OFF 0x01 4850b966c5eSopenharmony_ci#define CODEC_INFO_MP25_MODE_EXT_OFF_ON 0x02 4860b966c5eSopenharmony_ci#define CODEC_INFO_MP25_MODE_EXT_ON_ON 0x03 4870b966c5eSopenharmony_ci 4880b966c5eSopenharmony_ci#define CODEC_INFO_MP25_SAMPLE_PER_FRAME 576 4890b966c5eSopenharmony_ci 4900b966c5eSopenharmony_ci/* AAC/AAC+ CODEC Parameters */ 4910b966c5eSopenharmony_ci#define CODEC_INFO_AAC_SF_IDX_96K 0x0 4920b966c5eSopenharmony_ci#define CODEC_INFO_AAC_SF_IDX_88K 0x1 4930b966c5eSopenharmony_ci#define CODEC_INFO_AAC_SF_IDX_64K 0x2 4940b966c5eSopenharmony_ci#define CODEC_INFO_AAC_SF_IDX_48K 0x3 4950b966c5eSopenharmony_ci#define CODEC_INFO_AAC_SF_IDX_44K 0x4 4960b966c5eSopenharmony_ci#define CODEC_INFO_AAC_SF_IDX_32K 0x5 4970b966c5eSopenharmony_ci#define CODEC_INFO_AAC_SF_IDX_24K 0x6 4980b966c5eSopenharmony_ci#define CODEC_INFO_AAC_SF_IDX_22K 0x7 4990b966c5eSopenharmony_ci#define CODEC_INFO_AAC_SF_IDX_16K 0x8 5000b966c5eSopenharmony_ci#define CODEC_INFO_AAC_SF_IDX_12K 0x9 5010b966c5eSopenharmony_ci#define CODEC_INFO_AAC_SF_IDX_11K 0xA 5020b966c5eSopenharmony_ci#define CODEC_INFO_AAC_SF_IDX_08K 0xB 5030b966c5eSopenharmony_ci#define CODEC_INFO_AAC_SF_IDX_RESERVE 0xC 5040b966c5eSopenharmony_ci 5050b966c5eSopenharmony_ci#define CODEC_INFO_AAC_BR_RATE_48K 288000 5060b966c5eSopenharmony_ci#define CODEC_INFO_AAC_BR_RATE_44K 264600 5070b966c5eSopenharmony_ci#define CODEC_INFO_AAC_BR_RATE_32K 192000 5080b966c5eSopenharmony_ci 5090b966c5eSopenharmony_ci#define CODEC_INFO_AAC_1_CH 1 /* center front speaker */ 5100b966c5eSopenharmony_ci#define CODEC_INFO_AAC_2_CH 2 /* left, right front speaker */ 5110b966c5eSopenharmony_ci#define CODEC_INFO_AAC_3_CH 3 /* center front speaker, left right front speaker */ 5120b966c5eSopenharmony_ci#define CODEC_INFO_AAC_4_CH 4 /* center/rear front speaker, left/right front speaker */ 5130b966c5eSopenharmony_ci#define CODEC_INFO_AAC_5_CH 5 /* center, left, right front speaker, left/right surround */ 5140b966c5eSopenharmony_ci#define CODEC_INFO_AAC_6_CH 6 /* center, left, right front speaker, left/right surround, LFE */ 5150b966c5eSopenharmony_ci#define CODEC_INFO_AAC_7_CH 7 /* (left, right)center/left,right front speaker, left/right surround, LFE */ 5160b966c5eSopenharmony_ci 5170b966c5eSopenharmony_citypedef struct { 5180b966c5eSopenharmony_ci uint8_t sampling_freq; 5190b966c5eSopenharmony_ci uint8_t channel_mode; 5200b966c5eSopenharmony_ci uint8_t block_length; 5210b966c5eSopenharmony_ci uint8_t num_subbands; 5220b966c5eSopenharmony_ci uint8_t alloc_method; 5230b966c5eSopenharmony_ci uint8_t bitpool_size; /* 2 - 250 */ 5240b966c5eSopenharmony_ci} tCODEC_INFO_SBC; 5250b966c5eSopenharmony_ci 5260b966c5eSopenharmony_citypedef struct { 5270b966c5eSopenharmony_ci uint8_t ch_mode; 5280b966c5eSopenharmony_ci uint8_t sampling_freq; 5290b966c5eSopenharmony_ci uint8_t bitrate_index; /* 0 - 14 */ 5300b966c5eSopenharmony_ci} tCODEC_INFO_MP3; 5310b966c5eSopenharmony_ci 5320b966c5eSopenharmony_citypedef struct { 5330b966c5eSopenharmony_ci uint8_t ch_mode; 5340b966c5eSopenharmony_ci uint8_t sampling_freq; 5350b966c5eSopenharmony_ci uint8_t bitrate_index; /* 0 - 14 */ 5360b966c5eSopenharmony_ci} tCODEC_INFO_MP2; 5370b966c5eSopenharmony_ci 5380b966c5eSopenharmony_citypedef struct { 5390b966c5eSopenharmony_ci uint8_t ch_mode; 5400b966c5eSopenharmony_ci uint8_t sampling_freq; 5410b966c5eSopenharmony_ci uint8_t bitrate_index; /* 0 - 14 */ 5420b966c5eSopenharmony_ci} tCODEC_INFO_MP2_5; 5430b966c5eSopenharmony_ci 5440b966c5eSopenharmony_citypedef struct { 5450b966c5eSopenharmony_ci uint16_t sampling_freq; 5460b966c5eSopenharmony_ci uint8_t channel_mode; /* 0x02:mono, 0x01:dual */ 5470b966c5eSopenharmony_ci uint32_t bitrate; /* 0 - 320K */ 5480b966c5eSopenharmony_ci uint32_t sbr_profile; /* 1: ON, 0: OFF */ 5490b966c5eSopenharmony_ci} tCODEC_INFO_AAC; 5500b966c5eSopenharmony_ci 5510b966c5eSopenharmony_citypedef union { 5520b966c5eSopenharmony_ci tCODEC_INFO_SBC sbc; 5530b966c5eSopenharmony_ci tCODEC_INFO_MP3 mp3; 5540b966c5eSopenharmony_ci tCODEC_INFO_MP2 mp2; 5550b966c5eSopenharmony_ci tCODEC_INFO_MP2_5 mp2_5; 5560b966c5eSopenharmony_ci tCODEC_INFO_AAC aac; 5570b966c5eSopenharmony_ci} tCODEC_INFO; 5580b966c5eSopenharmony_ci 5590b966c5eSopenharmony_citypedef struct { 5600b966c5eSopenharmony_ci uint8_t opcode; /* AUDIO_CODEC_CONFIG_REQ */ 5610b966c5eSopenharmony_ci uint16_t codec_type; 5620b966c5eSopenharmony_ci tCODEC_INFO codec_info; 5630b966c5eSopenharmony_ci} tAUDIO_CODEC_CONFIG_REQ; 5640b966c5eSopenharmony_ci 5650b966c5eSopenharmony_ci#define AUDIO_CONFIG_SUCCESS 0x00 5660b966c5eSopenharmony_ci#define AUDIO_CONFIG_NOT_SUPPORTED 0x01 5670b966c5eSopenharmony_ci#define AUDIO_CONFIG_FAIL_OUT_OF_MEMORY 0x02 5680b966c5eSopenharmony_ci#define AUDIO_CONFIG_FAIL_CODEC_USED 0x03 5690b966c5eSopenharmony_ci#define AUDIO_CONFIG_FAIL_ROUTE 0x04 5700b966c5eSopenharmony_ci 5710b966c5eSopenharmony_citypedef struct { 5720b966c5eSopenharmony_ci uint8_t opcode; /* AUDIO_CODEC_CONFIG_RESP */ 5730b966c5eSopenharmony_ci uint8_t status; 5740b966c5eSopenharmony_ci} tAUDIO_CODEC_CONFIG_RESP; 5750b966c5eSopenharmony_ci 5760b966c5eSopenharmony_citypedef struct { 5770b966c5eSopenharmony_ci uint8_t opcode; /* AUDIO_CODEC_SET_BITRATE_REQ */ 5780b966c5eSopenharmony_ci uint16_t codec_type; 5790b966c5eSopenharmony_ci union { 5800b966c5eSopenharmony_ci uint8_t sbc; 5810b966c5eSopenharmony_ci uint8_t mp3; 5820b966c5eSopenharmony_ci uint32_t aac; 5830b966c5eSopenharmony_ci } codec_bitrate; 5840b966c5eSopenharmony_ci} tAUDIO_CODEC_SET_BITRATE_REQ; 5850b966c5eSopenharmony_ci 5860b966c5eSopenharmony_ci#define AUDIO_ROUTE_SRC_FMRX 0x00 5870b966c5eSopenharmony_ci#define AUDIO_ROUTE_SRC_I2S 0x01 5880b966c5eSopenharmony_ci#define AUDIO_ROUTE_SRC_ADC 0x02 5890b966c5eSopenharmony_ci#define AUDIO_ROUTE_SRC_HOST 0x03 5900b966c5eSopenharmony_ci#define AUDIO_ROUTE_SRC_PTU 0x04 5910b966c5eSopenharmony_ci#define AUDIO_ROUTE_SRC_BTSNK 0x05 5920b966c5eSopenharmony_ci#define AUDIO_ROUTE_SRC_NONE 0x80 5930b966c5eSopenharmony_ci#define MAX_AUDIO_ROUTE_SRC 6 5940b966c5eSopenharmony_ci 5950b966c5eSopenharmony_ci#define AUDIO_ROUTE_MIX_NONE 0x00 5960b966c5eSopenharmony_ci#define AUDIO_ROUTE_MIX_HOST 0x01 5970b966c5eSopenharmony_ci#define AUDIO_ROUTE_MIX_PCM 0x02 5980b966c5eSopenharmony_ci#define AUDIO_ROUTE_MIX_CHIRP 0x03 5990b966c5eSopenharmony_ci#define AUDIO_ROUTE_MIX_I2S 0x04 6000b966c5eSopenharmony_ci#define AUDIO_ROUTE_MIX_ADC 0x05 6010b966c5eSopenharmony_ci#define AUDIO_ROUTE_MIX_RESERVED 0x06 6020b966c5eSopenharmony_ci#define MAX_AUDIO_ROUTE_MIX 7 6030b966c5eSopenharmony_ci 6040b966c5eSopenharmony_ci#define AUDIO_ROUTE_OUT_NONE 0x0000 6050b966c5eSopenharmony_ci#define AUDIO_ROUTE_OUT_BTA2DP 0x0001 6060b966c5eSopenharmony_ci#define AUDIO_ROUTE_OUT_FMTX 0x0002 6070b966c5eSopenharmony_ci#define AUDIO_ROUTE_OUT_BTSCO 0x0004 6080b966c5eSopenharmony_ci#define AUDIO_ROUTE_OUT_HOST 0x0008 6090b966c5eSopenharmony_ci#define AUDIO_ROUTE_OUT_DAC 0x0010 6100b966c5eSopenharmony_ci#define AUDIO_ROUTE_OUT_I2S 0x0020 6110b966c5eSopenharmony_ci#define AUDIO_ROUTE_OUT_BTA2DP_DAC 0x0040 6120b966c5eSopenharmony_ci#define AUDIO_ROUTE_OUT_BTA2DP_I2S 0x0080 6130b966c5eSopenharmony_ci#define AUDIO_ROUTE_OUT_BTSCO_DAC 0x0100 6140b966c5eSopenharmony_ci#define AUDIO_ROUTE_OUT_BTSCO_I2S 0x0200 6150b966c5eSopenharmony_ci#define AUDIO_ROUTE_OUT_HOST_BTA2DP 0x0400 6160b966c5eSopenharmony_ci#define AUDIO_ROUTE_OUT_HOST_BTSCO 0x0800 6170b966c5eSopenharmony_ci#define AUDIO_ROUTE_OUT_HOST_DAC 0x1000 6180b966c5eSopenharmony_ci#define AUDIO_ROUTE_OUT_HOST_I2S 0x2000 6190b966c5eSopenharmony_ci#define AUDIO_ROUTE_OUT_DAC_I2S 0x4000 6200b966c5eSopenharmony_ci#define AUDIO_ROUTE_OUT_RESERVED_2 0x8000 6210b966c5eSopenharmony_ci 6220b966c5eSopenharmony_ci#define MAX_AUDIO_SINGLE_ROUTE_OUT 6 6230b966c5eSopenharmony_ci#define MAX_AUDIO_MULTI_ROUTE_OUT 16 6240b966c5eSopenharmony_ci 6250b966c5eSopenharmony_ci#define AUDIO_ROUTE_SF_8K 0x00 6260b966c5eSopenharmony_ci#define AUDIO_ROUTE_SF_16K 0x01 6270b966c5eSopenharmony_ci#define AUDIO_ROUTE_SF_32K 0x02 6280b966c5eSopenharmony_ci#define AUDIO_ROUTE_SF_44_1K 0x03 6290b966c5eSopenharmony_ci#define AUDIO_ROUTE_SF_48K 0x04 6300b966c5eSopenharmony_ci#define AUDIO_ROUTE_SF_11K 0x05 6310b966c5eSopenharmony_ci#define AUDIO_ROUTE_SF_12K 0x06 6320b966c5eSopenharmony_ci#define AUDIO_ROUTE_SF_22K 0x07 6330b966c5eSopenharmony_ci#define AUDIO_ROUTE_SF_24K 0x08 6340b966c5eSopenharmony_ci#define AUDIO_ROUTE_SF_NA 0xFF 6350b966c5eSopenharmony_ci 6360b966c5eSopenharmony_ci#define AUDIO_ROUTE_EQ_BASS_BOOST 0x00 6370b966c5eSopenharmony_ci#define AUDIO_ROUTE_EQ_CLASSIC 0x01 6380b966c5eSopenharmony_ci#define AUDIO_ROUTE_EQ_JAZZ 0x02 6390b966c5eSopenharmony_ci#define AUDIO_ROUTE_EQ_LIVE 0x03 6400b966c5eSopenharmony_ci#define AUDIO_ROUTE_EQ_NORMAL 0x04 6410b966c5eSopenharmony_ci#define AUDIO_ROUTE_EQ_ROCK 0x05 6420b966c5eSopenharmony_ci#define AUDIO_ROUTE_EQ_BYPASS 0x06 6430b966c5eSopenharmony_ci 6440b966c5eSopenharmony_ci#define AUDIO_ROUTE_DIGITAL_VOLUME_CONTROL 0x07 6450b966c5eSopenharmony_ci 6460b966c5eSopenharmony_ci#define AUDIO_ROUTE_EQ_CONFIG_GAIN 0xFF /* Custion Gain Config */ 6470b966c5eSopenharmony_ci 6480b966c5eSopenharmony_citypedef struct { 6490b966c5eSopenharmony_ci uint8_t opcode; /* AUDIO_ROUTE_CONFIG_REQ */ 6500b966c5eSopenharmony_ci uint8_t src; 6510b966c5eSopenharmony_ci uint8_t src_sf; 6520b966c5eSopenharmony_ci uint8_t out; 6530b966c5eSopenharmony_ci uint8_t out_codec_sf; 6540b966c5eSopenharmony_ci uint8_t out_i2s_sf; 6550b966c5eSopenharmony_ci uint8_t eq_mode; 6560b966c5eSopenharmony_ci} tAUDIO_ROUTE_CONFIG_REQ; 6570b966c5eSopenharmony_ci 6580b966c5eSopenharmony_citypedef struct { 6590b966c5eSopenharmony_ci uint8_t opcode; /* AUDIO_ROUTE_CONFIG_RESP */ 6600b966c5eSopenharmony_ci uint8_t status; 6610b966c5eSopenharmony_ci} tAUDIO_ROUTE_CONFIG_RESP; 6620b966c5eSopenharmony_ci 6630b966c5eSopenharmony_citypedef struct { 6640b966c5eSopenharmony_ci uint16_t amp[2]; /* left/right 15 bit amplitude value */ 6650b966c5eSopenharmony_ci uint16_t tone[2]; /* left/right 12 bit frequency 0 - 4096Hz */ 6660b966c5eSopenharmony_ci uint16_t mark[2]; /* left/right 16 bit mark time 0 - 65535ms */ 6670b966c5eSopenharmony_ci uint16_t space[2]; /* left/right 16 bit space time 0 - 65535ms */ 6680b966c5eSopenharmony_ci} tCHIRP_CONFIG; 6690b966c5eSopenharmony_ci 6700b966c5eSopenharmony_citypedef struct { 6710b966c5eSopenharmony_ci uint8_t pri_l; /* Primary Left scale : 0 ~ 255 */ 6720b966c5eSopenharmony_ci uint8_t mix_l; /* Mixing Left scale : 0 ~ 255 */ 6730b966c5eSopenharmony_ci uint8_t pri_r; /* Primary Right scale : 0 ~ 255 */ 6740b966c5eSopenharmony_ci uint8_t mix_r; /* Mixing Right scale : 0 ~ 255 */ 6750b966c5eSopenharmony_ci} tMIX_SCALE_CONFIG; 6760b966c5eSopenharmony_ci 6770b966c5eSopenharmony_ci/* For custon equalizer gain configuration */ 6780b966c5eSopenharmony_citypedef struct { 6790b966c5eSopenharmony_ci uint32_t audio_l_g0; /* IIR biquad filter left ch gain 0 */ 6800b966c5eSopenharmony_ci uint32_t audio_l_g1; /* IIR biquad filter left ch gain 1 */ 6810b966c5eSopenharmony_ci uint32_t audio_l_g2; /* IIR biquad filter left ch gain 2 */ 6820b966c5eSopenharmony_ci uint32_t audio_l_g3; /* IIR biquad filter left ch gain 3 */ 6830b966c5eSopenharmony_ci uint32_t audio_l_g4; /* IIR biquad filter left ch gain 4 */ 6840b966c5eSopenharmony_ci uint32_t audio_l_gl; /* IIR biquad filter left ch global gain */ 6850b966c5eSopenharmony_ci uint32_t audio_r_g0; /* IIR biquad filter left ch gain 0 */ 6860b966c5eSopenharmony_ci uint32_t audio_r_g1; /* IIR biquad filter left ch gain 1 */ 6870b966c5eSopenharmony_ci uint32_t audio_r_g2; /* IIR biquad filter left ch gain 2 */ 6880b966c5eSopenharmony_ci uint32_t audio_r_g3; /* IIR biquad filter left ch gain 3 */ 6890b966c5eSopenharmony_ci uint32_t audio_r_g4; /* IIR biquad filter left ch gain 4 */ 6900b966c5eSopenharmony_ci uint32_t audio_r_gl; /* IIR biquad filter left ch global gain */ 6910b966c5eSopenharmony_ci} tEQ_GAIN_CONFIG; 6920b966c5eSopenharmony_ci 6930b966c5eSopenharmony_citypedef struct { 6940b966c5eSopenharmony_ci uint8_t opcode; /* AUDIO_MIX_CONFIG_REQ */ 6950b966c5eSopenharmony_ci uint8_t mix_src; 6960b966c5eSopenharmony_ci uint8_t mix_src_sf; 6970b966c5eSopenharmony_ci tMIX_SCALE_CONFIG mix_scale; 6980b966c5eSopenharmony_ci tCHIRP_CONFIG chirp_config; 6990b966c5eSopenharmony_ci} tAUDIO_MIX_CONFIG_REQ; 7000b966c5eSopenharmony_ci 7010b966c5eSopenharmony_citypedef struct { 7020b966c5eSopenharmony_ci uint8_t opcode; /* AUDIO_MIX_CONFIG_RESP */ 7030b966c5eSopenharmony_ci uint8_t status; 7040b966c5eSopenharmony_ci} tAUDIO_MIX_CONFIG_RESP; 7050b966c5eSopenharmony_ci 7060b966c5eSopenharmony_citypedef struct { 7070b966c5eSopenharmony_ci uint8_t opcode; /* AUDIO_BURST_FRAMES_IND */ 7080b966c5eSopenharmony_ci uint32_t burst_size; /* in bytes */ 7090b966c5eSopenharmony_ci} tAUDIO_BURST_FRAMES_IND; 7100b966c5eSopenharmony_ci 7110b966c5eSopenharmony_citypedef struct { 7120b966c5eSopenharmony_ci uint8_t opcode; /* AUDIO_BURST_END_IND */ 7130b966c5eSopenharmony_ci} tAUDIO_BURST_END_IND; 7140b966c5eSopenharmony_ci 7150b966c5eSopenharmony_citypedef struct { 7160b966c5eSopenharmony_ci uint8_t opcode; /* AUDIO_CODEC_FLUSH_REQ */ 7170b966c5eSopenharmony_ci} tAUDIO_CODEC_FLUSH_REQ; 7180b966c5eSopenharmony_ci 7190b966c5eSopenharmony_citypedef struct { 7200b966c5eSopenharmony_ci uint8_t opcode; /* AUDIO_EQ_MODE_CONFIG_REQ */ 7210b966c5eSopenharmony_ci uint8_t eq_mode; 7220b966c5eSopenharmony_ci tEQ_GAIN_CONFIG filter_gain; /* Valid only when eq_mode is 0xFF */ 7230b966c5eSopenharmony_ci} tAUDIO_EQ_MODE_CONFIG_REQ; 7240b966c5eSopenharmony_ci 7250b966c5eSopenharmony_citypedef struct { 7260b966c5eSopenharmony_ci uint8_t opcode; /* AUDIO_SCALE_CONFIG_REQ */ 7270b966c5eSopenharmony_ci tMIX_SCALE_CONFIG mix_scale; 7280b966c5eSopenharmony_ci} tAUDIO_SCALE_CONFIG_REQ; 7290b966c5eSopenharmony_ci 7300b966c5eSopenharmony_ci#pragma pack(pop) /* pop saved alignment to stack */ 7310b966c5eSopenharmony_ci 7320b966c5eSopenharmony_ci#endif /* BT_VENDOR_UIPC_MSG_H */ 733