Merge "ODROID: Make sure to use CRS B/T module than RealTek combo." into odroidg12-4.9.y-android

This commit is contained in:
Chris
2021-02-18 16:44:57 +09:00
committed by Gerrit Code Review

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