[Vivid][PATCH 2/6] Bluetooth: btusb: Add setup callback for chip init on USB
Wen-chien Jesse Sung
jesse.sung at canonical.com
Thu Jun 4 09:45:53 UTC 2015
From: "Kim, Ben Young Tae" <ytkim at qca.qualcomm.com>
BugLink: https://launchpad.net/bugs/1459937
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 <ytkim at qca.qualcomm.com>
Signed-off-by: Marcel Holtmann <marcel at holtmann.org>
(cherry picked from commit ace31982585a323afb194f56b9e0486f7bc6570c)
Signed-off-by: Wen-chien Jesse Sung <jesse.sung at canonical.com>
---
drivers/bluetooth/btusb.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index 7134171..1677d8e 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -316,6 +316,8 @@ struct btusb_data {
int suspend_count;
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)
@@ -857,6 +859,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;
--
2.1.4
More information about the kernel-team
mailing list