summaryrefslogtreecommitdiff
authorjiamin.miao <jiamin.miao@amlogic.com>2014-02-12 05:38:31 (GMT)
committer Sandy lUo <sandy.luo@amlogic.com>2014-02-19 10:30:48 (GMT)
commit4c5d728e7ebea8ef11e9ba8c10ac40476041fe14 (patch)
treea0e53b9d7a6f1c7148116418334fc99b4beae0cc
parentefae12b0334af5fdf43fd68da75a7ac04de46adc (diff)
downloadlibbt-4c5d728e7ebea8ef11e9ba8c10ac40476041fe14.zip
libbt-4c5d728e7ebea8ef11e9ba8c10ac40476041fe14.tar.gz
libbt-4c5d728e7ebea8ef11e9ba8c10ac40476041fe14.tar.bz2
PD#87085:set bt port via ioctol
Diffstat
-rwxr-xr-xsrc/userial_vendor.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/userial_vendor.c b/src/userial_vendor.c
index 1a745b5..09bf954 100755
--- a/src/userial_vendor.c
+++ b/src/userial_vendor.c
@@ -51,6 +51,10 @@
#define VND_PORT_NAME_MAXLEN 256
+#if (BT_WAKE_VIA_PROC == TRUE)
+#define TIOCSETBTPORT 0x5489
+#define TIOCCLRBTPORT 0x5490
+#endif
/******************************************************************************
** Local type definitions
******************************************************************************/
@@ -253,6 +257,10 @@ int userial_vendor_open(tUSERIAL_CFG *p_cfg)
#if (BT_WAKE_VIA_USERIAL_IOCTL==TRUE)
userial_ioctl_init_bt_wake(vnd_userial.fd);
#endif
+#if (BT_WAKE_VIA_PROC == TRUE)
+ /* set bluesleep uart port */
+ ioctl(vnd_userial.fd, TIOCSETBTPORT, NULL);
+#endif
ALOGI("device fd = %d open", vnd_userial.fd);
@@ -279,7 +287,9 @@ void userial_vendor_close(void)
/* de-assert bt_wake BEFORE closing port */
ioctl(vnd_userial.fd, USERIAL_IOCTL_BT_WAKE_DEASSERT, NULL);
#endif
-
+#if (BT_WAKE_VIA_PROC == TRUE)
+ ioctl(vnd_userial.fd, TIOCCLRBTPORT, NULL);
+#endif
ALOGI("device fd = %d close", vnd_userial.fd);
if ((result = close(vnd_userial.fd)) < 0)