From patchwork Tue Jan 22 16:20:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Pisati X-Patchwork-Id: 1029386 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43kYYl1RxRz9s1l; Wed, 23 Jan 2019 03:20:43 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1glymv-0001uW-In; Tue, 22 Jan 2019 16:20:33 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.86_2) (envelope-from ) id 1glymu-0001u6-9U for kernel-team@lists.ubuntu.com; Tue, 22 Jan 2019 16:20:32 +0000 Received: from 1.general.ppisati.uk.vpn ([10.172.193.134] helo=canonical.com) by youngberry.canonical.com with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1glymu-0000ro-0o for kernel-team@lists.ubuntu.com; Tue, 22 Jan 2019 16:20:32 +0000 From: Paolo Pisati To: kernel-team@lists.ubuntu.com Subject: [PATCH 1/2 C-D/master] UBUNTU: SAUCE: btqcomsmd: introduce BT_QCOMSMD_HACK Date: Tue, 22 Jan 2019 17:20:29 +0100 Message-Id: <1548174031-23334-2-git-send-email-paolo.pisati@canonical.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1548174031-23334-1-git-send-email-paolo.pisati@canonical.com> References: <1548174031-23334-1-git-send-email-paolo.pisati@canonical.com> X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" BugLink: https://bugs.launchpad.net/bugs/1810797 Signed-off-by: Paolo Pisati Acked-by: Colin Ian King Acked-by: Stefan Bader --- drivers/bluetooth/Kconfig | 7 +++++++ drivers/bluetooth/btqcomsmd.c | 5 +++++ 2 files changed, 12 insertions(+) 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);