Commit 3011faa2 authored by Archie Pusaka's avatar Archie Pusaka Committed by Marcel Holtmann
Browse files

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: default avatarArchie Pusaka <apusaka@chromium.org>
Reviewed-by: default avatarAbhishek Pandit-Subedi <abhishekpandit@chromium.org>
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent 02ce2c2c
Loading
Loading
Loading
Loading
+16 −10
Original line number Original line Diff line number Diff line
@@ -719,17 +719,8 @@ int btrtl_download_firmware(struct hci_dev *hdev,
}
}
EXPORT_SYMBOL_GPL(btrtl_download_firmware);
EXPORT_SYMBOL_GPL(btrtl_download_firmware);


int btrtl_setup_realtek(struct hci_dev *hdev)
void btrtl_set_quirks(struct hci_dev *hdev, struct btrtl_device_info *btrtl_dev)
{
{
	struct btrtl_device_info *btrtl_dev;
	int ret;

	btrtl_dev = btrtl_initialize(hdev, NULL);
	if (IS_ERR(btrtl_dev))
		return PTR_ERR(btrtl_dev);

	ret = btrtl_download_firmware(hdev, btrtl_dev);

	/* Enable controller to do both LE scan and BR/EDR inquiry
	/* Enable controller to do both LE scan and BR/EDR inquiry
	 * simultaneously.
	 * simultaneously.
	 */
	 */
@@ -750,6 +741,21 @@ int btrtl_setup_realtek(struct hci_dev *hdev)
		rtl_dev_dbg(hdev, "WBS supported not enabled.");
		rtl_dev_dbg(hdev, "WBS supported not enabled.");
		break;
		break;
	}
	}
}
EXPORT_SYMBOL_GPL(btrtl_set_quirks);

int btrtl_setup_realtek(struct hci_dev *hdev)
{
	struct btrtl_device_info *btrtl_dev;
	int ret;

	btrtl_dev = btrtl_initialize(hdev, NULL);
	if (IS_ERR(btrtl_dev))
		return PTR_ERR(btrtl_dev);

	ret = btrtl_download_firmware(hdev, btrtl_dev);

	btrtl_set_quirks(hdev, btrtl_dev);


	btrtl_free(btrtl_dev);
	btrtl_free(btrtl_dev);
	return ret;
	return ret;
+7 −0
Original line number Original line Diff line number Diff line
@@ -54,6 +54,8 @@ struct btrtl_device_info *btrtl_initialize(struct hci_dev *hdev,
void btrtl_free(struct btrtl_device_info *btrtl_dev);
void btrtl_free(struct btrtl_device_info *btrtl_dev);
int btrtl_download_firmware(struct hci_dev *hdev,
int btrtl_download_firmware(struct hci_dev *hdev,
			    struct btrtl_device_info *btrtl_dev);
			    struct btrtl_device_info *btrtl_dev);
void btrtl_set_quirks(struct hci_dev *hdev,
		      struct btrtl_device_info *btrtl_dev);
int btrtl_setup_realtek(struct hci_dev *hdev);
int btrtl_setup_realtek(struct hci_dev *hdev);
int btrtl_shutdown_realtek(struct hci_dev *hdev);
int btrtl_shutdown_realtek(struct hci_dev *hdev);
int btrtl_get_uart_settings(struct hci_dev *hdev,
int btrtl_get_uart_settings(struct hci_dev *hdev,
@@ -79,6 +81,11 @@ static inline int btrtl_download_firmware(struct hci_dev *hdev,
	return -EOPNOTSUPP;
	return -EOPNOTSUPP;
}
}


static inline void btrtl_set_quirks(struct hci_dev *hdev,
				    struct btrtl_device_info *btrtl_dev)
{
}

static inline int btrtl_setup_realtek(struct hci_dev *hdev)
static inline int btrtl_setup_realtek(struct hci_dev *hdev)
{
{
	return -EOPNOTSUPP;
	return -EOPNOTSUPP;
+1 −4
Original line number Original line Diff line number Diff line
@@ -906,10 +906,7 @@ static int h5_btrtl_setup(struct h5 *h5)
	/* Give the device some time before the hci-core sends it a reset */
	/* Give the device some time before the hci-core sends it a reset */
	usleep_range(10000, 20000);
	usleep_range(10000, 20000);


	/* Enable controller to do both LE scan and BR/EDR inquiry
	btrtl_set_quirks(h5->hu->hdev, btrtl_dev);
	 * simultaneously.
	 */
	set_bit(HCI_QUIRK_SIMULTANEOUS_DISCOVERY, &h5->hu->hdev->quirks);


out_free:
out_free:
	btrtl_free(btrtl_dev);
	btrtl_free(btrtl_dev);