diff options
author | jeonghoon.lim <jeonghoon.lim@lge.com> | 2012-07-13 13:00:37 -0700 |
---|---|---|
committer | Iliyan Malchev <malchev@google.com> | 2012-07-18 01:09:56 -0700 |
commit | 6a2ca5a2f570d4327c5909332ce584334feb73cf (patch) | |
tree | 19735a4f55ae46700676b5fa348b52d196461b85 | |
parent | e87b04dedc2bc4185758e2b1656d3c509e54e4e5 (diff) | |
download | mako-6a2ca5a2f570d4327c5909332ce584334feb73cf.tar.gz |
mako: bluetooth: bring up
- top-level init.mako.bt.sh script calls hci_qcomm_init to initialize bluetooth
- modified BoardConfig.mk, device.mk, init.mako.rc. ueventd.mako.rc
to add bring up code (remove qcom property for smd)
Change-Id: Id97080655696676c02fea93138eb819b1ee1a4b9
Signed-off-by: Iliyan Malchev <malchev@google.com>
-rw-r--r-- | BoardConfig.mk | 2 | ||||
-rw-r--r-- | device.mk | 12 | ||||
-rw-r--r-- | init.mako.bt.sh | 58 | ||||
-rw-r--r-- | init.mako.rc | 8 | ||||
-rw-r--r-- | ueventd.mako.rc | 5 |
5 files changed, 84 insertions, 1 deletions
diff --git a/BoardConfig.mk b/BoardConfig.mk index 83fec66..4f56ddf 100644 --- a/BoardConfig.mk +++ b/BoardConfig.mk @@ -77,7 +77,9 @@ BOARD_FLASH_BLOCK_SIZE := 131072 # (BOARD_KERNEL_PAGESIZE * 64) BOARD_USES_SECURE_SERVICES := true BOARD_BLUETOOTH_DOES_NOT_USE_RFKILL := true +BOARD_BLUETOOTH_USES_HCIATTACH_PROPERTY := true BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE := $(TARGET_BOARD_PLATFORM) TARGET_NO_RPC := true + -include vendor/lge/mako/BoardConfigVendor.mk @@ -50,6 +50,9 @@ PRODUCT_COPY_FILES += \ device/lge/mako/WCNSS_qcom_wlan_nv.bin:system/etc/firmware/wlan/prima/WCNSS_qcom_wlan_nv.bin PRODUCT_COPY_FILES += \ + system/bluetooth/data/main.conf:system/etc/bluetooth/main.conf + +PRODUCT_COPY_FILES += \ device/lge/mako/snd_soc_msm_2x_Fusion3:system/etc/snd_soc_msm/snd_soc_msm_2x_Fusion3 PRODUCT_COPY_FILES += \ @@ -130,6 +133,15 @@ PRODUCT_PACKAGES += \ audio_policy.conf PRODUCT_PACKAGES += \ + hci_qcomm_init + +PRODUCT_COPY_FILES += \ + device/lge/mako/init.mako.bt.sh:system/etc/init.mako.bt.sh + +PRODUCT_PROPERTY_OVERRIDES += \ + ro.qualcomm.bt.hci_transport=smd + +PRODUCT_PACKAGES += \ camera.msm8960 \ libmmcamera_interface2 diff --git a/init.mako.bt.sh b/init.mako.bt.sh new file mode 100644 index 0000000..3e80196 --- /dev/null +++ b/init.mako.bt.sh @@ -0,0 +1,58 @@ +#!/system/bin/sh + +BLUETOOTH_SLEEP_PATH=/proc/bluetooth/sleep/proto +LOG_TAG="mako-bluetooth" +LOG_NAME="${0}:" + +hciattach_pid="" + +loge () +{ + /system/bin/log -t $LOG_TAG -p e "$LOG_NAME $@" +} + +logi () +{ + /system/bin/log -t $LOG_TAG -p i "$LOG_NAME $@" +} + +failed () +{ + loge "$1: exit code $2" + exit $2 +} + +# Note that "hci_qcomm_init -e" prints expressions to set the shell variables +# BTS_DEVICE, BTS_TYPE, BTS_BAUD, and BTS_ADDRESS. + +POWER_CLASS=`getprop qcom.bt.dev_power_class` +TRANSPORT=`getprop ro.qualcomm.bt.hci_transport` + +#find the transport type +logi "Transport : $TRANSPORT" + +case $POWER_CLASS in + 1) PWR_CLASS="-p 0" ; + logi "Power Class: 1";; + 2) PWR_CLASS="-p 1" ; + logi "Power Class: 2";; + 3) PWR_CLASS="-p 2" ; + logi "Power Class: CUSTOM";; + *) PWR_CLASS=""; + logi "Power Class: Ignored. Default(1) used (1-CLASS1/2-CLASS2/3-CUSTOM)"; + logi "Power Class: To override, Before turning BT ON; setprop qcom.bt.dev_power_class <1 or 2 or 3>";; +esac + +logwrapper /system/bin/hci_qcomm_init -e $PWR_CLASS + +case $? 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; + exit $exit_code_hci_qcomm_init;; +esac + +logi "start bluetooth smd transport" + +echo 1 > /sys/module/hci_smd/parameters/hcismd_set + +exit 0 diff --git a/init.mako.rc b/init.mako.rc index a0ba297..4c0a26b 100644 --- a/init.mako.rc +++ b/init.mako.rc @@ -312,13 +312,19 @@ service rmt_storage /system/bin/rmt_storage class main user root -service hciattach /system/bin/sh /system/etc/init.qcom.bt.sh +service hciattach /system/bin/sh /system/etc/init.mako.bt.sh class late_start user bluetooth group qcom_oncrpc bluetooth net_bt_admin system disabled oneshot +on property:bluetooth.hciattach=true + start hciattach + +on property:bluetooth.hciattach=false + write /sys/module/hci_smd/parameters/hcismd_set 0 + service bridgemgrd /system/bin/bridgemgrd class main user radio diff --git a/ueventd.mako.rc b/ueventd.mako.rc index 685de8d..754c01c 100644 --- a/ueventd.mako.rc +++ b/ueventd.mako.rc @@ -1,3 +1,8 @@ +/dev/smd3 0660 bluetooth bluetooth +/dev/smd2 0660 bluetooth bluetooth +/dev/uinput 0660 system bluetooth +/dev/ttyHS0 0600 bluetooth bluetooth +/dev/ttyMSM0 0600 bluetooth bluetooth /dev/genlock 0666 system system /dev/kgsl 0666 system system /dev/kgsl-3d0 0666 system system |