summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortturney <tturney@google.com>2015-08-19 10:38:28 -0700
committertturney <tturney@google.com>2015-08-31 15:41:47 -0700
commitb7b7af83922fc5918d2632402daa3824364806fb (patch)
treeccfa5677a63a0ec066272d5eab655416af0eb262
parent955f8769d470fb2bbb8a1d44a39ce8e104085d9a (diff)
downloadandroid_hardware_broadcom_libbt-b7b7af83922fc5918d2632402daa3824364806fb.tar.gz
android_hardware_broadcom_libbt-b7b7af83922fc5918d2632402daa3824364806fb.tar.bz2
android_hardware_broadcom_libbt-b7b7af83922fc5918d2632402daa3824364806fb.zip
Fix btwrite timer timeout for Angler (1/2)
1. For vnd_angler.txt: Set PROC_BTWRITE_TIMER_TIMEOUT_MS to 0 to avoid upio start and stop timer when LMP is enabled and BT_WAKE is asserted and de-asserted. This time is useless and would set btwrite to 0 by mistake even when host is sending data to UART, and this would de-assert BT_WAKE by mistake. 2. For hardware.c: For chipset 4358 we need to set LPM_HC_IDLE_THRESHOLD to 24, so we need to reduce the multiplier to make timeout_ms a reasonable value. Without modification, the timeout_ms would be 36000ms which is too large. 3. For upio.c: Need to set lmp_proc_cb.btwrite_active even though PROC_BTWRITE_TIMER_TIMEOUT_MS is set to 0. Otherwise, btwrite would be written very frequently. Bug: 23248798 Change-Id: Ie55c346785679e51a771d5e46270c0858e6082ee
-rwxr-xr-xinclude/vnd_angler.txt2
-rwxr-xr-xsrc/hardware.c3
-rw-r--r--src/upio.c7
3 files changed, 8 insertions, 4 deletions
diff --git a/include/vnd_angler.txt b/include/vnd_angler.txt
index 103b656..8d7b271 100755
--- a/include/vnd_angler.txt
+++ b/include/vnd_angler.txt
@@ -2,7 +2,7 @@ BLUETOOTH_UART_DEVICE_PORT = "/dev/ttyHS0"
FW_PATCHFILE_LOCATION = "/vendor/firmware/"
BT_WAKE_VIA_PROC = TRUE
BT_WAKE_VIA_PROC_NOTIFY_DEASSERT=TRUE
-PROC_BTWRITE_TIMER_TIMEOUT_MS = 4000
+PROC_BTWRITE_TIMER_TIMEOUT_MS = 0
UART_TARGET_BAUD_RATE = 3000000
LPM_IDLE_TIMEOUT_MULTIPLE = 5
LPM_HC_IDLE_THRESHOLD = 24
diff --git a/src/hardware.c b/src/hardware.c
index 02103ca..10bf22b 100755
--- a/src/hardware.c
+++ b/src/hardware.c
@@ -1211,9 +1211,10 @@ uint32_t hw_lpm_get_idle_timeout(void)
*/
timeout_ms = (uint32_t)lpm_param.host_stack_idle_threshold \
* LPM_IDLE_TIMEOUT_MULTIPLE;
-
if (strstr(hw_cfg_cb.local_chip_name, "BCM4325") != NULL)
timeout_ms *= 25; // 12.5 or 25 ?
+ else if (strstr(hw_cfg_cb.local_chip_name, "BCM4358") != NULL)
+ timeout_ms *= 50;
else
timeout_ms *= 300;
diff --git a/src/upio.c b/src/upio.c
index 3f73482..43dc5b5 100644
--- a/src/upio.c
+++ b/src/upio.c
@@ -499,13 +499,16 @@ void upio_set(uint8_t pio, uint8_t action, uint8_t polarity)
ALOGE("upio_set : write(%s) failed: %s (%d)",
VENDOR_BTWRITE_PROC_NODE, strerror(errno),errno);
}
-#if (PROC_BTWRITE_TIMER_TIMEOUT_MS != 0)
else
{
+#if (BT_WAKE_VIA_PROC == TRUE)
+ lpm_proc_cb.btwrite_active = TRUE;
+#endif
+#if (PROC_BTWRITE_TIMER_TIMEOUT_MS != 0)
/* arm user space timer based on action */
upio_start_stop_timer(action);
- }
#endif
+ }
UPIODBG("%s: proc btwrite assertion, buffer: %c, timer_armed %d %d",
__FUNCTION__, buffer, lpm_proc_cb.btwrite_active, lpm_proc_cb.timer_created);