Skip to contentSkip to conversation

Bluetooth: hci_h5: btrtl: Add support for RTL8822CS hci_ver 0x08

PATCH Superseded Vyacheslav Bocharov 2 participants 5 messages Oct 25, 2021 – Oct 27, 2021 Bluetooth drivers

v2 of 7 Superseded Latest is v7 →

lore
Share & tools
lore
#0 lore raw

v2 cover 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 The controller does not always start when the system starts up, so we do a forced reset via gpio during initialization.

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  | 7 +++++++
 drivers/bluetooth/hci_h5.c | 5 +++++
 2 files changed, 12 insertions(+)
Signature · 1 line
2.30.2
#1 lore raw

PATCH v2 1/2 Bluetooth: btrtl: Add support for RTL8822C hci_ver 0x08

Add detection of RTL8822CS controller with hci_ver = 0x08

---
 drivers/bluetooth/btrtl.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/bluetooth/btrtl.c +7 -0
index 1f8afa0244d8..60c4a9976d5a 100644
@@ -152,6 +152,13 @@ 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,
+	  .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,
Signature · 1 line
2.30.2
#2 lore raw

PATCH v2 2/2 Bluetooth: hci_h5: Add power reset via gpio in h5_btrtl_open

In reply to Vyacheslav Bocharov

Add power reset via enable-gpios in h5_btrtl_open function.

---
 drivers/bluetooth/hci_h5.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/bluetooth/hci_h5.c +5 -0
index 0c0dedece59c..ab7c929cc25d 100644
@@ -968,6 +968,11 @@ static void h5_btrtl_open(struct h5 *h5)
 					 SUSPEND_TIMEOUT_MS);
 	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);
Signature · 1 line
2.30.2
maintainer
#3 lore raw
In reply to Vyacheslav Bocharov

Hi Vzacheslav,

Quoted 6 lines

Add a variation of RTL8822CS with hci_ver = 0x08. This is fully similar to RTL8822CS with hci_ver = 0x0a The controller does not always start when the system starts up, so we do a forced reset via gpio during initialization.

Changes from v1:
- remove Signed-off-by chbgdn <[email protected]> as not reachable

Quoted 7 lines

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 | 7 +++++++
drivers/bluetooth/hci_h5.c | 5 +++++

2 files changed, 12 insertions(+)

the patches don’t apply cleanly against bluetooth-next tree.

Regards

Marcel

author
#4 lore raw

Thanks. Aligned to bluetooth-next.

Quoted 22 lines · Marcel Holtmann

Hi Vzacheslav,

Quoted 6 lines

Add a variation of RTL8822CS with hci_ver = 0x08. This is fully similar to RTL8822CS with hci_ver = 0x0a The controller does not always start when the system starts up, so we do a forced reset via gpio during initialization.

Changes from v1:
- remove Signed-off-by chbgdn <[email protected]> as not reachable

Quoted 7 lines

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 | 7 +++++++
drivers/bluetooth/hci_h5.c | 5 +++++

2 files changed, 12 insertions(+)

the patches don’t apply cleanly against bluetooth-next tree.

Regards

Marcel