Commit 93600997 authored by Marcel Holtmann's avatar Marcel Holtmann Committed by Johan Hedberg

Bluetooth: Convert BCM92035 support to driver setup callback

With the early init stage during setup, this quirk can be simplified
and kept fully inside the driver.
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
Signed-off-by: default avatarJohan Hedberg <johan.hedberg@intel.com>
parent f41c70c4
...@@ -246,6 +246,7 @@ struct btusb_data { ...@@ -246,6 +246,7 @@ struct btusb_data {
struct usb_endpoint_descriptor *isoc_rx_ep; struct usb_endpoint_descriptor *isoc_rx_ep;
__u8 cmdreq_type; __u8 cmdreq_type;
unsigned long driver_info;
unsigned int sco_num; unsigned int sco_num;
int isoc_altsetting; int isoc_altsetting;
...@@ -699,6 +700,26 @@ static int btusb_flush(struct hci_dev *hdev) ...@@ -699,6 +700,26 @@ static int btusb_flush(struct hci_dev *hdev)
return 0; return 0;
} }
static int btusb_setup(struct hci_dev *hdev)
{
struct btusb_data *data = hci_get_drvdata(hdev);
BT_DBG("%s", hdev->name);
if (data->driver_info & BTUSB_BCM92035) {
struct sk_buff *skb;
__u8 val = 0x00;
skb = __hci_cmd_sync(hdev, 0xfc3b, 1, &val, HCI_INIT_TIMEOUT);
if (IS_ERR(skb))
BT_ERR("BCM92035 command failed (%ld)", -PTR_ERR(skb));
else
kfree_skb(skb);
}
return 0;
}
static int btusb_send_frame(struct sk_buff *skb) static int btusb_send_frame(struct sk_buff *skb)
{ {
struct hci_dev *hdev = (struct hci_dev *) skb->dev; struct hci_dev *hdev = (struct hci_dev *) skb->dev;
...@@ -996,6 +1017,7 @@ static int btusb_probe(struct usb_interface *intf, ...@@ -996,6 +1017,7 @@ static int btusb_probe(struct usb_interface *intf,
return -ENODEV; return -ENODEV;
data->cmdreq_type = USB_TYPE_CLASS; data->cmdreq_type = USB_TYPE_CLASS;
data->driver_info = id->driver_info;
data->udev = interface_to_usbdev(intf); data->udev = interface_to_usbdev(intf);
data->intf = intf; data->intf = intf;
...@@ -1026,6 +1048,7 @@ static int btusb_probe(struct usb_interface *intf, ...@@ -1026,6 +1048,7 @@ static int btusb_probe(struct usb_interface *intf,
hdev->open = btusb_open; hdev->open = btusb_open;
hdev->close = btusb_close; hdev->close = btusb_close;
hdev->flush = btusb_flush; hdev->flush = btusb_flush;
hdev->setup = btusb_setup;
hdev->send = btusb_send_frame; hdev->send = btusb_send_frame;
hdev->notify = btusb_notify; hdev->notify = btusb_notify;
...@@ -1066,17 +1089,6 @@ static int btusb_probe(struct usb_interface *intf, ...@@ -1066,17 +1089,6 @@ static int btusb_probe(struct usb_interface *intf,
data->isoc = NULL; data->isoc = NULL;
} }
if (id->driver_info & BTUSB_BCM92035) {
unsigned char cmd[] = { 0x3b, 0xfc, 0x01, 0x00 };
struct sk_buff *skb;
skb = bt_skb_alloc(sizeof(cmd), GFP_KERNEL);
if (skb) {
memcpy(skb_put(skb, sizeof(cmd)), cmd, sizeof(cmd));
skb_queue_tail(&hdev->driver_init, skb);
}
}
if (data->isoc) { if (data->isoc) {
err = usb_driver_claim_interface(&btusb_driver, err = usb_driver_claim_interface(&btusb_driver,
data->isoc, data); data->isoc, data);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment