Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #! /bin/sh
- # /etc/init.d/khadas-bt-init
- #
- do_start()
- {
- #non mainline: model=`cat /sys/bus/mmc/devices/sdio:0001/sdio:0001:1/device`
- model=`cat /sys/bus/mmc/devices/mmc2\:0001/mmc2\:0001\:1/device`
- echo 0 > /sys/class/rfkill/rfkill0/state
- /bin/sleep 1
- echo 1 > /sys/class/rfkill/rfkill0/state
- # Load the firmware
- if [ "$model" = "0xa9bf" ]; then
- # VIM Pro
- /usr/local/bin/brcm_patchram_plus --patchram /lib/firmware/brcm/BCM4345C0.hcd --enable_hci --no2bytes --tosleep 1000 /dev/ttyAML1
- #non mainline: /usr/local/bin/brcm_patchram_plus --patchram /lib/firmware/brcm/BCM4345C0.hcd --enable_hci --no2bytes --tosleep 1000 /dev/ttyS1
- else
- # VIM
- /usr/local/bin/brcm_patchram_plus --patchram /lib/firmware/brcm/bcm43438a1.hcd --enable_hci --no2bytes --tosleep 1000 /dev/ttyAML1
- # non mainline: /usr/local/bin/brcm_patchram_plus --patchram /lib/firmware/brcm/bcm43438a1.hcd --enable_hci --no2bytes --tosleep 1000 /dev/ttyS1
- fi
- # FIXME Delay
- /bin/sleep 1
- # Attach HCI adapter
- #non mainline: /usr/bin/hciattach /dev/ttyS1 any
- /usr/bin/hciattach /dev/ttyAML1 any
- }
- case "$1" in
- start)
- echo "Starting khadas-bt-init"
- do_start
- break;;
- stop)
- echo "Stopping khadas-bt-init"
- break;;
- *)
- echo "Usage: /etc/init.d/khadas-bt-init {start|stop}"
- exit 1
- ;;
- esac
- exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement