Skip to contentSkip to conversation

Enable Bluetooth functionality for WCN3998.

PATCH Superseded Harish Bandi 3 participants 5 messages Mar 25, 2019

Subsystems (5)

v4 of 8 Superseded Latest is v8 →

lore
Share & tools
lore
#0 lore raw

v4 cover Enable Bluetooth functionality for WCN3998.

This patch series we add support for WCN3998 BT chip set. This new chip set is based from the WCN3990 with minimal power numbers. So here in this patch The major difference between wcn3990 and WCN3998 is only power numbers. where as init process and fw download is same with wcn3990.So we add new compatible for WCN3998.
Removed the Reading of regulator values from dts.
Added new compatible for WCN3998.
Changes in V4:
Added is_qca_soc_type_wcn399x_family helper function
to get the soc type is wcn399x or not.
Changes in V3:
updated to latest code base.

Harish Bandi (2):
Bluetooth: hci_qca: Added support for WCN3998
dt-bindings: net: bluetooth: Add device tree bindings for QTI chip

    WCN3998
 .../devicetree/bindings/net/qualcomm-bluetooth.txt |  7 ++--
 drivers/bluetooth/btqca.c                          |  4 +-
 drivers/bluetooth/btqca.h                          |  3 +-
 drivers/bluetooth/hci_qca.c                        | 48 +++++++++++++++-------
 4 files changed, 42 insertions(+), 20 deletions(-)
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
#1 lore raw

PATCH v4 1/2 Bluetooth: hci_qca: Added support for WCN3998

Added new compatible for WCN3998 and corresponding voltage and current values to WCN3998 compatible.
Changed driver code to support WCN3998

---
Changes in V4:
- Added is_qca_soc_type_wcn399x_family helper function
- to get the soc type is wcn399x or not.

---
 drivers/bluetooth/btqca.c   |  4 ++--
 drivers/bluetooth/btqca.h   |  3 ++-
 drivers/bluetooth/hci_qca.c | 48 ++++++++++++++++++++++++++++++++-------------
 3 files changed, 38 insertions(+), 17 deletions(-)
drivers/bluetooth/btqca.c +2 -2
index 6122685..70cab13 100644
@@ -344,7 +344,7 @@ int qca_uart_setup(struct hci_dev *hdev, uint8_t baudrate,
 
 	/* Download rampatch file */
 	config.type = TLV_TYPE_PATCH;
-	if (soc_type == QCA_WCN3990) {
+	if (soc_type >= QCA_WCN3990) {
 		/* Firmware files to download are based on ROM version.
 		 * ROM version is derived from last two bytes of soc_ver.
 		 */
@@ -365,7 +365,7 @@ int qca_uart_setup(struct hci_dev *hdev, uint8_t baudrate,
 
 	/* Download NVM configuration */
 	config.type = TLV_TYPE_NVM;
-	if (soc_type == QCA_WCN3990)
+	if (soc_type >= QCA_WCN3990)
 		snprintf(config.fwname, sizeof(config.fwname),
 			 "qca/crnv%02x.bin", rom_ver);
 	else
drivers/bluetooth/btqca.h +2 -1
index c72c56e..bd6a902 100644
@@ -132,7 +132,8 @@ enum qca_btsoc_type {
 	QCA_INVALID = -1,
 	QCA_AR3002,
 	QCA_ROME,
-	QCA_WCN3990
+	QCA_WCN3990,
+	QCA_WCN3998,
 };
 
 #if IS_ENABLED(CONFIG_BT_QCA)
drivers/bluetooth/hci_qca.c +34 -14

138 lines not on this page · raw message

Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
#2 lore raw

Re: [PATCH v4 1/2] Bluetooth: hci_qca: Added support for WCN3998

drivers/bluetooth/hci_qca.c static enum qca_btsoc_type qca_soc_type(struct hci_uart *hu) · line 194

Quoted 3 lines · Harish Bandi
drivers/bluetooth/hci_qca.c +3 -0
+bool is_qca_soc_type_wcn399x_family(enum qca_btsoc_type soc_type)
+{
+	if ((soc_type  == QCA_WCN3990) || (soc_type  == QCA_WCN3998))

^ ^
spurious white-space here as well

drivers/bluetooth/hci_qca.c static enum qca_btsoc_type qca_soc_type(struct hci_uart *hu) · line 198

Quoted 4 lines
drivers/bluetooth/hci_qca.c +4 -0
+		return true;
+
+	return false;
+}

(Apologies for the bike-shed)

I don't know what the kernel coding-style says about this, but for functions returning bool, isn't it better to write

	return $BOOLEAN_EXPRESSION;

instead of

	if ($BOOLEAN_EXPRESSION)
		return true;
	return false;

i.e.

bool is_qca_soc_type_wcn399x_family(enum qca_btsoc_type soc_type)

{
	return soc_type == QCA_WCN3990 || soc_type  == QCA_WCN3998;
}

Regards.

#3 lore raw

PATCH v4 2/2 dt-bindings: net: bluetooth: Add device tree bindings for QTI chip WCN3998

In reply to Harish Bandi

This patch enables regulators for the Qualcomm Bluetooth WCN3998 controller.

---
Changes in V4:
- Removed new compatible WCN3998
- changed wcn3990 to wcn399* to represent wcn399* family

---
 Documentation/devicetree/bindings/net/qualcomm-bluetooth.txt | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
Documentation/devicetree/bindings/net/qualcomm-bluetooth.txt +4 -3
index 824c0e2..de9cefa 100644
@@ -11,20 +11,21 @@ Required properties:
  - compatible: should contain one of the following:
    * "qcom,qca6174-bt"
    * "qcom,wcn3990-bt"
+   * "qcom,wcn3998-bt"
 
 Optional properties for compatible string qcom,qca6174-bt:
 
  - enable-gpios: gpio specifier used to enable chip
  - clocks: clock provided to the controller (SUSCLK_32KHZ)
 
-Required properties for compatible string qcom,wcn3990-bt:
+Required properties for compatible string qcom,wcn399*-bt:
 
  - vddio-supply: VDD_IO supply regulator handle.
  - vddxo-supply: VDD_XO supply regulator handle.
  - vddrf-supply: VDD_RF supply regulator handle.
  - vddch0-supply: VDD_CH0 supply regulator handle.
 
-Optional properties for compatible string qcom,wcn3990-bt:
+Optional properties for compatible string qcom,wcn399*-bt:
 
  - max-speed: see Documentation/devicetree/bindings/serial/slave-device.txt
 
@@ -44,7 +45,7 @@ serial@7570000 {
 
 serial@898000 {
 	bluetooth {
-		compatible = "qcom,wcn3990-bt";
+		compatible = "qcom,wcn399*-bt";
 
 		vddio-supply = <&vreg_s4a_1p8>;
 		vddxo-supply = <&vreg_l7a_1p8>;
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
maintainer
#4 lore raw

Re: [PATCH v4 2/2] dt-bindings: net: bluetooth: Add device tree bindings for QTI chip WCN3998

Hi Harish,

Quoted 41 lines

This patch enables regulators for the Qualcomm Bluetooth WCN3998 controller.

---
Changes in V4:
- Removed new compatible WCN3998
- changed wcn3990 to wcn399* to represent wcn399* family
---
Documentation/devicetree/bindings/net/qualcomm-bluetooth.txt | 7 ++++---

1 file changed, 4 insertions(+), 3 deletions(-)
Documentation/devicetree/bindings/net/qualcomm-bluetooth.txt +1 -0
index 824c0e2..de9cefa 100644
@@ -11,20 +11,21 @@ Required properties:
 - compatible: should contain one of the following:
   * "qcom,qca6174-bt"
   * "qcom,wcn3990-bt"
+   * "qcom,wcn3998-bt"
 

Optional properties for compatible string qcom,qca6174-bt:

- enable-gpios: gpio specifier used to enable chip
- clocks: clock provided to the controller (SUSCLK_32KHZ)

Documentation/devicetree/bindings/net/qualcomm-bluetooth.txt +2 -2
-Required properties for compatible string qcom,wcn3990-bt:
+Required properties for compatible string qcom,wcn399*-bt:
 
 - vddio-supply: VDD_IO supply regulator handle.
 - vddxo-supply: VDD_XO supply regulator handle.
 - vddrf-supply: VDD_RF supply regulator handle.
 - vddch0-supply: VDD_CH0 supply regulator handle.
 
-Optional properties for compatible string qcom,wcn3990-bt:
+Optional properties for compatible string qcom,wcn399*-bt:
 
 - max-speed: see Documentation/devicetree/bindings/serial/slave-device.txt

Documentation/devicetree/bindings/net/qualcomm-bluetooth.txt serial@7570000 { · line 48

Quoted 5 lines
Documentation/devicetree/bindings/net/qualcomm-bluetooth.txt +1 -1
@@ -44,7 +45,7 @@ serial@7570000 {
 
 serial@898000 {
 	bluetooth {
-		compatible = "qcom,wcn3990-bt";
+		compatible = "qcom,wcn399*-bt”;

I am not convinced that examples should have a * in the compatible string. So lets have Rob ack this one.

Regards

Marcel