Skip to content

Commit 7948fe1

Browse files
rtkbt-maxVudentz
authored andcommitted
Bluetooth: btrtl: Add the support for RTL8851B
Add the support for RTL8851B BT controller on USB interface. The necessary firmware will be submitted to linux-firmware project. Note that the Bluetooth devices WITH the VID=0x0bda would be set the feature quirk in btrtl_setup_realtek(). It's able to ignore the feature flag set for the specific VID and PID in blacklist_table[] of btusb.c. (check [1]) If Realtek Bluetooth chips WITHOUT the VID=0x0bda, it shall be added the feature flag for the specific VID and PID in blacklist_table[] of btusb.c. (check [2]) [1] '9ab9235fe5cf ("Bluetooth: btrtl: Enable WBS for the specific Realtek devices")' [2] '73280f13c9bb ("Bluetooth: btusb: Add the more support IDs for Realtek RTL8822CE")' The device info from /sys/kernel/debug/usb/devices as below. T: Bus=03 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 33 Spd=480 MxCh= 0 D: Ver= 2.00 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs= 1 P: Vendor=0bda ProdID=b851 Rev= 0.00 S: Manufacturer=Realtek S: Product=802.11ax WLAN Adapter S: SerialNumber=00E04C885A01 C:* #Ifs= 3 Cfg#= 1 Atr=80 MxPwr=500mA A: FirstIf#= 0 IfCount= 2 Cls=e0(wlcon) Sub=01 Prot=01 I:* If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=81(I) Atr=03(Int.) MxPS= 16 Ivl=1ms E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=03(O) Atr=01(Isoc) MxPS= 0 Ivl=1ms E: Ad=83(I) Atr=01(Isoc) MxPS= 0 Ivl=1ms I: If#= 1 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=03(O) Atr=01(Isoc) MxPS= 9 Ivl=1ms E: Ad=83(I) Atr=01(Isoc) MxPS= 9 Ivl=1ms I: If#= 1 Alt= 2 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=03(O) Atr=01(Isoc) MxPS= 17 Ivl=1ms E: Ad=83(I) Atr=01(Isoc) MxPS= 17 Ivl=1ms I: If#= 1 Alt= 3 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=03(O) Atr=01(Isoc) MxPS= 25 Ivl=1ms E: Ad=83(I) Atr=01(Isoc) MxPS= 25 Ivl=1ms I: If#= 1 Alt= 4 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=03(O) Atr=01(Isoc) MxPS= 33 Ivl=1ms E: Ad=83(I) Atr=01(Isoc) MxPS= 33 Ivl=1ms I: If#= 1 Alt= 5 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=03(O) Atr=01(Isoc) MxPS= 49 Ivl=1ms E: Ad=83(I) Atr=01(Isoc) MxPS= 49 Ivl=1ms I:* If#= 2 Alt= 0 #EPs= 8 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none) E: Ad=84(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=05(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=06(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=07(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=09(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=0a(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=0b(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=0c(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms Signed-off-by: Max Chou <[email protected]> Signed-off-by: Luiz Augusto von Dentz <[email protected]>
1 parent 9e080b5 commit 7948fe1

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

drivers/bluetooth/btrtl.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#define RTL_ROM_LMP_8761A 0x8761
3030
#define RTL_ROM_LMP_8822B 0x8822
3131
#define RTL_ROM_LMP_8852A 0x8852
32+
#define RTL_ROM_LMP_8851B 0x8851
3233
#define RTL_CONFIG_MAGIC 0x8723ab55
3334

3435
#define IC_MATCH_FL_LMPSUBV (1 << 0)
@@ -65,6 +66,7 @@ enum btrtl_chip_id {
6566
CHIP_ID_8852A = 18,
6667
CHIP_ID_8852B = 20,
6768
CHIP_ID_8852C = 25,
69+
CHIP_ID_8851B = 36,
6870
};
6971

7072
struct id_table {
@@ -271,6 +273,14 @@ static const struct id_table ic_id_table[] = {
271273
.has_msft_ext = true,
272274
.fw_name = "rtl_bt/rtl8852cu_fw.bin",
273275
.cfg_name = "rtl_bt/rtl8852cu_config" },
276+
277+
/* 8851B */
278+
{ IC_INFO(RTL_ROM_LMP_8851B, 0xb, 0xc, HCI_USB),
279+
.config_needed = false,
280+
.has_rom_version = true,
281+
.has_msft_ext = false,
282+
.fw_name = "rtl_bt/rtl8851bu_fw.bin",
283+
.cfg_name = "rtl_bt/rtl8851bu_config" },
274284
};
275285

276286
static const struct id_table *btrtl_match_ic(u16 lmp_subver, u16 hci_rev,
@@ -607,6 +617,7 @@ static int rtlbt_parse_firmware(struct hci_dev *hdev,
607617
{ RTL_ROM_LMP_8852A, 18 }, /* 8852A */
608618
{ RTL_ROM_LMP_8852A, 20 }, /* 8852B */
609619
{ RTL_ROM_LMP_8852A, 25 }, /* 8852C */
620+
{ RTL_ROM_LMP_8851B, 36 }, /* 8851B */
610621
};
611622

612623
if (btrtl_dev->fw_len <= 8)
@@ -1134,6 +1145,7 @@ int btrtl_download_firmware(struct hci_dev *hdev,
11341145
case RTL_ROM_LMP_8822B:
11351146
case RTL_ROM_LMP_8852A:
11361147
case RTL_ROM_LMP_8703B:
1148+
case RTL_ROM_LMP_8851B:
11371149
return btrtl_setup_rtl8723b(hdev, btrtl_dev);
11381150
default:
11391151
rtl_dev_info(hdev, "assuming no firmware upload needed");
@@ -1158,6 +1170,7 @@ void btrtl_set_quirks(struct hci_dev *hdev, struct btrtl_device_info *btrtl_dev)
11581170
case CHIP_ID_8852A:
11591171
case CHIP_ID_8852B:
11601172
case CHIP_ID_8852C:
1173+
case CHIP_ID_8851B:
11611174
set_bit(HCI_QUIRK_VALID_LE_STATES, &hdev->quirks);
11621175
set_bit(HCI_QUIRK_WIDEBAND_SPEECH_SUPPORTED, &hdev->quirks);
11631176

@@ -1370,3 +1383,5 @@ MODULE_FIRMWARE("rtl_bt/rtl8852bu_fw.bin");
13701383
MODULE_FIRMWARE("rtl_bt/rtl8852bu_config.bin");
13711384
MODULE_FIRMWARE("rtl_bt/rtl8852cu_fw.bin");
13721385
MODULE_FIRMWARE("rtl_bt/rtl8852cu_config.bin");
1386+
MODULE_FIRMWARE("rtl_bt/rtl8851bu_fw.bin");
1387+
MODULE_FIRMWARE("rtl_bt/rtl8851bu_config.bin");

0 commit comments

Comments
 (0)