10b966c5eSopenharmony_ci/******************************************************************************
20b966c5eSopenharmony_ci *
30b966c5eSopenharmony_ci *  Copyright (C) 2009-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 *  Filename:      bt_vendor_brcm.h
220b966c5eSopenharmony_ci *
230b966c5eSopenharmony_ci *  Description:   A wrapper header file of bt_vendor_lib.h
240b966c5eSopenharmony_ci *
250b966c5eSopenharmony_ci *                 Contains definitions specific for interfacing with Broadcom
260b966c5eSopenharmony_ci *                 Bluetooth chipsets
270b966c5eSopenharmony_ci *
280b966c5eSopenharmony_ci ******************************************************************************/
290b966c5eSopenharmony_ci
300b966c5eSopenharmony_ci#ifndef BT_VENDOR_BRCM_H
310b966c5eSopenharmony_ci#define BT_VENDOR_BRCM_H
320b966c5eSopenharmony_ci
330b966c5eSopenharmony_ci#include "bt_vendor_lib.h"
340b966c5eSopenharmony_ci
350b966c5eSopenharmony_ci/******************************************************************************
360b966c5eSopenharmony_ci**  Constants & Macros
370b966c5eSopenharmony_ci******************************************************************************/
380b966c5eSopenharmony_ci
390b966c5eSopenharmony_ci#ifndef FALSE
400b966c5eSopenharmony_ci#define FALSE 0
410b966c5eSopenharmony_ci#endif
420b966c5eSopenharmony_ci
430b966c5eSopenharmony_ci#ifndef TRUE
440b966c5eSopenharmony_ci#define TRUE (!FALSE)
450b966c5eSopenharmony_ci#endif
460b966c5eSopenharmony_ci
470b966c5eSopenharmony_ci#ifndef VENDOR_LIB_RUNTIME_TUNING_ENABLED
480b966c5eSopenharmony_ci#define VENDOR_LIB_RUNTIME_TUNING_ENABLED FALSE
490b966c5eSopenharmony_ci#endif
500b966c5eSopenharmony_ci
510b966c5eSopenharmony_ci/* Run-time configuration file */
520b966c5eSopenharmony_ci#ifndef VENDOR_LIB_CONF_FILE
530b966c5eSopenharmony_ci#define VENDOR_LIB_CONF_FILE "/vendor/etc/bluetooth/bt_vendor.conf"
540b966c5eSopenharmony_ci#endif
550b966c5eSopenharmony_ci
560b966c5eSopenharmony_ci/* Device port name where Bluetooth controller attached */
570b966c5eSopenharmony_ci#ifndef BLUETOOTH_UART_DEVICE_PORT
580b966c5eSopenharmony_ci#define BLUETOOTH_UART_DEVICE_PORT "/dev/ttyS8" /* maguro */
590b966c5eSopenharmony_ci#endif
600b966c5eSopenharmony_ci
610b966c5eSopenharmony_ci/* Location of firmware patch files */
620b966c5eSopenharmony_ci#ifndef FW_PATCHFILE_LOCATION
630b966c5eSopenharmony_ci#define FW_PATCHFILE_LOCATION "/vendor/etc/firmware/" /* maguro */
640b966c5eSopenharmony_ci#endif
650b966c5eSopenharmony_ci
660b966c5eSopenharmony_ci#ifndef UART_TARGET_BAUD_RATE
670b966c5eSopenharmony_ci#define UART_TARGET_BAUD_RATE 3000000
680b966c5eSopenharmony_ci#endif
690b966c5eSopenharmony_ci
700b966c5eSopenharmony_ci/* The millisecond delay pauses on HCI transport after firmware patches
710b966c5eSopenharmony_ci * were downloaded. This gives some time for firmware to restart with
720b966c5eSopenharmony_ci * patches before host attempts to send down any HCI commands.
730b966c5eSopenharmony_ci *
740b966c5eSopenharmony_ci * Note: It has been discovered that BCM43241B0 needs at least 200ms
750b966c5eSopenharmony_ci * settlement delay in here. Without the delay, a Hardware Error event
760b966c5eSopenharmony_ci * from BCM43241B0 had been seen in HCI upstream path right after the
770b966c5eSopenharmony_ci * host sent the HCI_VSC_SET_BDADDR commad to the controller at higher
780b966c5eSopenharmony_ci * baud.
790b966c5eSopenharmony_ci */
800b966c5eSopenharmony_ci#ifndef FW_PATCH_SETTLEMENT_DELAY_MS
810b966c5eSopenharmony_ci#define FW_PATCH_SETTLEMENT_DELAY_MS 0
820b966c5eSopenharmony_ci#endif
830b966c5eSopenharmony_ci
840b966c5eSopenharmony_ci#ifndef USERIAL_VENDOR_SET_BAUD_DELAY_US
850b966c5eSopenharmony_ci#define USERIAL_VENDOR_SET_BAUD_DELAY_US 0
860b966c5eSopenharmony_ci#endif
870b966c5eSopenharmony_ci
880b966c5eSopenharmony_ci#ifndef FW_AUTO_DETECTION
890b966c5eSopenharmony_ci#define FW_AUTO_DETECTION FALSE
900b966c5eSopenharmony_ci#endif
910b966c5eSopenharmony_ci
920b966c5eSopenharmony_ci/* The Bluetooth Device Address source switch:
930b966c5eSopenharmony_ci *
940b966c5eSopenharmony_ci * -FALSE- (default value)
950b966c5eSopenharmony_ci *  Get the factory BDADDR from device's file system. Normally the BDADDR is
960b966c5eSopenharmony_ci *  stored in the location pointed by the PROPERTY_BT_BDADDR_PATH (defined in
970b966c5eSopenharmony_ci *  btif_common.h file) property.
980b966c5eSopenharmony_ci *
990b966c5eSopenharmony_ci * -TRUE-
1000b966c5eSopenharmony_ci *  If the Bluetooth Controller has equipped with a non-volatile memory (such
1010b966c5eSopenharmony_ci *  as BCM4330's OTP memory), the factory BDADDR can be stored in there and
1020b966c5eSopenharmony_ci *  retrieved by the stack while enabling BT.
1030b966c5eSopenharmony_ci *  !!! WARNING !!! Make sure that the OTP feature has been enabled in the
1040b966c5eSopenharmony_ci *  firmware patchram (.hcd) file.
1050b966c5eSopenharmony_ci */
1060b966c5eSopenharmony_ci#ifndef USE_CONTROLLER_BDADDR
1070b966c5eSopenharmony_ci#define USE_CONTROLLER_BDADDR FALSE
1080b966c5eSopenharmony_ci#endif
1090b966c5eSopenharmony_ci
1100b966c5eSopenharmony_ci/* sleep mode
1110b966c5eSopenharmony_ci
1120b966c5eSopenharmony_ci    0: disable
1130b966c5eSopenharmony_ci    1: UART with Host wake/BT wake out of band signals
1140b966c5eSopenharmony_ci*/
1150b966c5eSopenharmony_ci#ifndef LPM_SLEEP_MODE
1160b966c5eSopenharmony_ci#define LPM_SLEEP_MODE 0
1170b966c5eSopenharmony_ci#endif
1180b966c5eSopenharmony_ci
1190b966c5eSopenharmony_ci/* Host Stack Idle Threshold in 300ms or 25ms
1200b966c5eSopenharmony_ci  In sleep mode 1, this is the number of firmware loops executed with no
1210b966c5eSopenharmony_ci    action before the Host wake line is deasserted. action includes HCI
1220b966c5eSopenharmony_ci    traffic excluding certain sleep mode commands and the presence of SCO
1230b966c5eSopenharmony_ci    connections if the "Allow Host Sleep During SCO" flag is not set to 1.
1240b966c5eSopenharmony_ci    Each count of this parameter is roughly equivalent to 300ms or 25ms.
1250b966c5eSopenharmony_ci*/
1260b966c5eSopenharmony_ci#ifndef LPM_IDLE_THRESHOLD
1270b966c5eSopenharmony_ci#define LPM_IDLE_THRESHOLD 1
1280b966c5eSopenharmony_ci#endif
1290b966c5eSopenharmony_ci
1300b966c5eSopenharmony_ci/* Host Controller Idle Threshold in 300ms or 25ms
1310b966c5eSopenharmony_ci
1320b966c5eSopenharmony_ci    This is the number of firmware loops executed with no action before the
1330b966c5eSopenharmony_ci    HC is considered idle. Depending on the mode, HC may then attempt to sleep.
1340b966c5eSopenharmony_ci    Action includes HCI traffic excluding certain sleep mode commands and
1350b966c5eSopenharmony_ci    the presence of ACL/SCO connections.
1360b966c5eSopenharmony_ci*/
1370b966c5eSopenharmony_ci#ifndef LPM_HC_IDLE_THRESHOLD
1380b966c5eSopenharmony_ci#define LPM_HC_IDLE_THRESHOLD 1
1390b966c5eSopenharmony_ci#endif
1400b966c5eSopenharmony_ci
1410b966c5eSopenharmony_ci/* BT_WAKE Polarity - 0=Active Low, 1= Active High */
1420b966c5eSopenharmony_ci#ifndef LPM_BT_WAKE_POLARITY
1430b966c5eSopenharmony_ci#define LPM_BT_WAKE_POLARITY 1 /* maguro */
1440b966c5eSopenharmony_ci#endif
1450b966c5eSopenharmony_ci
1460b966c5eSopenharmony_ci/* HOST_WAKE Polarity - 0=Active Low, 1= Active High */
1470b966c5eSopenharmony_ci#ifndef LPM_HOST_WAKE_POLARITY
1480b966c5eSopenharmony_ci#define LPM_HOST_WAKE_POLARITY 1 /* maguro */
1490b966c5eSopenharmony_ci#endif
1500b966c5eSopenharmony_ci
1510b966c5eSopenharmony_ci/* LPM_ALLOW_HOST_SLEEP_DURING_SCO
1520b966c5eSopenharmony_ci
1530b966c5eSopenharmony_ci    When this flag is set to 0, the host is not allowed to sleep while
1540b966c5eSopenharmony_ci    an SCO is active. In sleep mode 1, the device will keep the host
1550b966c5eSopenharmony_ci    wake line asserted while an SCO is active.
1560b966c5eSopenharmony_ci    When this flag is set to 1, the host can sleep while an SCO is active.
1570b966c5eSopenharmony_ci    This flag should only be set to 1 if SCO traffic is directed to the PCM
1580b966c5eSopenharmony_ci    interface.
1590b966c5eSopenharmony_ci*/
1600b966c5eSopenharmony_ci#ifndef LPM_ALLOW_HOST_SLEEP_DURING_SCO
1610b966c5eSopenharmony_ci#define LPM_ALLOW_HOST_SLEEP_DURING_SCO 1
1620b966c5eSopenharmony_ci#endif
1630b966c5eSopenharmony_ci
1640b966c5eSopenharmony_ci/* LPM_COMBINE_SLEEP_MODE_AND_LPM
1650b966c5eSopenharmony_ci
1660b966c5eSopenharmony_ci    In Mode 0, always set byte 7 to 0. In sleep mode 1, device always
1670b966c5eSopenharmony_ci    requires permission to sleep between scans / periodic inquiries regardless
1680b966c5eSopenharmony_ci    of the setting of this byte. In sleep mode 1, if byte is set, device must
1690b966c5eSopenharmony_ci    have "permission" to sleep during the low power modes of sniff, hold, and
1700b966c5eSopenharmony_ci    park. If byte is not set, device can sleep without permission during these
1710b966c5eSopenharmony_ci    modes. Permission to sleep in Mode 1 is obtained if the BT_WAKE signal is
1720b966c5eSopenharmony_ci    not asserted.
1730b966c5eSopenharmony_ci*/
1740b966c5eSopenharmony_ci#ifndef LPM_COMBINE_SLEEP_MODE_AND_LPM
1750b966c5eSopenharmony_ci#define LPM_COMBINE_SLEEP_MODE_AND_LPM 1
1760b966c5eSopenharmony_ci#endif
1770b966c5eSopenharmony_ci
1780b966c5eSopenharmony_ci/* LPM_ENABLE_UART_TXD_TRI_STATE
1790b966c5eSopenharmony_ci
1800b966c5eSopenharmony_ci    When set to 0, the device will not tristate its UART TX line before going
1810b966c5eSopenharmony_ci    to sleep.
1820b966c5eSopenharmony_ci    When set to 1, the device will tristate its UART TX line before going to
1830b966c5eSopenharmony_ci    sleep.
1840b966c5eSopenharmony_ci*/
1850b966c5eSopenharmony_ci#ifndef LPM_ENABLE_UART_TXD_TRI_STATE
1860b966c5eSopenharmony_ci#define LPM_ENABLE_UART_TXD_TRI_STATE 0
1870b966c5eSopenharmony_ci#endif
1880b966c5eSopenharmony_ci
1890b966c5eSopenharmony_ci/* LPM_PULSED_HOST_WAKE
1900b966c5eSopenharmony_ci*/
1910b966c5eSopenharmony_ci#ifndef LPM_PULSED_HOST_WAKE
1920b966c5eSopenharmony_ci#define LPM_PULSED_HOST_WAKE 0
1930b966c5eSopenharmony_ci#endif
1940b966c5eSopenharmony_ci
1950b966c5eSopenharmony_ci/* LPM_IDLE_TIMEOUT_MULTIPLE
1960b966c5eSopenharmony_ci
1970b966c5eSopenharmony_ci    The multiple factor of host stack idle threshold in 300ms/25ms
1980b966c5eSopenharmony_ci*/
1990b966c5eSopenharmony_ci#ifndef LPM_IDLE_TIMEOUT_MULTIPLE
2000b966c5eSopenharmony_ci#define LPM_IDLE_TIMEOUT_MULTIPLE 10
2010b966c5eSopenharmony_ci#endif
2020b966c5eSopenharmony_ci
2030b966c5eSopenharmony_ci/* BT_WAKE_VIA_USERIAL_IOCTL
2040b966c5eSopenharmony_ci
2050b966c5eSopenharmony_ci    Use userial ioctl function to control BT_WAKE signal
2060b966c5eSopenharmony_ci*/
2070b966c5eSopenharmony_ci#ifndef BT_WAKE_VIA_USERIAL_IOCTL
2080b966c5eSopenharmony_ci#define BT_WAKE_VIA_USERIAL_IOCTL FALSE
2090b966c5eSopenharmony_ci#endif
2100b966c5eSopenharmony_ci
2110b966c5eSopenharmony_ci/* BT_WAKE_USERIAL_LDISC
2120b966c5eSopenharmony_ci
2130b966c5eSopenharmony_ci    Use line discipline if the BT_WAKE control is in line discipline
2140b966c5eSopenharmony_ci*/
2150b966c5eSopenharmony_ci#ifndef BT_WAKE_USERIAL_LDISC
2160b966c5eSopenharmony_ci#define BT_WAKE_USERIAL_LDISC FALSE
2170b966c5eSopenharmony_ci#endif
2180b966c5eSopenharmony_ci
2190b966c5eSopenharmony_ci/* BT_WAKE_VIA_PROC
2200b966c5eSopenharmony_ci
2210b966c5eSopenharmony_ci    LPM & BT_WAKE control through PROC nodes
2220b966c5eSopenharmony_ci*/
2230b966c5eSopenharmony_ci#ifndef BT_WAKE_VIA_PROC
2240b966c5eSopenharmony_ci#define BT_WAKE_VIA_PROC FALSE
2250b966c5eSopenharmony_ci#endif
2260b966c5eSopenharmony_ci
2270b966c5eSopenharmony_ci#ifndef BT_WAKE_VIA_PROC_NOTIFY_DEASSERT
2280b966c5eSopenharmony_ci#define BT_WAKE_VIA_PROC_NOTIFY_DEASSERT FALSE
2290b966c5eSopenharmony_ci#endif
2300b966c5eSopenharmony_ci
2310b966c5eSopenharmony_ci/* N_BRCM_HCI
2320b966c5eSopenharmony_ci
2330b966c5eSopenharmony_ci    UART ioctl line discipline
2340b966c5eSopenharmony_ci*/
2350b966c5eSopenharmony_ci#ifndef N_BRCM_HCI
2360b966c5eSopenharmony_ci#define N_BRCM_HCI 25
2370b966c5eSopenharmony_ci#endif
2380b966c5eSopenharmony_ci
2390b966c5eSopenharmony_ci/* SCO_CFG_INCLUDED
2400b966c5eSopenharmony_ci
2410b966c5eSopenharmony_ci    Do SCO configuration by default. If the firmware patch had been embedded
2420b966c5eSopenharmony_ci    with desired SCO configuration, set this FALSE to bypass configuration
2430b966c5eSopenharmony_ci    from host software.
2440b966c5eSopenharmony_ci*/
2450b966c5eSopenharmony_ci#ifndef SCO_CFG_INCLUDED
2460b966c5eSopenharmony_ci#define SCO_CFG_INCLUDED TRUE
2470b966c5eSopenharmony_ci#endif
2480b966c5eSopenharmony_ci
2490b966c5eSopenharmony_ci#ifndef SCO_USE_I2S_INTERFACE
2500b966c5eSopenharmony_ci#define SCO_USE_I2S_INTERFACE FALSE
2510b966c5eSopenharmony_ci#endif
2520b966c5eSopenharmony_ci
2530b966c5eSopenharmony_ci#define SCO_I2SPCM_PARAM_IF_MODE 0
2540b966c5eSopenharmony_ci#define SCO_I2SPCM_PARAM_IF_ROLE 1
2550b966c5eSopenharmony_ci#define SCO_I2SPCM_PARAM_IF_SAMPLE_RATE 2
2560b966c5eSopenharmony_ci#define SCO_I2SPCM_PARAM_IF_CLOCK_RATE 3
2570b966c5eSopenharmony_ci#define SCO_I2SPCM_PARAM_SIZE 4
2580b966c5eSopenharmony_ci
2590b966c5eSopenharmony_ci/* SCO_WBS_SAMPLE_RATE
2600b966c5eSopenharmony_ci    0 : 8K
2610b966c5eSopenharmony_ci    1 : 16K
2620b966c5eSopenharmony_ci    2 : 4K
2630b966c5eSopenharmony_ci This macro is used for setting WBS sampling rate for a SCO connection
2640b966c5eSopenharmony_ci If the mobile network supports WBS, we need to use 16KHz as default
2650b966c5eSopenharmony_ci but if the platform doesn't support 16KHz, the sample rate can be
2660b966c5eSopenharmony_ci overriden to 8KHz by setting this to 0.
2670b966c5eSopenharmony_ci*/
2680b966c5eSopenharmony_ci#ifndef SCO_WBS_SAMPLE_RATE
2690b966c5eSopenharmony_ci#define SCO_WBS_SAMPLE_RATE 1
2700b966c5eSopenharmony_ci#endif
2710b966c5eSopenharmony_ci
2720b966c5eSopenharmony_ci/* SCO_I2SPCM_IF_MODE - 0=Disable, 1=Enable */
2730b966c5eSopenharmony_ci#ifndef SCO_I2SPCM_IF_MODE
2740b966c5eSopenharmony_ci#define SCO_I2SPCM_IF_MODE 1
2750b966c5eSopenharmony_ci#endif
2760b966c5eSopenharmony_ci
2770b966c5eSopenharmony_ci/* SCO_I2SPCM_IF_ROLE - 0=Slave, 1=Master */
2780b966c5eSopenharmony_ci#ifndef SCO_I2SPCM_IF_ROLE
2790b966c5eSopenharmony_ci#define SCO_I2SPCM_IF_ROLE 1
2800b966c5eSopenharmony_ci#endif
2810b966c5eSopenharmony_ci
2820b966c5eSopenharmony_ci/* SCO_I2SPCM_IF_SAMPLE_RATE
2830b966c5eSopenharmony_ci
2840b966c5eSopenharmony_ci    0 : 8K
2850b966c5eSopenharmony_ci    1 : 16K
2860b966c5eSopenharmony_ci    2 : 4K
2870b966c5eSopenharmony_ci*/
2880b966c5eSopenharmony_ci#ifndef SCO_I2SPCM_IF_SAMPLE_RATE
2890b966c5eSopenharmony_ci#define SCO_I2SPCM_IF_SAMPLE_RATE 0
2900b966c5eSopenharmony_ci#endif
2910b966c5eSopenharmony_ci
2920b966c5eSopenharmony_ci/* SCO_I2SPCM_IF_CLOCK_RATE
2930b966c5eSopenharmony_ci
2940b966c5eSopenharmony_ci    0 : 128K
2950b966c5eSopenharmony_ci    1 : 256K
2960b966c5eSopenharmony_ci    2 : 512K
2970b966c5eSopenharmony_ci    3 : 1024K
2980b966c5eSopenharmony_ci    4 : 2048K
2990b966c5eSopenharmony_ci*/
3000b966c5eSopenharmony_ci#ifndef SCO_I2SPCM_IF_CLOCK_RATE
3010b966c5eSopenharmony_ci#define SCO_I2SPCM_IF_CLOCK_RATE 1
3020b966c5eSopenharmony_ci#endif
3030b966c5eSopenharmony_ci
3040b966c5eSopenharmony_ci/* SCO_I2SPCM_IF_CLOCK_RATE4WBS
3050b966c5eSopenharmony_ci
3060b966c5eSopenharmony_ci    0 : 128K
3070b966c5eSopenharmony_ci    1 : 256K
3080b966c5eSopenharmony_ci    2 : 512K
3090b966c5eSopenharmony_ci    3 : 1024K
3100b966c5eSopenharmony_ci    4 : 2048K
3110b966c5eSopenharmony_ci*/
3120b966c5eSopenharmony_ci#ifndef SCO_I2SPCM_IF_CLOCK_RATE4WBS
3130b966c5eSopenharmony_ci#define SCO_I2SPCM_IF_CLOCK_RATE4WBS 2
3140b966c5eSopenharmony_ci#endif
3150b966c5eSopenharmony_ci
3160b966c5eSopenharmony_ci#define SCO_PCM_PARAM_ROUTING 0
3170b966c5eSopenharmony_ci#define SCO_PCM_PARAM_IF_CLOCK_RATE 1
3180b966c5eSopenharmony_ci#define SCO_PCM_PARAM_IF_FRAME_TYPE 2
3190b966c5eSopenharmony_ci#define SCO_PCM_PARAM_IF_SYNC_MODE 3
3200b966c5eSopenharmony_ci#define SCO_PCM_PARAM_IF_CLOCK_MODE 4
3210b966c5eSopenharmony_ci#define SCO_PCM_PARAM_SIZE 5
3220b966c5eSopenharmony_ci
3230b966c5eSopenharmony_ci/* SCO_PCM_ROUTING
3240b966c5eSopenharmony_ci
3250b966c5eSopenharmony_ci    0 : PCM
3260b966c5eSopenharmony_ci    1 : Transport
3270b966c5eSopenharmony_ci    2 : Codec
3280b966c5eSopenharmony_ci    3 : I2S
3290b966c5eSopenharmony_ci*/
3300b966c5eSopenharmony_ci#ifndef SCO_PCM_ROUTING
3310b966c5eSopenharmony_ci#define SCO_PCM_ROUTING 0
3320b966c5eSopenharmony_ci#endif
3330b966c5eSopenharmony_ci
3340b966c5eSopenharmony_ci/* SCO_PCM_IF_CLOCK_RATE
3350b966c5eSopenharmony_ci
3360b966c5eSopenharmony_ci    NOTICE: suggested to be consistent with SCO_I2SPCM_IF_CLOCK_RATE
3370b966c5eSopenharmony_ci
3380b966c5eSopenharmony_ci    0 : 128K
3390b966c5eSopenharmony_ci    1 : 256K
3400b966c5eSopenharmony_ci    2 : 512K
3410b966c5eSopenharmony_ci    3 : 1024K
3420b966c5eSopenharmony_ci    4 : 2048K
3430b966c5eSopenharmony_ci*/
3440b966c5eSopenharmony_ci#ifndef SCO_PCM_IF_CLOCK_RATE
3450b966c5eSopenharmony_ci#define SCO_PCM_IF_CLOCK_RATE 4
3460b966c5eSopenharmony_ci#endif
3470b966c5eSopenharmony_ci
3480b966c5eSopenharmony_ci/* SCO_PCM_IF_FRAME_TYPE - 0=Short, 1=Long */
3490b966c5eSopenharmony_ci#ifndef SCO_PCM_IF_FRAME_TYPE
3500b966c5eSopenharmony_ci#define SCO_PCM_IF_FRAME_TYPE 0
3510b966c5eSopenharmony_ci#endif
3520b966c5eSopenharmony_ci
3530b966c5eSopenharmony_ci/* SCO_PCM_IF_SYNC_MODE
3540b966c5eSopenharmony_ci
3550b966c5eSopenharmony_ci    NOTICE: in most usage cases the value will be the same as
3560b966c5eSopenharmony_ci            SCO_PCM_IF_CLOCK_MODE setting
3570b966c5eSopenharmony_ci
3580b966c5eSopenharmony_ci    0 : Slave
3590b966c5eSopenharmony_ci    1 : Master
3600b966c5eSopenharmony_ci*/
3610b966c5eSopenharmony_ci#ifndef SCO_PCM_IF_SYNC_MODE
3620b966c5eSopenharmony_ci#define SCO_PCM_IF_SYNC_MODE 0
3630b966c5eSopenharmony_ci#endif
3640b966c5eSopenharmony_ci
3650b966c5eSopenharmony_ci/* SCO_PCM_IF_CLOCK_MODE
3660b966c5eSopenharmony_ci
3670b966c5eSopenharmony_ci    NOTICE: suggested to be consistent with SCO_I2SPCM_IF_ROLE
3680b966c5eSopenharmony_ci
3690b966c5eSopenharmony_ci    0 : Slave
3700b966c5eSopenharmony_ci    1 : Master
3710b966c5eSopenharmony_ci*/
3720b966c5eSopenharmony_ci#ifndef SCO_PCM_IF_CLOCK_MODE
3730b966c5eSopenharmony_ci#define SCO_PCM_IF_CLOCK_MODE 0
3740b966c5eSopenharmony_ci#endif
3750b966c5eSopenharmony_ci
3760b966c5eSopenharmony_ci#define PCM_DATA_FORMAT_PARAM_SIZE 5
3770b966c5eSopenharmony_ci
3780b966c5eSopenharmony_ci/* PCM_DATA_FMT_SHIFT_MODE
3790b966c5eSopenharmony_ci
3800b966c5eSopenharmony_ci    0 : MSB first
3810b966c5eSopenharmony_ci    1 : LSB first
3820b966c5eSopenharmony_ci*/
3830b966c5eSopenharmony_ci#ifndef PCM_DATA_FMT_SHIFT_MODE
3840b966c5eSopenharmony_ci#define PCM_DATA_FMT_SHIFT_MODE 0
3850b966c5eSopenharmony_ci#endif
3860b966c5eSopenharmony_ci
3870b966c5eSopenharmony_ci/* PCM_DATA_FMT_FILL_BITS
3880b966c5eSopenharmony_ci
3890b966c5eSopenharmony_ci    Specifies the value with which to fill unused bits
3900b966c5eSopenharmony_ci    if Fill_Method is set to programmable
3910b966c5eSopenharmony_ci*/
3920b966c5eSopenharmony_ci#ifndef PCM_DATA_FMT_FILL_BITS
3930b966c5eSopenharmony_ci#define PCM_DATA_FMT_FILL_BITS 0
3940b966c5eSopenharmony_ci#endif
3950b966c5eSopenharmony_ci
3960b966c5eSopenharmony_ci/* PCM_DATA_FMT_FILL_METHOD
3970b966c5eSopenharmony_ci
3980b966c5eSopenharmony_ci    0 : 0's
3990b966c5eSopenharmony_ci    1 : 1's
4000b966c5eSopenharmony_ci    2 : Signed
4010b966c5eSopenharmony_ci    3 : Programmable
4020b966c5eSopenharmony_ci*/
4030b966c5eSopenharmony_ci#ifndef PCM_DATA_FMT_FILL_METHOD
4040b966c5eSopenharmony_ci#define PCM_DATA_FMT_FILL_METHOD 3
4050b966c5eSopenharmony_ci#endif
4060b966c5eSopenharmony_ci
4070b966c5eSopenharmony_ci/* PCM_DATA_FMT_FILL_NUM
4080b966c5eSopenharmony_ci
4090b966c5eSopenharmony_ci    Specifies the number of bits to be filled
4100b966c5eSopenharmony_ci*/
4110b966c5eSopenharmony_ci#ifndef PCM_DATA_FMT_FILL_NUM
4120b966c5eSopenharmony_ci#define PCM_DATA_FMT_FILL_NUM 0
4130b966c5eSopenharmony_ci#endif
4140b966c5eSopenharmony_ci
4150b966c5eSopenharmony_ci/* PCM_DATA_FMT_JUSTIFY_MODE
4160b966c5eSopenharmony_ci
4170b966c5eSopenharmony_ci    0 : Left justify (fill data shifted out last)
4180b966c5eSopenharmony_ci    1 : Right justify (fill data shifted out first)
4190b966c5eSopenharmony_ci*/
4200b966c5eSopenharmony_ci#ifndef PCM_DATA_FMT_JUSTIFY_MODE
4210b966c5eSopenharmony_ci#define PCM_DATA_FMT_JUSTIFY_MODE 0
4220b966c5eSopenharmony_ci#endif
4230b966c5eSopenharmony_ci
4240b966c5eSopenharmony_ci/* HW_END_WITH_HCI_RESET
4250b966c5eSopenharmony_ci
4260b966c5eSopenharmony_ci    Sample code implementation of sending a HCI_RESET command during the epilog
4270b966c5eSopenharmony_ci    process. It calls back to the callers after command complete of HCI_RESET
4280b966c5eSopenharmony_ci    is received.
4290b966c5eSopenharmony_ci*/
4300b966c5eSopenharmony_ci#ifndef HW_END_WITH_HCI_RESET
4310b966c5eSopenharmony_ci#define HW_END_WITH_HCI_RESET TRUE
4320b966c5eSopenharmony_ci#endif
4330b966c5eSopenharmony_ci
4340b966c5eSopenharmony_ci#define BD_ADDR_LEN 6
4350b966c5eSopenharmony_ci#define BT_VENDOR_TIME_RAIDX 1000
4360b966c5eSopenharmony_ci/******************************************************************************
4370b966c5eSopenharmony_ci**  Extern variables and functions
4380b966c5eSopenharmony_ci******************************************************************************/
4390b966c5eSopenharmony_ci
4400b966c5eSopenharmony_ciextern bt_vendor_callbacks_t *bt_vendor_cbacks;
4410b966c5eSopenharmony_ci/** audio (SCO) state changes triggering VS commands for configuration */
4420b966c5eSopenharmony_citypedef struct {
4430b966c5eSopenharmony_ci    uint16_t handle;
4440b966c5eSopenharmony_ci    uint16_t peer_codec;
4450b966c5eSopenharmony_ci    uint16_t state;
4460b966c5eSopenharmony_ci} bt_vendor_op_audio_state_t;
4470b966c5eSopenharmony_ci
4480b966c5eSopenharmony_ciextern int hw_set_audio_state(bt_vendor_op_audio_state_t *p_state);
4490b966c5eSopenharmony_ciextern uint8_t vnd_local_bd_addr[BD_ADDR_LEN];
4500b966c5eSopenharmony_ci
4510b966c5eSopenharmony_ciextern void hw_process_event(HC_BT_HDR *);
4520b966c5eSopenharmony_ci
4530b966c5eSopenharmony_ci#endif /* BT_VENDOR_BRCM_H */
454