S36ap6256-bluetooth 894 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #!/bin/sh
  2. #
  3. # This shell script to loading the ap6256 bluetooth firmware
  4. # and set gpio52 to reset the bluetooth hardware.
  5. #
  6. DESC="loading ap6256 bluetooth firmware and reset bluetooth"
  7. [ -e /lib/firmware/BCM4345C5.hcd ] || exit
  8. case "$1" in
  9. start)
  10. echo "Starting $DESC: "
  11. echo 52 > /sys/class/gpio/export
  12. echo out > /sys/class/gpio/gpio52/direction
  13. echo 0 > /sys/class/gpio/gpio52/value
  14. sleep 1
  15. echo 1 > /sys/class/gpio/gpio52/value
  16. brcm_patchram_plus --enable_hci --no2bytes --tosleep 200000 --baudrate 1500000 --patchram /lib/firmware/BCM4345C5.hcd /dev/ttyS1 &
  17. ;;
  18. stop)
  19. echo "Stopping $DESC: "
  20. echo 0 > /sys/class/gpio/gpio52/value
  21. echo 52 > /sys/class/gpio/unexport
  22. killall brcm_patchram_plus
  23. ;;
  24. restart|force-reload)
  25. echo "Restarting $DESC: "
  26. $0 stop
  27. sleep 1
  28. $0 start
  29. ;;
  30. *)
  31. echo "Usage: $0 {start|stop|restart|force-reload}" >&2
  32. exit 1
  33. ;;
  34. esac
  35. exit 0