Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2519796pxb; Mon, 18 Jan 2021 22:02:46 -0800 (PST) X-Google-Smtp-Source: ABdhPJx8i6mAS6W9V297wThNbOmGzQvLeqdjhbVyV8rWZJra4N4HWaa9K7wQiMoILNi4e+a8/ux5 X-Received: by 2002:a17:906:4a14:: with SMTP id w20mr2086860eju.192.1611036166767; Mon, 18 Jan 2021 22:02:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611036166; cv=none; d=google.com; s=arc-20160816; b=NGCX+7C1K/4MpWqkng2rav8qRVl0jXG7hiHK2V5F+4jgrUjNsqW6eiCtLNfDK50xFa J3E7S4lzxIGMrZUaPkhGo3buBfE+GygN8Iz23I32K5BELdiwBkp0Cr71Oiicx8nLjWRO +udwnR9N5jTNvk0HKg1syN32/QpqXtwjjHlvaWYFOWX1EQrM2LXzyyES+bicC/qXjsQd EgWfO1S5myaTwyfCx53DyqjrpXySlKKFVWqTA3km6gmDf+IAIa7nTpM6nWbYyoHXQ7I2 OeK1yCJDTQste3VRF7IOqok12p/Cddk9B3ZYhpwSf3ILBg9PwgoeuX1tgmZf8PPi1aFM jPVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=yxguhV1s8HV3uAUmVwAP9veGFogzAl9hGJElFs8+sg8=; b=eOPFt6YcXYE9IV4wdjxG50w+axE0UJQqvWlEDJ0Xyo4SU9H1ru+UPTZkwIjFXWlTLI oRAg1JH7Cg1ZWY1KGJ6jqXk2BOC72a05NWtwysvV+V+KaBQ6o/4V/4uQwckQZgt9b9GA BHRGdOT+oTAYVNxdo7dziYAwg0hcnxys5p3ZPTOqaV+lwzKhS9kzO49zQkmsQo7eRHBx cf+o48ZLSzRN15aBZfSsXa1dVugGbNeIqVUH9tlbaoeacIk2laJ0z5pslJNRzN691qJU ZyfD9mVWtHaD8SMBkczDnZfG65PGRWE6p+TEDctHyH5Z0mjXm+lOQlbig2wlzjuamZDq Igtg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=hxGX2VCa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d24si8301502edu.93.2021.01.18.22.02.23; Mon, 18 Jan 2021 22:02:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=hxGX2VCa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732624AbhASExX (ORCPT + 99 others); Mon, 18 Jan 2021 23:53:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39182 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387890AbhASEmg (ORCPT ); Mon, 18 Jan 2021 23:42:36 -0500 Received: from mail-vs1-xe2e.google.com (mail-vs1-xe2e.google.com [IPv6:2607:f8b0:4864:20::e2e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0649BC061574 for ; Mon, 18 Jan 2021 20:41:13 -0800 (PST) Received: by mail-vs1-xe2e.google.com with SMTP id o19so10419003vsn.3 for ; Mon, 18 Jan 2021 20:41:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=yxguhV1s8HV3uAUmVwAP9veGFogzAl9hGJElFs8+sg8=; b=hxGX2VCaRgK3TvZZyA8vqpQ2j6H0o61h6RRTo9JBmAzOhsbRmzDyNPj1THO/XvyUNQ rIMldKA4xhJw2A9RBASR1qcsG6gfaASGhm8dBLi+aEDbMDosMn+2u7d2KMvIKGpALrza bIgHYeCTjKR+g0Pv+pvm5pjtV8YVXUl1Mfsmw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=yxguhV1s8HV3uAUmVwAP9veGFogzAl9hGJElFs8+sg8=; b=IWH8JVZwAOQVzlb0OSNkk4GpgZGr4Fmqp42V4zjj4K8LLKPkm/ojmAy8InOdVQSzOp XAr3LBZ50pj2ZnwwvbqlOFh1+c6TpoYZwWvXSMNnF/zHSgni0xZR5MzVP6a0gsxXBRrs cRdRt5QVT67VA29h+VbPnOmV97xsnJUhifBo59r84MZnPl2nspVic1AYxKL/+0HKO8as grwh+mhA41/Q7JWq5aViV4HF23EyuZU/U4EujzDhpBrEezqi8gZjqV+gjBIsAcxd6po1 SFRzDFUzVotdS38//T+wPFo0P+G3v30kXU7i6s1PrtET73T85tqqRB1H/RaqgMslQCjV R36A== X-Gm-Message-State: AOAM531vtxtjehA1NtLwlcjXCnfLsktMg1HQbKkDnuGb2F0Dnkhfciap a9sScqav0AaGx5JwdA9W1w54+rZ2HTaJx6cbNvj8MQ== X-Received: by 2002:a05:6102:66a:: with SMTP id z10mr1655865vsf.53.1611031272168; Mon, 18 Jan 2021 20:41:12 -0800 (PST) MIME-Version: 1.0 References: <20210118112827.6192-1-max.chou@realtek.com> In-Reply-To: <20210118112827.6192-1-max.chou@realtek.com> From: Abhishek Pandit-Subedi Date: Mon, 18 Jan 2021 20:41:00 -0800 Message-ID: Subject: Re: [PATCH] Bluetooth: btrtl: Enable WBS for the specific Realtek devices To: max.chou@realtek.com Cc: Marcel Holtmann , Johan Hedberg , Luiz Augusto von Dentz , Bluez mailing list , LKML , Alex Lu , hildawu@realtek.com, kidman@realtek.com, Shyh-In Hwang Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Max, On Mon, Jan 18, 2021 at 3:28 AM wrote: > > From: Max Chou > > By this change, it will enable WBS supported on the specific Realtek BT > devices, such as RTL8822C and RTL8852A. > In the future, it's able to maintain what the Realtek devices support WBS > here. > > Tested-by: Hilda Wu > Signed-off-by: Max Chou > --- > drivers/bluetooth/btrtl.c | 26 +++++++++++++++++++++++--- > 1 file changed, 23 insertions(+), 3 deletions(-) > > diff --git a/drivers/bluetooth/btrtl.c b/drivers/bluetooth/btrtl.c > index 24f03a1f8d57..835819c47ae6 100644 > --- a/drivers/bluetooth/btrtl.c > +++ b/drivers/bluetooth/btrtl.c > @@ -38,6 +38,19 @@ > .hci_ver = (hciv), \ > .hci_bus = (bus) > > +enum btrtl_chip_id { > + CHIP_ID_8723A, /* index 0 for RTL8723A*/ > + CHIP_ID_8723B, /* index 1 for RTL8723B*/ > + CHIP_ID_8821A, /* index 2 for RTL8821A*/ > + CHIP_ID_8761A, /* index 3 for RTL8761A*/ > + CHIP_ID_8822B = 8, /* index 8 for RTL8822B */ > + CHIP_ID_8723D, /* index 9 for RTL8723D */ > + CHIP_ID_8821C, /* index 10 for RTL8821C */ > + CHIP_ID_8822C = 13, /* index 13 for RTL8822C */ > + CHIP_ID_8761B, /* index 14 for RTL8761B */ > + CHIP_ID_8852A = 18, /* index 18 for RTL8852A */ > +}; > + > struct id_table { > __u16 match_flags; > __u16 lmp_subver; > @@ -58,6 +71,7 @@ struct btrtl_device_info { > u8 *cfg_data; > int cfg_len; > bool drop_fw; > + int project_id; > }; > > static const struct id_table ic_id_table[] = { > @@ -307,8 +321,10 @@ static int rtlbt_parse_firmware(struct hci_dev *hdev, > > /* Find project_id in table */ > for (i = 0; i < ARRAY_SIZE(project_id_to_lmp_subver); i++) { > - if (project_id == project_id_to_lmp_subver[i].id) > + if (project_id == project_id_to_lmp_subver[i].id) { > + btrtl_dev->project_id = project_id; > break; > + } > } > > if (i >= ARRAY_SIZE(project_id_to_lmp_subver)) { > @@ -725,12 +741,16 @@ int btrtl_setup_realtek(struct hci_dev *hdev) > /* Enable central-peripheral role (able to create new connections with > * an existing connection in slave role). > */ > - switch (btrtl_dev->ic_info->lmp_subver) { > - case RTL_ROM_LMP_8822B: > + /* Enable WBS supported for the specific Realtek 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); > break; > default: > rtl_dev_dbg(hdev, "Central-peripheral role not enabled."); > + rtl_dev_dbg(hdev, "WBS supported not enabled."); > break; > } There is a null-check on btrtl_dev->ic_info right above this switch statement (https://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git/commit/?id=b649813eadbc062d8682f7a20aa025275707dd1f). Is this still necessary with this change? (Sorry, I missed this during our previous review). > > -- > 2.17.1 > Abhishek