diff options
Diffstat (limited to 'drivers/bluetooth')
-rw-r--r-- | drivers/bluetooth/ath3k.c | 4 | ||||
-rw-r--r-- | drivers/bluetooth/btmrvl_drv.h | 25 | ||||
-rw-r--r-- | drivers/bluetooth/btmrvl_main.c | 130 | ||||
-rw-r--r-- | drivers/bluetooth/btmrvl_sdio.c | 9 | ||||
-rw-r--r-- | drivers/bluetooth/btmrvl_sdio.h | 2 | ||||
-rw-r--r-- | drivers/bluetooth/btusb.c | 7 |
6 files changed, 54 insertions, 123 deletions
diff --git a/drivers/bluetooth/ath3k.c b/drivers/bluetooth/ath3k.c index 6bfc1bb318f6..d3fdc32b579d 100644 --- a/drivers/bluetooth/ath3k.c +++ b/drivers/bluetooth/ath3k.c | |||
@@ -83,6 +83,7 @@ static const struct usb_device_id ath3k_table[] = { | |||
83 | { USB_DEVICE(0x04CA, 0x3005) }, | 83 | { USB_DEVICE(0x04CA, 0x3005) }, |
84 | { USB_DEVICE(0x04CA, 0x3006) }, | 84 | { USB_DEVICE(0x04CA, 0x3006) }, |
85 | { USB_DEVICE(0x04CA, 0x3008) }, | 85 | { USB_DEVICE(0x04CA, 0x3008) }, |
86 | { USB_DEVICE(0x04CA, 0x300b) }, | ||
86 | { USB_DEVICE(0x13d3, 0x3362) }, | 87 | { USB_DEVICE(0x13d3, 0x3362) }, |
87 | { USB_DEVICE(0x0CF3, 0xE004) }, | 88 | { USB_DEVICE(0x0CF3, 0xE004) }, |
88 | { USB_DEVICE(0x0CF3, 0xE005) }, | 89 | { USB_DEVICE(0x0CF3, 0xE005) }, |
@@ -96,6 +97,7 @@ static const struct usb_device_id ath3k_table[] = { | |||
96 | { USB_DEVICE(0x13d3, 0x3402) }, | 97 | { USB_DEVICE(0x13d3, 0x3402) }, |
97 | { USB_DEVICE(0x0cf3, 0x3121) }, | 98 | { USB_DEVICE(0x0cf3, 0x3121) }, |
98 | { USB_DEVICE(0x0cf3, 0xe003) }, | 99 | { USB_DEVICE(0x0cf3, 0xe003) }, |
100 | { USB_DEVICE(0x0489, 0xe05f) }, | ||
99 | 101 | ||
100 | /* Atheros AR5BBU12 with sflash firmware */ | 102 | /* Atheros AR5BBU12 with sflash firmware */ |
101 | { USB_DEVICE(0x0489, 0xE02C) }, | 103 | { USB_DEVICE(0x0489, 0xE02C) }, |
@@ -125,6 +127,7 @@ static const struct usb_device_id ath3k_blist_tbl[] = { | |||
125 | { USB_DEVICE(0x04ca, 0x3005), .driver_info = BTUSB_ATH3012 }, | 127 | { USB_DEVICE(0x04ca, 0x3005), .driver_info = BTUSB_ATH3012 }, |
126 | { USB_DEVICE(0x04ca, 0x3006), .driver_info = BTUSB_ATH3012 }, | 128 | { USB_DEVICE(0x04ca, 0x3006), .driver_info = BTUSB_ATH3012 }, |
127 | { USB_DEVICE(0x04ca, 0x3008), .driver_info = BTUSB_ATH3012 }, | 129 | { USB_DEVICE(0x04ca, 0x3008), .driver_info = BTUSB_ATH3012 }, |
130 | { USB_DEVICE(0x04ca, 0x300b), .driver_info = BTUSB_ATH3012 }, | ||
128 | { USB_DEVICE(0x13d3, 0x3362), .driver_info = BTUSB_ATH3012 }, | 131 | { USB_DEVICE(0x13d3, 0x3362), .driver_info = BTUSB_ATH3012 }, |
129 | { USB_DEVICE(0x0cf3, 0xe004), .driver_info = BTUSB_ATH3012 }, | 132 | { USB_DEVICE(0x0cf3, 0xe004), .driver_info = BTUSB_ATH3012 }, |
130 | { USB_DEVICE(0x0cf3, 0xe005), .driver_info = BTUSB_ATH3012 }, | 133 | { USB_DEVICE(0x0cf3, 0xe005), .driver_info = BTUSB_ATH3012 }, |
@@ -138,6 +141,7 @@ static const struct usb_device_id ath3k_blist_tbl[] = { | |||
138 | { USB_DEVICE(0x13d3, 0x3402), .driver_info = BTUSB_ATH3012 }, | 141 | { USB_DEVICE(0x13d3, 0x3402), .driver_info = BTUSB_ATH3012 }, |
139 | { USB_DEVICE(0x0cf3, 0x3121), .driver_info = BTUSB_ATH3012 }, | 142 | { USB_DEVICE(0x0cf3, 0x3121), .driver_info = BTUSB_ATH3012 }, |
140 | { USB_DEVICE(0x0cf3, 0xe003), .driver_info = BTUSB_ATH3012 }, | 143 | { USB_DEVICE(0x0cf3, 0xe003), .driver_info = BTUSB_ATH3012 }, |
144 | { USB_DEVICE(0x0489, 0xe05f), .driver_info = BTUSB_ATH3012 }, | ||
141 | 145 | ||
142 | /* Atheros AR5BBU22 with sflash firmware */ | 146 | /* Atheros AR5BBU22 with sflash firmware */ |
143 | { USB_DEVICE(0x0489, 0xE03C), .driver_info = BTUSB_ATH3012 }, | 147 | { USB_DEVICE(0x0489, 0xE03C), .driver_info = BTUSB_ATH3012 }, |
diff --git a/drivers/bluetooth/btmrvl_drv.h b/drivers/bluetooth/btmrvl_drv.h index f9d183387f45..7399303d7d99 100644 --- a/drivers/bluetooth/btmrvl_drv.h +++ b/drivers/bluetooth/btmrvl_drv.h | |||
@@ -23,8 +23,6 @@ | |||
23 | #include <linux/bitops.h> | 23 | #include <linux/bitops.h> |
24 | #include <linux/slab.h> | 24 | #include <linux/slab.h> |
25 | #include <net/bluetooth/bluetooth.h> | 25 | #include <net/bluetooth/bluetooth.h> |
26 | #include <linux/ctype.h> | ||
27 | #include <linux/firmware.h> | ||
28 | 26 | ||
29 | #define BTM_HEADER_LEN 4 | 27 | #define BTM_HEADER_LEN 4 |
30 | #define BTM_UPLD_SIZE 2312 | 28 | #define BTM_UPLD_SIZE 2312 |
@@ -43,8 +41,6 @@ struct btmrvl_thread { | |||
43 | struct btmrvl_device { | 41 | struct btmrvl_device { |
44 | void *card; | 42 | void *card; |
45 | struct hci_dev *hcidev; | 43 | struct hci_dev *hcidev; |
46 | struct device *dev; | ||
47 | const char *cal_data; | ||
48 | 44 | ||
49 | u8 dev_type; | 45 | u8 dev_type; |
50 | 46 | ||
@@ -90,12 +86,12 @@ struct btmrvl_private { | |||
90 | 86 | ||
91 | #define MRVL_VENDOR_PKT 0xFE | 87 | #define MRVL_VENDOR_PKT 0xFE |
92 | 88 | ||
93 | /* Bluetooth commands */ | 89 | /* Vendor specific Bluetooth commands */ |
94 | #define BT_CMD_AUTO_SLEEP_MODE 0x23 | 90 | #define BT_CMD_AUTO_SLEEP_MODE 0xFC23 |
95 | #define BT_CMD_HOST_SLEEP_CONFIG 0x59 | 91 | #define BT_CMD_HOST_SLEEP_CONFIG 0xFC59 |
96 | #define BT_CMD_HOST_SLEEP_ENABLE 0x5A | 92 | #define BT_CMD_HOST_SLEEP_ENABLE 0xFC5A |
97 | #define BT_CMD_MODULE_CFG_REQ 0x5B | 93 | #define BT_CMD_MODULE_CFG_REQ 0xFC5B |
98 | #define BT_CMD_LOAD_CONFIG_DATA 0x61 | 94 | #define BT_CMD_LOAD_CONFIG_DATA 0xFC61 |
99 | 95 | ||
100 | /* Sub-commands: Module Bringup/Shutdown Request/Response */ | 96 | /* Sub-commands: Module Bringup/Shutdown Request/Response */ |
101 | #define MODULE_BRINGUP_REQ 0xF1 | 97 | #define MODULE_BRINGUP_REQ 0xF1 |
@@ -104,6 +100,11 @@ struct btmrvl_private { | |||
104 | 100 | ||
105 | #define MODULE_SHUTDOWN_REQ 0xF2 | 101 | #define MODULE_SHUTDOWN_REQ 0xF2 |
106 | 102 | ||
103 | /* Vendor specific Bluetooth events */ | ||
104 | #define BT_EVENT_AUTO_SLEEP_MODE 0x23 | ||
105 | #define BT_EVENT_HOST_SLEEP_CONFIG 0x59 | ||
106 | #define BT_EVENT_HOST_SLEEP_ENABLE 0x5A | ||
107 | #define BT_EVENT_MODULE_CFG_REQ 0x5B | ||
107 | #define BT_EVENT_POWER_STATE 0x20 | 108 | #define BT_EVENT_POWER_STATE 0x20 |
108 | 109 | ||
109 | /* Bluetooth Power States */ | 110 | /* Bluetooth Power States */ |
@@ -111,8 +112,6 @@ struct btmrvl_private { | |||
111 | #define BT_PS_DISABLE 0x03 | 112 | #define BT_PS_DISABLE 0x03 |
112 | #define BT_PS_SLEEP 0x01 | 113 | #define BT_PS_SLEEP 0x01 |
113 | 114 | ||
114 | #define OGF 0x3F | ||
115 | |||
116 | /* Host Sleep states */ | 115 | /* Host Sleep states */ |
117 | #define HS_ACTIVATED 0x01 | 116 | #define HS_ACTIVATED 0x01 |
118 | #define HS_DEACTIVATED 0x00 | 117 | #define HS_DEACTIVATED 0x00 |
@@ -121,7 +120,7 @@ struct btmrvl_private { | |||
121 | #define PS_SLEEP 0x01 | 120 | #define PS_SLEEP 0x01 |
122 | #define PS_AWAKE 0x00 | 121 | #define PS_AWAKE 0x00 |
123 | 122 | ||
124 | #define BT_CMD_DATA_SIZE 32 | 123 | #define BT_CAL_HDR_LEN 4 |
125 | #define BT_CAL_DATA_SIZE 28 | 124 | #define BT_CAL_DATA_SIZE 28 |
126 | 125 | ||
127 | struct btmrvl_event { | 126 | struct btmrvl_event { |
diff --git a/drivers/bluetooth/btmrvl_main.c b/drivers/bluetooth/btmrvl_main.c index 5cf31c4fe6d1..1e0320af00c6 100644 --- a/drivers/bluetooth/btmrvl_main.c +++ b/drivers/bluetooth/btmrvl_main.c | |||
@@ -19,7 +19,7 @@ | |||
19 | **/ | 19 | **/ |
20 | 20 | ||
21 | #include <linux/module.h> | 21 | #include <linux/module.h> |
22 | 22 | #include <linux/of.h> | |
23 | #include <net/bluetooth/bluetooth.h> | 23 | #include <net/bluetooth/bluetooth.h> |
24 | #include <net/bluetooth/hci_core.h> | 24 | #include <net/bluetooth/hci_core.h> |
25 | 25 | ||
@@ -50,12 +50,10 @@ bool btmrvl_check_evtpkt(struct btmrvl_private *priv, struct sk_buff *skb) | |||
50 | 50 | ||
51 | if (hdr->evt == HCI_EV_CMD_COMPLETE) { | 51 | if (hdr->evt == HCI_EV_CMD_COMPLETE) { |
52 | struct hci_ev_cmd_complete *ec; | 52 | struct hci_ev_cmd_complete *ec; |
53 | u16 opcode, ocf, ogf; | 53 | u16 opcode; |
54 | 54 | ||
55 | ec = (void *) (skb->data + HCI_EVENT_HDR_SIZE); | 55 | ec = (void *) (skb->data + HCI_EVENT_HDR_SIZE); |
56 | opcode = __le16_to_cpu(ec->opcode); | 56 | opcode = __le16_to_cpu(ec->opcode); |
57 | ocf = hci_opcode_ocf(opcode); | ||
58 | ogf = hci_opcode_ogf(opcode); | ||
59 | 57 | ||
60 | if (priv->btmrvl_dev.sendcmdflag) { | 58 | if (priv->btmrvl_dev.sendcmdflag) { |
61 | priv->btmrvl_dev.sendcmdflag = false; | 59 | priv->btmrvl_dev.sendcmdflag = false; |
@@ -63,9 +61,8 @@ bool btmrvl_check_evtpkt(struct btmrvl_private *priv, struct sk_buff *skb) | |||
63 | wake_up_interruptible(&priv->adapter->cmd_wait_q); | 61 | wake_up_interruptible(&priv->adapter->cmd_wait_q); |
64 | } | 62 | } |
65 | 63 | ||
66 | if (ogf == OGF) { | 64 | if (hci_opcode_ogf(opcode) == 0x3F) { |
67 | BT_DBG("vendor event skipped: ogf 0x%4.4x ocf 0x%4.4x", | 65 | BT_DBG("vendor event skipped: opcode=%#4.4x", opcode); |
68 | ogf, ocf); | ||
69 | kfree_skb(skb); | 66 | kfree_skb(skb); |
70 | return false; | 67 | return false; |
71 | } | 68 | } |
@@ -89,7 +86,7 @@ int btmrvl_process_event(struct btmrvl_private *priv, struct sk_buff *skb) | |||
89 | } | 86 | } |
90 | 87 | ||
91 | switch (event->data[0]) { | 88 | switch (event->data[0]) { |
92 | case BT_CMD_AUTO_SLEEP_MODE: | 89 | case BT_EVENT_AUTO_SLEEP_MODE: |
93 | if (!event->data[2]) { | 90 | if (!event->data[2]) { |
94 | if (event->data[1] == BT_PS_ENABLE) | 91 | if (event->data[1] == BT_PS_ENABLE) |
95 | adapter->psmode = 1; | 92 | adapter->psmode = 1; |
@@ -102,7 +99,7 @@ int btmrvl_process_event(struct btmrvl_private *priv, struct sk_buff *skb) | |||
102 | } | 99 | } |
103 | break; | 100 | break; |
104 | 101 | ||
105 | case BT_CMD_HOST_SLEEP_CONFIG: | 102 | case BT_EVENT_HOST_SLEEP_CONFIG: |
106 | if (!event->data[3]) | 103 | if (!event->data[3]) |
107 | BT_DBG("gpio=%x, gap=%x", event->data[1], | 104 | BT_DBG("gpio=%x, gap=%x", event->data[1], |
108 | event->data[2]); | 105 | event->data[2]); |
@@ -110,7 +107,7 @@ int btmrvl_process_event(struct btmrvl_private *priv, struct sk_buff *skb) | |||
110 | BT_DBG("HSCFG command failed"); | 107 | BT_DBG("HSCFG command failed"); |
111 | break; | 108 | break; |
112 | 109 | ||
113 | case BT_CMD_HOST_SLEEP_ENABLE: | 110 | case BT_EVENT_HOST_SLEEP_ENABLE: |
114 | if (!event->data[1]) { | 111 | if (!event->data[1]) { |
115 | adapter->hs_state = HS_ACTIVATED; | 112 | adapter->hs_state = HS_ACTIVATED; |
116 | if (adapter->psmode) | 113 | if (adapter->psmode) |
@@ -121,7 +118,7 @@ int btmrvl_process_event(struct btmrvl_private *priv, struct sk_buff *skb) | |||
121 | } | 118 | } |
122 | break; | 119 | break; |
123 | 120 | ||
124 | case BT_CMD_MODULE_CFG_REQ: | 121 | case BT_EVENT_MODULE_CFG_REQ: |
125 | if (priv->btmrvl_dev.sendcmdflag && | 122 | if (priv->btmrvl_dev.sendcmdflag && |
126 | event->data[1] == MODULE_BRINGUP_REQ) { | 123 | event->data[1] == MODULE_BRINGUP_REQ) { |
127 | BT_DBG("EVENT:%s", | 124 | BT_DBG("EVENT:%s", |
@@ -166,7 +163,7 @@ exit: | |||
166 | } | 163 | } |
167 | EXPORT_SYMBOL_GPL(btmrvl_process_event); | 164 | EXPORT_SYMBOL_GPL(btmrvl_process_event); |
168 | 165 | ||
169 | static int btmrvl_send_sync_cmd(struct btmrvl_private *priv, u16 cmd_no, | 166 | static int btmrvl_send_sync_cmd(struct btmrvl_private *priv, u16 opcode, |
170 | const void *param, u8 len) | 167 | const void *param, u8 len) |
171 | { | 168 | { |
172 | struct sk_buff *skb; | 169 | struct sk_buff *skb; |
@@ -179,7 +176,7 @@ static int btmrvl_send_sync_cmd(struct btmrvl_private *priv, u16 cmd_no, | |||
179 | } | 176 | } |
180 | 177 | ||
181 | hdr = (struct hci_command_hdr *)skb_put(skb, HCI_COMMAND_HDR_SIZE); | 178 | hdr = (struct hci_command_hdr *)skb_put(skb, HCI_COMMAND_HDR_SIZE); |
182 | hdr->opcode = cpu_to_le16(hci_opcode_pack(OGF, cmd_no)); | 179 | hdr->opcode = cpu_to_le16(opcode); |
183 | hdr->plen = len; | 180 | hdr->plen = len; |
184 | 181 | ||
185 | if (len) | 182 | if (len) |
@@ -417,127 +414,62 @@ static int btmrvl_open(struct hci_dev *hdev) | |||
417 | return 0; | 414 | return 0; |
418 | } | 415 | } |
419 | 416 | ||
420 | /* | 417 | static int btmrvl_download_cal_data(struct btmrvl_private *priv, |
421 | * This function parses provided calibration data input. It should contain | 418 | u8 *data, int len) |
422 | * hex bytes separated by space or new line character. Here is an example. | ||
423 | * 00 1C 01 37 FF FF FF FF 02 04 7F 01 | ||
424 | * CE BA 00 00 00 2D C6 C0 00 00 00 00 | ||
425 | * 00 F0 00 00 | ||
426 | */ | ||
427 | static int btmrvl_parse_cal_cfg(const u8 *src, u32 len, u8 *dst, u32 dst_size) | ||
428 | { | 419 | { |
429 | const u8 *s = src; | ||
430 | u8 *d = dst; | ||
431 | int ret; | 420 | int ret; |
432 | u8 tmp[3]; | ||
433 | |||
434 | tmp[2] = '\0'; | ||
435 | while ((s - src) <= len - 2) { | ||
436 | if (isspace(*s)) { | ||
437 | s++; | ||
438 | continue; | ||
439 | } | ||
440 | |||
441 | if (isxdigit(*s)) { | ||
442 | if ((d - dst) >= dst_size) { | ||
443 | BT_ERR("calibration data file too big!!!"); | ||
444 | return -EINVAL; | ||
445 | } | ||
446 | |||
447 | memcpy(tmp, s, 2); | ||
448 | |||
449 | ret = kstrtou8(tmp, 16, d++); | ||
450 | if (ret < 0) | ||
451 | return ret; | ||
452 | |||
453 | s += 2; | ||
454 | } else { | ||
455 | return -EINVAL; | ||
456 | } | ||
457 | } | ||
458 | if (d == dst) | ||
459 | return -EINVAL; | ||
460 | |||
461 | return 0; | ||
462 | } | ||
463 | |||
464 | static int btmrvl_load_cal_data(struct btmrvl_private *priv, | ||
465 | u8 *config_data) | ||
466 | { | ||
467 | int i, ret; | ||
468 | u8 data[BT_CMD_DATA_SIZE]; | ||
469 | 421 | ||
470 | data[0] = 0x00; | 422 | data[0] = 0x00; |
471 | data[1] = 0x00; | 423 | data[1] = 0x00; |
472 | data[2] = 0x00; | 424 | data[2] = 0x00; |
473 | data[3] = BT_CMD_DATA_SIZE - 4; | 425 | data[3] = len; |
474 | |||
475 | /* Swap cal-data bytes. Each four bytes are swapped. Considering 4 | ||
476 | * byte SDIO header offset, mapping of input and output bytes will be | ||
477 | * {3, 2, 1, 0} -> {0+4, 1+4, 2+4, 3+4}, | ||
478 | * {7, 6, 5, 4} -> {4+4, 5+4, 6+4, 7+4} */ | ||
479 | for (i = 4; i < BT_CMD_DATA_SIZE; i++) | ||
480 | data[i] = config_data[(i / 4) * 8 - 1 - i]; | ||
481 | 426 | ||
482 | print_hex_dump_bytes("Calibration data: ", | 427 | print_hex_dump_bytes("Calibration data: ", |
483 | DUMP_PREFIX_OFFSET, data, BT_CMD_DATA_SIZE); | 428 | DUMP_PREFIX_OFFSET, data, BT_CAL_HDR_LEN + len); |
484 | 429 | ||
485 | ret = btmrvl_send_sync_cmd(priv, BT_CMD_LOAD_CONFIG_DATA, data, | 430 | ret = btmrvl_send_sync_cmd(priv, BT_CMD_LOAD_CONFIG_DATA, data, |
486 | BT_CMD_DATA_SIZE); | 431 | BT_CAL_HDR_LEN + len); |
487 | if (ret) | 432 | if (ret) |
488 | BT_ERR("Failed to download caibration data\n"); | 433 | BT_ERR("Failed to download caibration data\n"); |
489 | 434 | ||
490 | return 0; | 435 | return 0; |
491 | } | 436 | } |
492 | 437 | ||
493 | static int | 438 | static int btmrvl_cal_data_dt(struct btmrvl_private *priv) |
494 | btmrvl_process_cal_cfg(struct btmrvl_private *priv, u8 *data, u32 size) | ||
495 | { | 439 | { |
496 | u8 cal_data[BT_CAL_DATA_SIZE]; | 440 | struct device_node *dt_node; |
441 | u8 cal_data[BT_CAL_HDR_LEN + BT_CAL_DATA_SIZE]; | ||
442 | const char name[] = "btmrvl_caldata"; | ||
443 | const char property[] = "btmrvl,caldata"; | ||
497 | int ret; | 444 | int ret; |
498 | 445 | ||
499 | ret = btmrvl_parse_cal_cfg(data, size, cal_data, sizeof(cal_data)); | 446 | dt_node = of_find_node_by_name(NULL, name); |
447 | if (!dt_node) | ||
448 | return -ENODEV; | ||
449 | |||
450 | ret = of_property_read_u8_array(dt_node, property, | ||
451 | cal_data + BT_CAL_HDR_LEN, | ||
452 | BT_CAL_DATA_SIZE); | ||
500 | if (ret) | 453 | if (ret) |
501 | return ret; | 454 | return ret; |
502 | 455 | ||
503 | ret = btmrvl_load_cal_data(priv, cal_data); | 456 | BT_DBG("Use cal data from device tree"); |
457 | ret = btmrvl_download_cal_data(priv, cal_data, BT_CAL_DATA_SIZE); | ||
504 | if (ret) { | 458 | if (ret) { |
505 | BT_ERR("Fail to load calibrate data"); | 459 | BT_ERR("Fail to download calibrate data"); |
506 | return ret; | 460 | return ret; |
507 | } | 461 | } |
508 | 462 | ||
509 | return 0; | 463 | return 0; |
510 | } | 464 | } |
511 | 465 | ||
512 | static int btmrvl_cal_data_config(struct btmrvl_private *priv) | ||
513 | { | ||
514 | const struct firmware *cfg; | ||
515 | int ret; | ||
516 | const char *cal_data = priv->btmrvl_dev.cal_data; | ||
517 | |||
518 | if (!cal_data) | ||
519 | return 0; | ||
520 | |||
521 | ret = request_firmware(&cfg, cal_data, priv->btmrvl_dev.dev); | ||
522 | if (ret < 0) { | ||
523 | BT_DBG("Failed to get %s file, skipping cal data download", | ||
524 | cal_data); | ||
525 | return 0; | ||
526 | } | ||
527 | |||
528 | ret = btmrvl_process_cal_cfg(priv, (u8 *)cfg->data, cfg->size); | ||
529 | release_firmware(cfg); | ||
530 | return ret; | ||
531 | } | ||
532 | |||
533 | static int btmrvl_setup(struct hci_dev *hdev) | 466 | static int btmrvl_setup(struct hci_dev *hdev) |
534 | { | 467 | { |
535 | struct btmrvl_private *priv = hci_get_drvdata(hdev); | 468 | struct btmrvl_private *priv = hci_get_drvdata(hdev); |
536 | 469 | ||
537 | btmrvl_send_module_cfg_cmd(priv, MODULE_BRINGUP_REQ); | 470 | btmrvl_send_module_cfg_cmd(priv, MODULE_BRINGUP_REQ); |
538 | 471 | ||
539 | if (btmrvl_cal_data_config(priv)) | 472 | btmrvl_cal_data_dt(priv); |
540 | BT_ERR("Set cal data failed"); | ||
541 | 473 | ||
542 | priv->btmrvl_dev.psmode = 1; | 474 | priv->btmrvl_dev.psmode = 1; |
543 | btmrvl_enable_ps(priv); | 475 | btmrvl_enable_ps(priv); |
diff --git a/drivers/bluetooth/btmrvl_sdio.c b/drivers/bluetooth/btmrvl_sdio.c index fabcf5bb48af..1b52c9f5230d 100644 --- a/drivers/bluetooth/btmrvl_sdio.c +++ b/drivers/bluetooth/btmrvl_sdio.c | |||
@@ -18,6 +18,7 @@ | |||
18 | * this warranty disclaimer. | 18 | * this warranty disclaimer. |
19 | **/ | 19 | **/ |
20 | 20 | ||
21 | #include <linux/firmware.h> | ||
21 | #include <linux/slab.h> | 22 | #include <linux/slab.h> |
22 | 23 | ||
23 | #include <linux/mmc/sdio_ids.h> | 24 | #include <linux/mmc/sdio_ids.h> |
@@ -101,7 +102,6 @@ static const struct btmrvl_sdio_card_reg btmrvl_reg_88xx = { | |||
101 | static const struct btmrvl_sdio_device btmrvl_sdio_sd8688 = { | 102 | static const struct btmrvl_sdio_device btmrvl_sdio_sd8688 = { |
102 | .helper = "mrvl/sd8688_helper.bin", | 103 | .helper = "mrvl/sd8688_helper.bin", |
103 | .firmware = "mrvl/sd8688.bin", | 104 | .firmware = "mrvl/sd8688.bin", |
104 | .cal_data = NULL, | ||
105 | .reg = &btmrvl_reg_8688, | 105 | .reg = &btmrvl_reg_8688, |
106 | .sd_blksz_fw_dl = 64, | 106 | .sd_blksz_fw_dl = 64, |
107 | }; | 107 | }; |
@@ -109,7 +109,6 @@ static const struct btmrvl_sdio_device btmrvl_sdio_sd8688 = { | |||
109 | static const struct btmrvl_sdio_device btmrvl_sdio_sd8787 = { | 109 | static const struct btmrvl_sdio_device btmrvl_sdio_sd8787 = { |
110 | .helper = NULL, | 110 | .helper = NULL, |
111 | .firmware = "mrvl/sd8787_uapsta.bin", | 111 | .firmware = "mrvl/sd8787_uapsta.bin", |
112 | .cal_data = NULL, | ||
113 | .reg = &btmrvl_reg_87xx, | 112 | .reg = &btmrvl_reg_87xx, |
114 | .sd_blksz_fw_dl = 256, | 113 | .sd_blksz_fw_dl = 256, |
115 | }; | 114 | }; |
@@ -117,7 +116,6 @@ static const struct btmrvl_sdio_device btmrvl_sdio_sd8787 = { | |||
117 | static const struct btmrvl_sdio_device btmrvl_sdio_sd8797 = { | 116 | static const struct btmrvl_sdio_device btmrvl_sdio_sd8797 = { |
118 | .helper = NULL, | 117 | .helper = NULL, |
119 | .firmware = "mrvl/sd8797_uapsta.bin", | 118 | .firmware = "mrvl/sd8797_uapsta.bin", |
120 | .cal_data = "mrvl/sd8797_caldata.conf", | ||
121 | .reg = &btmrvl_reg_87xx, | 119 | .reg = &btmrvl_reg_87xx, |
122 | .sd_blksz_fw_dl = 256, | 120 | .sd_blksz_fw_dl = 256, |
123 | }; | 121 | }; |
@@ -125,7 +123,6 @@ static const struct btmrvl_sdio_device btmrvl_sdio_sd8797 = { | |||
125 | static const struct btmrvl_sdio_device btmrvl_sdio_sd8897 = { | 123 | static const struct btmrvl_sdio_device btmrvl_sdio_sd8897 = { |
126 | .helper = NULL, | 124 | .helper = NULL, |
127 | .firmware = "mrvl/sd8897_uapsta.bin", | 125 | .firmware = "mrvl/sd8897_uapsta.bin", |
128 | .cal_data = NULL, | ||
129 | .reg = &btmrvl_reg_88xx, | 126 | .reg = &btmrvl_reg_88xx, |
130 | .sd_blksz_fw_dl = 256, | 127 | .sd_blksz_fw_dl = 256, |
131 | }; | 128 | }; |
@@ -1007,7 +1004,6 @@ static int btmrvl_sdio_probe(struct sdio_func *func, | |||
1007 | struct btmrvl_sdio_device *data = (void *) id->driver_data; | 1004 | struct btmrvl_sdio_device *data = (void *) id->driver_data; |
1008 | card->helper = data->helper; | 1005 | card->helper = data->helper; |
1009 | card->firmware = data->firmware; | 1006 | card->firmware = data->firmware; |
1010 | card->cal_data = data->cal_data; | ||
1011 | card->reg = data->reg; | 1007 | card->reg = data->reg; |
1012 | card->sd_blksz_fw_dl = data->sd_blksz_fw_dl; | 1008 | card->sd_blksz_fw_dl = data->sd_blksz_fw_dl; |
1013 | } | 1009 | } |
@@ -1036,8 +1032,6 @@ static int btmrvl_sdio_probe(struct sdio_func *func, | |||
1036 | } | 1032 | } |
1037 | 1033 | ||
1038 | card->priv = priv; | 1034 | card->priv = priv; |
1039 | priv->btmrvl_dev.dev = &card->func->dev; | ||
1040 | priv->btmrvl_dev.cal_data = card->cal_data; | ||
1041 | 1035 | ||
1042 | /* Initialize the interface specific function pointers */ | 1036 | /* Initialize the interface specific function pointers */ |
1043 | priv->hw_host_to_card = btmrvl_sdio_host_to_card; | 1037 | priv->hw_host_to_card = btmrvl_sdio_host_to_card; |
@@ -1220,5 +1214,4 @@ MODULE_FIRMWARE("mrvl/sd8688_helper.bin"); | |||
1220 | MODULE_FIRMWARE("mrvl/sd8688.bin"); | 1214 | MODULE_FIRMWARE("mrvl/sd8688.bin"); |
1221 | MODULE_FIRMWARE("mrvl/sd8787_uapsta.bin"); | 1215 | MODULE_FIRMWARE("mrvl/sd8787_uapsta.bin"); |
1222 | MODULE_FIRMWARE("mrvl/sd8797_uapsta.bin"); | 1216 | MODULE_FIRMWARE("mrvl/sd8797_uapsta.bin"); |
1223 | MODULE_FIRMWARE("mrvl/sd8797_caldata.conf"); | ||
1224 | MODULE_FIRMWARE("mrvl/sd8897_uapsta.bin"); | 1217 | MODULE_FIRMWARE("mrvl/sd8897_uapsta.bin"); |
diff --git a/drivers/bluetooth/btmrvl_sdio.h b/drivers/bluetooth/btmrvl_sdio.h index 6872d9ecac07..43d35a609ca9 100644 --- a/drivers/bluetooth/btmrvl_sdio.h +++ b/drivers/bluetooth/btmrvl_sdio.h | |||
@@ -85,7 +85,6 @@ struct btmrvl_sdio_card { | |||
85 | u32 ioport; | 85 | u32 ioport; |
86 | const char *helper; | 86 | const char *helper; |
87 | const char *firmware; | 87 | const char *firmware; |
88 | const char *cal_data; | ||
89 | const struct btmrvl_sdio_card_reg *reg; | 88 | const struct btmrvl_sdio_card_reg *reg; |
90 | u16 sd_blksz_fw_dl; | 89 | u16 sd_blksz_fw_dl; |
91 | u8 rx_unit; | 90 | u8 rx_unit; |
@@ -95,7 +94,6 @@ struct btmrvl_sdio_card { | |||
95 | struct btmrvl_sdio_device { | 94 | struct btmrvl_sdio_device { |
96 | const char *helper; | 95 | const char *helper; |
97 | const char *firmware; | 96 | const char *firmware; |
98 | const char *cal_data; | ||
99 | const struct btmrvl_sdio_card_reg *reg; | 97 | const struct btmrvl_sdio_card_reg *reg; |
100 | u16 sd_blksz_fw_dl; | 98 | u16 sd_blksz_fw_dl; |
101 | }; | 99 | }; |
diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c index c0ff34f2d2df..bfbcc5a772a6 100644 --- a/drivers/bluetooth/btusb.c +++ b/drivers/bluetooth/btusb.c | |||
@@ -150,6 +150,7 @@ static const struct usb_device_id blacklist_table[] = { | |||
150 | { USB_DEVICE(0x04ca, 0x3005), .driver_info = BTUSB_ATH3012 }, | 150 | { USB_DEVICE(0x04ca, 0x3005), .driver_info = BTUSB_ATH3012 }, |
151 | { USB_DEVICE(0x04ca, 0x3006), .driver_info = BTUSB_ATH3012 }, | 151 | { USB_DEVICE(0x04ca, 0x3006), .driver_info = BTUSB_ATH3012 }, |
152 | { USB_DEVICE(0x04ca, 0x3008), .driver_info = BTUSB_ATH3012 }, | 152 | { USB_DEVICE(0x04ca, 0x3008), .driver_info = BTUSB_ATH3012 }, |
153 | { USB_DEVICE(0x04ca, 0x300b), .driver_info = BTUSB_ATH3012 }, | ||
153 | { USB_DEVICE(0x13d3, 0x3362), .driver_info = BTUSB_ATH3012 }, | 154 | { USB_DEVICE(0x13d3, 0x3362), .driver_info = BTUSB_ATH3012 }, |
154 | { USB_DEVICE(0x0cf3, 0xe004), .driver_info = BTUSB_ATH3012 }, | 155 | { USB_DEVICE(0x0cf3, 0xe004), .driver_info = BTUSB_ATH3012 }, |
155 | { USB_DEVICE(0x0cf3, 0xe005), .driver_info = BTUSB_ATH3012 }, | 156 | { USB_DEVICE(0x0cf3, 0xe005), .driver_info = BTUSB_ATH3012 }, |
@@ -163,6 +164,7 @@ static const struct usb_device_id blacklist_table[] = { | |||
163 | { USB_DEVICE(0x13d3, 0x3402), .driver_info = BTUSB_ATH3012 }, | 164 | { USB_DEVICE(0x13d3, 0x3402), .driver_info = BTUSB_ATH3012 }, |
164 | { USB_DEVICE(0x0cf3, 0x3121), .driver_info = BTUSB_ATH3012 }, | 165 | { USB_DEVICE(0x0cf3, 0x3121), .driver_info = BTUSB_ATH3012 }, |
165 | { USB_DEVICE(0x0cf3, 0xe003), .driver_info = BTUSB_ATH3012 }, | 166 | { USB_DEVICE(0x0cf3, 0xe003), .driver_info = BTUSB_ATH3012 }, |
167 | { USB_DEVICE(0x0489, 0xe05f), .driver_info = BTUSB_ATH3012 }, | ||
166 | 168 | ||
167 | /* Atheros AR5BBU12 with sflash firmware */ | 169 | /* Atheros AR5BBU12 with sflash firmware */ |
168 | { USB_DEVICE(0x0489, 0xe02c), .driver_info = BTUSB_IGNORE }, | 170 | { USB_DEVICE(0x0489, 0xe02c), .driver_info = BTUSB_IGNORE }, |
@@ -223,6 +225,7 @@ static const struct usb_device_id blacklist_table[] = { | |||
223 | 225 | ||
224 | /* Intel Bluetooth device */ | 226 | /* Intel Bluetooth device */ |
225 | { USB_DEVICE(0x8087, 0x07dc), .driver_info = BTUSB_INTEL }, | 227 | { USB_DEVICE(0x8087, 0x07dc), .driver_info = BTUSB_INTEL }, |
228 | { USB_DEVICE(0x8087, 0x0a2a), .driver_info = BTUSB_INTEL }, | ||
226 | 229 | ||
227 | { } /* Terminating entry */ | 230 | { } /* Terminating entry */ |
228 | }; | 231 | }; |
@@ -1435,8 +1438,10 @@ static int btusb_probe(struct usb_interface *intf, | |||
1435 | if (id->driver_info & BTUSB_BCM92035) | 1438 | if (id->driver_info & BTUSB_BCM92035) |
1436 | hdev->setup = btusb_setup_bcm92035; | 1439 | hdev->setup = btusb_setup_bcm92035; |
1437 | 1440 | ||
1438 | if (id->driver_info & BTUSB_INTEL) | 1441 | if (id->driver_info & BTUSB_INTEL) { |
1442 | usb_enable_autosuspend(data->udev); | ||
1439 | hdev->setup = btusb_setup_intel; | 1443 | hdev->setup = btusb_setup_intel; |
1444 | } | ||
1440 | 1445 | ||
1441 | /* Interface numbers are hardcoded in the specification */ | 1446 | /* Interface numbers are hardcoded in the specification */ |
1442 | data->isoc = usb_ifnum_to_if(data->udev, 1); | 1447 | data->isoc = usb_ifnum_to_if(data->udev, 1); |