From 7582b32538021fdb19887067c37f66d9a773d8c8 Mon Sep 17 00:00:00 2001 From: Chris Date: Wed, 27 Jan 2021 17:26:43 +0900 Subject: [PATCH] ODROID: Make sure to use CRS B/T module than RealTek combo. If system have a Realtek combo(8821CU) and a CSR BT module at time, system make sure to use a CSR B/T module. Bus 001 Device 003: ID 0a12:0001 <- CSR B/T Bus 001 Device 006: ID 0bda:c820 <- RealTek combo B/T Change-Id: I082d3966a88cef6dec03cbe07458c07e6ff77cf3 --- drivers/bluetooth/btusb.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c index c2c6002457a7..f6aaf15e8400 100644 --- a/drivers/bluetooth/btusb.c +++ b/drivers/bluetooth/btusb.c @@ -2732,6 +2732,8 @@ static int btusb_bcm_set_diag(struct hci_dev *hdev, bool enable) } #endif +static int exist_csr_module = 0; + static int btusb_probe(struct usb_interface *intf, const struct usb_device_id *id) { @@ -2936,7 +2938,8 @@ static int btusb_probe(struct usb_interface *intf, } #ifdef CONFIG_BT_HCIBTUSB_RTL - if (id->driver_info & BTUSB_REALTEK) { + if (id->driver_info & BTUSB_REALTEK && !exist_csr_module) { + BT_DBG("RealTek module detected\n"); hdev->setup = btrtl_setup_realtek; hdev->shutdown = btrtl_shutdown_realtek; @@ -2975,6 +2978,10 @@ static int btusb_probe(struct usb_interface *intf, if (id->driver_info & BTUSB_CSR) { struct usb_device *udev = data->udev; u16 bcdDevice = le16_to_cpu(udev->descriptor.bcdDevice); +#ifdef CONFIG_BT_HCIBTUSB_RTL + BT_DBG("CSR module detected\n"); + exist_csr_module = 1; +#endif /* Old firmware would otherwise execute USB reset */ if (bcdDevice < 0x117) @@ -3041,6 +3048,9 @@ static void btusb_disconnect(struct usb_interface *intf) { struct btusb_data *data = usb_get_intfdata(intf); struct hci_dev *hdev; +#ifdef CONFIG_BT_HCIBTUSB_RTL + exist_csr_module = 0; +#endif BT_DBG("intf %p", intf);