diff mbox series

[2/3] Bluetooth: btrtl: Add support for RTL8822BS UART

Message ID 20230514074731.70614-3-rudi@heitbaum.com (mailing list archive)
State New, archived
Headers show
Series Bluetooth: btrtl: Add support for RTL8822BS | expand

Checks

Context Check Description
tedd_an/pre-ci_am success Success
tedd_an/CheckPatch success CheckPatch PASS
tedd_an/GitLint success Gitlint PASS
tedd_an/SubjectPrefix success Gitlint PASS
tedd_an/IncrementalBuild success Incremental Build PASS

Commit Message

Rudi Heitbaum May 14, 2023, 7:47 a.m. UTC
Add a RTL8822BS UART with hci_ver = 0x07. This is similar to RTL8822CS
observed on the Tanix TX6 Android set-top box. But the previous
generation of chip. The RTL8822BS requires the
BROKEN_LOCAL_EXT_FEATURES_PAGE_2 quirk.

Signed-off-by: Rudi Heitbaum <rudi@heitbaum.com>
---
 drivers/bluetooth/btrtl.c  | 12 +++++++++++-
 drivers/bluetooth/hci_h5.c |  6 ++++++
 2 files changed, 17 insertions(+), 1 deletion(-)

Comments

Christophe JAILLET May 14, 2023, 8:15 a.m. UTC | #1
Le 14/05/2023 à 09:47, Rudi Heitbaum a écrit :
> Add a RTL8822BS UART with hci_ver = 0x07. This is similar to RTL8822CS
> observed on the Tanix TX6 Android set-top box. But the previous
> generation of chip. The RTL8822BS requires the
> BROKEN_LOCAL_EXT_FEATURES_PAGE_2 quirk.
> 
> Signed-off-by: Rudi Heitbaum <rudi-8t6dWLoy+3lWk0Htik3J/w@public.gmane.org>
> ---
>   drivers/bluetooth/btrtl.c  | 12 +++++++++++-
>   drivers/bluetooth/hci_h5.c |  6 ++++++
>   2 files changed, 17 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/bluetooth/btrtl.c b/drivers/bluetooth/btrtl.c
> index 2915c82d719d..b53a4ef88550 100644
> --- a/drivers/bluetooth/btrtl.c
> +++ b/drivers/bluetooth/btrtl.c
> @@ -234,7 +234,15 @@ static const struct id_table ic_id_table[] = {
>   	  .fw_name  = "rtl_bt/rtl8822cu_fw.bin",
>   	  .cfg_name = "rtl_bt/rtl8822cu_config" },
>   
> -	/* 8822B */
> +	/* 8822BS with UART interface */
> +	{ IC_INFO(RTL_ROM_LMP_8822B, 0xb, 0x7, HCI_UART),
> +	  .config_needed = true,
> +	  .has_rom_version = true,
> +	  .has_msft_ext = true,
> +	  .fw_name  = "rtl_bt/rtl8822bs_fw.bin",
> +	  .cfg_name = "rtl_bt/rtl8822bs_config" },
> +
> +	/* 8822BU with USB interface */
>   	{ IC_INFO(RTL_ROM_LMP_8822B, 0xb, 0x7, HCI_USB),
>   	  .config_needed = true,
>   	  .has_rom_version = true,
> @@ -1182,6 +1190,8 @@ void btrtl_set_quirks(struct hci_dev *hdev, struct btrtl_device_info *btrtl_dev)
>   
>   		hci_set_aosp_capable(hdev);
>   		break;
> +	case CHIP_ID_8822B:
> +		set_bit(HCI_QUIRK_BROKEN_LOCAL_EXT_FEATURES_PAGE_2, &hdev->quirks);

break missing?
If it is intentinal, a "fallthrough;" would be more explicit.

just my 2c,

CJ

>   	default:
>   		rtl_dev_dbg(hdev, "Central-peripheral role not enabled.");
>   		rtl_dev_dbg(hdev, "WBS supported not enabled.");
> diff --git a/drivers/bluetooth/hci_h5.c b/drivers/bluetooth/hci_h5.c
> index fefc37b98b4a..726b6c7e28b8 100644
> --- a/drivers/bluetooth/hci_h5.c
> +++ b/drivers/bluetooth/hci_h5.c
> @@ -1072,6 +1072,10 @@ static struct h5_vnd rtl_vnd = {
>   	.acpi_gpio_map	= acpi_btrtl_gpios,
>   };
>   
> +static const struct h5_device_data h5_data_rtl8822bs = {
> +	.vnd = &rtl_vnd,
> +};
> +
>   static const struct h5_device_data h5_data_rtl8822cs = {
>   	.vnd = &rtl_vnd,
>   };
> @@ -1100,6 +1104,8 @@ static const struct dev_pm_ops h5_serdev_pm_ops = {
>   
>   static const struct of_device_id rtl_bluetooth_of_match[] = {
>   #ifdef CONFIG_BT_HCIUART_RTL
> +	{ .compatible = "realtek,rtl8822bs-bt",
> +	  .data = (const void *)&h5_data_rtl8822bs },
>   	{ .compatible = "realtek,rtl8822cs-bt",
>   	  .data = (const void *)&h5_data_rtl8822cs },
>   	{ .compatible = "realtek,rtl8723bs-bt",
kernel test robot May 14, 2023, 9:14 a.m. UTC | #2
Hi Rudi,

kernel test robot noticed the following build warnings:

[auto build test WARNING on bb7c241fae6228e89c0286ffd6f249b3b0dea225]

url:    https://github.com/intel-lab-lkp/linux/commits/Rudi-Heitbaum/dt-bindings-net-realtek-bluetooth-Add-RTL8822BS/20230514-155000
base:   bb7c241fae6228e89c0286ffd6f249b3b0dea225
patch link:    https://lore.kernel.org/r/20230514074731.70614-3-rudi%40heitbaum.com
patch subject: [PATCH 2/3] Bluetooth: btrtl: Add support for RTL8822BS UART
config: arm-randconfig-r004-20230514
compiler: clang version 17.0.0 (https://github.com/llvm/llvm-project b0fb98227c90adf2536c9ad644a74d5e92961111)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install arm cross compiling tool for clang build
        # apt-get install binutils-arm-linux-gnueabi
        # https://github.com/intel-lab-lkp/linux/commit/2f68c37a4fd8f66ba45a8ff74d845954644401e0
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Rudi-Heitbaum/dt-bindings-net-realtek-bluetooth-Add-RTL8822BS/20230514-155000
        git checkout 2f68c37a4fd8f66ba45a8ff74d845954644401e0
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=arm olddefconfig
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=arm SHELL=/bin/bash drivers/bluetooth/

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Link: https://lore.kernel.org/oe-kbuild-all/202305141652.RsLrMY8N-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> drivers/bluetooth/btrtl.c:1195:2: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]
           default:
           ^
   drivers/bluetooth/btrtl.c:1195:2: note: insert '__attribute__((fallthrough));' to silence this warning
           default:
           ^
           __attribute__((fallthrough)); 
   drivers/bluetooth/btrtl.c:1195:2: note: insert 'break;' to avoid fall-through
           default:
           ^
           break; 
   1 warning generated.


vim +1195 drivers/bluetooth/btrtl.c

26503ad25de8c7c Martin Blumenstingl    2018-08-02  1164  
3011faa29bc6f45 Archie Pusaka          2021-05-27  1165  void btrtl_set_quirks(struct hci_dev *hdev, struct btrtl_device_info *btrtl_dev)
26503ad25de8c7c Martin Blumenstingl    2018-08-02  1166  {
65251e2e0ad379d Alex Lu                2019-08-30  1167  	/* Enable controller to do both LE scan and BR/EDR inquiry
65251e2e0ad379d Alex Lu                2019-08-30  1168  	 * simultaneously.
65251e2e0ad379d Alex Lu                2019-08-30  1169  	 */
65251e2e0ad379d Alex Lu                2019-08-30  1170  	set_bit(HCI_QUIRK_SIMULTANEOUS_DISCOVERY, &hdev->quirks);
65251e2e0ad379d Alex Lu                2019-08-30  1171  
05672a2c14a4ea2 Abhishek Pandit-Subedi 2020-12-22  1172  	/* Enable central-peripheral role (able to create new connections with
05672a2c14a4ea2 Abhishek Pandit-Subedi 2020-12-22  1173  	 * an existing connection in slave role).
05672a2c14a4ea2 Abhishek Pandit-Subedi 2020-12-22  1174  	 */
9ab9235fe5cf7f8 Max Chou               2021-01-27  1175  	/* Enable WBS supported for the specific Realtek devices. */
9ab9235fe5cf7f8 Max Chou               2021-01-27  1176  	switch (btrtl_dev->project_id) {
9ab9235fe5cf7f8 Max Chou               2021-01-27  1177  	case CHIP_ID_8822C:
9ab9235fe5cf7f8 Max Chou               2021-01-27  1178  	case CHIP_ID_8852A:
18e8055c88142d8 Max Chou               2022-03-14  1179  	case CHIP_ID_8852B:
8b1d66b50437b65 Max Chou               2022-04-11  1180  	case CHIP_ID_8852C:
7948fe1c92d9231 Max Chou               2023-04-18  1181  	case CHIP_ID_8851B:
05672a2c14a4ea2 Abhishek Pandit-Subedi 2020-12-22  1182  		set_bit(HCI_QUIRK_VALID_LE_STATES, &hdev->quirks);
9ab9235fe5cf7f8 Max Chou               2021-01-27  1183  		set_bit(HCI_QUIRK_WIDEBAND_SPEECH_SUPPORTED, &hdev->quirks);
a479e71322ced3e Hilda Wu               2022-10-05  1184  
a479e71322ced3e Hilda Wu               2022-10-05  1185  		/* RTL8852C needs to transmit mSBC data continuously without
a479e71322ced3e Hilda Wu               2022-10-05  1186  		 * the zero length of USB packets for the ALT 6 supported chips
a479e71322ced3e Hilda Wu               2022-10-05  1187  		 */
a479e71322ced3e Hilda Wu               2022-10-05  1188  		if (btrtl_dev->project_id == CHIP_ID_8852C)
a479e71322ced3e Hilda Wu               2022-10-05  1189  			btrealtek_set_flag(hdev, REALTEK_ALT6_CONTINUOUS_TX_CHIP);
a479e71322ced3e Hilda Wu               2022-10-05  1190  
099c6d31764b97d Joseph Hwang           2021-09-26  1191  		hci_set_aosp_capable(hdev);
05672a2c14a4ea2 Abhishek Pandit-Subedi 2020-12-22  1192  		break;
2f68c37a4fd8f66 Rudi Heitbaum          2023-05-14  1193  	case CHIP_ID_8822B:
2f68c37a4fd8f66 Rudi Heitbaum          2023-05-14  1194  		set_bit(HCI_QUIRK_BROKEN_LOCAL_EXT_FEATURES_PAGE_2, &hdev->quirks);
05672a2c14a4ea2 Abhishek Pandit-Subedi 2020-12-22 @1195  	default:
05672a2c14a4ea2 Abhishek Pandit-Subedi 2020-12-22  1196  		rtl_dev_dbg(hdev, "Central-peripheral role not enabled.");
9ab9235fe5cf7f8 Max Chou               2021-01-27  1197  		rtl_dev_dbg(hdev, "WBS supported not enabled.");
05672a2c14a4ea2 Abhishek Pandit-Subedi 2020-12-22  1198  		break;
05672a2c14a4ea2 Abhishek Pandit-Subedi 2020-12-22  1199  	}
c0123cb6c4c7fc2 Vasily Khoruzhick      2023-03-07  1200  
253cf30e8d3d001 Max Chou               2023-03-21  1201  	if (!btrtl_dev->ic_info)
253cf30e8d3d001 Max Chou               2023-03-21  1202  		return;
253cf30e8d3d001 Max Chou               2023-03-21  1203  
c0123cb6c4c7fc2 Vasily Khoruzhick      2023-03-07  1204  	switch (btrtl_dev->ic_info->lmp_subver) {
c0123cb6c4c7fc2 Vasily Khoruzhick      2023-03-07  1205  	case RTL_ROM_LMP_8703B:
c0123cb6c4c7fc2 Vasily Khoruzhick      2023-03-07  1206  		/* 8723CS reports two pages for local ext features,
c0123cb6c4c7fc2 Vasily Khoruzhick      2023-03-07  1207  		 * but it doesn't support any features from page 2 -
c0123cb6c4c7fc2 Vasily Khoruzhick      2023-03-07  1208  		 * it either responds with garbage or with error status
c0123cb6c4c7fc2 Vasily Khoruzhick      2023-03-07  1209  		 */
c0123cb6c4c7fc2 Vasily Khoruzhick      2023-03-07  1210  		set_bit(HCI_QUIRK_BROKEN_LOCAL_EXT_FEATURES_PAGE_2,
c0123cb6c4c7fc2 Vasily Khoruzhick      2023-03-07  1211  			&hdev->quirks);
c0123cb6c4c7fc2 Vasily Khoruzhick      2023-03-07  1212  		break;
c0123cb6c4c7fc2 Vasily Khoruzhick      2023-03-07  1213  	default:
c0123cb6c4c7fc2 Vasily Khoruzhick      2023-03-07  1214  		break;
c0123cb6c4c7fc2 Vasily Khoruzhick      2023-03-07  1215  	}
3011faa29bc6f45 Archie Pusaka          2021-05-27  1216  }
3011faa29bc6f45 Archie Pusaka          2021-05-27  1217  EXPORT_SYMBOL_GPL(btrtl_set_quirks);
3011faa29bc6f45 Archie Pusaka          2021-05-27  1218
kernel test robot May 14, 2023, 9:44 a.m. UTC | #3
Hi Rudi,

kernel test robot noticed the following build warnings:

[auto build test WARNING on bb7c241fae6228e89c0286ffd6f249b3b0dea225]

url:    https://github.com/intel-lab-lkp/linux/commits/Rudi-Heitbaum/dt-bindings-net-realtek-bluetooth-Add-RTL8822BS/20230514-155000
base:   bb7c241fae6228e89c0286ffd6f249b3b0dea225
patch link:    https://lore.kernel.org/r/20230514074731.70614-3-rudi%40heitbaum.com
patch subject: [PATCH 2/3] Bluetooth: btrtl: Add support for RTL8822BS UART
config: csky-randconfig-r035-20230514
compiler: csky-linux-gcc (GCC) 12.1.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/intel-lab-lkp/linux/commit/2f68c37a4fd8f66ba45a8ff74d845954644401e0
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Rudi-Heitbaum/dt-bindings-net-realtek-bluetooth-Add-RTL8822BS/20230514-155000
        git checkout 2f68c37a4fd8f66ba45a8ff74d845954644401e0
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=csky olddefconfig
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=csky SHELL=/bin/bash drivers/bluetooth/

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Link: https://lore.kernel.org/oe-kbuild-all/202305141608.tB1ES6sg-lkp@intel.com/

All warnings (new ones prefixed by >>):

   drivers/bluetooth/btrtl.c: In function 'btrtl_set_quirks':
>> drivers/bluetooth/btrtl.c:1194:17: warning: this statement may fall through [-Wimplicit-fallthrough=]
    1194 |                 set_bit(HCI_QUIRK_BROKEN_LOCAL_EXT_FEATURES_PAGE_2, &hdev->quirks);
         |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/bluetooth/btrtl.c:1195:9: note: here
    1195 |         default:
         |         ^~~~~~~


vim +1194 drivers/bluetooth/btrtl.c

  1164	
  1165	void btrtl_set_quirks(struct hci_dev *hdev, struct btrtl_device_info *btrtl_dev)
  1166	{
  1167		/* Enable controller to do both LE scan and BR/EDR inquiry
  1168		 * simultaneously.
  1169		 */
  1170		set_bit(HCI_QUIRK_SIMULTANEOUS_DISCOVERY, &hdev->quirks);
  1171	
  1172		/* Enable central-peripheral role (able to create new connections with
  1173		 * an existing connection in slave role).
  1174		 */
  1175		/* Enable WBS supported for the specific Realtek devices. */
  1176		switch (btrtl_dev->project_id) {
  1177		case CHIP_ID_8822C:
  1178		case CHIP_ID_8852A:
  1179		case CHIP_ID_8852B:
  1180		case CHIP_ID_8852C:
  1181		case CHIP_ID_8851B:
  1182			set_bit(HCI_QUIRK_VALID_LE_STATES, &hdev->quirks);
  1183			set_bit(HCI_QUIRK_WIDEBAND_SPEECH_SUPPORTED, &hdev->quirks);
  1184	
  1185			/* RTL8852C needs to transmit mSBC data continuously without
  1186			 * the zero length of USB packets for the ALT 6 supported chips
  1187			 */
  1188			if (btrtl_dev->project_id == CHIP_ID_8852C)
  1189				btrealtek_set_flag(hdev, REALTEK_ALT6_CONTINUOUS_TX_CHIP);
  1190	
  1191			hci_set_aosp_capable(hdev);
  1192			break;
  1193		case CHIP_ID_8822B:
> 1194			set_bit(HCI_QUIRK_BROKEN_LOCAL_EXT_FEATURES_PAGE_2, &hdev->quirks);
  1195		default:
  1196			rtl_dev_dbg(hdev, "Central-peripheral role not enabled.");
  1197			rtl_dev_dbg(hdev, "WBS supported not enabled.");
  1198			break;
  1199		}
  1200	
  1201		if (!btrtl_dev->ic_info)
  1202			return;
  1203	
  1204		switch (btrtl_dev->ic_info->lmp_subver) {
  1205		case RTL_ROM_LMP_8703B:
  1206			/* 8723CS reports two pages for local ext features,
  1207			 * but it doesn't support any features from page 2 -
  1208			 * it either responds with garbage or with error status
  1209			 */
  1210			set_bit(HCI_QUIRK_BROKEN_LOCAL_EXT_FEATURES_PAGE_2,
  1211				&hdev->quirks);
  1212			break;
  1213		default:
  1214			break;
  1215		}
  1216	}
  1217	EXPORT_SYMBOL_GPL(btrtl_set_quirks);
  1218
kernel test robot May 14, 2023, 11:05 a.m. UTC | #4
Hi Rudi,

kernel test robot noticed the following build warnings:

[auto build test WARNING on bb7c241fae6228e89c0286ffd6f249b3b0dea225]

url:    https://github.com/intel-lab-lkp/linux/commits/Rudi-Heitbaum/dt-bindings-net-realtek-bluetooth-Add-RTL8822BS/20230514-155000
base:   bb7c241fae6228e89c0286ffd6f249b3b0dea225
patch link:    https://lore.kernel.org/r/20230514074731.70614-3-rudi%40heitbaum.com
patch subject: [PATCH 2/3] Bluetooth: btrtl: Add support for RTL8822BS UART
config: arm-allyesconfig
compiler: arm-linux-gnueabi-gcc (GCC) 12.1.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/intel-lab-lkp/linux/commit/2f68c37a4fd8f66ba45a8ff74d845954644401e0
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Rudi-Heitbaum/dt-bindings-net-realtek-bluetooth-Add-RTL8822BS/20230514-155000
        git checkout 2f68c37a4fd8f66ba45a8ff74d845954644401e0
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=arm olddefconfig
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=arm SHELL=/bin/bash drivers/bluetooth/

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Link: https://lore.kernel.org/oe-kbuild-all/202305141828.USyPW8CP-lkp@intel.com/

All warnings (new ones prefixed by >>):

   In file included from include/linux/bitops.h:68,
                    from include/linux/log2.h:12,
                    from include/asm-generic/div64.h:55,
                    from arch/arm/include/asm/div64.h:107,
                    from include/linux/math.h:6,
                    from include/linux/math64.h:6,
                    from include/linux/time.h:6,
                    from include/linux/stat.h:19,
                    from include/linux/module.h:13,
                    from drivers/bluetooth/btrtl.c:8:
   drivers/bluetooth/btrtl.c: In function 'btrtl_set_quirks':
>> arch/arm/include/asm/bitops.h:185:41: warning: this statement may fall through [-Wimplicit-fallthrough=]
     185 | #define ATOMIC_BITOP(name,nr,p)         _##name(nr,p)
         |                                         ^~~~~~~~~~~~~
   arch/arm/include/asm/bitops.h:191:41: note: in expansion of macro 'ATOMIC_BITOP'
     191 | #define set_bit(nr,p)                   ATOMIC_BITOP(set_bit,nr,p)
         |                                         ^~~~~~~~~~~~
   drivers/bluetooth/btrtl.c:1194:17: note: in expansion of macro 'set_bit'
    1194 |                 set_bit(HCI_QUIRK_BROKEN_LOCAL_EXT_FEATURES_PAGE_2, &hdev->quirks);
         |                 ^~~~~~~
   drivers/bluetooth/btrtl.c:1195:9: note: here
    1195 |         default:
         |         ^~~~~~~


vim +185 arch/arm/include/asm/bitops.h

^1da177e4c3f41 include/asm-arm/bitops.h      Linus Torvalds 2005-04-16  177  
e7ec02938dbe8c include/asm-arm/bitops.h      Russell King   2005-07-28  178  #ifndef CONFIG_SMP
^1da177e4c3f41 include/asm-arm/bitops.h      Linus Torvalds 2005-04-16  179  /*
^1da177e4c3f41 include/asm-arm/bitops.h      Linus Torvalds 2005-04-16  180   * The __* form of bitops are non-atomic and may be reordered.
^1da177e4c3f41 include/asm-arm/bitops.h      Linus Torvalds 2005-04-16  181   */
6323f0ccedf756 arch/arm/include/asm/bitops.h Russell King   2011-01-16  182  #define ATOMIC_BITOP(name,nr,p)			\
6323f0ccedf756 arch/arm/include/asm/bitops.h Russell King   2011-01-16  183  	(__builtin_constant_p(nr) ? ____atomic_##name(nr, p) : _##name(nr,p))
e7ec02938dbe8c include/asm-arm/bitops.h      Russell King   2005-07-28  184  #else
6323f0ccedf756 arch/arm/include/asm/bitops.h Russell King   2011-01-16 @185  #define ATOMIC_BITOP(name,nr,p)		_##name(nr,p)
e7ec02938dbe8c include/asm-arm/bitops.h      Russell King   2005-07-28  186  #endif
^1da177e4c3f41 include/asm-arm/bitops.h      Linus Torvalds 2005-04-16  187
diff mbox series

Patch

diff --git a/drivers/bluetooth/btrtl.c b/drivers/bluetooth/btrtl.c
index 2915c82d719d..b53a4ef88550 100644
--- a/drivers/bluetooth/btrtl.c
+++ b/drivers/bluetooth/btrtl.c
@@ -234,7 +234,15 @@  static const struct id_table ic_id_table[] = {
 	  .fw_name  = "rtl_bt/rtl8822cu_fw.bin",
 	  .cfg_name = "rtl_bt/rtl8822cu_config" },
 
-	/* 8822B */
+	/* 8822BS with UART interface */
+	{ IC_INFO(RTL_ROM_LMP_8822B, 0xb, 0x7, HCI_UART),
+	  .config_needed = true,
+	  .has_rom_version = true,
+	  .has_msft_ext = true,
+	  .fw_name  = "rtl_bt/rtl8822bs_fw.bin",
+	  .cfg_name = "rtl_bt/rtl8822bs_config" },
+
+	/* 8822BU with USB interface */
 	{ IC_INFO(RTL_ROM_LMP_8822B, 0xb, 0x7, HCI_USB),
 	  .config_needed = true,
 	  .has_rom_version = true,
@@ -1182,6 +1190,8 @@  void btrtl_set_quirks(struct hci_dev *hdev, struct btrtl_device_info *btrtl_dev)
 
 		hci_set_aosp_capable(hdev);
 		break;
+	case CHIP_ID_8822B:
+		set_bit(HCI_QUIRK_BROKEN_LOCAL_EXT_FEATURES_PAGE_2, &hdev->quirks);
 	default:
 		rtl_dev_dbg(hdev, "Central-peripheral role not enabled.");
 		rtl_dev_dbg(hdev, "WBS supported not enabled.");
diff --git a/drivers/bluetooth/hci_h5.c b/drivers/bluetooth/hci_h5.c
index fefc37b98b4a..726b6c7e28b8 100644
--- a/drivers/bluetooth/hci_h5.c
+++ b/drivers/bluetooth/hci_h5.c
@@ -1072,6 +1072,10 @@  static struct h5_vnd rtl_vnd = {
 	.acpi_gpio_map	= acpi_btrtl_gpios,
 };
 
+static const struct h5_device_data h5_data_rtl8822bs = {
+	.vnd = &rtl_vnd,
+};
+
 static const struct h5_device_data h5_data_rtl8822cs = {
 	.vnd = &rtl_vnd,
 };
@@ -1100,6 +1104,8 @@  static const struct dev_pm_ops h5_serdev_pm_ops = {
 
 static const struct of_device_id rtl_bluetooth_of_match[] = {
 #ifdef CONFIG_BT_HCIUART_RTL
+	{ .compatible = "realtek,rtl8822bs-bt",
+	  .data = (const void *)&h5_data_rtl8822bs },
 	{ .compatible = "realtek,rtl8822cs-bt",
 	  .data = (const void *)&h5_data_rtl8822cs },
 	{ .compatible = "realtek,rtl8723bs-bt",