devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3 V2] Bluetooth: Add support for RTL8821CS
@ 2023-02-24 23:23 Chris Morgan
  2023-02-24 23:23 ` [PATCH 1/3 V2] dt-bindings: net: realtek-bluetooth: Add RTL8821CS Chris Morgan
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Chris Morgan @ 2023-02-24 23:23 UTC (permalink / raw)
  To: linux-bluetooth
  Cc: linux-rockchip, devicetree, alistair, anarsoul, luiz.dentz,
	johan.hedberg, marcel, heiko, krzysztof.kozlowski+dt, robh+dt,
	Chris Morgan

From: Chris Morgan <macromorgan@hotmail.com>

This patch series is to add support for the RTL8821CS Bluetooth
controller found on the RTL8821CS WiFi/Bluetooth combo chip.

This has been tested with firmware version 0x75b8f098 which has been
submitted by Realtek for inclusion in linux-firmware.

https://lore.kernel.org/linux-firmware/20230223062453.181239-1-max.chou@realtek.com/

Changes from V1:
 - Switched to use a fallback string for the rtl8822cs so as to not add
   an extra entry to the of_device_id table. The driver is capable of
   selecting the correct firmware blob to load.
 - Updated the messages to note a new version of the firmware was
   tested and that Realtek has submitted this firmware upstream.
 - Updated the devicetree node on the Anbernic RGxx3 series to use the
   fallback string of realtek,rtl8822cs-bt.

Chris Morgan (3):
  dt-bindings: net: realtek-bluetooth: Add RTL8821CS
  Bluetooth: hci_h5: btrtl: Add support for RTL8821CS
  arm64: dts: rockchip: Update compatible for bluetooth

 .../bindings/net/realtek-bluetooth.yaml       | 23 +++++++++++--------
 .../dts/rockchip/rk3566-anbernic-rgxx3.dtsi   |  2 +-
 drivers/bluetooth/btrtl.c                     |  8 +++++++
 3 files changed, 23 insertions(+), 10 deletions(-)

-- 
2.34.1


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

* [PATCH 1/3 V2] dt-bindings: net: realtek-bluetooth: Add RTL8821CS
  2023-02-24 23:23 [PATCH 0/3 V2] Bluetooth: Add support for RTL8821CS Chris Morgan
@ 2023-02-24 23:23 ` Chris Morgan
  2023-02-27  4:49   ` Alistair
  2023-02-27  7:49   ` Krzysztof Kozlowski
  2023-02-24 23:23 ` [PATCH 2/3 V2] Bluetooth: hci_h5: btrtl: Add support for RTL8821CS Chris Morgan
  2023-02-24 23:23 ` [PATCH 3/3 V2] arm64: dts: rockchip: Update compatible for bluetooth Chris Morgan
  2 siblings, 2 replies; 6+ messages in thread
From: Chris Morgan @ 2023-02-24 23:23 UTC (permalink / raw)
  To: linux-bluetooth
  Cc: linux-rockchip, devicetree, alistair, anarsoul, luiz.dentz,
	johan.hedberg, marcel, heiko, krzysztof.kozlowski+dt, robh+dt,
	Chris Morgan

From: Chris Morgan <macromorgan@hotmail.com>

Add compatible string for RTL8821CS for existing Realtek Bluetooth
driver.

Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
---
 .../bindings/net/realtek-bluetooth.yaml       | 23 +++++++++++--------
 1 file changed, 14 insertions(+), 9 deletions(-)

diff --git a/Documentation/devicetree/bindings/net/realtek-bluetooth.yaml b/Documentation/devicetree/bindings/net/realtek-bluetooth.yaml
index 143b5667abad..f91d06d629b9 100644
--- a/Documentation/devicetree/bindings/net/realtek-bluetooth.yaml
+++ b/Documentation/devicetree/bindings/net/realtek-bluetooth.yaml
@@ -4,24 +4,29 @@
 $id: http://devicetree.org/schemas/net/realtek-bluetooth.yaml#
 $schema: http://devicetree.org/meta-schemas/core.yaml#
 
-title: RTL8723BS/RTL8723CS/RTL8822CS Bluetooth
+title: RTL8723BS/RTL8723CS/RTL8821CS/RTL8822CS Bluetooth
 
 maintainers:
   - Vasily Khoruzhick <anarsoul@gmail.com>
   - Alistair Francis <alistair@alistair23.me>
 
 description:
-  RTL8723CS/RTL8723CS/RTL8822CS is WiFi + BT chip. WiFi part is connected over
-  SDIO, while BT is connected over serial. It speaks H5 protocol with few
-  extra commands to upload firmware and change module speed.
+  RTL8723CS/RTL8723CS/RTL8821CS/RTL8822CS is a WiFi + BT chip. WiFi part
+  is connected over SDIO, while BT is connected over serial. It speaks
+  H5 protocol with few extra commands to upload firmware and change
+  module speed.
 
 properties:
   compatible:
-    enum:
-      - realtek,rtl8723bs-bt
-      - realtek,rtl8723cs-bt
-      - realtek,rtl8723ds-bt
-      - realtek,rtl8822cs-bt
+    oneOf:
+      - const: realtek,rtl8723bs-bt
+      - const: realtek,rtl8723cs-bt
+      - const: realtek,rtl8723ds-bt
+      - const: realtek,rtl8822cs-bt
+      - items:
+          - enum:
+              - realtek,rtl8821cs-bt
+          - const: realtek,rtl8822cs-bt
 
   device-wake-gpios:
     maxItems: 1
-- 
2.34.1


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

* [PATCH 2/3 V2] Bluetooth: hci_h5: btrtl: Add support for RTL8821CS
  2023-02-24 23:23 [PATCH 0/3 V2] Bluetooth: Add support for RTL8821CS Chris Morgan
  2023-02-24 23:23 ` [PATCH 1/3 V2] dt-bindings: net: realtek-bluetooth: Add RTL8821CS Chris Morgan
@ 2023-02-24 23:23 ` Chris Morgan
  2023-02-24 23:23 ` [PATCH 3/3 V2] arm64: dts: rockchip: Update compatible for bluetooth Chris Morgan
  2 siblings, 0 replies; 6+ messages in thread
From: Chris Morgan @ 2023-02-24 23:23 UTC (permalink / raw)
  To: linux-bluetooth
  Cc: linux-rockchip, devicetree, alistair, anarsoul, luiz.dentz,
	johan.hedberg, marcel, heiko, krzysztof.kozlowski+dt, robh+dt,
	Chris Morgan

From: Chris Morgan <macromorgan@hotmail.com>

RTL8821CS is a WiFi + Bluetooth combo chip from Realtek that provides
WiFi A/B/G/N/AC over an SDIO interface and Bluetooth 4.2 over a UART
interface.

Note that the firmware this was tested with was firmware version
0x75b8f098.

Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
---
 drivers/bluetooth/btrtl.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/bluetooth/btrtl.c b/drivers/bluetooth/btrtl.c
index 69c3fe649ca7..72947d319fa6 100644
--- a/drivers/bluetooth/btrtl.c
+++ b/drivers/bluetooth/btrtl.c
@@ -128,6 +128,14 @@ static const struct id_table ic_id_table[] = {
 	  .fw_name  = "rtl_bt/rtl8821c_fw.bin",
 	  .cfg_name = "rtl_bt/rtl8821c_config" },
 
+	/* 8821CS */
+	{ IC_INFO(RTL_ROM_LMP_8821A, 0xc, 0x8, HCI_UART),
+	  .config_needed = true,
+	  .has_rom_version = true,
+	  .has_msft_ext = true,
+	  .fw_name  = "rtl_bt/rtl8821cs_fw.bin",
+	  .cfg_name = "rtl_bt/rtl8821cs_config" },
+
 	/* 8761A */
 	{ IC_INFO(RTL_ROM_LMP_8761A, 0xa, 0x6, HCI_USB),
 	  .config_needed = false,
-- 
2.34.1


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

* [PATCH 3/3 V2] arm64: dts: rockchip: Update compatible for bluetooth
  2023-02-24 23:23 [PATCH 0/3 V2] Bluetooth: Add support for RTL8821CS Chris Morgan
  2023-02-24 23:23 ` [PATCH 1/3 V2] dt-bindings: net: realtek-bluetooth: Add RTL8821CS Chris Morgan
  2023-02-24 23:23 ` [PATCH 2/3 V2] Bluetooth: hci_h5: btrtl: Add support for RTL8821CS Chris Morgan
@ 2023-02-24 23:23 ` Chris Morgan
  2 siblings, 0 replies; 6+ messages in thread
From: Chris Morgan @ 2023-02-24 23:23 UTC (permalink / raw)
  To: linux-bluetooth
  Cc: linux-rockchip, devicetree, alistair, anarsoul, luiz.dentz,
	johan.hedberg, marcel, heiko, krzysztof.kozlowski+dt, robh+dt,
	Chris Morgan

From: Chris Morgan <macromorgan@hotmail.com>

Update the compatible for the Realtek RTL8821CS bluetooth node.

Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
---
 arch/arm64/boot/dts/rockchip/rk3566-anbernic-rgxx3.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/rockchip/rk3566-anbernic-rgxx3.dtsi b/arch/arm64/boot/dts/rockchip/rk3566-anbernic-rgxx3.dtsi
index 41262a69d33e..8fadd8afb190 100644
--- a/arch/arm64/boot/dts/rockchip/rk3566-anbernic-rgxx3.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3566-anbernic-rgxx3.dtsi
@@ -716,7 +716,7 @@ &uart1 {
 	status = "okay";
 
 	bluetooth {
-		compatible = "realtek,rtl8821cs-bt";
+		compatible = "realtek,rtl8821cs-bt", "realtek,rtl8822cs-bt";
 		device-wake-gpios = <&gpio4 4 GPIO_ACTIVE_HIGH>;
 		enable-gpios = <&gpio4 3 GPIO_ACTIVE_HIGH>;
 		host-wake-gpios = <&gpio4 5 GPIO_ACTIVE_HIGH>;
-- 
2.34.1


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

* Re: [PATCH 1/3 V2] dt-bindings: net: realtek-bluetooth: Add RTL8821CS
  2023-02-24 23:23 ` [PATCH 1/3 V2] dt-bindings: net: realtek-bluetooth: Add RTL8821CS Chris Morgan
@ 2023-02-27  4:49   ` Alistair
  2023-02-27  7:49   ` Krzysztof Kozlowski
  1 sibling, 0 replies; 6+ messages in thread
From: Alistair @ 2023-02-27  4:49 UTC (permalink / raw)
  To: Chris Morgan, linux-bluetooth
  Cc: linux-rockchip, devicetree, Vasily Khoruzhick,
	Luiz Augusto von Dentz, Johan Hedberg, Marcel Holtmann,
	Heiko Stuebner, Krzysztof Kozlowski, Rob Herring, Chris Morgan

On Sat, 25 Feb 2023, at 9:23 AM, Chris Morgan wrote:
> From: Chris Morgan <macromorgan@hotmail.com>
> 
> Add compatible string for RTL8821CS for existing Realtek Bluetooth
> driver.
> 
> Signed-off-by: Chris Morgan <macromorgan@hotmail.com>

Reviewed-by: Alistair Francis <alistair@alistair23.me>

Alistair

> ---
> .../bindings/net/realtek-bluetooth.yaml       | 23 +++++++++++--------
> 1 file changed, 14 insertions(+), 9 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/net/realtek-bluetooth.yaml b/Documentation/devicetree/bindings/net/realtek-bluetooth.yaml
> index 143b5667abad..f91d06d629b9 100644
> --- a/Documentation/devicetree/bindings/net/realtek-bluetooth.yaml
> +++ b/Documentation/devicetree/bindings/net/realtek-bluetooth.yaml
> @@ -4,24 +4,29 @@
> $id: http://devicetree.org/schemas/net/realtek-bluetooth.yaml#
> $schema: http://devicetree.org/meta-schemas/core.yaml#
>  
> -title: RTL8723BS/RTL8723CS/RTL8822CS Bluetooth
> +title: RTL8723BS/RTL8723CS/RTL8821CS/RTL8822CS Bluetooth
>  
> maintainers:
>    - Vasily Khoruzhick <anarsoul@gmail.com>
>    - Alistair Francis <alistair@alistair23.me>
>  
> description:
> -  RTL8723CS/RTL8723CS/RTL8822CS is WiFi + BT chip. WiFi part is connected over
> -  SDIO, while BT is connected over serial. It speaks H5 protocol with few
> -  extra commands to upload firmware and change module speed.
> +  RTL8723CS/RTL8723CS/RTL8821CS/RTL8822CS is a WiFi + BT chip. WiFi part
> +  is connected over SDIO, while BT is connected over serial. It speaks
> +  H5 protocol with few extra commands to upload firmware and change
> +  module speed.
>  
> properties:
>    compatible:
> -    enum:
> -      - realtek,rtl8723bs-bt
> -      - realtek,rtl8723cs-bt
> -      - realtek,rtl8723ds-bt
> -      - realtek,rtl8822cs-bt
> +    oneOf:
> +      - const: realtek,rtl8723bs-bt
> +      - const: realtek,rtl8723cs-bt
> +      - const: realtek,rtl8723ds-bt
> +      - const: realtek,rtl8822cs-bt
> +      - items:
> +          - enum:
> +              - realtek,rtl8821cs-bt
> +          - const: realtek,rtl8822cs-bt
>  
>    device-wake-gpios:
>      maxItems: 1
> -- 
> 2.34.1
> 
> 

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

* Re: [PATCH 1/3 V2] dt-bindings: net: realtek-bluetooth: Add RTL8821CS
  2023-02-24 23:23 ` [PATCH 1/3 V2] dt-bindings: net: realtek-bluetooth: Add RTL8821CS Chris Morgan
  2023-02-27  4:49   ` Alistair
@ 2023-02-27  7:49   ` Krzysztof Kozlowski
  1 sibling, 0 replies; 6+ messages in thread
From: Krzysztof Kozlowski @ 2023-02-27  7:49 UTC (permalink / raw)
  To: Chris Morgan, linux-bluetooth
  Cc: linux-rockchip, devicetree, alistair, anarsoul, luiz.dentz,
	johan.hedberg, marcel, heiko, krzysztof.kozlowski+dt, robh+dt,
	Chris Morgan

On 25/02/2023 00:23, Chris Morgan wrote:
> From: Chris Morgan <macromorgan@hotmail.com>
> 
> Add compatible string for RTL8821CS for existing Realtek Bluetooth
> driver.
> 
> Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
> ---
>  .../bindings/net/realtek-bluetooth.yaml       | 23 +++++++++++--------
>  1 file changed, 14 insertions(+), 9 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/net/realtek-bluetooth.yaml b/Documentation/devicetree/bindings/net/realtek-bluetooth.yaml
> index 143b5667abad..f91d06d629b9 100644
> --- a/Documentation/devicetree/bindings/net/realtek-bluetooth.yaml
> +++ b/Documentation/devicetree/bindings/net/realtek-bluetooth.yaml
> @@ -4,24 +4,29 @@
>  $id: http://devicetree.org/schemas/net/realtek-bluetooth.yaml#
>  $schema: http://devicetree.org/meta-schemas/core.yaml#
>  
> -title: RTL8723BS/RTL8723CS/RTL8822CS Bluetooth
> +title: RTL8723BS/RTL8723CS/RTL8821CS/RTL8822CS Bluetooth
>  
>  maintainers:
>    - Vasily Khoruzhick <anarsoul@gmail.com>
>    - Alistair Francis <alistair@alistair23.me>
>  
>  description:
> -  RTL8723CS/RTL8723CS/RTL8822CS is WiFi + BT chip. WiFi part is connected over
> -  SDIO, while BT is connected over serial. It speaks H5 protocol with few
> -  extra commands to upload firmware and change module speed.
> +  RTL8723CS/RTL8723CS/RTL8821CS/RTL8822CS is a WiFi + BT chip. WiFi part
> +  is connected over SDIO, while BT is connected over serial. It speaks
> +  H5 protocol with few extra commands to upload firmware and change
> +  module speed.
>  
>  properties:
>    compatible:
> -    enum:
> -      - realtek,rtl8723bs-bt
> -      - realtek,rtl8723cs-bt
> -      - realtek,rtl8723ds-bt
> -      - realtek,rtl8822cs-bt
> +    oneOf:
> +      - const: realtek,rtl8723bs-bt
> +      - const: realtek,rtl8723cs-bt
> +      - const: realtek,rtl8723ds-bt
> +      - const: realtek,rtl8822cs-bt

These still should be an enum. Why changing them?

> +      - items:
> +          - enum:
> +              - realtek,rtl8821cs-bt
> +          - const: realtek,rtl8822cs-bt

Best regards,
Krzysztof


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

end of thread, other threads:[~2023-02-27  7:49 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-24 23:23 [PATCH 0/3 V2] Bluetooth: Add support for RTL8821CS Chris Morgan
2023-02-24 23:23 ` [PATCH 1/3 V2] dt-bindings: net: realtek-bluetooth: Add RTL8821CS Chris Morgan
2023-02-27  4:49   ` Alistair
2023-02-27  7:49   ` Krzysztof Kozlowski
2023-02-24 23:23 ` [PATCH 2/3 V2] Bluetooth: hci_h5: btrtl: Add support for RTL8821CS Chris Morgan
2023-02-24 23:23 ` [PATCH 3/3 V2] arm64: dts: rockchip: Update compatible for bluetooth Chris Morgan

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).