linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3] bluetooth: bcm: Use the BDADDR_PROPERTY quirk for Orange Pi 3
@ 2019-11-22 10:04 Andre Heider
  2019-11-22 12:02 ` Marcel Holtmann
  0 siblings, 1 reply; 2+ messages in thread
From: Andre Heider @ 2019-11-22 10:04 UTC (permalink / raw)
  To: Johan Hedberg; +Cc: linux-bluetooth, Ondrej Jirman, Jernej Skrabec

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.

Signed-off-by: Andre Heider <a.heider@gmail.com>
---
 drivers/bluetooth/btbcm.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/bluetooth/btbcm.c b/drivers/bluetooth/btbcm.c
index 2d2e6d862068..e20e7da45377 100644
--- a/drivers/bluetooth/btbcm.c
+++ b/drivers/bluetooth/btbcm.c
@@ -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);
-- 
2.24.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v3] bluetooth: bcm: Use the BDADDR_PROPERTY quirk for Orange Pi 3
  2019-11-22 10:04 [PATCH v3] bluetooth: bcm: Use the BDADDR_PROPERTY quirk for Orange Pi 3 Andre Heider
@ 2019-11-22 12:02 ` Marcel Holtmann
  0 siblings, 0 replies; 2+ messages in thread
From: Marcel Holtmann @ 2019-11-22 12:02 UTC (permalink / raw)
  To: Andre Heider
  Cc: Johan Hedberg, linux-bluetooth, Ondrej Jirman, Jernej Skrabec

Hi Andre,

> 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.
> 
> Signed-off-by: Andre Heider <a.heider@gmail.com>
> ---
> drivers/bluetooth/btbcm.c | 7 +++++++
> 1 file changed, 7 insertions(+)
> 
> diff --git a/drivers/bluetooth/btbcm.c b/drivers/bluetooth/btbcm.c
> index 2d2e6d862068..e20e7da45377 100644
> --- a/drivers/bluetooth/btbcm.c
> +++ b/drivers/bluetooth/btbcm.c
> @@ -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);
> +

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

Regards

Marcel


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-11-22 12:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-22 10:04 [PATCH v3] bluetooth: bcm: Use the BDADDR_PROPERTY quirk for Orange Pi 3 Andre Heider
2019-11-22 12:02 ` Marcel Holtmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).