Skip to content

Commit

Permalink
Merge tag 'for-net-next-2023-04-23' 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

bluetooth-next pull request for net-next:

 - Introduce devcoredump support
 - Add support for Realtek RTL8821CS, RTL8851B, RTL8852BS
 - Add support for Mediatek MT7663, MT7922
 - Add support for NXP w8997
 - Add support for Actions Semi ATS2851
 - Add support for QTI WCN6855
 - Add support for Marvell 88W8997
  • Loading branch information
David S. Miller committed Apr 24, 2023
2 parents fd84c56 + d883a46 commit 2efb07b
Showing 50 changed files with 4,122 additions and 516 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/net/bluetooth/nxp,88w8987-bt.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: NXP Bluetooth chips

description:
This binding describes UART-attached NXP bluetooth chips. These chips
are dual-radio chips supporting WiFi and Bluetooth. The bluetooth
works on standard H4 protocol over 4-wire UART. The RTS and CTS lines
are used during FW download. To enable power save mode, the host
asserts break signal over UART-TX line to put the chip into power save
state. De-asserting break wakes up the BT chip.

maintainers:
- Neeraj Sanjay Kale <neeraj.sanjaykale@nxp.com>

properties:
compatible:
enum:
- nxp,88w8987-bt
- nxp,88w8997-bt

fw-init-baudrate:
description:
Chip baudrate after FW is downloaded and initialized.
This property depends on the module vendor's
configuration. If this property is not specified,
115200 is set as default.

required:
- compatible

additionalProperties: false

examples:
- |
serial {
bluetooth {
compatible = "nxp,88w8987-bt";
fw-init-baudrate = <3000000>;
};
};
Original file line number Diff line number Diff line change
@@ -23,6 +23,7 @@ properties:
- qcom,wcn3998-bt
- qcom,qca6390-bt
- qcom,wcn6750-bt
- qcom,wcn6855-bt

enable-gpios:
maxItems: 1
@@ -133,6 +134,22 @@ allOf:
- vddrfa1p7-supply
- vddrfa1p2-supply
- vddasd-supply
- if:
properties:
compatible:
contains:
enum:
- qcom,wcn6855-bt
then:
required:
- enable-gpios
- swctrl-gpios
- vddio-supply
- vddbtcxmx-supply
- vddrfacmn-supply
- vddrfa0p8-supply
- vddrfa1p2-supply
- vddrfa1p7-supply

examples:
- |
20 changes: 19 additions & 1 deletion Documentation/devicetree/bindings/net/marvell-bluetooth.yaml
Original file line number Diff line number Diff line change
@@ -15,11 +15,29 @@ maintainers:

properties:
compatible:
const: mrvl,88w8897
enum:
- mrvl,88w8897
- mrvl,88w8997

max-speed:
description: see Documentation/devicetree/bindings/serial/serial.yaml

required:
- compatible

allOf:
- if:
properties:
compatible:
contains:
const: mrvl,88w8997
then:
properties:
max-speed: true
else:
properties:
max-speed: false

additionalProperties: false

examples:
24 changes: 15 additions & 9 deletions Documentation/devicetree/bindings/net/realtek-bluetooth.yaml
Original file line number Diff line number Diff line change
@@ -4,24 +4,30 @@
$id: http://devicetree.org/schemas/net/realtek-bluetooth.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: RTL8723BS/RTL8723CS/RTL8822CS Bluetooth
title: RTL8723BS/RTL8723CS/RTL8821CS/RTL8822CS Bluetooth

maintainers:
- Vasily Khoruzhick <anarsoul@gmail.com>
- Alistair Francis <alistair@alistair23.me>

description:
RTL8723CS/RTL8723CS/RTL8822CS is WiFi + BT chip. WiFi part is connected over
SDIO, while BT is connected over serial. It speaks H5 protocol with few
extra commands to upload firmware and change module speed.
RTL8723CS/RTL8723CS/RTL8821CS/RTL8822CS is a WiFi + BT chip. WiFi part
is connected over SDIO, while BT is connected over serial. It speaks
H5 protocol with few extra commands to upload firmware and change
module speed.

properties:
compatible:
enum:
- realtek,rtl8723bs-bt
- realtek,rtl8723cs-bt
- realtek,rtl8723ds-bt
- realtek,rtl8822cs-bt
oneOf:
- enum:
- realtek,rtl8723bs-bt
- realtek,rtl8723cs-bt
- realtek,rtl8723ds-bt
- realtek,rtl8822cs-bt
- items:
- enum:
- realtek,rtl8821cs-bt
- const: realtek,rtl8822cs-bt

device-wake-gpios:
maxItems: 1
7 changes: 7 additions & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
@@ -23237,6 +23237,13 @@ L: linux-mm@kvack.org
S: Maintained
F: mm/zswap.c

NXP BLUETOOTH WIRELESS DRIVERS
M: Amitkumar Karwar <amitkumar.karwar@nxp.com>
M: Neeraj Kale <neeraj.sanjaykale@nxp.com>
S: Maintained
F: Documentation/devicetree/bindings/net/bluetooth/nxp,88w8987-bt.yaml
F: drivers/bluetooth/btnxpuart.c

THE REST
M: Linus Torvalds <torvalds@linux-foundation.org>
L: linux-kernel@vger.kernel.org
2 changes: 1 addition & 1 deletion arch/arm64/boot/dts/rockchip/rk3566-anbernic-rgxx3.dtsi
Original file line number Diff line number Diff line change
@@ -716,7 +716,7 @@
status = "okay";

bluetooth {
compatible = "realtek,rtl8821cs-bt";
compatible = "realtek,rtl8821cs-bt", "realtek,rtl8822cs-bt";
device-wake-gpios = <&gpio4 4 GPIO_ACTIVE_HIGH>;
enable-gpios = <&gpio4 3 GPIO_ACTIVE_HIGH>;
host-wake-gpios = <&gpio4 5 GPIO_ACTIVE_HIGH>;
14 changes: 14 additions & 0 deletions drivers/bluetooth/Kconfig
Original file line number Diff line number Diff line change
@@ -363,6 +363,7 @@ config BT_HCIBLUECARD

config BT_HCIVHCI
tristate "HCI VHCI (Virtual HCI device) driver"
select WANT_DEV_COREDUMP
help
Bluetooth Virtual HCI device driver.
This driver is required if you want to use HCI Emulation software.
@@ -465,4 +466,17 @@ config BT_VIRTIO
Say Y here to compile support for HCI over Virtio into the
kernel or say M to compile as a module.

config BT_NXPUART
tristate "NXP protocol support"
depends on SERIAL_DEV_BUS
select CRC32
select CRC8
help
NXP is serial driver required for NXP Bluetooth
devices with UART interface.

Say Y here to compile support for NXP Bluetooth UART device into
the kernel, or say M here to compile as a module (btnxpuart).


endmenu
1 change: 1 addition & 0 deletions drivers/bluetooth/Makefile
Original file line number Diff line number Diff line change
@@ -29,6 +29,7 @@ obj-$(CONFIG_BT_QCA) += btqca.o
obj-$(CONFIG_BT_MTK) += btmtk.o

obj-$(CONFIG_BT_VIRTIO) += virtio_bt.o
obj-$(CONFIG_BT_NXPUART) += btnxpuart.o

obj-$(CONFIG_BT_HCIUART_NOKIA) += hci_nokia.o

47 changes: 44 additions & 3 deletions drivers/bluetooth/btbcm.c
Original file line number Diff line number Diff line change
@@ -6,6 +6,7 @@
* Copyright (C) 2015 Intel Corporation
*/

#include <linux/efi.h>
#include <linux/module.h>
#include <linux/firmware.h>
#include <linux/dmi.h>
@@ -34,6 +35,43 @@
/* For kmalloc-ing the fw-name array instead of putting it on the stack */
typedef char bcm_fw_name[BCM_FW_NAME_LEN];

#ifdef CONFIG_EFI
static int btbcm_set_bdaddr_from_efi(struct hci_dev *hdev)
{
efi_guid_t guid = EFI_GUID(0x74b00bd9, 0x805a, 0x4d61, 0xb5, 0x1f,
0x43, 0x26, 0x81, 0x23, 0xd1, 0x13);
bdaddr_t efi_bdaddr, bdaddr;
efi_status_t status;
unsigned long len;
int ret;

if (!efi_rt_services_supported(EFI_RT_SUPPORTED_GET_VARIABLE))
return -EOPNOTSUPP;

len = sizeof(efi_bdaddr);
status = efi.get_variable(L"BDADDR", &guid, NULL, &len, &efi_bdaddr);
if (status != EFI_SUCCESS)
return -ENXIO;

if (len != sizeof(efi_bdaddr))
return -EIO;

baswap(&bdaddr, &efi_bdaddr);

ret = btbcm_set_bdaddr(hdev, &bdaddr);
if (ret)
return ret;

bt_dev_info(hdev, "BCM: Using EFI device address (%pMR)", &bdaddr);
return 0;
}
#else
static int btbcm_set_bdaddr_from_efi(struct hci_dev *hdev)
{
return -EOPNOTSUPP;
}
#endif

int btbcm_check_bdaddr(struct hci_dev *hdev)
{
struct hci_rp_read_bd_addr *bda;
@@ -87,9 +125,12 @@ int btbcm_check_bdaddr(struct hci_dev *hdev)
!bacmp(&bda->bdaddr, BDADDR_BCM4345C5) ||
!bacmp(&bda->bdaddr, BDADDR_BCM43430A0) ||
!bacmp(&bda->bdaddr, BDADDR_BCM43341B)) {
bt_dev_info(hdev, "BCM: Using default device address (%pMR)",
&bda->bdaddr);
set_bit(HCI_QUIRK_INVALID_BDADDR, &hdev->quirks);
/* Try falling back to BDADDR EFI variable */
if (btbcm_set_bdaddr_from_efi(hdev) != 0) {
bt_dev_info(hdev, "BCM: Using default device address (%pMR)",
&bda->bdaddr);
set_bit(HCI_QUIRK_INVALID_BDADDR, &hdev->quirks);
}
}

kfree_skb(skb);
Loading

0 comments on commit 2efb07b

Please sign in to comment.