summaryrefslogtreecommitdiffstats
path: root/src/upio.c
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 /src/upio.c
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>
Diffstat (limited to 'src/upio.c')
-rw-r--r--src/upio.c11
1 files changed, 8 insertions, 3 deletions
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)
{