From patchwork Mon Sep 13 07:28:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joseph Hwang X-Patchwork-Id: 12488033 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4C2ACC433EF for ; Mon, 13 Sep 2021 07:28:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2984860FDA for ; Mon, 13 Sep 2021 07:28:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237632AbhIMHaB (ORCPT ); Mon, 13 Sep 2021 03:30:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33164 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237603AbhIMHaA (ORCPT ); Mon, 13 Sep 2021 03:30:00 -0400 Received: from mail-pl1-x632.google.com (mail-pl1-x632.google.com [IPv6:2607:f8b0:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D7C81C061574 for ; Mon, 13 Sep 2021 00:28:44 -0700 (PDT) Received: by mail-pl1-x632.google.com with SMTP id bg1so5201001plb.13 for ; Mon, 13 Sep 2021 00:28:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=DnoYR5x/DwI9mRpxTVlQwvsfoxsFdaE2SzPcs+yYnk8=; b=njbPXFywfXR+xOmYU3z+sSYoLjhwfEyrdlj+CwD2HXM0s09iyTR72harRqICh/4+UZ 1a4u/M+XDdnyEJhasMj8jGa2fiua74bxGbyiMnhqYy6ZzFpZGmqYUNK9GdSVBrRiZZys 7T9AKPlAQeS0s4KNdRBbnLKbhecNb14ghu1x4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=DnoYR5x/DwI9mRpxTVlQwvsfoxsFdaE2SzPcs+yYnk8=; b=UH1KHajidFIL4F9hXZe2YUxAxvxiCInV+QjbmJU7wHP1cJLsL2WrVZwd5WX0lvsDvM JY/cOkyxoBprodJnn79/N5vgnp3fQbJdXvpCxOrUzymiXxX16An1zyNugQXWwanen1oO kRbu+TzOEcr6j/48b7c70spp/yNxDQQmgnK3XqG7lfB0w4pHe/c00Spt1a+VdQ7UAxdz f9CinYQC5yDsG+ceJnvMbQvwejGZeVzjvoqUv0rnuPfBc87g9+M/AAUZkwuRZdejLC6U w8/aOlDgvPX17Vu+wk4o+LcakVE2nmQIgpcGWEP++21cqFg1m7LOZ/6e2YmKIfK34bqI tHMg== X-Gm-Message-State: AOAM530SdCbo7TZARMsnmGS0KAHjFzbt72OV7eg3A/uP4zYOMtmAuW/5 2pFuzHnDzNxt67zPpTY3nJolWmAxrHSrqA== X-Google-Smtp-Source: ABdhPJyIXiW/sfh6i4lN8UmYLjjuq2GGPYZKMncz+ZlPySfACwqkuEAp19mPfM1R4zlmNgsHCfdoUQ== X-Received: by 2002:a17:90b:1c07:: with SMTP id oc7mr11579080pjb.209.1631518124059; Mon, 13 Sep 2021 00:28:44 -0700 (PDT) Received: from josephsih-z840.tpe.corp.google.com ([2401:fa00:1:10:b418:a601:c444:4951]) by smtp.gmail.com with ESMTPSA id g8sm5688019pfv.51.2021.09.13.00.28.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Sep 2021 00:28:43 -0700 (PDT) From: Joseph Hwang To: linux-bluetooth@vger.kernel.org, marcel@holtmann.org, luiz.dentz@gmail.com, pali@kernel.org Cc: josephsih@google.com, chromeos-bluetooth-upstreaming@chromium.org, Joseph Hwang , kernel test robot , Miao-chen Chou , Johan Hedberg , linux-kernel@vger.kernel.org Subject: [PATCH v3 1/3] Bluetooth: btandroid: Support Android Bluetooth Quality Report Date: Mon, 13 Sep 2021 15:28:36 +0800 Message-Id: <20210913152801.v3.1.I17f57656757b83a1c0fb4b78525d8aca581725db@changeid> X-Mailer: git-send-email 2.33.0.309.g3052b89438-goog MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Add the btandroid.c file to support Android BQR commands. This module may be referenced by btusb, btrtl, and hci_qca when a Bluetooth controller supports the Android Bluetooth Quality Report. Reported-by: kernel test robot Reviewed-by: Miao-chen Chou Signed-off-by: Joseph Hwang --- Changes in v3: - Fix the auto build test ERROR "undefined symbol: btandroid_set_quality_report" that occurred with some kernel configs. - Note that the mgmt-tester "Read Exp Feature - Success" failed. But on my test device, the same test passed. Please kindly let me know what may be going wrong. These patches do not actually modify read/set experimental features. - As to CheckPatch failed. No need to modify the MAINTAINERS file. Thanks. Changes in v2: - Fix the titles of patches 2/3 and 3/3 and reduce their lengths. drivers/bluetooth/Kconfig | 5 ++ drivers/bluetooth/Makefile | 1 + drivers/bluetooth/btandroid.c | 106 ++++++++++++++++++++++++++++++++++ drivers/bluetooth/btandroid.h | 10 ++++ 4 files changed, 122 insertions(+) create mode 100644 drivers/bluetooth/btandroid.c create mode 100644 drivers/bluetooth/btandroid.h diff --git a/drivers/bluetooth/Kconfig b/drivers/bluetooth/Kconfig index 851842372c9b..0be352cdc6c9 100644 --- a/drivers/bluetooth/Kconfig +++ b/drivers/bluetooth/Kconfig @@ -19,10 +19,14 @@ config BT_QCA tristate select FW_LOADER +config BT_HCIBTANDROID + tristate + config BT_HCIBTUSB tristate "HCI USB driver" depends on USB select BT_INTEL + select BT_HCIBTANDROID help Bluetooth HCI USB driver. This driver is required if you want to use Bluetooth devices with @@ -90,6 +94,7 @@ config BT_HCIUART depends on SERIAL_DEV_BUS || !SERIAL_DEV_BUS depends on NVMEM || !NVMEM depends on TTY + select BT_HCIBTANDROID help Bluetooth HCI UART driver. This driver is required if you want to use Bluetooth devices with diff --git a/drivers/bluetooth/Makefile b/drivers/bluetooth/Makefile index 16286ea2655d..3a2ca2eb7cd7 100644 --- a/drivers/bluetooth/Makefile +++ b/drivers/bluetooth/Makefile @@ -13,6 +13,7 @@ obj-$(CONFIG_BT_HCIBT3C) += bt3c_cs.o obj-$(CONFIG_BT_HCIBLUECARD) += bluecard_cs.o obj-$(CONFIG_BT_HCIBTUSB) += btusb.o +obj-$(CONFIG_BT_HCIBTANDROID) += btandroid.o obj-$(CONFIG_BT_HCIBTSDIO) += btsdio.o obj-$(CONFIG_BT_INTEL) += btintel.o diff --git a/drivers/bluetooth/btandroid.c b/drivers/bluetooth/btandroid.c new file mode 100644 index 000000000000..fffacc8d67cc --- /dev/null +++ b/drivers/bluetooth/btandroid.c @@ -0,0 +1,106 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * Support for Android Bluetooth Quality Report (BQR) specifications + * https://source.android.com/devices/bluetooth/hci_requirements + * + * Copyright (C) 2021 Google Corporation + */ + +#include + +#include +#include + +#include "btandroid.h" + +#define VERSION "0.1" + +/* + * Reference for the command op codes and parameters below: + * https://source.android.com/devices/bluetooth/hci_requirements#bluetooth-quality-report-command + */ +#define BQR_COMMAND_OCF 0x015e +#define BQR_OPCODE hci_opcode_pack(0x3f, BQR_COMMAND_OCF) + +/* report action */ +#define REPORT_ACTION_ADD 0x00 +#define REPORT_ACTION_DELETE 0x01 +#define REPORT_ACTION_CLEAR 0x02 + +/* BQR event masks */ +#define QUALITY_MONITORING (1 << 0) +#define APPRAOCHING_LSTO (1 << 1) +#define A2DP_AUDIO_CHOPPY (1 << 2) +#define SCO_VOICE_CHOPPY (1 << 3) + +#define DEFAULT_BQR_EVENT_MASK (QUALITY_MONITORING | APPRAOCHING_LSTO | \ + A2DP_AUDIO_CHOPPY | SCO_VOICE_CHOPPY) + +/* + * Reporting at seconds so as not to stress the controller too much. + * Range: 0 ~ 65535 ms + */ +#define DEFALUT_REPORT_INTERVAL_MS 5000 + +struct android_bqr_cp { + __u8 report_action; + __u32 event_mask; + __u16 min_report_interval; +} __packed; + +static int enable_quality_report(struct hci_dev *hdev) +{ + struct sk_buff *skb; + struct android_bqr_cp cp; + + cp.report_action = REPORT_ACTION_ADD; + cp.event_mask = DEFAULT_BQR_EVENT_MASK; + cp.min_report_interval = DEFALUT_REPORT_INTERVAL_MS; + + skb = __hci_cmd_sync(hdev, BQR_OPCODE, sizeof(cp), &cp, + HCI_CMD_TIMEOUT); + if (IS_ERR(skb)) { + bt_dev_err(hdev, "Enabling Android BQR failed (%ld)", + PTR_ERR(skb)); + return PTR_ERR(skb); + } + + kfree_skb(skb); + return 0; +} + +static int disable_quality_report(struct hci_dev *hdev) +{ + struct sk_buff *skb; + struct android_bqr_cp cp = { 0 }; + + cp.report_action = REPORT_ACTION_CLEAR; + + skb = __hci_cmd_sync(hdev, BQR_OPCODE, sizeof(cp), &cp, + HCI_CMD_TIMEOUT); + if (IS_ERR(skb)) { + bt_dev_err(hdev, "Disabling Android BQR failed (%ld)", + PTR_ERR(skb)); + return PTR_ERR(skb); + } + + kfree_skb(skb); + return 0; +} + +int btandroid_set_quality_report(struct hci_dev *hdev, bool enable) +{ + bt_dev_info(hdev, "quality report enable %d", enable); + + /* Enable or disable the quality report feature. */ + if (enable) + return enable_quality_report(hdev); + else + return disable_quality_report(hdev); +} +EXPORT_SYMBOL_GPL(btandroid_set_quality_report); + +MODULE_AUTHOR("Google"); +MODULE_DESCRIPTION("Support for Android Bluetooth Specification " VERSION); +MODULE_VERSION(VERSION); +MODULE_LICENSE("GPL"); diff --git a/drivers/bluetooth/btandroid.h b/drivers/bluetooth/btandroid.h new file mode 100644 index 000000000000..6abc9e8e0838 --- /dev/null +++ b/drivers/bluetooth/btandroid.h @@ -0,0 +1,10 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +/* + * Bluetooth support for Android specifications + * + * Copyright (C) 2021 Google Corporation + */ + +#include + +int btandroid_set_quality_report(struct hci_dev *hdev, bool enable); From patchwork Mon Sep 13 07:28:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joseph Hwang X-Patchwork-Id: 12488035 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AFDBBC433FE for ; Mon, 13 Sep 2021 07:28:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9492F60FDA for ; Mon, 13 Sep 2021 07:28:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237657AbhIMHaD (ORCPT ); Mon, 13 Sep 2021 03:30:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33184 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237646AbhIMHaC (ORCPT ); Mon, 13 Sep 2021 03:30:02 -0400 Received: from mail-pg1-x52b.google.com (mail-pg1-x52b.google.com [IPv6:2607:f8b0:4864:20::52b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 05DAEC061767 for ; Mon, 13 Sep 2021 00:28:47 -0700 (PDT) Received: by mail-pg1-x52b.google.com with SMTP id h3so8627732pgb.7 for ; Mon, 13 Sep 2021 00:28:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Wzr/tDY+SZhvYSJPQ+K7kJlNJzjJfxAyxq+7vt2n+E8=; b=PapxB+4evxTDIxxsBZs5sP8wB4RESQHtmXbaiuABpZbRCivOVxFr/xnYn3ArvE2x45 OkkT3PnMsDFTkOaZVqSgJa5Y27vFcvLL83iIUQfY6XO4XW2zayPuyH5wKFrHvZUva2DT 5r154psCD4xPSSTD9vZmEwoY3Qikmhp9FVIQ0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Wzr/tDY+SZhvYSJPQ+K7kJlNJzjJfxAyxq+7vt2n+E8=; b=udd7OXVWk7EI8qbWrZziIcRJmSze0U/iBG59CS9YfJuZAvPsBerK+b5/ZheW5KRQle V74aGECJtFN4sm1xj5pU+qFLTo6qV4h6ig/UsyvOvA3gU0Wp1FR3ff2ZMo44jESbHgx0 d1J1iVy5wMPBT9LQyXcmJn8UQ6eNcDG3Z1+P62Bwrij18MGKVRy0wa6WN53qZNAIzcL+ CK3aYu6IE4TRWws4oI5fWQ/SSfDO6stk8CZkywyIWG9X2OxWN9u5ZRb6sGJAsbTEFxXy uz5kELT1qgXk9rjZtzXmRbp22Qr8+gEfee/Hk6pOQwKCsecF8WX1nd80Q2XVMN6YysrL bdYg== X-Gm-Message-State: AOAM530gqWZDZzu3Jbi45YNDiMeEzNhbqVj1o4zWVc/p/qKpG5X8p1Sr hkx2eSg/nWrLFv1cNsaAS0JZ5/qimeaSYQ== X-Google-Smtp-Source: ABdhPJzkKp9xe290AFmj3veLxm1mWg9pNLjagG+3eu2OWr86D1yuTxbIo9Td28dQqtVn/Ng8v60jVw== X-Received: by 2002:a62:16c8:0:b0:43d:d6b8:f38 with SMTP id 191-20020a6216c8000000b0043dd6b80f38mr2948110pfw.9.1631518126387; Mon, 13 Sep 2021 00:28:46 -0700 (PDT) Received: from josephsih-z840.tpe.corp.google.com ([2401:fa00:1:10:b418:a601:c444:4951]) by smtp.gmail.com with ESMTPSA id g8sm5688019pfv.51.2021.09.13.00.28.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Sep 2021 00:28:46 -0700 (PDT) From: Joseph Hwang To: linux-bluetooth@vger.kernel.org, marcel@holtmann.org, luiz.dentz@gmail.com, pali@kernel.org Cc: josephsih@google.com, chromeos-bluetooth-upstreaming@chromium.org, Joseph Hwang , kernel test robot , Miao-chen Chou , Johan Hedberg , linux-kernel@vger.kernel.org Subject: [PATCH v3 2/3] Bluetooth: hci_qca: Set up Qualcomm WCN399x for Android BQR commands Date: Mon, 13 Sep 2021 15:28:37 +0800 Message-Id: <20210913152801.v3.2.Ie2014b5e6ed62dee26015805cf9c9b00d8dc64e5@changeid> X-Mailer: git-send-email 2.33.0.309.g3052b89438-goog In-Reply-To: <20210913152801.v3.1.I17f57656757b83a1c0fb4b78525d8aca581725db@changeid> References: <20210913152801.v3.1.I17f57656757b83a1c0fb4b78525d8aca581725db@changeid> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org This patch sets up Qualcomm WCN399x to support the Android BQR commands. Reported-by: kernel test robot Reviewed-by: Miao-chen Chou Signed-off-by: Joseph Hwang --- Changes in v3: - Fix the auto build test ERROR "undefined symbol: btandroid_set_quality_report" that occurred with some kernel configs. Changes in v2: - Fix the title drivers/bluetooth/hci_qca.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/bluetooth/hci_qca.c b/drivers/bluetooth/hci_qca.c index 53deea2eb7b4..bf576046681d 100644 --- a/drivers/bluetooth/hci_qca.c +++ b/drivers/bluetooth/hci_qca.c @@ -38,6 +38,7 @@ #include "hci_uart.h" #include "btqca.h" +#include "btandroid.h" /* HCI_IBS protocol messages */ #define HCI_IBS_SLEEP_IND 0xFE @@ -1730,6 +1731,7 @@ static int qca_setup(struct hci_uart *hu) if (qca_is_wcn399x(soc_type) || qca_is_wcn6750(soc_type)) { set_bit(HCI_QUIRK_USE_BDADDR_PROPERTY, &hdev->quirks); + hdev->set_quality_report = btandroid_set_quality_report; ret = qca_read_soc_version(hdev, &ver, soc_type); if (ret) From patchwork Mon Sep 13 07:28:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joseph Hwang X-Patchwork-Id: 12488037 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C714FC433EF for ; Mon, 13 Sep 2021 07:28:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AD0E460FDA for ; Mon, 13 Sep 2021 07:28:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237645AbhIMHaG (ORCPT ); Mon, 13 Sep 2021 03:30:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33204 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237641AbhIMHaE (ORCPT ); Mon, 13 Sep 2021 03:30:04 -0400 Received: from mail-pf1-x42b.google.com (mail-pf1-x42b.google.com [IPv6:2607:f8b0:4864:20::42b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 68AB0C061760 for ; Mon, 13 Sep 2021 00:28:49 -0700 (PDT) Received: by mail-pf1-x42b.google.com with SMTP id n30so5274083pfq.5 for ; Mon, 13 Sep 2021 00:28:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=9zCYdlsfppNPwVWp82IXgP0ehxEmeMjdmzKt1MZjwpc=; b=ZeEsB1XIs3wKP/Y06tvwmKpkvoqpXUDgLh+NB8aheVtSoCD0+c7ke5/nieY5wg7762 yUn8jWrxLXlx7bYEIXgVtkuO/eUwATPTfTygZrDa9/ytM954YQLk5QQpA/Cu1rxcF1Lg XM+6fdhfKiXJ1qAXKo1TNiZvtctlLua6xUo6E= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=9zCYdlsfppNPwVWp82IXgP0ehxEmeMjdmzKt1MZjwpc=; b=4yQBOh5GR6/NBRwPOcIy0iXsJ8knkQMBdiBH+9rA0gxcWxV9AE86A1jTk4QpETCkq9 hdFLlGk/kGj5EpbGxfdx4EIjNZ5hUcfh9NQeKGFm120+Wmil6UbliSDfaxla4hs0rsXm /V+sd7BQvAQcsHidkNDYDSD7Pl3LjFy6aCXUNyeAjdzD9GetFBqL0In9VDYvbzPqody9 07k5gf3zVnx9ebLXkWeEw8UEXNG1waqCEGIpPoFACweAv01TsFWy0gn6wI1gmaGKlCJ7 ClcnU/yII0ozf6CpTg8YSkq78m6ngK4AG5+CAsi7f8jJQqLRFk+ZKaKqBttWNL3XnLjx 2FUg== X-Gm-Message-State: AOAM533wKtEaKfZ9KRi+rccsTkrSXTSvAb91HGFu2Dfw3s2BCHapFEl9 AUtMm+Pe2DdSG5xR6yGx0fcHA1P2PlMwQA== X-Google-Smtp-Source: ABdhPJxmfuPOVwpj+1LU6eb8tITQ4Rtckdfl8xMmkt0+NTbLMm9QQ53x/9FBfReaGxRVW5kStaakxw== X-Received: by 2002:a63:7112:: with SMTP id m18mr9993627pgc.93.1631518128727; Mon, 13 Sep 2021 00:28:48 -0700 (PDT) Received: from josephsih-z840.tpe.corp.google.com ([2401:fa00:1:10:b418:a601:c444:4951]) by smtp.gmail.com with ESMTPSA id g8sm5688019pfv.51.2021.09.13.00.28.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Sep 2021 00:28:48 -0700 (PDT) From: Joseph Hwang To: linux-bluetooth@vger.kernel.org, marcel@holtmann.org, luiz.dentz@gmail.com, pali@kernel.org Cc: josephsih@google.com, chromeos-bluetooth-upstreaming@chromium.org, Joseph Hwang , kernel test robot , Miao-chen Chou , Johan Hedberg , linux-kernel@vger.kernel.org Subject: [PATCH v3 3/3] Bluetooth: btrtl: Set up Realtek 8822CE for Android BQR commands Date: Mon, 13 Sep 2021 15:28:38 +0800 Message-Id: <20210913152801.v3.3.Ic8dcac2622d16775748f9d36c0a5e893372aa48d@changeid> X-Mailer: git-send-email 2.33.0.309.g3052b89438-goog In-Reply-To: <20210913152801.v3.1.I17f57656757b83a1c0fb4b78525d8aca581725db@changeid> References: <20210913152801.v3.1.I17f57656757b83a1c0fb4b78525d8aca581725db@changeid> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org This patch sets up Realtek 8822CE to support the Android BQR commands. Reported-by: kernel test robot Reviewed-by: Miao-chen Chou Signed-off-by: Joseph Hwang --- Changes in v3: - Fix the auto build test ERROR "undefined symbol: btandroid_set_quality_report" that occurred with some kernel configs. Changes in v2: - Fix the title drivers/bluetooth/btrtl.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/bluetooth/btrtl.c b/drivers/bluetooth/btrtl.c index 1f8afa0244d8..e0bcdbe03eca 100644 --- a/drivers/bluetooth/btrtl.c +++ b/drivers/bluetooth/btrtl.c @@ -14,6 +14,7 @@ #include #include "btrtl.h" +#include "btandroid.h" #define VERSION "0.1" @@ -740,12 +741,13 @@ void btrtl_set_quirks(struct hci_dev *hdev, struct btrtl_device_info *btrtl_dev) /* Enable central-peripheral role (able to create new connections with * an existing connection in slave role). */ - /* Enable WBS supported for the specific Realtek devices. */ + /* Enable WBS and quality report supported by the specific devices. */ switch (btrtl_dev->project_id) { case CHIP_ID_8822C: case CHIP_ID_8852A: set_bit(HCI_QUIRK_VALID_LE_STATES, &hdev->quirks); set_bit(HCI_QUIRK_WIDEBAND_SPEECH_SUPPORTED, &hdev->quirks); + hdev->set_quality_report = btandroid_set_quality_report; break; default: rtl_dev_dbg(hdev, "Central-peripheral role not enabled.");