From 09b16a99028ec3f68cff6a0db9f7a5d94b9e7498 Mon Sep 17 00:00:00 2001 From: Hyuk Lee Date: Tue, 5 Sep 2017 10:22:09 +0900 Subject: [PATCH 1/1] Add the bt-dev-end-rpi3.sh for RPI3 Change-Id: I4a3f41dd3bc2edb1c25e430cd4a0864635402919 Signed-off-by: Hyuk Lee --- packaging/bluetooth-firmware-bcm.spec | 4 +++- scripts/CMakeLists.txt | 1 + scripts/bt-dev-end-rpi3.sh | 30 ++++++++++++++++++++++++++++++ 3 files changed, 34 insertions(+), 1 deletion(-) create mode 100755 scripts/bt-dev-end-rpi3.sh diff --git a/packaging/bluetooth-firmware-bcm.spec b/packaging/bluetooth-firmware-bcm.spec index fb77b03..544ad10 100644 --- a/packaging/bluetooth-firmware-bcm.spec +++ b/packaging/bluetooth-firmware-bcm.spec @@ -140,13 +140,15 @@ ln -s /lib/firmware/bcm43012/BCM43012B0_002.001.021.0081.0087.hex /lib/firmware/ %post rpi3 rm -rf %{_prefix}/etc/bluetooth/bt-dev-start.sh +rm -rf %{_prefix}/etc/bluetooth/bt-dev-end.sh ln -s %{_prefix}/etc/bluetooth/bt-dev-start-rpi3.sh %{_prefix}/etc/bluetooth/bt-dev-start.sh +ln -s %{_prefix}/etc/bluetooth/bt-dev-end-rpi3.sh %{_prefix}/etc/bluetooth/bt-dev-end.sh %files rpi3 %manifest %{name}.manifest %license LICENSE.APLv2 LICENSE.Broadcom %defattr(-,root,root,-) %{_prefix}/etc/bluetooth/BCM43430A1.hcd -%attr(755,-,-) %{_prefix}/etc/bluetooth/bt-dev-end.sh +%attr(755,-,-) %{_prefix}/etc/bluetooth/bt-dev-end-rpi3.sh %attr(755,-,-) %{_prefix}/etc/bluetooth/bt-dev-start-rpi3.sh %manifest %{name}.manifest diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt index 45b184c..a088f04 100755 --- a/scripts/CMakeLists.txt +++ b/scripts/CMakeLists.txt @@ -11,3 +11,4 @@ INSTALL(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/bt-dev-start-artik.sh DESTINATION $ # RPI3 INSTALL(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/bt-dev-start-rpi3.sh DESTINATION ${PLUGIN_INSTALL_PREFIX}/etc/bluetooth) +INSTALL(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/bt-dev-end-rpi3.sh DESTINATION ${PLUGIN_INSTALL_PREFIX}/etc/bluetooth) diff --git a/scripts/bt-dev-end-rpi3.sh b/scripts/bt-dev-end-rpi3.sh new file mode 100755 index 0000000..ae8f86c --- /dev/null +++ b/scripts/bt-dev-end-rpi3.sh @@ -0,0 +1,30 @@ +#!/bin/sh +PATH=/bin:/usr/bin:/sbin:/usr/sbin +PGREP=/usr/bin/pgrep + +# +# Script for stopping Broadcom UART Bluetooth stack +# + +# Device down +/usr/bin/hciconfig hci0 down + +# OMAP4 +REVISION_NUM=`grep Revision /proc/cpuinfo | awk "{print \\$3}"` +if [ $REVISION_NUM == "0006" ]; then + rmmod bt_drv.ko + rmmod st_drv.ko + sleep 1 + UIM_RFKILL_PID=$($PGREP uim_rfkill) + kill $UIM_RFKILL_PID + exit 0 +fi + +#if [ -e /sys/class/gpio/gpio17/value ] +#then +# # Reset BT chip +# echo 0 > /sys/class/gpio/gpio17/value +# sleep 0.1 +# echo 1 > /sys/class/gpio/gpio17/value +#fi + -- 2.7.4