Skip to contentSkip to conversation

bluetooth: bcm: Use the BDADDR_PROPERTY quirk for Orange Pi 3

PATCH Superseded Andre Heider 2 participants 2 messages Nov 22, 2019 Bluetooth drivers

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 bluetooth: bcm: Use the BDADDR_PROPERTY quirk for Orange Pi 3

Some devices ship with the controller default address, like the Orange Pi 3 (BCM4345C5).

Allow the bootloader to set a valid address through the device tree.

---
 drivers/bluetooth/btbcm.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/bluetooth/btbcm.c +7 -0
index 2d2e6d862068..e20e7da45377 100644
@@ -8,6 +8,7 @@
 
 #include <linux/module.h>
 #include <linux/firmware.h>
+#include <linux/of.h>
 #include <asm/unaligned.h>
 
 #include <net/bluetooth/bluetooth.h>
@@ -440,6 +441,12 @@ int btbcm_finalize(struct hci_dev *hdev)
 
 	set_bit(HCI_QUIRK_STRICT_DUPLICATE_FILTER, &hdev->quirks);
 
+	/* Some devices ship with the controller default address.
+	 * Allow the bootloader to set a valid address through the device tree.
+	 */
+	if (of_machine_is_compatible("xunlong,orangepi-3"))
+		set_bit(HCI_QUIRK_USE_BDADDR_PROPERTY, &hdev->quirks);
+
 	return 0;
 }
 EXPORT_SYMBOL_GPL(btbcm_finalize);
Signature · 1 line
2.24.0
maintainer
#1 lore raw

Hi Andre,

Quoted 23 lines

Some devices ship with the controller default address, like the Orange Pi 3 (BCM4345C5).

Allow the bootloader to set a valid address through the device tree.

---
drivers/bluetooth/btbcm.c | 7 +++++++

1 file changed, 7 insertions(+)
drivers/bluetooth/btbcm.c +1 -0
index 2d2e6d862068..e20e7da45377 100644
@@ -8,6 +8,7 @@
 
 #include <linux/module.h>
 #include <linux/firmware.h>
+#include <linux/of.h>
 #include <asm/unaligned.h>
 
 #include <net/bluetooth/bluetooth.h>

drivers/bluetooth/btbcm.c int btbcm_finalize(struct hci_dev *hdev) · line 449

Quoted 9 lines
drivers/bluetooth/btbcm.c +6 -0
@@ -440,6 +441,12 @@ int btbcm_finalize(struct hci_dev *hdev)
 
 	set_bit(HCI_QUIRK_STRICT_DUPLICATE_FILTER, &hdev->quirks);
 
+	/* Some devices ship with the controller default address.
+	 * Allow the bootloader to set a valid address through the device tree.
+	 */
+	if (of_machine_is_compatible("xunlong,orangepi-3"))
+		set_bit(HCI_QUIRK_USE_BDADDR_PROPERTY, &hdev->quirks);
+

just make it unconditional. I think this will be just fine.

Regards

Marcel