From patchwork Wed Sep 8 11:19:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joseph Hwang X-Patchwork-Id: 12480933 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, 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 89FAAC433F5 for ; Wed, 8 Sep 2021 11:20:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5E99861078 for ; Wed, 8 Sep 2021 11:20:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348643AbhIHLVH (ORCPT ); Wed, 8 Sep 2021 07:21:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44542 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235223AbhIHLVH (ORCPT ); Wed, 8 Sep 2021 07:21:07 -0400 Received: from mail-pj1-x102b.google.com (mail-pj1-x102b.google.com [IPv6:2607:f8b0:4864:20::102b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B1F4DC061757 for ; Wed, 8 Sep 2021 04:19:59 -0700 (PDT) Received: by mail-pj1-x102b.google.com with SMTP id u13-20020a17090abb0db0290177e1d9b3f7so1158242pjr.1 for ; Wed, 08 Sep 2021 04:19:59 -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=IDGj9HWyjNNo4qWirZssrlehTTw1UTlg3WK+Ed0rG1k=; b=bHm8R8kVRgth4LRfbqYfL6RvAyFHZyEURXhEp6go5NHmS3qq0/jtYWjTfHOR91Cvxr fN0xuLysatIZ8mR8gdYjEC0H0P4soOxHYylOrCo2Yno/WWic0Pb0l+PGnXi9EOVM8hkF 5LrnaxZ8CThtUN+dyPBYHOn4kZXT6cKwtsF1o= 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=IDGj9HWyjNNo4qWirZssrlehTTw1UTlg3WK+Ed0rG1k=; b=OXEjtm3g2o9n4tP4CDCkmaZRjb09C2t9gsg9+oSaOu3rf9GFwcEQ6byP0I+ngGYgPd mTFtuFjfv7Cic50oXTqwtrcYsY4fpWUvHbQn/41BnEZvbQVK7ZJrNlhJ8RCXvmuleIO8 GHMWlEesubUalakxqCb3zkCMT+pjz2fdD77SYAbVydvbVDAYK3ovwy94KyVgUL8axDG3 3VG6+m6GJh4+gSoSbL8ixWbHClSkKIdnMkWRLCBRcpb7d73wEP/Ft7wbY9lQRUBfBl0+ P5x0OPLoWjCJhh0uXxCiJ+0r1nDbzvYKMXira4ruNCoPUhsi/l90EirgE8caGh0LYARG zt4A== X-Gm-Message-State: AOAM533AsIsUmyB94yo3XtxKzfiA/VxadLIsYqcEZtKil+0IVUM5s12c nFUqFUfStoW2yuP9PfAmAbgDxJDMS4aktA== X-Google-Smtp-Source: ABdhPJwk/40wHHl6IFamfFFRBr21kLVM6fZBELFkMSse00XW1leETGNDMV07SidwAVMaA08MqolEzw== X-Received: by 2002:a17:90a:708c:: with SMTP id g12mr3602337pjk.13.1631099998976; Wed, 08 Sep 2021 04:19:58 -0700 (PDT) Received: from josephsih-z840.tpe.corp.google.com ([2401:fa00:1:10:6939:f2f4:4be:bf22]) by smtp.gmail.com with ESMTPSA id v6sm2160881pjr.41.2021.09.08.04.19.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Sep 2021 04:19:58 -0700 (PDT) From: Joseph Hwang To: linux-bluetooth@vger.kernel.org, marcel@holtmann.org, luiz.dentz@gmail.com, pali@kernel.org Cc: chromeos-bluetooth-upstreaming@chromium.org, josephsih@google.com, Joseph Hwang , Miao-chen Chou , Johan Hedberg , linux-kernel@vger.kernel.org Subject: [PATCH v2 1/3] Bluetooth: btandroid: Support Android Bluetooth Quality Report Date: Wed, 8 Sep 2021 19:19:49 +0800 Message-Id: <20210908191915.v2.1.I17f57656757b83a1c0fb4b78525d8aca581725db@changeid> X-Mailer: git-send-email 2.33.0.153.gba50c8fa24-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. Reviewed-by: Miao-chen Chou Signed-off-by: Joseph Hwang --- Changes in v2: - Fix the titles of patches 2/3 and 3/3 and reduce their lengths. drivers/bluetooth/Makefile | 1 + drivers/bluetooth/btandroid.c | 106 ++++++++++++++++++++++++++++++++++ drivers/bluetooth/btandroid.h | 10 ++++ 3 files changed, 117 insertions(+) create mode 100644 drivers/bluetooth/btandroid.c create mode 100644 drivers/bluetooth/btandroid.h diff --git a/drivers/bluetooth/Makefile b/drivers/bluetooth/Makefile index 16286ea2655d..4d5d010bb947 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_HCIBTUSB) += 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 Wed Sep 8 11:19:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joseph Hwang X-Patchwork-Id: 12480935 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, 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 6D1BEC4332F for ; Wed, 8 Sep 2021 11:20:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4FA4861139 for ; Wed, 8 Sep 2021 11:20:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349147AbhIHLVJ (ORCPT ); Wed, 8 Sep 2021 07:21:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44552 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348280AbhIHLVJ (ORCPT ); Wed, 8 Sep 2021 07:21:09 -0400 Received: from mail-pf1-x42f.google.com (mail-pf1-x42f.google.com [IPv6:2607:f8b0:4864:20::42f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E6826C061575 for ; Wed, 8 Sep 2021 04:20:01 -0700 (PDT) Received: by mail-pf1-x42f.google.com with SMTP id n34so1752287pfv.7 for ; Wed, 08 Sep 2021 04:20:01 -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=Coy2eW1XyQHI0Kys17CdQehAZIVSSakTIxwVO2f+uuk=; b=ix7iuG6AMjXW4gtpi0mlq7XdWkNLJKw+27HLSTWoqCkn38ZqFuZWvO2p4u87CdJ06/ IvQGdOkCOdrhd4R3yZ+gfSMX3eoNlJFTcHBH8KxuwbVDqqK+42HnUOkpuUUTrxKxbwQ1 TXNQSxUUFS2ZT17aRGVRtsEcrtiV66t2TTnTo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Coy2eW1XyQHI0Kys17CdQehAZIVSSakTIxwVO2f+uuk=; b=MuQfFsWY7OmJJyrFE1WzI7BWtBQXmOtcP8kyu2FQz0Y83Bk+sbCK4VWor/E2RT8rjT CcxY2RixkPJMPiC7bNThcyG0lCkWpp33tlf5JTDg6Cmk9hj3wTM+iZ1fT8+JZ9bO4bbJ kt40TlCzkumB9k9v/JS4E06U+ZsYpHx1jwfX3tFJ/zaBBX5PRL3cdK6sB2lCc4RwA0LM f0IkE1TT6JGmSDyg6fm2jry+og3mzDWOqQaMF0NpqoYTLDN6ttBWROf6KajEyWjcTeJh XiFZ238j2UbNO93ARyoKlzwhQzO1ya5jHpFHr1Xe/lTaa7EKU8vhNeCkrUxHzIpn/N4l 326Q== X-Gm-Message-State: AOAM530ZSRPDBTdogDy1h7b0lt4KyKCkTflT/rokBx2LWf+ykyCohssU 6rKR3uWdfSdvTm3NyFODoThEN7CvDJDfWQ== X-Google-Smtp-Source: ABdhPJw79A14sqmPxPpGF554ONNVKxU4Ccz7p0hqCDsDNCsj7Ug6QTvaEp1kipObIucWxMYDNen1Gg== X-Received: by 2002:a05:6a00:14c4:b0:412:444e:f600 with SMTP id w4-20020a056a0014c400b00412444ef600mr3039154pfu.83.1631100001200; Wed, 08 Sep 2021 04:20:01 -0700 (PDT) Received: from josephsih-z840.tpe.corp.google.com ([2401:fa00:1:10:6939:f2f4:4be:bf22]) by smtp.gmail.com with ESMTPSA id v6sm2160881pjr.41.2021.09.08.04.19.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Sep 2021 04:20:00 -0700 (PDT) From: Joseph Hwang To: linux-bluetooth@vger.kernel.org, marcel@holtmann.org, luiz.dentz@gmail.com, pali@kernel.org Cc: chromeos-bluetooth-upstreaming@chromium.org, josephsih@google.com, Joseph Hwang , Miao-chen Chou , Johan Hedberg , linux-kernel@vger.kernel.org Subject: [PATCH v2 2/3] Bluetooth: hci_qca: Set up Qualcomm WCN399x for Android BQR commands Date: Wed, 8 Sep 2021 19:19:50 +0800 Message-Id: <20210908191915.v2.2.Ie2014b5e6ed62dee26015805cf9c9b00d8dc64e5@changeid> X-Mailer: git-send-email 2.33.0.153.gba50c8fa24-goog In-Reply-To: <20210908191915.v2.1.I17f57656757b83a1c0fb4b78525d8aca581725db@changeid> References: <20210908191915.v2.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. Reviewed-by: Miao-chen Chou Signed-off-by: Joseph Hwang Reported-by: kernel test robot Reported-by: kernel test robot Reported-by: kernel test robot --- 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 Wed Sep 8 11:19:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joseph Hwang X-Patchwork-Id: 12480937 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, 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 29F32C433EF for ; Wed, 8 Sep 2021 11:20:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0B42C61078 for ; Wed, 8 Sep 2021 11:20:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351430AbhIHLVP (ORCPT ); Wed, 8 Sep 2021 07:21:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44568 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351384AbhIHLVL (ORCPT ); Wed, 8 Sep 2021 07:21:11 -0400 Received: from mail-pl1-x629.google.com (mail-pl1-x629.google.com [IPv6:2607:f8b0:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 44B84C06175F for ; Wed, 8 Sep 2021 04:20:04 -0700 (PDT) Received: by mail-pl1-x629.google.com with SMTP id u1so1091394plq.5 for ; Wed, 08 Sep 2021 04:20:04 -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=pmk2a81JVl4SkAncwyxKrhCXZFyctOgBxo36TTei3kc=; b=AWG1220m9+DCOAGn5Ytl/f+I2ojC1KPGwYixzk2HOe/AqaVO3K9yqyNxd/B9HKWV1T du/mzJWSwa6TLuad+dcXAYyNHmm5m2yb6c95yjmS0YvspxMQORTQJrETXD3xiiEvEbf/ zLBg0dbQfcSQv0JXkIwPxqWZKyMQpeM14Cxog= 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=pmk2a81JVl4SkAncwyxKrhCXZFyctOgBxo36TTei3kc=; b=HPrmHkKqgMP4vTtW6FJI288g3nn3LKQOLwXxv3oK7dMcKoaDRaXmXPR/Ke/NPi0OVS 9Tn+BciAYVSrz0tPaFPNX/5SMZsTplr7RlJoKZ2+jWKcCEgqR8aiyd1nMjRDmobNiy0w hZRJy485JmV0IQ4zTof0JUuOZ0QkRrFarnRCzv7HWwwapHnZAxs/KRQpZ1iemRXLgkp3 cR3S5VY1GiMBYH9Wr+B3WcYSE0qb/H7dvKvsR6FtAQEf82mnI4J4wMNUMq3T/kmxNdC/ JqWpzQqf12t1u0QIOHkWqL8NtxZNbqOH62uL7xAZ7Z+7ZMUzThRyHwhdSz9UF+Y9SxgX xe+g== X-Gm-Message-State: AOAM5327Ax1CwdyO+ISri6SVVSGmaLyKRuzp58Y5p+Y1BG+FdeBmfPCO 4jEt+hWkqqJXqYuIt/jko5JnpsAQzitA9Q== X-Google-Smtp-Source: ABdhPJxHbqzFAiURaotJ7J2wZ1NVUHXZuEv5T02En4QRCuPNLGNTg50874q3/ZcCbJ9rEkc5ktwr2w== X-Received: by 2002:a17:902:b713:b0:132:5a48:18cb with SMTP id d19-20020a170902b71300b001325a4818cbmr2583683pls.50.1631100003426; Wed, 08 Sep 2021 04:20:03 -0700 (PDT) Received: from josephsih-z840.tpe.corp.google.com ([2401:fa00:1:10:6939:f2f4:4be:bf22]) by smtp.gmail.com with ESMTPSA id v6sm2160881pjr.41.2021.09.08.04.20.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Sep 2021 04:20:03 -0700 (PDT) From: Joseph Hwang To: linux-bluetooth@vger.kernel.org, marcel@holtmann.org, luiz.dentz@gmail.com, pali@kernel.org Cc: chromeos-bluetooth-upstreaming@chromium.org, josephsih@google.com, Joseph Hwang , Miao-chen Chou , Johan Hedberg , linux-kernel@vger.kernel.org Subject: [PATCH v2 3/3] Bluetooth: btrtl: Set up Realtek 8822CE for Android BQR commands Date: Wed, 8 Sep 2021 19:19:51 +0800 Message-Id: <20210908191915.v2.3.Ic8dcac2622d16775748f9d36c0a5e893372aa48d@changeid> X-Mailer: git-send-email 2.33.0.153.gba50c8fa24-goog In-Reply-To: <20210908191915.v2.1.I17f57656757b83a1c0fb4b78525d8aca581725db@changeid> References: <20210908191915.v2.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. Reviewed-by: Miao-chen Chou Signed-off-by: Joseph Hwang Reported-by: kernel test robot --- 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.");