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
This commit is contained in:
Chris
2021-01-27 17:26:43 +09:00
parent c796bc6aef
commit caafaa6c92

View File

@@ -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);