summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas.TT_Lin <Thomas.TT_Lin@htc.com>2014-03-11 11:41:53 +0800
committerDmitry Shmidt <dimitrysh@google.com>2014-03-13 10:53:07 -0700
commita69c3a9b765f246cdded713969f922b40e1dfe15 (patch)
tree7498f0499e34cf06967b7c838752aa340e08b577
parent2dc00a4c75cb76d3958f1858c8b2d0e09366eae4 (diff)
downloadandroid_hardware_broadcom_libbt-a69c3a9b765f246cdded713969f922b40e1dfe15.tar.gz
android_hardware_broadcom_libbt-a69c3a9b765f246cdded713969f922b40e1dfe15.tar.bz2
android_hardware_broadcom_libbt-a69c3a9b765f246cdded713969f922b40e1dfe15.zip
flounder64: bluetooth: let BT enter sleep mode
let BT sleep doesn't ignore the UPIO_DEASSERT command and just use one node to control BT sleep. Change-Id: I8d4f89be1b8e44c4d77b01a885bf7972dffe0cc3 Signed-off-by: Thomas.TT_Lin <Thomas.TT_Lin@htc.com>
-rw-r--r--include/bt_vendor_brcm.h4
-rw-r--r--include/vnd_flounder64.txt10
-rw-r--r--src/upio.c11
3 files changed, 22 insertions, 3 deletions
diff --git a/include/bt_vendor_brcm.h b/include/bt_vendor_brcm.h
index 8f336bd..0440d9f 100644
--- a/include/bt_vendor_brcm.h
+++ b/include/bt_vendor_brcm.h
@@ -210,6 +210,10 @@
#define BT_WAKE_VIA_PROC FALSE
#endif
+#ifndef BT_WAKE_VIA_PROC_NOTIFY_DEASSERT
+#define BT_WAKE_VIA_PROC_NOTIFY_DEASSERT FALSE
+#endif
+
/* SCO_CFG_INCLUDED
Do SCO configuration by default. If the firmware patch had been embedded
diff --git a/include/vnd_flounder64.txt b/include/vnd_flounder64.txt
new file mode 100644
index 0000000..a366b9c
--- /dev/null
+++ b/include/vnd_flounder64.txt
@@ -0,0 +1,10 @@
+VENDOR_BTWRITE_PROC_NODE = "/proc/bluetooth/sleep/lpm"
+LPM_IDLE_TIMEOUT_MULTIPLE = 5
+SCO_USE_I2S_INTERFACE = FALSE
+SCO_PCM_IF_CLOCK_RATE = 3
+BTVND_DBG = FALSE
+BTHW_DBG = TRUE
+VNDUSERIAL_DBG = FALSE
+BT_WAKE_VIA_PROC_NOTIFY_DEASSERT = TRUE
+BT_WAKE_VIA_PROC = TRUE
+UPIO_DBG = FALSE
diff --git a/src/upio.c b/src/upio.c
index 2de171c..e6a0444 100644
--- a/src/upio.c
+++ b/src/upio.c
@@ -434,9 +434,10 @@ void upio_set(uint8_t pio, uint8_t action, uint8_t polarity)
/*
* Kick proc btwrite node only at UPIO_ASSERT
*/
+#if (BT_WAKE_VIA_PROC_NOTIFY_DEASSERT == FALSE)
if (action == UPIO_DEASSERT)
return;
-
+#endif
fd = open(VENDOR_BTWRITE_PROC_NODE, O_WRONLY);
if (fd < 0)
@@ -445,8 +446,12 @@ void upio_set(uint8_t pio, uint8_t action, uint8_t polarity)
VENDOR_BTWRITE_PROC_NODE, strerror(errno), errno);
return;
}
-
- buffer = '1';
+#if (BT_WAKE_VIA_PROC_NOTIFY_DEASSERT == TRUE)
+ if (action == UPIO_DEASSERT)
+ buffer = '0';
+ else
+#endif
+ buffer = '1';
if (write(fd, &buffer, 1) < 0)
{