[PATCH v4 1/2] Bluetooth: hci_qca: Reopen the UART after enabling QCA2066

From: Shuai Zhang

Date: Tue Nov 10 2026 - 04:48:29 EST


QCA2066 does not reopen the UART after the controller is enabled, which
causes RX/TX out-of-sync errors. The UART has to be reopened once the
controller is powered on.

qca_regulator_init() already enables the controller and then reopens the
UART, but QCA2066 does not go through it. QCA2066 was added with its own
SoC type and handled in the default case.

Let QCA2066 go through qca_regulator_init() as well, and handle it in the
other places that check the SoC type in the same way. This also applies
the baudrate switching, flow control, shutdown and probe handling of
those chips to QCA2066. btqca.c checks the SoC type in the same way, so
the firmware version is also shown in the log.

Signed-off-by: Shuai Zhang <shuai.zhang@xxxxxxxxxxxxxxxx>
---
drivers/bluetooth/btqca.c | 1 +
drivers/bluetooth/hci_qca.c | 13 +++++++++++++
2 files changed, 14 insertions(+)

diff --git a/drivers/bluetooth/btqca.c b/drivers/bluetooth/btqca.c
index 60735b70d..9f54e33e4 100644
--- a/drivers/bluetooth/btqca.c
+++ b/drivers/bluetooth/btqca.c
@@ -983,6 +983,7 @@ int qca_uart_setup(struct hci_dev *hdev, uint8_t baudrate,
switch (soc_type) {
case QCA_WCN3991:
case QCA_WCN6750:
+ case QCA_QCA2066:
case QCA_WCN6855:
case QCA_WCN7850:
/* get fw build info */
diff --git a/drivers/bluetooth/hci_qca.c b/drivers/bluetooth/hci_qca.c
index 7089e9b63..520cb84a1 100644
--- a/drivers/bluetooth/hci_qca.c
+++ b/drivers/bluetooth/hci_qca.c
@@ -1381,6 +1381,7 @@ static int qca_set_baudrate(struct hci_dev *hdev, uint8_t baudrate)
case QCA_WCN3991:
case QCA_WCN3998:
case QCA_WCN6750:
+ case QCA_QCA2066:
case QCA_WCN6855:
case QCA_WCN7850:
usleep_range(1000, 10000);
@@ -1468,6 +1469,7 @@ static int qca_check_speeds(struct hci_uart *hu)
case QCA_WCN3991:
case QCA_WCN3998:
case QCA_WCN6750:
+ case QCA_QCA2066:
case QCA_WCN6855:
case QCA_WCN7850:
if (!qca_get_speed(hu, QCA_INIT_SPEED) &&
@@ -1511,6 +1513,7 @@ static int qca_set_speed(struct hci_uart *hu, enum qca_speed_type speed_type)
case QCA_WCN3991:
case QCA_WCN3998:
case QCA_WCN6750:
+ case QCA_QCA2066:
case QCA_WCN6855:
case QCA_WCN7850:
hci_uart_set_flow_control(hu, true);
@@ -1546,6 +1549,7 @@ static int qca_set_speed(struct hci_uart *hu, enum qca_speed_type speed_type)
case QCA_WCN3991:
case QCA_WCN3998:
case QCA_WCN6750:
+ case QCA_QCA2066:
case QCA_WCN6855:
case QCA_WCN7850:
hci_uart_set_flow_control(hu, false);
@@ -1862,6 +1866,7 @@ static int qca_power_on(struct hci_dev *hdev)
case QCA_WCN3991:
case QCA_WCN3998:
case QCA_WCN6750:
+ case QCA_QCA2066:
case QCA_WCN6855:
case QCA_WCN7850:
ret = qca_regulator_init(hu);
@@ -1984,6 +1989,7 @@ static int qca_setup(struct hci_uart *hu)
case QCA_WCN3991:
case QCA_WCN3998:
case QCA_WCN6750:
+ case QCA_QCA2066:
case QCA_WCN6855:
case QCA_WCN7850:
if (qcadev && qcadev->bdaddr_property_broken)
@@ -2017,6 +2023,7 @@ static int qca_setup(struct hci_uart *hu)
case QCA_WCN3991:
case QCA_WCN3998:
case QCA_WCN6750:
+ case QCA_QCA2066:
case QCA_WCN6855:
case QCA_WCN7850:
break;
@@ -2279,6 +2286,7 @@ static void qca_power_off(struct hci_uart *hu)
break;

case QCA_WCN6750:
+ case QCA_QCA2066:
case QCA_WCN6855:
gpiod_set_value_cansleep(qcadev->bt_en, 0);
msleep(100);
@@ -2433,6 +2441,7 @@ static int qca_serdev_probe(struct serdev_device *serdev)
case QCA_WCN3991:
case QCA_WCN3998:
case QCA_WCN6750:
+ case QCA_QCA2066:
case QCA_WCN6855:
case QCA_WCN7850:
qcadev->bt_power = devm_kzalloc(&serdev->dev,
@@ -2452,6 +2461,7 @@ static int qca_serdev_probe(struct serdev_device *serdev)
case QCA_WCN3991:
case QCA_WCN3998:
case QCA_WCN6750:
+ case QCA_QCA2066:
case QCA_WCN6855:
case QCA_WCN7850:
if (!device_property_present(&serdev->dev, "enable-gpios")) {
@@ -2495,6 +2505,7 @@ static int qca_serdev_probe(struct serdev_device *serdev)

if (!qcadev->bt_en &&
(data->soc_type == QCA_WCN6750 ||
+ data->soc_type == QCA_QCA2066 ||
data->soc_type == QCA_WCN6855 ||
data->soc_type == QCA_WCN7850))
power_ctrl_enabled = false;
@@ -2503,6 +2514,7 @@ static int qca_serdev_probe(struct serdev_device *serdev)
GPIOD_IN);
if (IS_ERR(qcadev->sw_ctrl) &&
(data->soc_type == QCA_WCN6750 ||
+ data->soc_type == QCA_QCA2066 ||
data->soc_type == QCA_WCN6855 ||
data->soc_type == QCA_WCN7850)) {
dev_err(&serdev->dev, "failed to acquire SW_CTRL gpio\n");
@@ -2587,6 +2599,7 @@ static void qca_serdev_remove(struct serdev_device *serdev)
case QCA_WCN3991:
case QCA_WCN3998:
case QCA_WCN6750:
+ case QCA_QCA2066:
case QCA_WCN6855:
case QCA_WCN7850:
if (power->vregs_on)
--
2.34.1