2022-01-26 20:23:35

by Viacheslav

[permalink] [raw]
Subject: [PATCH v7 0/2] Bluetooth: hci_h5: btrtl: Add support for RTL8822CS hci_ver 0x08

Add a variation of RTL8822CS with hci_ver = 0x08. This is fully similar
to RTL8822CS with hci_ver = 0x0a observed on the Tanix TX6 Android set-top
box and JetHome JetHub H1.

While testing the RTL8822CS SDIO WiFi/BT adapter, I found that in some
cases the kernel could not initialize it. However, manually resetting the
adapter via gpio allows it to start correctly.
Apparently at system start the adapter is in an undefined state (including
the unknown state of gpio after starting uboot). A forced reset helps to
initialize the adapter in most cases. Experimentally it was found that
100ms is enough to reset.
So, add power reset via enable-gpios in h5_btrtl_open function.

Changes from v6..v4:
- fix patch description
Changes from v3:
- add has_msft_ext option
Changes from v2:
- align the patches for bluetooth-next
Changes from v1:
- remove Signed-off-by chbgdn <[email protected]> as not reachable

Vyacheslav Bocharov (2):
Bluetooth: btrtl: Add support for RTL8822C hci_ver 0x08
Bluetooth: hci_h5: Add power reset via gpio in h5_btrtl_open

drivers/bluetooth/btrtl.c | 8 ++++++++
drivers/bluetooth/hci_h5.c | 5 +++++
2 files changed, 13 insertions(+)

--
2.30.2


2022-01-26 20:23:38

by Viacheslav

[permalink] [raw]
Subject: [PATCH v7 1/2] Bluetooth: btrtl: Add support for RTL8822C hci_ver 0x08

Add a variation of RTL8822CS with hci_ver = 0x08. This is fully similar
to RTL8822CS with hci_ver = 0x0a observed on the Tanix TX6 Android
set-top box and JetHome JetHub H1.

Signed-off-by: Vyacheslav Bocharov <[email protected]>
Signed-off-by: Rudi Heitbaum <[email protected]>
---
drivers/bluetooth/btrtl.c | 8 ++++++++
1 file changed, 8 insertions(+)

diff --git a/drivers/bluetooth/btrtl.c b/drivers/bluetooth/btrtl.c
index c2bdd1e6060e..c2030f7e25b4 100644
--- a/drivers/bluetooth/btrtl.c
+++ b/drivers/bluetooth/btrtl.c
@@ -148,6 +148,14 @@ static const struct id_table ic_id_table[] = {
.fw_name = "rtl_bt/rtl8761bu_fw.bin",
.cfg_name = "rtl_bt/rtl8761bu_config" },

+ /* 8822C with UART interface */
+ { IC_INFO(RTL_ROM_LMP_8822B, 0xc, 0x8, HCI_UART),
+ .config_needed = true,
+ .has_rom_version = true,
+ .has_msft_ext = true,
+ .fw_name = "rtl_bt/rtl8822cs_fw.bin",
+ .cfg_name = "rtl_bt/rtl8822cs_config" },
+
/* 8822C with UART interface */
{ IC_INFO(RTL_ROM_LMP_8822B, 0xc, 0xa, HCI_UART),
.config_needed = true,
--
2.30.2

2022-01-26 21:22:23

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [PATCH v7 0/2] Bluetooth: hci_h5: btrtl: Add support for RTL8822CS hci_ver 0x08

Hi Vyacheslav,

> Add a variation of RTL8822CS with hci_ver = 0x08. This is fully similar
> to RTL8822CS with hci_ver = 0x0a observed on the Tanix TX6 Android set-top
> box and JetHome JetHub H1.
>
> While testing the RTL8822CS SDIO WiFi/BT adapter, I found that in some
> cases the kernel could not initialize it. However, manually resetting the
> adapter via gpio allows it to start correctly.
> Apparently at system start the adapter is in an undefined state (including
> the unknown state of gpio after starting uboot). A forced reset helps to
> initialize the adapter in most cases. Experimentally it was found that
> 100ms is enough to reset.
> So, add power reset via enable-gpios in h5_btrtl_open function.
>
> Changes from v6..v4:
> - fix patch description
> Changes from v3:
> - add has_msft_ext option
> Changes from v2:
> - align the patches for bluetooth-next
> Changes from v1:
> - remove Signed-off-by chbgdn <[email protected]> as not reachable
>
> Vyacheslav Bocharov (2):
> Bluetooth: btrtl: Add support for RTL8822C hci_ver 0x08
> Bluetooth: hci_h5: Add power reset via gpio in h5_btrtl_open
>
> drivers/bluetooth/btrtl.c | 8 ++++++++
> drivers/bluetooth/hci_h5.c | 5 +++++
> 2 files changed, 13 insertions(+)

both patches have been applied to bluetooth-next tree.

Regards

Marcel