2022-01-21 16:58:01

by Viacheslav

[permalink] [raw]
Subject: [PATCH v4 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.

The controller does not always start when the system starts up, so we do a forced reset via gpio during initialization.

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-21 16:58:02

by Viacheslav

[permalink] [raw]
Subject: [PATCH v4 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.

Changes from v3:
- add has_msft_ext option

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..13e82783c2b9 100644
--- a/drivers/bluetooth/btrtl.c
+++ b/drivers/bluetooth/btrtl.c
@@ -156,6 +156,14 @@ static const struct id_table ic_id_table[] = {
.fw_name = "rtl_bt/rtl8822cs_fw.bin",
.cfg_name = "rtl_bt/rtl8822cs_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 USB interface */
{ IC_INFO(RTL_ROM_LMP_8822B, 0xc, 0xa, HCI_USB),
.config_needed = false,
--
2.30.2

2022-01-21 16:58:06

by Viacheslav

[permalink] [raw]
Subject: [PATCH v4 2/2] Bluetooth: hci_h5: Add power reset via gpio in h5_btrtl_open

Add power reset via enable-gpios in h5_btrtl_open function.

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

diff --git a/drivers/bluetooth/hci_h5.c b/drivers/bluetooth/hci_h5.c
index 34286ffe0568..fdf504b0d265 100644
--- a/drivers/bluetooth/hci_h5.c
+++ b/drivers/bluetooth/hci_h5.c
@@ -966,6 +966,11 @@ static void h5_btrtl_open(struct h5 *h5)
pm_runtime_enable(&h5->hu->serdev->dev);
}

+ /* The controller needs reset to startup */
+ gpiod_set_value_cansleep(h5->enable_gpio, 0);
+ gpiod_set_value_cansleep(h5->device_wake_gpio, 0);
+ msleep(100);
+
/* The controller needs up to 500ms to wakeup */
gpiod_set_value_cansleep(h5->enable_gpio, 1);
gpiod_set_value_cansleep(h5->device_wake_gpio, 1);
--
2.30.2

2022-01-21 19:59:34

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [PATCH v4 1/2] Bluetooth: btrtl: Add support for RTL8822C 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.
>
> Changes from v3:
> - add has_msft_ext option

these belong after the --- line. Please see patch submission guidelines.

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

Regards

Marcel