Skip to content

Commit 29d3c04

Browse files
committed
Merge branch 'for-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next
Johan Hedberg says: ==================== pull request: bluetooth-next 2018-12-19 Here's the main bluetooth-next pull request for 4.21: - Multiple fixes & improvements for Broadcom-based controllers - New USB ID for an Intel controller - Support for new Broadcom controller variants - Use DEFINE_SHOW_ATTRIBUTE to simplify debugfs code - Eliminate confusing "last event is not cmd complete" warning message - Added vendor suspend/resume support for H:5 (3-Wire UART) controllers - Various other smaller improvements & fixes Please let me know if there are any issues pulling. Thanks. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2 parents 5a862f8 + 1629db9 commit 29d3c04

14 files changed

Lines changed: 280 additions & 132 deletions

File tree

‎Documentation/devicetree/bindings/net/broadcom-bluetooth.txt‎

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ device the slave device is attached to.
1010
Required properties:
1111

1212
- compatible: should contain one of the following:
13+
* "brcm,bcm20702a1"
14+
* "brcm,bcm4330-bt"
1315
* "brcm,bcm43438-bt"
1416

1517
Optional properties:
@@ -18,8 +20,13 @@ Optional properties:
1820
- shutdown-gpios: GPIO specifier, used to enable the BT module
1921
- device-wakeup-gpios: GPIO specifier, used to wakeup the controller
2022
- host-wakeup-gpios: GPIO specifier, used to wakeup the host processor
21-
- clocks: clock specifier if external clock provided to the controller
22-
- clock-names: should be "extclk"
23+
- clocks: 1 or 2 clocks as defined in clock-names below, in that order
24+
- clock-names: names for clock inputs, matching the clocks given
25+
- "extclk": deprecated, replaced by "txco"
26+
- "txco": external reference clock (not a standalone crystal)
27+
- "lpo": external low power 32.768 kHz clock
28+
- vbat-supply: phandle to regulator supply for VBAT
29+
- vddio-supply: phandle to regulator supply for VDDIO
2330

2431

2532
Example:

‎drivers/bluetooth/btbcm.c‎

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@
3333
#define VERSION "0.1"
3434

3535
#define BDADDR_BCM20702A0 (&(bdaddr_t) {{0x00, 0xa0, 0x02, 0x70, 0x20, 0x00}})
36+
#define BDADDR_BCM20702A1 (&(bdaddr_t) {{0x00, 0x00, 0xa0, 0x02, 0x70, 0x20}})
37+
#define BDADDR_BCM43430A0 (&(bdaddr_t) {{0xac, 0x1f, 0x12, 0xa0, 0x43, 0x43}})
3638
#define BDADDR_BCM4324B3 (&(bdaddr_t) {{0x00, 0x00, 0x00, 0xb3, 0x24, 0x43}})
3739
#define BDADDR_BCM4330B1 (&(bdaddr_t) {{0x00, 0x00, 0x00, 0xb1, 0x30, 0x43}})
3840

@@ -64,15 +66,23 @@ int btbcm_check_bdaddr(struct hci_dev *hdev)
6466
* The address 00:20:70:02:A0:00 indicates a BCM20702A0 controller
6567
* with no configured address.
6668
*
69+
* The address 20:70:02:A0:00:00 indicates a BCM20702A1 controller
70+
* with no configured address.
71+
*
6772
* The address 43:24:B3:00:00:00 indicates a BCM4324B3 controller
6873
* with waiting for configuration state.
6974
*
7075
* The address 43:30:B1:00:00:00 indicates a BCM4330B1 controller
7176
* with waiting for configuration state.
77+
*
78+
* The address 43:43:A0:12:1F:AC indicates a BCM43430A0 controller
79+
* with no configured address.
7280
*/
7381
if (!bacmp(&bda->bdaddr, BDADDR_BCM20702A0) ||
82+
!bacmp(&bda->bdaddr, BDADDR_BCM20702A1) ||
7483
!bacmp(&bda->bdaddr, BDADDR_BCM4324B3) ||
75-
!bacmp(&bda->bdaddr, BDADDR_BCM4330B1)) {
84+
!bacmp(&bda->bdaddr, BDADDR_BCM4330B1) ||
85+
!bacmp(&bda->bdaddr, BDADDR_BCM43430A0)) {
7686
bt_dev_info(hdev, "BCM: Using default device address (%pMR)",
7787
&bda->bdaddr);
7888
set_bit(HCI_QUIRK_INVALID_BDADDR, &hdev->quirks);
@@ -330,6 +340,8 @@ static const struct bcm_subver_table bcm_uart_subver_table[] = {
330340
{ 0x2209, "BCM43430A1" }, /* 001.002.009 */
331341
{ 0x6119, "BCM4345C0" }, /* 003.001.025 */
332342
{ 0x230f, "BCM4356A2" }, /* 001.003.015 */
343+
{ 0x220e, "BCM20702A1" }, /* 001.002.014 */
344+
{ 0x4217, "BCM4329B1" }, /* 002.002.023 */
333345
{ }
334346
};
335347

‎drivers/bluetooth/btusb.c‎

Lines changed: 39 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,7 @@ static const struct usb_device_id blacklist_table[] = {
344344
/* Intel Bluetooth devices */
345345
{ USB_DEVICE(0x8087, 0x0025), .driver_info = BTUSB_INTEL_NEW },
346346
{ USB_DEVICE(0x8087, 0x0026), .driver_info = BTUSB_INTEL_NEW },
347+
{ USB_DEVICE(0x8087, 0x0029), .driver_info = BTUSB_INTEL_NEW },
347348
{ USB_DEVICE(0x8087, 0x07da), .driver_info = BTUSB_CSR },
348349
{ USB_DEVICE(0x8087, 0x07dc), .driver_info = BTUSB_INTEL },
349350
{ USB_DEVICE(0x8087, 0x0a2a), .driver_info = BTUSB_INTEL },
@@ -1935,10 +1936,8 @@ static void btusb_intel_bootup(struct btusb_data *data, const void *ptr,
19351936
if (len != sizeof(*evt))
19361937
return;
19371938

1938-
if (test_and_clear_bit(BTUSB_BOOTING, &data->flags)) {
1939-
smp_mb__after_atomic();
1939+
if (test_and_clear_bit(BTUSB_BOOTING, &data->flags))
19401940
wake_up_bit(&data->flags, BTUSB_BOOTING);
1941-
}
19421941
}
19431942

19441943
static void btusb_intel_secure_send_result(struct btusb_data *data,
@@ -1953,10 +1952,8 @@ static void btusb_intel_secure_send_result(struct btusb_data *data,
19531952
set_bit(BTUSB_FIRMWARE_FAILED, &data->flags);
19541953

19551954
if (test_and_clear_bit(BTUSB_DOWNLOADING, &data->flags) &&
1956-
test_bit(BTUSB_FIRMWARE_LOADED, &data->flags)) {
1957-
smp_mb__after_atomic();
1955+
test_bit(BTUSB_FIRMWARE_LOADED, &data->flags))
19581956
wake_up_bit(&data->flags, BTUSB_DOWNLOADING);
1959-
}
19601957
}
19611958

19621959
static int btusb_recv_event_intel(struct hci_dev *hdev, struct sk_buff *skb)
@@ -2055,6 +2052,35 @@ static int btusb_send_frame_intel(struct hci_dev *hdev, struct sk_buff *skb)
20552052
return -EILSEQ;
20562053
}
20572054

2055+
static bool btusb_setup_intel_new_get_fw_name(struct intel_version *ver,
2056+
struct intel_boot_params *params,
2057+
char *fw_name, size_t len,
2058+
const char *suffix)
2059+
{
2060+
switch (ver->hw_variant) {
2061+
case 0x0b: /* SfP */
2062+
case 0x0c: /* WsP */
2063+
snprintf(fw_name, len, "intel/ibt-%u-%u.%s",
2064+
le16_to_cpu(ver->hw_variant),
2065+
le16_to_cpu(params->dev_revid),
2066+
suffix);
2067+
break;
2068+
case 0x11: /* JfP */
2069+
case 0x12: /* ThP */
2070+
case 0x13: /* HrP */
2071+
case 0x14: /* CcP */
2072+
snprintf(fw_name, len, "intel/ibt-%u-%u-%u.%s",
2073+
le16_to_cpu(ver->hw_variant),
2074+
le16_to_cpu(ver->hw_revision),
2075+
le16_to_cpu(ver->fw_revision),
2076+
suffix);
2077+
break;
2078+
default:
2079+
return false;
2080+
}
2081+
return true;
2082+
}
2083+
20582084
static int btusb_setup_intel_new(struct hci_dev *hdev)
20592085
{
20602086
struct btusb_data *data = hci_get_drvdata(hdev);
@@ -2106,7 +2132,7 @@ static int btusb_setup_intel_new(struct hci_dev *hdev)
21062132
case 0x11: /* JfP */
21072133
case 0x12: /* ThP */
21082134
case 0x13: /* HrP */
2109-
case 0x14: /* QnJ, IcP */
2135+
case 0x14: /* CcP */
21102136
break;
21112137
default:
21122138
bt_dev_err(hdev, "Unsupported Intel hardware variant (%u)",
@@ -2190,23 +2216,9 @@ static int btusb_setup_intel_new(struct hci_dev *hdev)
21902216
* ibt-<hw_variant>-<hw_revision>-<fw_revision>.sfi.
21912217
*
21922218
*/
2193-
switch (ver.hw_variant) {
2194-
case 0x0b: /* SfP */
2195-
case 0x0c: /* WsP */
2196-
snprintf(fwname, sizeof(fwname), "intel/ibt-%u-%u.sfi",
2197-
le16_to_cpu(ver.hw_variant),
2198-
le16_to_cpu(params.dev_revid));
2199-
break;
2200-
case 0x11: /* JfP */
2201-
case 0x12: /* ThP */
2202-
case 0x13: /* HrP */
2203-
case 0x14: /* QnJ, IcP */
2204-
snprintf(fwname, sizeof(fwname), "intel/ibt-%u-%u-%u.sfi",
2205-
le16_to_cpu(ver.hw_variant),
2206-
le16_to_cpu(ver.hw_revision),
2207-
le16_to_cpu(ver.fw_revision));
2208-
break;
2209-
default:
2219+
err = btusb_setup_intel_new_get_fw_name(&ver, &params, fwname,
2220+
sizeof(fwname), "sfi");
2221+
if (!err) {
22102222
bt_dev_err(hdev, "Unsupported Intel firmware naming");
22112223
return -EINVAL;
22122224
}
@@ -2222,23 +2234,9 @@ static int btusb_setup_intel_new(struct hci_dev *hdev)
22222234
/* Save the DDC file name for later use to apply once the firmware
22232235
* downloading is done.
22242236
*/
2225-
switch (ver.hw_variant) {
2226-
case 0x0b: /* SfP */
2227-
case 0x0c: /* WsP */
2228-
snprintf(fwname, sizeof(fwname), "intel/ibt-%u-%u.ddc",
2229-
le16_to_cpu(ver.hw_variant),
2230-
le16_to_cpu(params.dev_revid));
2231-
break;
2232-
case 0x11: /* JfP */
2233-
case 0x12: /* ThP */
2234-
case 0x13: /* HrP */
2235-
case 0x14: /* QnJ, IcP */
2236-
snprintf(fwname, sizeof(fwname), "intel/ibt-%u-%u-%u.ddc",
2237-
le16_to_cpu(ver.hw_variant),
2238-
le16_to_cpu(ver.hw_revision),
2239-
le16_to_cpu(ver.fw_revision));
2240-
break;
2241-
default:
2237+
err = btusb_setup_intel_new_get_fw_name(&ver, &params, fwname,
2238+
sizeof(fwname), "ddc");
2239+
if (!err) {
22422240
bt_dev_err(hdev, "Unsupported Intel firmware naming");
22432241
return -EINVAL;
22442242
}

0 commit comments

Comments
 (0)