Browse files

Fix Bluetooth, move EGL to proprietary and remove btld crap.

  • Loading branch information...
1 parent d3e5247 commit a967b181b372e4f71cdd047e9f4d71454803a5ad @Dazzozo committed Jun 15, 2012
View
9 device_blade2.mk
@@ -81,19 +81,14 @@ PRODUCT_COPY_FILES += \
# WLAN + BT + FM
PRODUCT_COPY_FILES += \
- device/zte/blade2/prebuilt/etc/init.bt.sh:system/etc/init.bt.sh \
+ device/zte/blade2/prebuilt/etc/init.bt.sh:system/etc/init.qcom.bt.sh \
device/zte/blade2/prebuilt/etc/init.qcom.fm.sh:system/etc/init.qcom.fm.sh \
device/zte/blade2/prebuilt/etc/init.wlanprop.sh:system/etc/init.wlanprop.sh \
device/zte/blade2/prebuilt/etc/wifi/wpa_supplicant.conf:system/etc/wifi/wpa_supplicant.conf \
device/zte/blade2/prebuilt/etc/dhcpcd/dhcpcd.conf:system/etc/dhcpcd/dhcpcd.conf
# EGL
PRODUCT_COPY_FILES += \
- device/zte/blade2/prebuilt/lib/libgsl.so:system/lib/libgsl.so \
- device/zte/blade2/prebuilt/lib/egl/libEGL_adreno200.so:system/lib/egl/libEGL_adreno200.so \
- device/zte/blade2/prebuilt/lib/egl/libGLESv1_CM_adreno200.so:system/lib/egl/libGLESv1_CM_adreno200.so \
- device/zte/blade2/prebuilt/lib/egl/libGLESv2_adreno200.so:system/lib/egl/libGLESv2_adreno200.so \
- device/zte/blade2/prebuilt/lib/egl/libq3dtools_adreno200.so:system/lib/egl/libq3dtools_adreno200.so \
device/zte/blade2/prebuilt/lib/egl/egl.cfg:system/lib/egl/egl.cfg
# Install the features available on this device.
@@ -129,7 +124,7 @@ PRODUCT_PROPERTY_OVERRIDES += \
ro.media.dec.jpeg.memcap=10000000
PRODUCT_PROPERTY_OVERRIDES += \
- ro.build.baseband_version=P736EB01 \
+ ro.build.baseband_version=P736VB01 \
wifi.supplicant_scan_interval=60 \
ro.com.android.dataroaming=false
View
87 prebuilt/etc/init.bt.sh → prebuilt/etc/init.qcom.bt.sh
@@ -1,5 +1,5 @@
#!/system/bin/sh
-# Copyright (c) 2009, Code Aurora Forum. All rights reserved.
+# Copyright (c) 2009-2010, Code Aurora Forum. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
@@ -26,10 +26,29 @@
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
+# Modified by C3C0 for ZTE Skate ICS purposes - 24/04/2012
+# 1) disabled hci_qcom_init that is used to get the correct BT device parameters
+# to be used with hciattach. Since it has problems running under CFX we just
+# use parameters explicitly - we know the correct ones anyway...
+#
+# 2) in start_hci_attach() - use BCM sleep switch instead of default bluetooth sleep switch to make
+# BT release wake lock on suspend
+#
+
+# DEFAULT BT sleep switch
BLUETOOTH_SLEEP_PATH=/proc/bluetooth/sleep/proto
+
+# Broadcom bcm2035 sleep switch
+BLUETOOTH_SLEEP_PATH2=/proc/bcm/sleep/proto
+
LOG_TAG="qcom-bluetooth"
LOG_NAME="${0}:"
+# these are our correct parameters for hciattach
+BTS_DEVICE="/dev/ttyHS0"
+BTS_TYPE="bcm2035"
+BTS_BAUD="115200"
+
hciattach_pid=""
loge ()
@@ -45,13 +64,24 @@ logi ()
failed ()
{
loge "$1: exit code $2"
- exit $2
+ exit $2
}
start_hciattach ()
{
- echo 1 > $BLUETOOTH_SLEEP_PATH
- /system/bin/hciattach -n $QSOC_DEVICE $QSOC_TYPE $QSOC_BAUD &
+ # set default BT switch explicitly to 0 just to be sure
+ # it does not occupy wake IRQ that bcm sleep switch needs
+ echo 0 > $BLUETOOTH_SLEEP_PATH
+
+ # set bcm sleep switch to 1 to allow bluetooth sleep mode
+ echo 1 > $BLUETOOTH_SLEEP_PATH2
+
+ # exec hciattach with our explicit params
+ /system/bin/hciattach -n -s $BTS_BAUD $BTS_DEVICE $BTS_TYPE &
+
+ # original call
+ #/system/bin/hciattach -n $BTS_DEVICE $BTS_TYPE $BTS_BAUD &
+
hciattach_pid=$!
logi "start_hciattach: pid = $hciattach_pid"
}
@@ -66,31 +96,30 @@ kill_hciattach ()
}
# mimic hciattach options parsing -- maybe a waste of effort
-USAGE="hciattach [-n] [-p] [-b] [-t timeout] [-s initial_speed] <tty> <type | id> [speed] [flow|noflow] [bdaddr]"
-
-while getopts "blnpt:s:" f
-do
- case $f in
- b | l | n | p) opt_flags="$opt_flags -$f" ;;
- t) timeout=$OPTARG;;
- s) initial_speed=$OPTARG;;
- \?) echo $USAGE; exit 1;;
- esac
-done
-shift $(($OPTIND-1))
-
-QSOC_DEVICE=${1:-"/dev/ttyHS0"}
-QSOC_TYPE=${2:-"any"}
-QSOC_BAUD=${3:-"3000000"}
-
-/system/bin/hci_qcomm_init -d $QSOC_DEVICE -s $QSOC_BAUD
-
-exit_code_hci_qcomm_init=$?
-
-case $exit_code_hci_qcomm_init in
- 0) logi "Bluetooth QSoC firmware download succeeded";;
- *) failed "Bluetooth QSoC firmware download failed" $exit_code_hci_qcomm_init;;
-esac
+#USAGE="hciattach [-n] [-p] [-b] [-t timeout] [-s initial_speed] <tty> <type | id> [speed] [flow|noflow] [bdaddr]"
+
+#while getopts "blnpt:s:" f
+#do
+# case $f in
+# b | l | n | p) opt_flags="$opt_flags -$f" ;;
+# t) timeout=$OPTARG;;
+# s) initial_speed=$OPTARG;;
+# \?) echo $USAGE; exit 1;;
+# esac
+#done
+#shift $(($OPTIND-1))
+
+# Note that "hci_qcomm_init -e" prints expressions to set the shell variables
+# BTS_DEVICE, BTS_TYPE, BTS_BAUD, and BTS_ADDRESS.
+
+#eval $(/system/bin/hci_qcomm_init -e && echo "exit_code_hci_qcomm_init=0" || echo "exit_code_hci_qcomm_init=1")
+
+#case $exit_code_hci_qcomm_init in
+# 0) logi "Bluetooth QSoC firmware download succeeded, $BTS_DEVICE $BTS_TYPE $BTS_BAUD $BTS_ADDRESS";;
+# *) failed "Bluetooth QSoC firmware download failed" $exit_code_hci_qcomm_init;;
+#esac
+
+
# init does SIGTERM on ctl.stop for service
trap "kill_hciattach" TERM INT
View
23 prebuilt/init.blade2.rc
@@ -101,6 +101,13 @@ on property:init.svc.wpa_supplicant=stopped
stop dhcpcd
stop dhcpcd_wlan0
+# Necessary to have functional Bluetooth with Wi-Fi disabled.
+on property:init.svc.hciattach=running
+ write /sys/class/rfkill/rfkill1/state 1
+
+on property:init.svc.hciattach=stopped
+ write /sys/class/rfkill/rfkill1/state 0
+
on property:init.svc.bluetoothd=running
write /sys/devices/virtual/bluetooth/hci0/idle_timeout 7000
start btwlancoex
@@ -121,7 +128,7 @@ service rmt_storage /system/bin/rmt_storage /dev/block/mmcblk0p10 /dev/block/mmc
on property:ro.emmc=1
start rmt_storage
-service hciattach /system/bin/hciattach -n -s 115200 /dev/ttyHS0 bcm2035
+service hciattach /system/bin/sh /system/etc/init.qcom.bt.sh
user bluetooth
group qcom_oncrpc bluetooth net_bt_admin system
disabled
@@ -280,17 +287,5 @@ on property:persist.sys.ztelog.enable=1
on property:persist.sys.ztelog.enable=0
stop getlog
-service btld /system/bin/logwrapper /system/bin/btld -lpm 1 -hb 3000000
- user root
- group bluetooth net_bt_admin
- disabled
- oneshot
-
-on property:service.brcm.bt.soft_onoff=1
- start btld
-
-on property:service.brcm.bt.soft_onoff=0
- stop btld
-
# Hack for sh files in /etc
- chmod 7777 /system/etc/*.sh
+ chmod 7777 /system/etc/*.sh
View
BIN prebuilt/lib/egl/libEGL_adreno200.so
Binary file not shown.
View
BIN prebuilt/lib/egl/libGLESv1_CM_adreno200.so
Binary file not shown.
View
BIN prebuilt/lib/egl/libGLESv2_adreno200.so
Binary file not shown.
View
BIN prebuilt/lib/egl/libq3dtools_adreno200.so
Binary file not shown.
View
BIN prebuilt/lib/libgsl.so
Binary file not shown.

0 comments on commit a967b18

Please sign in to comment.