Skip to contentSkip to conversation

dt-bindings: net: broadcom-bluetooth: Add CYW4373A0 DT binding

PATCH Applied Marek Vasut 3 participants 4 messages Nov 2, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/2 dt-bindings: net: broadcom-bluetooth: Add CYW4373A0 DT binding

CYW4373A0 is a Wi-Fi + Bluetooth combo device from Cypress. This chip is present e.g. on muRata 2AE module. Extend the binding with its DT compatible.

---
Cc: Hakan Jansson <[email protected]>
Cc: Krzysztof Kozlowski <[email protected]>
Cc: Linus Walleij <[email protected]>
Cc: Luiz Augusto von Dentz <[email protected]>
Cc: Marcel Holtmann <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: [email protected]
To: [email protected]
---
V2: - Add RB from Linus
- Add AB from Rob

---
 Documentation/devicetree/bindings/net/broadcom-bluetooth.yaml | 1 +
 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/net/broadcom-bluetooth.yaml +1 -0
index 445b2a5536259..e0c8abc274134 100644
@@ -24,6 +24,7 @@ properties:
       - brcm,bcm43540-bt
       - brcm,bcm4335a0
       - brcm,bcm4349-bt
+      - cypress,cyw4373a0-bt
       - infineon,cyw55572-bt
 
   shutdown-gpios:
Signature · 1 line
2.35.1
#1 lore raw

PATCH v2 2/2 Bluetooth: hci_bcm: Add CYW4373A0 support

CYW4373A0 is a Wi-Fi + Bluetooth combo device from Cypress. This chip is present e.g. on muRata 2AE module.

This chip has additional quirk where the HCI command 0xfc45, used on older chips to switch UART clock from 24 MHz to 48 MHz, to support baudrates over 3 Mbdps, is no longer recognized by this newer chip. This newer chip can configure the 4 Mbdps baudrate without the need to issue HCI command 0xfc45, so add flag to indicate this and do not issue the command on this chip to avoid failure to set 4 Mbdps baud rate.

It is not clear whether there is a way to determine which chip does and which chip does not support the HCI command 0xfc45, other than trial and error.

---
Cc: Hakan Jansson <[email protected]>
Cc: Krzysztof Kozlowski <[email protected]>
Cc: Linus Walleij <[email protected]>
Cc: Luiz Augusto von Dentz <[email protected]>
Cc: Marcel Holtmann <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: [email protected]
To: [email protected]
---
V2: - Rename bcm4373a0_device_data to cyw4373a0_device_data to be
consistent with the rest of the device naming
- Add RB from Linus

---
 drivers/bluetooth/hci_bcm.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)
drivers/bluetooth/hci_bcm.c +12 -1
index d7e0b75db8a60..2b6c0e1922cb3 100644
@@ -53,11 +53,13 @@
  * struct bcm_device_data - device specific data
  * @no_early_set_baudrate: Disallow set baudrate before driver setup()
  * @drive_rts_on_open: drive RTS signal on ->open() when platform requires it
+ * @no_uart_clock_set: UART clock set command for >3Mbps mode is unavailable
  * @max_autobaud_speed: max baudrate supported by device in autobaud mode
  */
 struct bcm_device_data {
 	bool	no_early_set_baudrate;
 	bool	drive_rts_on_open;
+	bool	no_uart_clock_set;
 	u32	max_autobaud_speed;
 };
 
@@ -100,6 +102,7 @@ struct bcm_device_data {
  * @is_suspended: whether flow control is currently disabled
  * @no_early_set_baudrate: don't set_baudrate before setup()
  * @drive_rts_on_open: drive RTS signal on ->open() when platform requires it
+ * @no_uart_clock_set: UART clock set command for >3Mbps mode is unavailable
  * @pcm_int_params: keep the initial PCM configuration
  * @use_autobaud_mode: start Bluetooth device in autobaud mode
  * @max_autobaud_speed: max baudrate supported by device in autobaud mode
@@ -140,6 +143,7 @@ struct bcm_device {
 #endif
 	bool			no_early_set_baudrate;
 	bool			drive_rts_on_open;
+	bool			no_uart_clock_set;
 	bool			use_autobaud_mode;
 	u8			pcm_int_params[5];
 	u32			max_autobaud_speed;
@@ -172,10 +176,11 @@ static inline void host_set_baudrate(struct hci_uart *hu, unsigned int speed)
 static int bcm_set_baudrate(struct hci_uart *hu, unsigned int speed)
 {
 	struct hci_dev *hdev = hu->hdev;
+	struct bcm_data *bcm = hu->priv;
 	struct sk_buff *skb;
 	struct bcm_update_uart_baud_rate param;
 
-	if (speed > 3000000) {
+	if (speed > 3000000 && !bcm->dev->no_uart_clock_set) {
 		struct bcm_write_uart_clock_setting clock;
 
 		clock.type = BCM_UART_CLOCK_48MHZ;
@@ -1529,6 +1534,7 @@ static int bcm_serdev_probe(struct serdev_device *serdev)
 		bcmdev->max_autobaud_speed = data->max_autobaud_speed;
 		bcmdev->no_early_set_baudrate = data->no_early_set_baudrate;
 		bcmdev->drive_rts_on_open = data->drive_rts_on_open;
+		bcmdev->no_uart_clock_set = data->no_uart_clock_set;
 	}
 
 	return hci_uart_register_device(&bcmdev->serdev_hu, &bcm_proto);
@@ -1550,6 +1556,10 @@ static struct bcm_device_data bcm43438_device_data = {
 	.drive_rts_on_open = true,
 };
 
+static struct bcm_device_data cyw4373a0_device_data = {
+	.no_uart_clock_set = true,
+};
+
 static struct bcm_device_data cyw55572_device_data = {
 	.max_autobaud_speed = 921600,
 };
@@ -1566,6 +1576,7 @@ static const struct of_device_id bcm_bluetooth_of_match[] = {
 	{ .compatible = "brcm,bcm4349-bt", .data = &bcm43438_device_data },
 	{ .compatible = "brcm,bcm43540-bt", .data = &bcm4354_device_data },
 	{ .compatible = "brcm,bcm4335a0" },
+	{ .compatible = "cypress,cyw4373a0-bt", .data = &cyw4373a0_device_data },
 	{ .compatible = "infineon,cyw55572-bt", .data = &cyw55572_device_data },
 	{ },
 };
Signature · 1 line
2.35.1
#2 lore raw
In reply to Marek Vasut

This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list. This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=691310

---Test result---

Test Summary:

CheckPatch                    PASS      1.85 seconds
GitLint                       PASS      0.94 seconds
SubjectPrefix                 FAIL      0.34 seconds
BuildKernel                   PASS      46.24 seconds
BuildKernel32                 PASS      41.91 seconds
Incremental Build with patchesPASS      68.73 seconds
TestRunner: Setup             PASS      679.47 seconds
TestRunner: l2cap-tester      PASS      21.71 seconds
TestRunner: iso-tester        PASS      22.51 seconds
TestRunner: bnep-tester       PASS      8.52 seconds
TestRunner: mgmt-tester       PASS      143.45 seconds
TestRunner: rfcomm-tester     PASS      13.16 seconds
TestRunner: sco-tester        PASS      12.39 seconds
TestRunner: ioctl-tester      PASS      14.48 seconds
TestRunner: mesh-tester       PASS      10.53 seconds
TestRunner: smp-tester        PASS      12.39 seconds
TestRunner: userchan-tester   PASS      8.81 seconds

Details
##############################
Test: SubjectPrefix - FAIL - 0.34 seconds
Check subject contains "Bluetooth" prefix
"Bluetooth: " is not specified in the subject

---
Regards,
Linux Bluetooth

#3 lore raw
In reply to Marek Vasut
This series was applied to bluetooth/bluetooth-next.git (master) by Luiz Augusto von Dentz <[email protected]>:

Hello:

This series was applied to bluetooth/bluetooth-next.git (master) by Luiz Augusto von Dentz <[email protected]>:

Quoted 9 lines · On Wed, 2 Nov 2022 17:47:04 +0100 you wrote:

CYW4373A0 is a Wi-Fi + Bluetooth combo device from Cypress. This chip is present e.g. on muRata 2AE module. Extend the binding with its DT compatible.

[...]

Here is the summary with links:
- [v2,1/2] dt-bindings: net: broadcom-bluetooth: Add CYW4373A0 DT binding

    https://git.kernel.org/bluetooth/bluetooth-next/c/0a8d4b84bbd5
  - [v2,2/2] Bluetooth: hci_bcm: Add CYW4373A0 support
    https://git.kernel.org/bluetooth/bluetooth-next/c/ce52c2f04177

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html