Skip to content

Commit 9ab9235

Browse files
rtkbt-maxholtmann
authored andcommitted
Bluetooth: btrtl: Enable WBS for the specific Realtek devices
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 <[email protected]> Reviewed-by: Abhishek Pandit-Subedi <[email protected]> Signed-off-by: Max Chou <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
1 parent 231ee8b commit 9ab9235

File tree

1 file changed

+23
-7
lines changed

1 file changed

+23
-7
lines changed

drivers/bluetooth/btrtl.c

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,19 @@
3838
.hci_ver = (hciv), \
3939
.hci_bus = (bus)
4040

41+
enum btrtl_chip_id {
42+
CHIP_ID_8723A,
43+
CHIP_ID_8723B,
44+
CHIP_ID_8821A,
45+
CHIP_ID_8761A,
46+
CHIP_ID_8822B = 8,
47+
CHIP_ID_8723D,
48+
CHIP_ID_8821C,
49+
CHIP_ID_8822C = 13,
50+
CHIP_ID_8761B,
51+
CHIP_ID_8852A = 18,
52+
};
53+
4154
struct id_table {
4255
__u16 match_flags;
4356
__u16 lmp_subver;
@@ -58,6 +71,7 @@ struct btrtl_device_info {
5871
u8 *cfg_data;
5972
int cfg_len;
6073
bool drop_fw;
74+
int project_id;
6175
};
6276

6377
static const struct id_table ic_id_table[] = {
@@ -307,8 +321,10 @@ static int rtlbt_parse_firmware(struct hci_dev *hdev,
307321

308322
/* Find project_id in table */
309323
for (i = 0; i < ARRAY_SIZE(project_id_to_lmp_subver); i++) {
310-
if (project_id == project_id_to_lmp_subver[i].id)
324+
if (project_id == project_id_to_lmp_subver[i].id) {
325+
btrtl_dev->project_id = project_id;
311326
break;
327+
}
312328
}
313329

314330
if (i >= ARRAY_SIZE(project_id_to_lmp_subver)) {
@@ -719,22 +735,22 @@ int btrtl_setup_realtek(struct hci_dev *hdev)
719735
*/
720736
set_bit(HCI_QUIRK_SIMULTANEOUS_DISCOVERY, &hdev->quirks);
721737

722-
if (!btrtl_dev->ic_info)
723-
goto done;
724-
725738
/* Enable central-peripheral role (able to create new connections with
726739
* an existing connection in slave role).
727740
*/
728-
switch (btrtl_dev->ic_info->lmp_subver) {
729-
case RTL_ROM_LMP_8822B:
741+
/* Enable WBS supported for the specific Realtek devices. */
742+
switch (btrtl_dev->project_id) {
743+
case CHIP_ID_8822C:
744+
case CHIP_ID_8852A:
730745
set_bit(HCI_QUIRK_VALID_LE_STATES, &hdev->quirks);
746+
set_bit(HCI_QUIRK_WIDEBAND_SPEECH_SUPPORTED, &hdev->quirks);
731747
break;
732748
default:
733749
rtl_dev_dbg(hdev, "Central-peripheral role not enabled.");
750+
rtl_dev_dbg(hdev, "WBS supported not enabled.");
734751
break;
735752
}
736753

737-
done:
738754
btrtl_free(btrtl_dev);
739755
return ret;
740756
}

0 commit comments

Comments
 (0)