Skip to content

WORKAROUND: QCLINUX: Bluetooth: support Bluetooth over both USB and UART#364

Open
shuaz-shuai wants to merge 1 commit intoqualcomm-linux:qcom-6.18.yfrom
shuaz-shuai:hamoa_usb_bt_en
Open

WORKAROUND: QCLINUX: Bluetooth: support Bluetooth over both USB and UART#364
shuaz-shuai wants to merge 1 commit intoqualcomm-linux:qcom-6.18.yfrom
shuaz-shuai:hamoa_usb_bt_en

Conversation

@shuaz-shuai
Copy link
Copy Markdown

@shuaz-shuai shuaz-shuai commented Mar 18, 2026

On Hamoa boards, a single M.2 slot may host either a UART-based Bluetooth card or a USB-based Bluetooth card. As a result, the UART controller node is always present in the device tree, while the USB Bluetooth path is hot‑pluggable.

When Bluetooth is actually used over USB, the hci_qca UART driver still probes due to the DT node being present. During probe/power sequencing it drive BT_EN low (either directly or via the WCN power sequencer), which can cut power to the shared Bluetooth device and cause the USB Bluetooth interface to disconnect.

Model BT_EN as an always-on fixed regulator and ensure the UART path does not claim power control when BT_EN is not described for that consumer:
- Describe BT_EN as a fixed regulator (GPIO 116) that is boot-on and
always-on, so it cannot be inadvertently deasserted by the UART probe.
- Remove bt-enable-gpios from the WCN7850 power sequencer node and drop
its BT pinctrl entry.
- Wire the bluetooth DT supplies to the always-on 3.3V rail so the UART
driver can acquire its regulators without depending on the WCN PMU
regulators in this dual-path configuration.
- Treat WCN7850 like WCN6750/WCN6855 in hci_qca: if no bt_en GPIO is
provided for the UART device, disable power control for that instance.
- In pwrseq-qcom-wcn, do not match a "bluetooth" consumer if the
sequencer has no bt-enable GPIO configured. This prevents the sequencer
from binding to a bluetooth consumer node in the "BT_EN tied high /
absent from DT" case and allows the consumer to fall back accordingly.

With these changes, probing the UART path no longer deasserts BT_EN when Bluetooth is operating over USB, avoiding unexpected USB disconnects.

Without this change, Bluetooth over USB does not work.
This is a temporary workaround. Once a proper M.2 binding or solution is upstreamed, both the DTS and driver changes will be reworked and re-submitted according to the M.2 model.

CRs-Fixed: 4480880

Copy link
Copy Markdown

@shashim-quic shashim-quic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

QCLINUX: Bluetooth: support Bluetooth over both USB and UART
This is a temporary workaround. Once a proper M.2 binding or solution is upstreamed, both the DTS and driver changes will be reworked and re-submitted according to the M.2 model.

Please prefix it with WORKAROUND , it is so.

@shuaz-shuai shuaz-shuai changed the title QCLINUX: Bluetooth: support Bluetooth over both USB and UART WORKAROUND: QCLINUX: Bluetooth: support Bluetooth over both USB and UART Mar 23, 2026
@shuaz-shuai
Copy link
Copy Markdown
Author

QCLINUX: Bluetooth: support Bluetooth over both USB and UART
This is a temporary workaround. Once a proper M.2 binding or solution is upstreamed, both the DTS and driver changes will be reworked and re-submitted according to the M.2 model.

Please prefix it with WORKAROUND , it is so.

The prefix has been added. Please help review.

shashim-quic
shashim-quic previously approved these changes Mar 26, 2026
Copy link
Copy Markdown
Contributor

@sgaud-quic sgaud-quic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix Compilation Issue :
/opt/actions-runner/_work/kernel-config/kernel-config/arch/arm64/boot/dts/qcom/hamoa-iot-evk.dts:473.38-488.4: ERROR (phandle_references): /regulator-wcn-bt-en: Reference to non-existent node or label "wcn_bt_en"

https://github.com/qualcomm-linux/kernel-config/actions/runs/23594157895/job/68706519199

This is a temporary workaround.

On Hamoa boards, a single M.2 slot may host either a UART-based
Bluetooth card or a USB-based Bluetooth card. As a result, the UART
controller node is always present in the device tree, while the USB
Bluetooth path is hot-pluggable.

When Bluetooth is actually used over USB, the hci_qca UART driver still
probes due to the DT node being present. During probe and power
sequencing, it drives BT_EN low (either directly or via the WCN power
sequencer), which can cut power to the shared Bluetooth device and cause
the USB Bluetooth interface to disconnect.

Model BT_EN as an always-on fixed regulator and ensure that the UART
path does not claim power control when BT_EN is not described for that
consumer:

- Describe BT_EN as a fixed regulator (GPIO 116) that is boot-on and
  always-on, so it cannot be inadvertently deasserted by the UART probe.
- Remove bt-enable-gpios from the WCN7850 power sequencer node and drop
  its BT pinctrl entry.
- Wire the Bluetooth DT supplies to the always-on 3.3V rail so the UART
  driver can acquire its regulators without depending on the WCN PMU
  regulators in this dual-path configuration.
- Treat WCN7850 like WCN6750/WCN6855 in hci_qca: if no bt_en GPIO is
  provided for the UART device, disable power control for that instance.
- In pwrseq-qcom-wcn, do not match a "bluetooth" consumer if the
  sequencer has no bt-enable GPIO configured. This prevents the
  sequencer from binding to a Bluetooth consumer node in the
  "BT_EN tied high / absent from DT" case and allows the consumer to
  fall back accordingly.

With these changes, probing the UART path no longer deasserts BT_EN when
Bluetooth is operating over USB, avoiding unexpected USB disconnects.

Signed-off-by: Shuai Zhang <shuai.zhang@oss.qualcomm.com>
@shuaz-shuai
Copy link
Copy Markdown
Author

Please fix Compilation Issue : /opt/actions-runner/_work/kernel-config/kernel-config/arch/arm64/boot/dts/qcom/hamoa-iot-evk.dts:473.38-488.4: ERROR (phandle_references): /regulator-wcn-bt-en: Reference to non-existent node or label "wcn_bt_en"

https://github.com/qualcomm-linux/kernel-config/actions/runs/23594157895/job/68706519199

Thanks for the reminder. The update has been completed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants