Add the bt-dev-end-rpi3.sh for RPI3 50/147550/1
authorHyuk Lee <hyuk0512.lee@samsung.com>
Tue, 5 Sep 2017 01:22:09 +0000 (10:22 +0900)
committerHyuk Lee <hyuk0512.lee@samsung.com>
Tue, 5 Sep 2017 01:22:09 +0000 (10:22 +0900)
Change-Id: I4a3f41dd3bc2edb1c25e430cd4a0864635402919
Signed-off-by: Hyuk Lee <hyuk0512.lee@samsung.com>
packaging/bluetooth-firmware-bcm.spec
scripts/CMakeLists.txt
scripts/bt-dev-end-rpi3.sh [new file with mode: 0755]

index fb77b03..544ad10 100644 (file)
@@ -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
index 45b184c..a088f04 100755 (executable)
@@ -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 (executable)
index 0000000..ae8f86c
--- /dev/null
@@ -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
+