diff mbox series

[1/2,C-D/master] UBUNTU: SAUCE: btqcomsmd: introduce BT_QCOMSMD_HACK

Message ID 1548174031-23334-2-git-send-email-paolo.pisati@canonical.com
State New
Headers show
Series [1/2,C-D/master] UBUNTU: SAUCE: btqcomsmd: introduce BT_QCOMSMD_HACK | expand

Commit Message

Paolo Pisati Jan. 22, 2019, 4:20 p.m. UTC
BugLink: https://bugs.launchpad.net/bugs/1810797

Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
Acked-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
---
 drivers/bluetooth/Kconfig     | 7 +++++++
 drivers/bluetooth/btqcomsmd.c | 5 +++++
 2 files changed, 12 insertions(+)
diff mbox series

Patch

diff --git a/drivers/bluetooth/Kconfig b/drivers/bluetooth/Kconfig
index 5f953ca..13f28d0 100644
--- a/drivers/bluetooth/Kconfig
+++ b/drivers/bluetooth/Kconfig
@@ -378,6 +378,13 @@  config BT_QCOMSMD
 	  Say Y here to compile support for HCI over Qualcomm SMD into the
 	  kernel or say M to compile as a module.
 
+config BT_QCOMSMD_HACK
+	bool "Don't forcefully hook hci setup()"
+	default n
+	help
+	  Don't forcefully hook hci setup() in case a BD address wasn't
+	  assigned to hcidev during qcomsmd_probe().
+
 config BT_HCIRSI
 	tristate
 	help
diff --git a/drivers/bluetooth/btqcomsmd.c b/drivers/bluetooth/btqcomsmd.c
index 7df3eed..f9299088 100644
--- a/drivers/bluetooth/btqcomsmd.c
+++ b/drivers/bluetooth/btqcomsmd.c
@@ -190,7 +190,12 @@  static int btqcomsmd_probe(struct platform_device *pdev)
 	hdev->open = btqcomsmd_open;
 	hdev->close = btqcomsmd_close;
 	hdev->send = btqcomsmd_send;
+#ifdef CONFIG_BT_QCOMSMD_HACK
+	if (bacmp(&btq->bdaddr, BDADDR_ANY))
+		hdev->setup = btqcomsmd_setup;
+#else
 	hdev->setup = btqcomsmd_setup;
+#endif
 	hdev->set_bdaddr = qca_set_bdaddr_rome;
 
 	ret = hci_register_dev(hdev);