diff options
| author | Daniel Nygren <daniel.nygren2@sonymobile.com> | 2014-03-05 15:21:34 +0100 |
|---|---|---|
| committer | Sean Wan <swan@google.com> | 2014-06-11 09:26:18 -0700 |
| commit | b01dbb348576f8c06559f18152b98d9a4f83fee1 (patch) | |
| tree | b57d26ab9dfbdd0f892426a2f2d1a120ae29127f | |
| parent | 853d93ac84affbe9903b64688bc436c47fa9b606 (diff) | |
| download | android_hardware_broadcom_libbt-b01dbb348576f8c06559f18152b98d9a4f83fee1.tar.gz android_hardware_broadcom_libbt-b01dbb348576f8c06559f18152b98d9a4f83fee1.tar.bz2 android_hardware_broadcom_libbt-b01dbb348576f8c06559f18152b98d9a4f83fee1.zip | |
Fix for bt low power mode issue
Brought in from broadcom libbt branch.
Change-Id: I4ec3f28029f5ed7c54d3aae78680591f41e84b7b
| -rw-r--r-- | include/bt_vendor_brcm.h | 16 | ||||
| -rwxr-xr-x | src/userial_vendor.c | 13 |
2 files changed, 29 insertions, 0 deletions
diff --git a/include/bt_vendor_brcm.h b/include/bt_vendor_brcm.h index 8f336bd..d81e54a 100644 --- a/include/bt_vendor_brcm.h +++ b/include/bt_vendor_brcm.h @@ -202,6 +202,14 @@ #define BT_WAKE_VIA_USERIAL_IOCTL FALSE #endif +/* BT_WAKE_USERIAL_LDISC + + Use line discipline if the BT_WAKE control is in line discipline +*/ +#ifndef BT_WAKE_USERIAL_LDISC +#define BT_WAKE_USERIAL_LDISC FALSE +#endif + /* BT_WAKE_VIA_PROC LPM & BT_WAKE control through PROC nodes @@ -210,6 +218,14 @@ #define BT_WAKE_VIA_PROC FALSE #endif +/* N_BRCM_HCI + + UART ioctl line discipline +*/ +#ifndef N_BRCM_HCI +#define N_BRCM_HCI 25 +#endif + /* SCO_CFG_INCLUDED Do SCO configuration by default. If the firmware patch had been embedded diff --git a/src/userial_vendor.c b/src/userial_vendor.c index 1a745b5..b9c5f69 100755 --- a/src/userial_vendor.c +++ b/src/userial_vendor.c @@ -137,6 +137,19 @@ void userial_ioctl_init_bt_wake(int fd) { uint32_t bt_wake_state; +#if (BT_WAKE_USERIAL_LDISC==TRUE) + int ldisc = N_BRCM_HCI; /* brcm sleep mode support line discipline */ + + /* attempt to load enable discipline driver */ + if (ioctl(vnd_userial.fd, TIOCSETD, &ldisc) < 0) + { + VNDUSERIALDBG("USERIAL_Open():fd %d, TIOCSETD failed: error %d for ldisc: %d", + fd, errno, ldisc); + } +#endif + + + /* assert BT_WAKE through ioctl */ ioctl(fd, USERIAL_IOCTL_BT_WAKE_ASSERT, NULL); ioctl(fd, USERIAL_IOCTL_BT_WAKE_GET_ST, &bt_wake_state); |
