aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/bluetooth
diff options
context:
space:
mode:
authorAdam Lee <adam.lee@canonical.com>2015-01-28 15:30:27 -0500
committerMarcel Holtmann <marcel@holtmann.org>2015-01-29 13:12:21 -0500
commitc561a5753dd631920c4459a067d22679b3d110d6 (patch)
treee36b9b3e99a65517c22c6eb461ac321d67ba30fd /drivers/bluetooth
parentac363cf9eb0b0378165ebfcf41ffbf78295a817e (diff)
Bluetooth: ath3k: workaround the compatibility issue with xHCI controller
BugLink: https://bugs.launchpad.net/bugs/1400215 ath3k devices fail to load firmwares on xHCI buses, but work well on EHCI, this might be a compatibility issue between xHCI and ath3k chips. As my testing result, those chips will work on xHCI buses again with this patch. This workaround is from Qualcomm, they also did some workarounds in Windows driver. Signed-off-by: Adam Lee <adam.lee@canonical.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'drivers/bluetooth')
-rw-r--r--drivers/bluetooth/ath3k.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/bluetooth/ath3k.c b/drivers/bluetooth/ath3k.c
index 13a64d0c69e2..de4c8499cbac 100644
--- a/drivers/bluetooth/ath3k.c
+++ b/drivers/bluetooth/ath3k.c
@@ -176,6 +176,8 @@ static const struct usb_device_id ath3k_blist_tbl[] = {
176#define USB_REQ_DFU_DNLOAD 1 176#define USB_REQ_DFU_DNLOAD 1
177#define BULK_SIZE 4096 177#define BULK_SIZE 4096
178#define FW_HDR_SIZE 20 178#define FW_HDR_SIZE 20
179#define TIMEGAP_USEC_MIN 50
180#define TIMEGAP_USEC_MAX 100
179 181
180static int ath3k_load_firmware(struct usb_device *udev, 182static int ath3k_load_firmware(struct usb_device *udev,
181 const struct firmware *firmware) 183 const struct firmware *firmware)
@@ -207,6 +209,9 @@ static int ath3k_load_firmware(struct usb_device *udev,
207 pipe = usb_sndbulkpipe(udev, 0x02); 209 pipe = usb_sndbulkpipe(udev, 0x02);
208 210
209 while (count) { 211 while (count) {
212 /* workaround the compatibility issue with xHCI controller*/
213 usleep_range(TIMEGAP_USEC_MIN, TIMEGAP_USEC_MAX);
214
210 size = min_t(uint, count, BULK_SIZE); 215 size = min_t(uint, count, BULK_SIZE);
211 memcpy(send_buf, firmware->data + sent, size); 216 memcpy(send_buf, firmware->data + sent, size);
212 217
@@ -304,6 +309,9 @@ static int ath3k_load_fwfile(struct usb_device *udev,
304 pipe = usb_sndbulkpipe(udev, 0x02); 309 pipe = usb_sndbulkpipe(udev, 0x02);
305 310
306 while (count) { 311 while (count) {
312 /* workaround the compatibility issue with xHCI controller*/
313 usleep_range(TIMEGAP_USEC_MIN, TIMEGAP_USEC_MAX);
314
307 size = min_t(uint, count, BULK_SIZE); 315 size = min_t(uint, count, BULK_SIZE);
308 memcpy(send_buf, firmware->data + sent, size); 316 memcpy(send_buf, firmware->data + sent, size);
309 317