Skip to content

Commit 7dcd3e0

Browse files
quicjathotVudentz
authored andcommitted
Bluetooth: hci_qca: Set BDA quirk bit if fwnode exists in DT
BT adapter going into UNCONFIGURED state during BT turn ON when devicetree has no local-bd-address node. Bluetooth will not work out of the box on such devices, to avoid this problem, added check to set HCI_QUIRK_USE_BDADDR_PROPERTY based on local-bd-address node entry. When this quirk is not set, the public Bluetooth address read by host from controller though HCI Read BD Address command is considered as valid. Fixes: e668eb1 ("Bluetooth: hci_core: Don't stop BT if the BD address missing in dts") Signed-off-by: Janaki Ramaiah Thota <quic_janathot@quicinc.com> Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
1 parent c0dbc56 commit 7dcd3e0

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

drivers/bluetooth/hci_qca.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
*
88
* Copyright (C) 2007 Texas Instruments, Inc.
99
* Copyright (c) 2010, 2012, 2018 The Linux Foundation. All rights reserved.
10+
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
1011
*
1112
* Acknowledgements:
1213
* This file is based on hci_ll.c, which was...
@@ -1904,7 +1905,17 @@ static int qca_setup(struct hci_uart *hu)
19041905
case QCA_WCN6750:
19051906
case QCA_WCN6855:
19061907
case QCA_WCN7850:
1907-
set_bit(HCI_QUIRK_USE_BDADDR_PROPERTY, &hdev->quirks);
1908+
1909+
/* Set BDA quirk bit for reading BDA value from fwnode property
1910+
* only if that property exist in DT.
1911+
*/
1912+
if (fwnode_property_present(dev_fwnode(hdev->dev.parent), "local-bd-address")) {
1913+
set_bit(HCI_QUIRK_USE_BDADDR_PROPERTY, &hdev->quirks);
1914+
bt_dev_info(hdev, "setting quirk bit to read BDA from fwnode later");
1915+
} else {
1916+
bt_dev_dbg(hdev, "local-bd-address` is not present in the devicetree so not setting quirk bit for BDA");
1917+
}
1918+
19081919
hci_set_aosp_capable(hdev);
19091920

19101921
ret = qca_read_soc_version(hdev, &ver, soc_type);

0 commit comments

Comments
 (0)