diff options
| author | Steve Kondik <shade@chemlab.org> | 2013-08-06 22:34:12 -0700 |
|---|---|---|
| committer | Steve Kondik <shade@chemlab.org> | 2013-08-06 22:34:12 -0700 |
| commit | cf11e0f2261ed61c528d979bd213943810bd330b (patch) | |
| tree | f63a3fda90cc5581ff6c2f20b0090fdb6dae811e | |
| parent | f4e1368003e4f996984bc4bf0257acc633a0ece6 (diff) | |
| download | android_hardware_broadcom_libbt-cm-10.2.tar.gz android_hardware_broadcom_libbt-cm-10.2.tar.bz2 android_hardware_broadcom_libbt-cm-10.2.zip | |
libbt: Add support for using two stop bitscm-10.2.1cm-10.2.0cm-10.2-M1stable/cm-10.2cm-10.2
* This improves reliability on chips such as BCM4335.
* Also externalize some configuration.
Change-Id: I1271f0c1c3e602c8bfe9f816f57c9cb6add04b3a
| -rw-r--r-- | include/bt_vendor_brcm.h | 5 | ||||
| -rw-r--r-- | src/conf.c | 5 | ||||
| -rw-r--r-- | src/hardware.c | 19 | ||||
| -rwxr-xr-x | src/userial_vendor.c | 26 |
4 files changed, 52 insertions, 3 deletions
diff --git a/include/bt_vendor_brcm.h b/include/bt_vendor_brcm.h index 587094d..0cbddb3 100644 --- a/include/bt_vendor_brcm.h +++ b/include/bt_vendor_brcm.h @@ -76,6 +76,11 @@ #define FW_PRE_PATCH "" #endif +/* Force use of two stop bits */ +#ifndef UART_FORCE_TWO_STOPBITS +#define UART_FORCE_TWO_STOPBITS FALSE +#endif + /* The millisecond delay pauses on HCI transport after firmware patches * were downloaded. This gives some time for firmware to restart with * patches before host attempts to send down any HCI commands. @@ -37,6 +37,8 @@ int userial_set_port(char *p_conf_name, char *p_conf_value, int param); int hw_set_patch_file_path(char *p_conf_name, char *p_conf_value, int param); int hw_set_patch_file_name(char *p_conf_name, char *p_conf_value, int param); +int hw_set_pre_patch_file_name(char *p_conf_name, char *p_conf_value, int param); +int userial_set_force_use_2_stop_bits(char *p_conf_name, char *p_conf_value, int param); #if (VENDOR_LIB_RUNTIME_TUNING_ENABLED == TRUE) int hw_set_patch_settlement_delay(char *p_conf_name, char *p_conf_value, int param); #endif @@ -70,6 +72,9 @@ static const conf_entry_t conf_table[] = { {"UartPort", userial_set_port, 0}, {"FwPatchFilePath", hw_set_patch_file_path, 0}, {"FwPatchFileName", hw_set_patch_file_name, 0}, + {"FwPrePatchFileName", hw_set_pre_patch_file_name, 0}, + {"UartForceUse2StopBits", userial_set_force_use_2_stop_bits, 0}, + #if (VENDOR_LIB_RUNTIME_TUNING_ENABLED == TRUE) {"FwPatchSettlementDelay", hw_set_patch_settlement_delay, 0}, #endif diff --git a/src/hardware.c b/src/hardware.c index 4ef6fb0..8e47a4d 100644 --- a/src/hardware.c +++ b/src/hardware.c @@ -1335,6 +1335,25 @@ int hw_set_patch_file_name(char *p_conf_name, char *p_conf_value, int param) return 0; } +/******************************************************************************* +** +** Function hw_set_pre_patch_file_name +** +** Description Give the specific firmware pre-patch filename +** +** Returns 0 : Success +** Otherwise : Fail +** +*******************************************************************************/ +int hw_set_pre_patch_file_name(char *p_conf_name, char *p_conf_value, int param) +{ + + strcpy(fw_prepatch_name, p_conf_value); + + return 0; +} + + #if (VENDOR_LIB_RUNTIME_TUNING_ENABLED == TRUE) /******************************************************************************* ** diff --git a/src/userial_vendor.c b/src/userial_vendor.c index 1a745b5..5233d19 100755 --- a/src/userial_vendor.c +++ b/src/userial_vendor.c @@ -68,6 +68,7 @@ typedef struct ******************************************************************************/ static vnd_userial_cb_t vnd_userial; +static int vnd_userial_force_2stopbits = UART_FORCE_TWO_STOPBITS; /***************************************************************************** ** Helper Functions @@ -215,10 +216,10 @@ int userial_vendor_open(tUSERIAL_CFG *p_cfg) return -1; } - if(p_cfg->fmt & USERIAL_STOPBITS_1) - stop_bits = 0; - else if(p_cfg->fmt & USERIAL_STOPBITS_2) + if(vnd_userial_force_2stopbits || (p_cfg->fmt & USERIAL_STOPBITS_2)) stop_bits = CSTOPB; + else if(p_cfg->fmt & USERIAL_STOPBITS_1) + stop_bits = 0; else { ALOGE("userial vendor open: unsupported stop bits"); @@ -359,3 +360,22 @@ int userial_set_port(char *p_conf_name, char *p_conf_value, int param) return 0; } +/******************************************************************************* +** +** Function userial_set_force_use_2_stop_bits +** +** Description Configure UART port name +** +** Returns 0 : Success +** Otherwise : Fail +** +*******************************************************************************/ +int userial_set_force_use_2_stop_bits(char *p_conf_name, char *p_conf_value, int param) +{ + if (strcmp(p_conf_value, "true") == 0) + vnd_userial_force_2stopbits = TRUE; + else + vnd_userial_force_2stopbits = FALSE; + return 0; +} + |
