Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Bluetooth: hci_h5: Add RTL8822CS capabilities

RTL8822 chipset supports WBS, and this information is conveyed in
btusb.c. However, the UART driver doesn't have this information just
yet.

Signed-off-by: Archie Pusaka <apusaka@chromium.org>
Reviewed-by: Abhishek Pandit-Subedi <abhishekpandit@chromium.org>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>

authored by

Archie Pusaka and committed by
Marcel Holtmann
3011faa2 02ce2c2c

+24 -14
+16 -10
drivers/bluetooth/btrtl.c
··· 719 719 } 720 720 EXPORT_SYMBOL_GPL(btrtl_download_firmware); 721 721 722 - int btrtl_setup_realtek(struct hci_dev *hdev) 722 + void btrtl_set_quirks(struct hci_dev *hdev, struct btrtl_device_info *btrtl_dev) 723 723 { 724 - struct btrtl_device_info *btrtl_dev; 725 - int ret; 726 - 727 - btrtl_dev = btrtl_initialize(hdev, NULL); 728 - if (IS_ERR(btrtl_dev)) 729 - return PTR_ERR(btrtl_dev); 730 - 731 - ret = btrtl_download_firmware(hdev, btrtl_dev); 732 - 733 724 /* Enable controller to do both LE scan and BR/EDR inquiry 734 725 * simultaneously. 735 726 */ ··· 741 750 rtl_dev_dbg(hdev, "WBS supported not enabled."); 742 751 break; 743 752 } 753 + } 754 + EXPORT_SYMBOL_GPL(btrtl_set_quirks); 755 + 756 + int btrtl_setup_realtek(struct hci_dev *hdev) 757 + { 758 + struct btrtl_device_info *btrtl_dev; 759 + int ret; 760 + 761 + btrtl_dev = btrtl_initialize(hdev, NULL); 762 + if (IS_ERR(btrtl_dev)) 763 + return PTR_ERR(btrtl_dev); 764 + 765 + ret = btrtl_download_firmware(hdev, btrtl_dev); 766 + 767 + btrtl_set_quirks(hdev, btrtl_dev); 744 768 745 769 btrtl_free(btrtl_dev); 746 770 return ret;
+7
drivers/bluetooth/btrtl.h
··· 54 54 void btrtl_free(struct btrtl_device_info *btrtl_dev); 55 55 int btrtl_download_firmware(struct hci_dev *hdev, 56 56 struct btrtl_device_info *btrtl_dev); 57 + void btrtl_set_quirks(struct hci_dev *hdev, 58 + struct btrtl_device_info *btrtl_dev); 57 59 int btrtl_setup_realtek(struct hci_dev *hdev); 58 60 int btrtl_shutdown_realtek(struct hci_dev *hdev); 59 61 int btrtl_get_uart_settings(struct hci_dev *hdev, ··· 79 77 struct btrtl_device_info *btrtl_dev) 80 78 { 81 79 return -EOPNOTSUPP; 80 + } 81 + 82 + static inline void btrtl_set_quirks(struct hci_dev *hdev, 83 + struct btrtl_device_info *btrtl_dev) 84 + { 82 85 } 83 86 84 87 static inline int btrtl_setup_realtek(struct hci_dev *hdev)
+1 -4
drivers/bluetooth/hci_h5.c
··· 906 906 /* Give the device some time before the hci-core sends it a reset */ 907 907 usleep_range(10000, 20000); 908 908 909 - /* Enable controller to do both LE scan and BR/EDR inquiry 910 - * simultaneously. 911 - */ 912 - set_bit(HCI_QUIRK_SIMULTANEOUS_DISCOVERY, &h5->hu->hdev->quirks); 909 + btrtl_set_quirks(h5->hu->hdev, btrtl_dev); 913 910 914 911 out_free: 915 912 btrtl_free(btrtl_dev);