Skip to content

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

Open
shuaz-shuai wants to merge 2 commits intoqualcomm-linux:qcom-6.18.yfrom
shuaz-shuai:hamoa_usb_bt_en
Open

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

Conversation

@shuaz-shuai
Copy link

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: 4464912

…h USB and UART

When Bluetooth supports both USB and UART, the BT UART driver is
always loaded, while USB is hot-pluggable. As a result, when Bluetooth
is used over USB, the UART driver still be probed and drive BT_EN low,
which causes the Bluetooth device on USB to be disconnected.

Configure BT_EN as a GPIO hog so that it is controlled by the platform
instead of the UART driver, preventing BT over USB from being
unintentionally powered down.

Link: https://lore.kernel.org/all/20260311090921.1892191-1-shuai.zhang@oss.qualcomm.com/
Signed-off-by: Shuai Zhang <shuai.zhang@oss.qualcomm.com>
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.

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

@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.

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.

2 participants