OSDN Git Service

Add support of RTL8723BS Bluetooth
authorChih-Wei Huang <cwhuang@linux.org.tw>
Tue, 6 Jun 2017 17:38:51 +0000 (01:38 +0800)
committerChih-Wei Huang <cwhuang@linux.org.tw>
Wed, 7 Jun 2017 03:48:04 +0000 (11:48 +0800)
Based on a patch provided by Li Xin <lixin@phoenixos.com>.

init.sh
init.x86.rc
packages.mk

diff --git a/init.sh b/init.sh
index e587424..e955a8f 100644 (file)
--- a/init.sh
+++ b/init.sh
@@ -77,6 +77,16 @@ function init_hal_bluetooth()
                chown bluetooth.bluetooth $BTUART_PORT
                start btattach
        fi
+
+       # rtl8723bs bluetooth
+       if dmesg -t | grep -qE '8723bs.*BT'; then
+               TTYSTRING=`dmesg -t | grep -E 'tty.*MMIO' | awk '{print $2}' | head -1`
+               if [ -n "$TTYSTRING" ]; then
+                       echo "RTL8723BS BT uses $TTYSTRING for Bluetooth."
+                       ln -sf $TTYSTRING /dev/rtk_h5
+                       start rtk_hciattach
+               fi
+       fi
 }
 
 function init_hal_camera()
index b799245..f093310 100644 (file)
@@ -102,6 +102,11 @@ service btattach /system/bin/btattach
     disabled
     oneshot
 
+service rtk_hciattach /vendor/bin/rtk_hciattach -n -s 115200 /dev/rtk_h5 rtk_h5
+    class main
+    disabled
+    oneshot
+
 service wacom-input /system/bin/wacom-input
     disabled
     oneshot
index ef37a67..67dd9dc 100644 (file)
@@ -48,6 +48,7 @@ PRODUCT_PACKAGES := \
     make_ext4fs \
     parted \
     power.x86 \
+    rtk_hciattach \
     scp \
     sensors.hsb \
     sftp \