[PATCH v2 4/5] Bluetooth: hci_qca: Drop serdev based M.2 power sequencing code
From: Manivannan Sadhasivam via B4 Relay
Date: Mon Nov 30 2026 - 07:20:03 EST
From: Manivannan Sadhasivam <manivannan.sadhasivam@xxxxxxxxxxxxxxxx>
Bluetooth interface in M.2 modules is now enumerated using an auxiliary
device instead of serdev. The power sequencing driver now allocates an
auxiliary device for the Bluetooth interface whenever a compatible
M.2 module shows up over PCIe. And the auxiliary device gets bind to this
hci_qca driver using the existing auxiliary driver matching logic.
Earlier the same modules were brought up by fabricating a bluetooth
node under the UART controller, so that the serdev bus matched this
driver, and qca_serdev_probe grabbed the "uart" sequencer when the M.2
connector was reachable over the OF graph. That node is no longer
created, so the serdev driver never binds for an M.2 module.
Hence, remove the serdev based M.2 power sequencing code.
Tested-by: Wei Deng <wei.deng@xxxxxxxxxxxxxxxx> # QCC2072 over UART
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@xxxxxxxxxxxxxxxx>
---
drivers/bluetooth/hci_qca.c | 56 ---------------------------------------------
1 file changed, 56 deletions(-)
diff --git a/drivers/bluetooth/hci_qca.c b/drivers/bluetooth/hci_qca.c
index 1212520ab6f0..7599ead74287 100644
--- a/drivers/bluetooth/hci_qca.c
+++ b/drivers/bluetooth/hci_qca.c
@@ -26,7 +26,6 @@
#include <linux/gpio/consumer.h>
#include <linux/module.h>
#include <linux/of.h>
-#include <linux/of_graph.h>
#include <linux/acpi.h>
#include <linux/platform_device.h>
#include <linux/pwrseq/consumer.h>
@@ -2429,49 +2428,6 @@ static int qca_init_regulators(struct qca_serdev *qcadev,
return 0;
}
-/*
- * A BT device attached through an M.2 Key E connector is described by an OF
- * graph link from the serdev controller to the connector node. Resolve the
- * remote endpoint instead of merely testing for the presence of a local
- * 'port', as some device trees carry an unconnected port anchor which must
- * not be mistaken for an M.2 connector.
- */
-static bool qca_serdev_is_m2(struct serdev_device *serdev)
-{
- struct device_node *connector __free(device_node) =
- of_graph_get_remote_node(dev_of_node(&serdev->ctrl->dev), 0, 0);
-
- return !!connector;
-}
-
-static void qca_serdev_put_pwrseq(void *data)
-{
- pwrseq_put(data);
-}
-
-static int qca_serdev_get_m2_pwrseq(struct qca_serdev *qcadev)
-{
- struct serdev_device *serdev = qcadev->serdev_hu.serdev;
- struct pwrseq_desc *pwrseq;
-
- if (!qca_serdev_is_m2(serdev))
- return 0;
-
- /* The pwrseq is looked up on the serdev controller (which holds the
- * OF graph to the M.2 connector), but its lifetime must follow this
- * serdev consumer device, not the controller. So acquire it with the
- * non-devres pwrseq_get() and release it via a devres action bound to
- * &serdev->dev instead of using devm_pwrseq_get(&serdev->ctrl->dev).
- */
- pwrseq = pwrseq_get(&serdev->ctrl->dev, "uart");
- if (IS_ERR(pwrseq))
- return PTR_ERR(pwrseq);
-
- qcadev->pwrseq = pwrseq;
-
- return devm_add_action_or_reset(&serdev->dev, qca_serdev_put_pwrseq, pwrseq);
-}
-
static int qca_serdev_probe(struct serdev_device *serdev)
{
struct qca_serdev *qcadev;
@@ -2502,17 +2458,6 @@ static int qca_serdev_probe(struct serdev_device *serdev)
else
qcadev->btsoc_type = QCA_ROME;
- err = qca_serdev_get_m2_pwrseq(qcadev);
- if (err)
- return err;
-
- /*
- * A module behind a connector is powered entirely by the
- * connector's power sequencer.
- */
- if (qcadev->pwrseq)
- goto power_ctrl_done;
-
switch (qcadev->btsoc_type) {
case QCA_WCN3950:
case QCA_WCN3988:
@@ -2613,7 +2558,6 @@ static int qca_serdev_probe(struct serdev_device *serdev)
}
}
-power_ctrl_done:
if (qcadev->pwrseq) {
bt_en_available = pwrseq_is_controllable(qcadev->pwrseq);
if (!bt_en_available) {
--
2.53.0