Fix Bluetooth on ASUS Tinker (#1891) (#1892)

* Use upstream Linux driver for Bluetooth on ASUS Tinker

* Drop unnecessary Bluetooth initialization systemd service

Bluetooth is now entirely handled by the kernel.
This commit is contained in:
Stefan Agner
2022-05-11 01:51:19 +02:00
committed by GitHub
parent 4a42d578fe
commit ba8bda73fa
13 changed files with 116 additions and 245 deletions

View File

@@ -1,21 +0,0 @@
#!/bin/bash
echo "Setup the Bluetooth chip"
echo 146 > /sys/class/gpio/export
echo 149 > /sys/class/gpio/export
echo 151 > /sys/class/gpio/export
echo high > /sys/class/gpio/gpio146/direction
echo high > /sys/class/gpio/gpio149/direction
echo high > /sys/class/gpio/gpio151/direction
echo "Resetting the Bluetooth chip"
echo 0 > /sys/class/gpio/gpio149/value
echo -e "\tBluetooth chip power down..."
sleep 1
echo 1 > /sys/class/gpio/gpio149/value
echo -e "\tBluetooth chip power up..."
sleep 1
echo -e "\tResetting done"
/usr/sbin/rtk_hciattach -s 115200 /dev/ttyS0 rtk_h5 115200 flow

View File

@@ -4,27 +4,19 @@
#
################################################################################
BLUETOOTH_RTL8723_VERSION = 1.0.0
BLUETOOTH_RTL8723_VERSION = 1.1.0
BLUETOOTH_RTL8723_LICENSE = Apache License 2.0
BLUETOOTH_RTL8723_LICENSE_FILES = $(BR2_EXTERNAL_HASSOS_PATH)/../LICENSE
BLUETOOTH_RTL8723_SITE = $(BR2_EXTERNAL_HASSOS_PATH)/package/bluetooth-rtl8723
BLUETOOTH_RTL8723_SITE_METHOD = local
define BLUETOOTH_RTL8723_BUILD_CMDS
curl -L -o $(@D)/rtk_hciattach https://raw.githubusercontent.com/home-assistant/hassos-blobs/e0c8b7aebb626694cf5c017a9e03068aee2bc604/rtl_bt/rtk_hciattach
curl -L -o $(@D)/rtl8723b_config https://raw.githubusercontent.com/home-assistant/hassos-blobs/e0c8b7aebb626694cf5c017a9e03068aee2bc604/rtl_bt/rtl8723b_config.bin
curl -L -o $(@D)/rtl8723b_fw https://raw.githubusercontent.com/home-assistant/hassos-blobs/e0c8b7aebb626694cf5c017a9e03068aee2bc604/rtl_bt/rtl8723b_fw.bin
curl -L -o $(@D)/rtl8723bs_config.bin https://raw.githubusercontent.com/home-assistant/hassos-blobs/e0c8b7aebb626694cf5c017a9e03068aee2bc604/rtl_bt/rtl8723b_config.bin
endef
define BLUETOOTH_RTL8723_INSTALL_TARGET_CMDS
$(INSTALL) -d $(TARGET_DIR)/etc/systemd/system/hassos-hardware.target.wants
$(INSTALL) -m 0755 $(@D)/bluetooth-rtl8723 $(TARGET_DIR)/usr/sbin/
$(INSTALL) -m 0644 $(@D)/bluetooth-rtl8723.service $(TARGET_DIR)/usr/lib/systemd/system/
$(INSTALL) -d $(TARGET_DIR)/lib/firmware/rtlbt
$(INSTALL) -m 0644 $(@D)/rtl8723b_* $(TARGET_DIR)/lib/firmware/rtlbt/
$(INSTALL) -m 0755 $(@D)/rtk_hciattach $(TARGET_DIR)/usr/sbin/
$(INSTALL) -m 0644 $(@D)/rtl8723bs_config.bin $(TARGET_DIR)/lib/firmware/rtl_bt/
endef
$(eval $(generic-package))

View File

@@ -1,11 +0,0 @@
[Unit]
Description=Bluetooth for RTL8723
Before=bluetooth.service
After=dev-ttyS0.device
[Service]
Type=forking
ExecStart=/usr/sbin/bluetooth-rtl8723
[Install]
WantedBy=hassos-hardware.target