linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] Bluetooth: hci_h5: btrtl: Add support for RTL8822CS hci_ver 0x08
@ 2021-10-19  9:57 Vyacheslav Bocharov
  2021-10-19  9:57 ` [PATCH 1/2] Bluetooth: btrtl: Add support for RTL8822C " Vyacheslav Bocharov
  2021-10-19  9:57 ` [PATCH 2/2] Bluetooth: hci_h5: Add power reset via gpio in h5_btrtl_open Vyacheslav Bocharov
  0 siblings, 2 replies; 5+ messages in thread
From: Vyacheslav Bocharov @ 2021-10-19  9:57 UTC (permalink / raw)
  To: marcel, johan.hedberg, luiz.dentz; +Cc: linux-bluetooth, linux-kernel

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

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(+)

-- 
2.30.2


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/2] Bluetooth: btrtl: Add support for RTL8822C hci_ver 0x08
  2021-10-19  9:57 [PATCH 0/2] Bluetooth: hci_h5: btrtl: Add support for RTL8822CS hci_ver 0x08 Vyacheslav Bocharov
@ 2021-10-19  9:57 ` Vyacheslav Bocharov
  2021-10-19 18:29   ` Marcel Holtmann
  2021-10-19  9:57 ` [PATCH 2/2] Bluetooth: hci_h5: Add power reset via gpio in h5_btrtl_open Vyacheslav Bocharov
  1 sibling, 1 reply; 5+ messages in thread
From: Vyacheslav Bocharov @ 2021-10-19  9:57 UTC (permalink / raw)
  To: marcel, johan.hedberg, luiz.dentz; +Cc: linux-bluetooth, linux-kernel, chbgdn

Add detection of RTL8822CS controller with hci_ver = 0x08

Signed-off-by: chbgdn <chbgdn@gmail.com>
Signed-off-by: Vyacheslav Bocharov <adeep@lexina.in>
---
 drivers/bluetooth/btrtl.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/bluetooth/btrtl.c b/drivers/bluetooth/btrtl.c
index 1f8afa0244d8..60c4a9976d5a 100644
--- a/drivers/bluetooth/btrtl.c
+++ b/drivers/bluetooth/btrtl.c
@@ -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,
-- 
2.30.2


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 2/2] Bluetooth: hci_h5: Add power reset via gpio in h5_btrtl_open
  2021-10-19  9:57 [PATCH 0/2] Bluetooth: hci_h5: btrtl: Add support for RTL8822CS hci_ver 0x08 Vyacheslav Bocharov
  2021-10-19  9:57 ` [PATCH 1/2] Bluetooth: btrtl: Add support for RTL8822C " Vyacheslav Bocharov
@ 2021-10-19  9:57 ` Vyacheslav Bocharov
  1 sibling, 0 replies; 5+ messages in thread
From: Vyacheslav Bocharov @ 2021-10-19  9:57 UTC (permalink / raw)
  To: marcel, johan.hedberg, luiz.dentz; +Cc: linux-bluetooth, linux-kernel

Add power reset via enable-gpios in h5_btrtl_open function.

Signed-off-by: Vyacheslav Bocharov <adeep@lexina.in>
---
 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 0c0dedece59c..ab7c929cc25d 100644
--- a/drivers/bluetooth/hci_h5.c
+++ b/drivers/bluetooth/hci_h5.c
@@ -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);
-- 
2.30.2


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] Bluetooth: btrtl: Add support for RTL8822C hci_ver 0x08
  2021-10-19  9:57 ` [PATCH 1/2] Bluetooth: btrtl: Add support for RTL8822C " Vyacheslav Bocharov
@ 2021-10-19 18:29   ` Marcel Holtmann
  2021-10-20 10:08     ` Vyacheslav
  0 siblings, 1 reply; 5+ messages in thread
From: Marcel Holtmann @ 2021-10-19 18:29 UTC (permalink / raw)
  To: Vyacheslav Bocharov
  Cc: Johan Hedberg, Luiz Augusto von Dentz, linux-bluetooth,
	linux-kernel, chbgdn

Hi Vyacheslav,

> Add detection of RTL8822CS controller with hci_ver = 0x08
> 
> Signed-off-by: chbgdn <chbgdn@gmail.com>

clear name please.

> Signed-off-by: Vyacheslav Bocharov <adeep@lexina.in>
> ---
> drivers/bluetooth/btrtl.c | 7 +++++++
> 1 file changed, 7 insertions(+)
> 
> diff --git a/drivers/bluetooth/btrtl.c b/drivers/bluetooth/btrtl.c
> index 1f8afa0244d8..60c4a9976d5a 100644
> --- a/drivers/bluetooth/btrtl.c
> +++ b/drivers/bluetooth/btrtl.c
> @@ -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" },
> +

what about the .has_msft_ext here. Does this one support the Microsoft extension?

Regards

Marcel


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] Bluetooth: btrtl: Add support for RTL8822C hci_ver 0x08
  2021-10-19 18:29   ` Marcel Holtmann
@ 2021-10-20 10:08     ` Vyacheslav
  0 siblings, 0 replies; 5+ messages in thread
From: Vyacheslav @ 2021-10-20 10:08 UTC (permalink / raw)
  To: Marcel Holtmann
  Cc: Johan Hedberg, Luiz Augusto von Dentz, linux-bluetooth,
	linux-kernel, chbgdn

19.10.2021 21:29, Marcel Holtmann wrote:
> Hi Vyacheslav,
> 
>> Add detection of RTL8822CS controller with hci_ver = 0x08
>>
>> Signed-off-by: chbgdn <chbgdn@gmail.com>
> 
> clear name please.

If Bohdan doesn't answer, we can remove this line.

>> +	/* 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" },
>> +
> 
> what about the .has_msft_ext here. Does this one support the Microsoft extension?



This is only a variant of the already added 8822c controller, so I 
simply copied the parameters and changed only hci_ver to 0x8.
I found this controller on X96 TV Box and JetHome H1 device.

It will also be necessary to update rtl8822cs_config in the 
linux-firmware repository from 
https://github.com/armbian/firmware/commit/5d685ad233b4dfd03a4d025fa0061f6b0f850cb3

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-10-20 10:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-19  9:57 [PATCH 0/2] Bluetooth: hci_h5: btrtl: Add support for RTL8822CS hci_ver 0x08 Vyacheslav Bocharov
2021-10-19  9:57 ` [PATCH 1/2] Bluetooth: btrtl: Add support for RTL8822C " Vyacheslav Bocharov
2021-10-19 18:29   ` Marcel Holtmann
2021-10-20 10:08     ` Vyacheslav
2021-10-19  9:57 ` [PATCH 2/2] Bluetooth: hci_h5: Add power reset via gpio in h5_btrtl_open Vyacheslav Bocharov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).