Skip to content

Commit

Permalink
Merge tag 'for-net-next-2024-05-14' of git://git.kernel.org/pub/scm/l…
Browse files Browse the repository at this point in the history
…inux/kernel/git/bluetooth/bluetooth-next

Luiz Augusto von Dentz says:

====================
bluetooth-next pull request for net-next:

 - Add support MediaTek MT7921S SDIO
 - Various fixes for -Wflex-array-member-not-at-end and -Wfamnae
 - Add USB HW IDs for MT7921/MT7922/MT7925
 - Add support for Intel BlazarI and Filmore Peak2 (BE201)
 - Add initial support for Intel PCIe driver
 - Remove HCI_AMP support

* tag 'for-net-next-2024-05-14' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next: (47 commits)
  Bluetooth: btintel_pcie: Refactor and code cleanup
  Bluetooth: btintel_pcie: Fix warning reported by sparse
  Bluetooth: hci_core: Fix not handling hdev->le_num_of_adv_sets=1
  Bluetooth: btintel: Fix compiler warning for multi_v7_defconfig config
  Bluetooth: btintel_pcie: Fix compiler warnings
  Bluetooth: btintel_pcie: Add *setup* function to download firmware
  Bluetooth: btintel_pcie: Add support for PCIe transport
  Bluetooth: btintel: Export few static functions
  Bluetooth: HCI: Remove HCI_AMP support
  Bluetooth: L2CAP: Fix div-by-zero in l2cap_le_flowctl_init()
  Bluetooth: qca: Fix error code in qca_read_fw_build_info()
  Bluetooth: hci_conn: Use __counted_by() and avoid -Wfamnae warning
  Bluetooth: btintel: Add support for Filmore Peak2 (BE201)
  Bluetooth: btintel: Add support for BlazarI
  LE Create Connection command timeout increased to 20 secs
  dt-bindings: net: bluetooth: Add MediaTek MT7921S SDIO Bluetooth
  Bluetooth: compute LE flow credits based on recvbuf space
  Bluetooth: hci_sync: Use cmd->num_cis instead of magic number
  Bluetooth: hci_conn: Use struct_size() in hci_le_big_create_sync()
  Bluetooth: qca: clean up defines
  ...
====================

Link: https://lore.kernel.org/r/20240514150206.606432-1-luiz.dentz@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Jakub Kicinski committed May 14, 2024
2 parents 5c16727 + 6a486c1 commit 79982e8
Show file tree
Hide file tree
Showing 42 changed files with 2,651 additions and 1,141 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/net/bluetooth/mediatek,mt7921s-bluetooth.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: MediaTek MT7921S Bluetooth

maintainers:
- Sean Wang <sean.wang@mediatek.com>

description:
MT7921S is an SDIO-attached dual-radio WiFi+Bluetooth Combo chip; each
function is its own SDIO function on a shared SDIO interface. The chip
has two dedicated reset lines, one for each function core.
This binding only covers the Bluetooth SDIO function, with one device
node describing only this SDIO function.

allOf:
- $ref: bluetooth-controller.yaml#

properties:
compatible:
enum:
- mediatek,mt7921s-bluetooth

reg:
const: 2

reset-gpios:
maxItems: 1
description:
An active-low reset line for the Bluetooth core; on typical M.2
key E modules this is the W_DISABLE2# pin.

required:
- compatible
- reg

unevaluatedProperties: false

examples:
- |
#include <dt-bindings/gpio/gpio.h>
mmc {
#address-cells = <1>;
#size-cells = <0>;
bluetooth@2 {
compatible = "mediatek,mt7921s-bluetooth";
reg = <2>;
reset-gpios = <&pio 8 GPIO_ACTIVE_LOW>;
};
};
33 changes: 19 additions & 14 deletions Documentation/devicetree/bindings/net/broadcom-bluetooth.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,25 @@ description:

properties:
compatible:
enum:
- brcm,bcm20702a1
- brcm,bcm4329-bt
- brcm,bcm4330-bt
- brcm,bcm4334-bt
- brcm,bcm43430a0-bt
- brcm,bcm43430a1-bt
- brcm,bcm43438-bt
- brcm,bcm4345c5
- brcm,bcm43540-bt
- brcm,bcm4335a0
- brcm,bcm4349-bt
- cypress,cyw4373a0-bt
- infineon,cyw55572-bt
oneOf:
- items:
- enum:
- infineon,cyw43439-bt
- const: brcm,bcm4329-bt
- enum:
- brcm,bcm20702a1
- brcm,bcm4329-bt
- brcm,bcm4330-bt
- brcm,bcm4334-bt
- brcm,bcm43430a0-bt
- brcm,bcm43430a1-bt
- brcm,bcm43438-bt
- brcm,bcm4345c5
- brcm,bcm43540-bt
- brcm,bcm4335a0
- brcm,bcm4349-bt
- cypress,cyw4373a0-bt
- infineon,cyw55572-bt

shutdown-gpios:
maxItems: 1
Expand Down
1 change: 1 addition & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -13763,6 +13763,7 @@ M: Sean Wang <sean.wang@mediatek.com>
L: linux-bluetooth@vger.kernel.org
L: linux-mediatek@lists.infradead.org (moderated for non-subscribers)
S: Maintained
F: Documentation/devicetree/bindings/net/bluetooth/mediatek,mt7921s-bluetooth.yaml
F: Documentation/devicetree/bindings/net/mediatek-bluetooth.txt
F: drivers/bluetooth/btmtkuart.c

Expand Down
11 changes: 11 additions & 0 deletions drivers/bluetooth/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -478,5 +478,16 @@ config BT_NXPUART
Say Y here to compile support for NXP Bluetooth UART device into
the kernel, or say M here to compile as a module (btnxpuart).

config BT_INTEL_PCIE
tristate "Intel HCI PCIe driver"
depends on PCI
select BT_INTEL
select FW_LOADER
help
Intel Bluetooth transport driver for PCIe.
This driver is required if you want to use Intel Bluetooth device
with PCIe interface.

Say Y here to compiler support for Intel Bluetooth PCIe device into
the kernel or say M to compile it as module (btintel_pcie)
endmenu
1 change: 1 addition & 0 deletions drivers/bluetooth/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ obj-$(CONFIG_BT_HCIBTUSB) += btusb.o
obj-$(CONFIG_BT_HCIBTSDIO) += btsdio.o

obj-$(CONFIG_BT_INTEL) += btintel.o
obj-$(CONFIG_BT_INTEL_PCIE) += btintel_pcie.o btintel.o
obj-$(CONFIG_BT_ATH3K) += ath3k.o
obj-$(CONFIG_BT_MRVL) += btmrvl.o
obj-$(CONFIG_BT_MRVL_SDIO) += btmrvl_sdio.o
Expand Down
25 changes: 11 additions & 14 deletions drivers/bluetooth/ath3k.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
* Copyright (c) 2008-2009 Atheros Communications Inc.
*/


#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/init.h>
Expand Down Expand Up @@ -128,7 +127,6 @@ MODULE_DEVICE_TABLE(usb, ath3k_table);
* for AR3012
*/
static const struct usb_device_id ath3k_blist_tbl[] = {

/* Atheros AR3012 with sflash firmware*/
{ USB_DEVICE(0x0489, 0xe04e), .driver_info = BTUSB_ATH3012 },
{ USB_DEVICE(0x0489, 0xe04d), .driver_info = BTUSB_ATH3012 },
Expand Down Expand Up @@ -202,7 +200,7 @@ static inline void ath3k_log_failed_loading(int err, int len, int size,
#define TIMEGAP_USEC_MAX 100

static int ath3k_load_firmware(struct usb_device *udev,
const struct firmware *firmware)
const struct firmware *firmware)
{
u8 *send_buf;
int len = 0;
Expand Down Expand Up @@ -237,9 +235,9 @@ static int ath3k_load_firmware(struct usb_device *udev,
memcpy(send_buf, firmware->data + sent, size);

err = usb_bulk_msg(udev, pipe, send_buf, size,
&len, 3000);
&len, 3000);

if (err || (len != size)) {
if (err || len != size) {
ath3k_log_failed_loading(err, len, size, count);
goto error;
}
Expand All @@ -262,7 +260,7 @@ static int ath3k_get_state(struct usb_device *udev, unsigned char *state)
}

static int ath3k_get_version(struct usb_device *udev,
struct ath3k_version *version)
struct ath3k_version *version)
{
return usb_control_msg_recv(udev, 0, ATH3K_GETVERSION,
USB_TYPE_VENDOR | USB_DIR_IN, 0, 0,
Expand All @@ -271,7 +269,7 @@ static int ath3k_get_version(struct usb_device *udev,
}

static int ath3k_load_fwfile(struct usb_device *udev,
const struct firmware *firmware)
const struct firmware *firmware)
{
u8 *send_buf;
int len = 0;
Expand Down Expand Up @@ -310,8 +308,8 @@ static int ath3k_load_fwfile(struct usb_device *udev,
memcpy(send_buf, firmware->data + sent, size);

err = usb_bulk_msg(udev, pipe, send_buf, size,
&len, 3000);
if (err || (len != size)) {
&len, 3000);
if (err || len != size) {
ath3k_log_failed_loading(err, len, size, count);
kfree(send_buf);
return err;
Expand Down Expand Up @@ -425,7 +423,6 @@ static int ath3k_load_syscfg(struct usb_device *udev)
}

switch (fw_version.ref_clock) {

case ATH3K_XTAL_FREQ_26M:
clk_value = 26;
break;
Expand All @@ -441,7 +438,7 @@ static int ath3k_load_syscfg(struct usb_device *udev)
}

snprintf(filename, ATH3K_NAME_LEN, "ar3k/ramps_0x%08x_%d%s",
le32_to_cpu(fw_version.rom_version), clk_value, ".dfu");
le32_to_cpu(fw_version.rom_version), clk_value, ".dfu");

ret = request_firmware(&firmware, filename, &udev->dev);
if (ret < 0) {
Expand All @@ -456,7 +453,7 @@ static int ath3k_load_syscfg(struct usb_device *udev)
}

static int ath3k_probe(struct usb_interface *intf,
const struct usb_device_id *id)
const struct usb_device_id *id)
{
const struct firmware *firmware;
struct usb_device *udev = interface_to_usbdev(intf);
Expand Down Expand Up @@ -505,10 +502,10 @@ static int ath3k_probe(struct usb_interface *intf,
if (ret < 0) {
if (ret == -ENOENT)
BT_ERR("Firmware file \"%s\" not found",
ATH3K_FIRMWARE);
ATH3K_FIRMWARE);
else
BT_ERR("Firmware file \"%s\" request failed (err=%d)",
ATH3K_FIRMWARE, ret);
ATH3K_FIRMWARE, ret);
return ret;
}

Expand Down
Loading

0 comments on commit 79982e8

Please sign in to comment.