Skip to content

Commit 1e1f55d

Browse files
authored
Bluetooth: support Bluetooth over both USB and UART (#364)
Bluetooth: support Bluetooth over both USB and UART
2 parents 8b14607 + 24d48e0 commit 1e1f55d

File tree

3 files changed

+45
-14
lines changed

3 files changed

+45
-14
lines changed

arch/arm64/boot/dts/qcom/hamoa-iot-evk.dts

Lines changed: 29 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -497,6 +497,23 @@
497497
vin-supply = <&vreg_wcn_3p3>;
498498
};
499499

500+
vreg_wcn_bt_en: regulator-wcn-bt-en {
501+
compatible = "regulator-fixed";
502+
503+
regulator-name = "VREG_WCN_BT_EN";
504+
regulator-min-microvolt = <1800000>;
505+
regulator-max-microvolt = <1800000>;
506+
507+
gpio = <&tlmm 116 GPIO_ACTIVE_HIGH>;
508+
enable-active-high;
509+
510+
pinctrl-0 = <&wcn_bt_en>;
511+
pinctrl-names = "default";
512+
513+
regulator-always-on;
514+
regulator-boot-on;
515+
};
516+
500517
vreg_wcn_3p3: regulator-wcn-3p3 {
501518
compatible = "regulator-fixed";
502519

@@ -1415,12 +1432,11 @@
14151432
output-low;
14161433
};
14171434

1418-
wcn_bt_en_hog: wcn-bt-en-state-hog {
1419-
gpio-hog;
1420-
gpios = <116 GPIO_ACTIVE_HIGH>;
1421-
output-high;
1422-
input-disable;
1423-
line-name = "BT_EN";
1435+
wcn_bt_en: wcn-bt-en-state {
1436+
pins = "gpio116";
1437+
function = "gpio";
1438+
drive-strength = <2>;
1439+
bias-disable;
14241440
};
14251441

14261442
wcn_wlan_en: wcn-wlan-en-state {
@@ -1461,13 +1477,13 @@
14611477
compatible = "qcom,wcn7850-bt";
14621478
max-speed = <3200000>;
14631479

1464-
vddaon-supply = <&vreg_pmu_aon_0p59>;
1465-
vddwlcx-supply = <&vreg_pmu_wlcx_0p8>;
1466-
vddwlmx-supply = <&vreg_pmu_wlmx_0p85>;
1467-
vddrfacmn-supply = <&vreg_pmu_rfa_cmn>;
1468-
vddrfa0p8-supply = <&vreg_pmu_rfa_0p8>;
1469-
vddrfa1p2-supply = <&vreg_pmu_rfa_1p2>;
1470-
vddrfa1p8-supply = <&vreg_pmu_rfa_1p8>;
1480+
vddrfacmn-supply = <&vreg_wcn_3p3>;
1481+
vddaon-supply = <&vreg_wcn_3p3>;
1482+
vddwlcx-supply = <&vreg_wcn_3p3>;
1483+
vddwlmx-supply = <&vreg_wcn_3p3>;
1484+
vddrfa0p8-supply = <&vreg_wcn_3p3>;
1485+
vddrfa1p2-supply = <&vreg_wcn_3p3>;
1486+
vddrfa1p8-supply = <&vreg_wcn_3p3>;
14711487
};
14721488
};
14731489

drivers/bluetooth/hci_qca.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2467,7 +2467,8 @@ static int qca_serdev_probe(struct serdev_device *serdev)
24672467

24682468
if (!qcadev->bt_en &&
24692469
(data->soc_type == QCA_WCN6750 ||
2470-
data->soc_type == QCA_WCN6855))
2470+
data->soc_type == QCA_WCN6855 ||
2471+
data->soc_type == QCA_WCN7850))
24712472
power_ctrl_enabled = false;
24722473

24732474
qcadev->sw_ctrl = devm_gpiod_get_optional(&serdev->dev, "swctrl",

drivers/power/sequencing/pwrseq-qcom-wcn.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,20 @@ static int pwrseq_qcom_wcn_match(struct pwrseq_device *pwrseq,
357357
reg_node->parent->parent != ctx->of_node)
358358
return PWRSEQ_NO_MATCH;
359359

360+
/*
361+
* If this is a Bluetooth consumer device but the bt-enable GPIO is not
362+
* configured in the power sequencer (e.g. BT_EN is tied high via a
363+
* hardware pull-up and therefore absent from the DT), don't match.
364+
* The consumer driver will fall back to its legacy power control path
365+
* and correctly set power_ctrl_enabled to false.
366+
*
367+
* BT device nodes are conventionally named "bluetooth" in the DT,
368+
* so use of_node_name_eq() as a generic check rather than enumerating
369+
* specific compatible strings.
370+
*/
371+
if (!ctx->bt_gpio && of_node_name_eq(dev_node, "bluetooth"))
372+
return PWRSEQ_NO_MATCH;
373+
360374
return PWRSEQ_MATCH_OK;
361375
}
362376

0 commit comments

Comments
 (0)