Lakka-LibreELEC/projects/Allwinner/patches/linux/0102-Bluetooth-btrtl-Add-support-for-RTL8822BS-UART.patch
Rudi Heitbaum bd80779d30 linux (Allwinner): Bluetooth: btrtl: Add support for RTL8822BS UART
Found in some variants of Tanix TX6

Before:
[    7.512876] rtw_8822bs mmc2:0001:1: Firmware version 27.2.0, H2C version 13
[    8.219545] Bluetooth: hci0: RTL: examining hci_ver=07 hci_rev=000b lmp_ver=07 lmp_subver=8822
[    8.430833] Bluetooth: hci0: RTL: examining hci_ver=07 hci_rev=000b lmp_ver=07 lmp_subver=8822
[    8.430866] Bluetooth: hci0: RTL: unknown IC info, lmp subver 8822, hci rev 000b, hci ver 0007
After:
[    8.958224] rtw_8822bs mmc2:0001:1: Firmware version 27.2.0, H2C version 13
[    9.017294] Bluetooth: hci0: RTL: examining hci_ver=07 hci_rev=000b lmp_ver=07 lmp_subver=8822
[    9.021399] Bluetooth: hci0: RTL: rom_version status=0 version=2
[    9.021428] Bluetooth: hci0: RTL: loading rtl_bt/rtl8822bs_fw.bin
[    9.024180] Bluetooth: hci0: RTL: loading rtl_bt/rtl8822bs_config.bin
[    9.048050] Bluetooth: hci0: RTL: cfg_sz 25, total sz 23101
[   10.316891] Bluetooth: hci0: RTL: fw version 0xaa6c133c
2023-01-10 09:03:56 +00:00

63 lines
2.1 KiB
Diff

From db71696da000fd8cc7db992940fcb922e771b3d0 Mon Sep 17 00:00:00 2001
From: Rudi Heitbaum <rudi@heitbaum.com>
Date: Sun, 8 Jan 2023 04:22:27 +0000
Subject: [PATCH 1/2] Bluetooth: btrtl: Add support for RTL8822BS UART
Add a RTL8822BS UART with hci_ver = 0x07. This is similar to RTL8822CS
observed on the Tanix TX6 Android set-top box. But the previous
generation of chip.
Signed-off-by: Rudi Heitbaum <rudi@heitbaum.com>
---
drivers/bluetooth/btrtl.c | 10 +++++++++-
drivers/bluetooth/hci_h5.c | 6 ++++++
2 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/drivers/bluetooth/btrtl.c b/drivers/bluetooth/btrtl.c
index fb52313a1d45..011857e303b6 100644
--- a/drivers/bluetooth/btrtl.c
+++ b/drivers/bluetooth/btrtl.c
@@ -174,7 +174,15 @@ static const struct id_table ic_id_table[] = {
.fw_name = "rtl_bt/rtl8822cu_fw.bin",
.cfg_name = "rtl_bt/rtl8822cu_config" },
- /* 8822B */
+ /* 8822BS with UART interface */
+ { IC_INFO(RTL_ROM_LMP_8822B, 0xb, 0x7, HCI_UART),
+ .config_needed = true,
+ .has_rom_version = true,
+ .has_msft_ext = true,
+ .fw_name = "rtl_bt/rtl8822bs_fw.bin",
+ .cfg_name = "rtl_bt/rtl8822bs_config" },
+
+ /* 8822BU with USB interface */
{ IC_INFO(RTL_ROM_LMP_8822B, 0xb, 0x7, HCI_USB),
.config_needed = true,
.has_rom_version = true,
diff --git a/drivers/bluetooth/hci_h5.c b/drivers/bluetooth/hci_h5.c
index c5a0409ef84f..a8bc2097bc2c 100644
--- a/drivers/bluetooth/hci_h5.c
+++ b/drivers/bluetooth/hci_h5.c
@@ -1068,6 +1068,10 @@ static struct h5_vnd rtl_vnd = {
.acpi_gpio_map = acpi_btrtl_gpios,
};
+static const struct h5_device_data h5_data_rtl8822bs = {
+ .vnd = &rtl_vnd,
+};
+
static const struct h5_device_data h5_data_rtl8822cs = {
.vnd = &rtl_vnd,
};
@@ -1096,6 +1100,8 @@ static const struct dev_pm_ops h5_serdev_pm_ops = {
static const struct of_device_id rtl_bluetooth_of_match[] = {
#ifdef CONFIG_BT_HCIUART_RTL
+ { .compatible = "realtek,rtl8822bs-bt",
+ .data = (const void *)&h5_data_rtl8822bs },
{ .compatible = "realtek,rtl8822cs-bt",
.data = (const void *)&h5_data_rtl8822cs },
{ .compatible = "realtek,rtl8723bs-bt",
--
2.25.1