From: Kim, Ben Young Tae Date: Sun, 15 Feb 2015 23:06:14 +0000 (+0000) Subject: Bluetooth: btusb: Add setup callback for chip init on USB X-Git-Tag: firefly_0821_release~176^2~1974^2~244^2~46 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=ace31982585a323afb194f56b9e0486f7bc6570c;p=firefly-linux-kernel-4.4.55.git Bluetooth: btusb: Add setup callback for chip init on USB Some of chipset does not allow to send a patch or config files through HCI VS channel at early stage as well as they don't support to send USB patch files to other channel except USB bulk path. New callback added is for initialization of BT controller through USB Signed-off-by: Ben Young Tae Kim Signed-off-by: Marcel Holtmann --- diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c index 3ca2e1bf7bfa..73e1066cd38b 100644 --- a/drivers/bluetooth/btusb.c +++ b/drivers/bluetooth/btusb.c @@ -337,6 +337,8 @@ struct btusb_data { int (*recv_event)(struct hci_dev *hdev, struct sk_buff *skb); int (*recv_bulk)(struct btusb_data *data, void *buffer, int count); + + int (*setup_on_usb)(struct hci_dev *hdev); }; static inline void btusb_free_frags(struct btusb_data *data) @@ -878,6 +880,15 @@ static int btusb_open(struct hci_dev *hdev) BT_DBG("%s", hdev->name); + /* Patching USB firmware files prior to starting any URBs of HCI path + * It is more safe to use USB bulk channel for downloading USB patch + */ + if (data->setup_on_usb) { + err = data->setup_on_usb(hdev); + if (err <0) + return err; + } + err = usb_autopm_get_interface(data->intf); if (err < 0) return err;