Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp703601pxb; Thu, 21 Jan 2021 18:41:57 -0800 (PST) X-Google-Smtp-Source: ABdhPJwaonaXYof7oupFsCQzlAg5CF3C0My3iz6UIAzk89KaOlfmMakpLCXKjeFXXrHYW8TViHCC X-Received: by 2002:a17:907:20a7:: with SMTP id pw7mr1530981ejb.283.1611283316850; Thu, 21 Jan 2021 18:41:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611283316; cv=none; d=google.com; s=arc-20160816; b=Bz3gjy5UJ1za1nNRDzfZRQmCuorPyWXVGsVGpHNYxeBi2Ol6mduMH6DYWBJ2YoBK+k jb1On5lSqNF2csaU83Njm5WEdhYGTijCbBvRcSCuV1Pd+zlVHNsLDHid1WMXYxwyDo+d 7PP+un3wHb58FQmV5FXI2w4Dsu5bEa6jGUs30BBsh8hI+eYvRViupOT1XaLIr5N4EeNZ F/H2RNtKz4ShE30IRccMh09fpckXePeRuh+mMTG3LkxBm0+tT1DP2SAMs9YDV/NPAqmF /GWc+IYA8fkLBezIp42DrZpvk1TGP1f7DyDyWlMH6l93NxoxWS6Rdh+FbQpfDKmHiigH MunQ== 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=XAhkXR3v/Trmg98rGb282YEmEKWvpDJKR5OuaxfB1LU=; b=yUed8EU15maz9ojC8MBa+ovVGXELu5eRzQ1/wXjM75dHnSezqrK/7Uf6nUE1q6Um0c xSw4CUrPB+aOMs9AaOsP4QW6/WgdPtfba9lFhqlcJbwpfOa2WorSEQF3JsUjVCeyjEz/ 9d55weopHK8sxMoXHMhv5tEsERf4ZSz/dlRzTqKnRRmUOPzT5RHJr8niXlUnnAYAHArF T6jNRr0WTZbGmolfFLi9aaRHYXNYLK9uLSeXTwD4JIndpqDIHSMp1I1N2FOwwae5S3j9 o86hqxWEL59cKx3FffwVBoGBEMpzsVxOcHqLFlwFwVRGqVjRSk2KNF1X/ZiiS4k+ke2M cM7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=favjwhbG; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-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 uz30si2467481ejb.70.2021.01.21.18.41.33; Thu, 21 Jan 2021 18:41:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-bluetooth-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=favjwhbG; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-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 S1726576AbhAVCZk (ORCPT + 99 others); Thu, 21 Jan 2021 21:25:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37568 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726396AbhAVCZh (ORCPT ); Thu, 21 Jan 2021 21:25:37 -0500 Received: from mail-vs1-xe34.google.com (mail-vs1-xe34.google.com [IPv6:2607:f8b0:4864:20::e34]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 50B78C061756 for ; Thu, 21 Jan 2021 18:24:57 -0800 (PST) Received: by mail-vs1-xe34.google.com with SMTP id 186so2226528vsz.13 for ; Thu, 21 Jan 2021 18:24:57 -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=XAhkXR3v/Trmg98rGb282YEmEKWvpDJKR5OuaxfB1LU=; b=favjwhbGx3cxHQQ1FjgoCMzHl6Icuq/kfdcJ/JMLXT0e783mb1Hi3KQKC/p69oQjpQ YDAhnyijcUL0oN68cufZr2uHr4Mv/XJaUo6Y6/cOoAWLkNchUc/hFVNjosrZqk/toala 0qRC037nk9trBeKYUokbtdlmkhmXldKOAYSM4= 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=XAhkXR3v/Trmg98rGb282YEmEKWvpDJKR5OuaxfB1LU=; b=Wv9web9Ab/NQnsWuftWtdo+l+vkg6puPjGMLeeWXWDDLlagWdCY3jnExEYH4+3Y01s skHL/potZmDjN7PMWJLCL8ZX10FmMRLflxe4YaM7i5TgitB8Fn3muSsMSmXieuQp4/sv CWAVIOH/s5p1MBQC3P0spr02evqBifmeIOtYzs9NWMBBQIOZuG59LMQn+J4HZuHvcpIa 7DsxRyzptqgUTb9O0/LRPOW8XSZX8DqZG64kMS/mxVIsQls6WLBj9n9zPePYEMEa6UTd RWFkzjY6/hYi4c6Ki+nFzdNxRXz+3thEEpgY0hmy54uCarDLV6O5n9lROeYKIwfahgcj 4zxQ== X-Gm-Message-State: AOAM5337huxrLWLfFCafOf0yBpQiyv7uoVKIwBlXut/0EXpSGcOiKEjj FKF0vTkulITt5nO+R5xKSZDxvsWLbfVBeHOGmpZkN0UmEMI= X-Received: by 2002:a67:e353:: with SMTP id s19mr358563vsm.53.1611282296505; Thu, 21 Jan 2021 18:24:56 -0800 (PST) MIME-Version: 1.0 References: <20210122015938.964-1-max.chou@realtek.com> In-Reply-To: <20210122015938.964-1-max.chou@realtek.com> From: Abhishek Pandit-Subedi Date: Thu, 21 Jan 2021 18:24:43 -0800 Message-ID: Subject: Re: [PATCH v3] 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-bluetooth@vger.kernel.org Thanks Max. Patch v3 looks good to me. Reviewed-by: Abhishek Pandit-Subedi On Thu, Jan 21, 2021 at 5:59 PM 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 > Reviewed-by: Abhishek Pandit-Subedi > Signed-off-by: Max Chou > > --- > change in v3 > -remove the null check due to unnecessary > --- > drivers/bluetooth/btrtl.c | 29 +++++++++++++++++++++++------ > 1 file changed, 23 insertions(+), 6 deletions(-) > > diff --git a/drivers/bluetooth/btrtl.c b/drivers/bluetooth/btrtl.c > index 24f03a1f8d57..a21d6abc93c4 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)) { > @@ -719,18 +735,19 @@ int btrtl_setup_realtek(struct hci_dev *hdev) > */ > set_bit(HCI_QUIRK_SIMULTANEOUS_DISCOVERY, &hdev->quirks); > > - if (!btrtl_dev->ic_info) > - goto done; > - > /* 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; > } > > -- > 2.17.1 >