Skip to content

Commit ef17c3d

Browse files
committed
Merge tag 'for-net-next-2024-09-12' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next
Luiz Augusto von Dentz says: ==================== bluetooth-next pull request for net-next: - btusb: Add MediaTek MT7925-B22M support ID 0x13d3:0x3604 - btusb: Add Realtek RTL8852C support ID 0x0489:0xe122 - btrtl: Add the support for RTL8922A - btusb: Add 2 USB HW IDs for MT7925 (0xe118/e) - btnxpuart: Add support for ISO packets - btusb: Add Mediatek MT7925 support ID 0x13d3:0x3608 - btsdio: Do not bind to non-removable CYW4373 - hci_uart: Add support for Amlogic HCI UART * tag 'for-net-next-2024-09-12' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next: (27 commits) Bluetooth: btintel_pcie: Allocate memory for driver private data Bluetooth: btusb: Fix not handling ZPL/short-transfer Bluetooth: btusb: Add 2 USB HW IDs for MT7925 (0xe118/e) Bluetooth: btsdio: Do not bind to non-removable CYW4373 Bluetooth: hci_sync: Ignore errors from HCI_OP_REMOTE_NAME_REQ_CANCEL Bluetooth: CMTP: Mark BT_CMTP as DEPRECATED Bluetooth: replace deprecated strncpy with strscpy_pad Bluetooth: hci_core: Fix sending MGMT_EV_CONNECT_FAILED Bluetooth: btrtl: Set msft ext address filter quirk for RTL8852B Bluetooth: Use led_set_brightness() in LED trigger activate() callback Bluetooth: btrtl: Use kvmemdup to simplify the code Bluetooth: btusb: Add Mediatek MT7925 support ID 0x13d3:0x3608 Bluetooth: btrtl: Add the support for RTL8922A Bluetooth: hci_ldisc: Use speed set by btattach as oper_speed Bluetooth: hci_conn: Remove redundant memset after kzalloc Bluetooth: L2CAP: Remove unused declarations dt-bindings: bluetooth: bring the HW description closer to reality for wcn6855 Bluetooth: btnxpuart: Add support for ISO packets Bluetooth: hci_h4: Add support for ISO packets in h4_recv.h Bluetooth: btusb: Add Realtek RTL8852C support ID 0x0489:0xe122 ... ==================== Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2 parents 26d7460 + 7ffaa20 commit ef17c3d

File tree

23 files changed

+1037
-205
lines changed

23 files changed

+1037
-205
lines changed
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
# Copyright (C) 2024 Amlogic, Inc. All rights reserved
3+
%YAML 1.2
4+
---
5+
$id: http://devicetree.org/schemas/net/bluetooth/amlogic,w155s2-bt.yaml#
6+
$schema: http://devicetree.org/meta-schemas/core.yaml#
7+
8+
title: Amlogic Bluetooth chips
9+
10+
description:
11+
The W155S2 is an Amlogic Bluetooth and Wi-Fi combo chip. It works on
12+
the standard H4 protocol via a 4-wire UART interface, with baud rates
13+
up to 4 Mbps.
14+
15+
maintainers:
16+
- Yang Li <[email protected]>
17+
18+
properties:
19+
compatible:
20+
oneOf:
21+
- items:
22+
- enum:
23+
- amlogic,w265s1-bt
24+
- amlogic,w265p1-bt
25+
- const: amlogic,w155s2-bt
26+
- enum:
27+
- amlogic,w155s2-bt
28+
- amlogic,w265s2-bt
29+
30+
clocks:
31+
maxItems: 1
32+
description: clock provided to the controller (32.768KHz)
33+
34+
enable-gpios:
35+
maxItems: 1
36+
37+
vddio-supply:
38+
description: VDD_IO supply regulator handle
39+
40+
firmware-name:
41+
maxItems: 1
42+
description: specify the path of firmware bin to load
43+
44+
required:
45+
- compatible
46+
- clocks
47+
- enable-gpios
48+
- vddio-supply
49+
- firmware-name
50+
51+
additionalProperties: false
52+
53+
examples:
54+
- |
55+
#include <dt-bindings/gpio/gpio.h>
56+
bluetooth {
57+
compatible = "amlogic,w155s2-bt";
58+
clocks = <&extclk>;
59+
enable-gpios = <&gpio 17 GPIO_ACTIVE_HIGH>;
60+
vddio-supply = <&wcn_3v3>;
61+
firmware-name = "amlogic/aml_w155s2_bt_uart.bin";
62+
};
63+

Documentation/devicetree/bindings/net/bluetooth/qualcomm-bluetooth.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -172,14 +172,14 @@ allOf:
172172
- qcom,wcn6855-bt
173173
then:
174174
required:
175-
- enable-gpios
176-
- swctrl-gpios
177-
- vddio-supply
178-
- vddbtcxmx-supply
179175
- vddrfacmn-supply
176+
- vddaon-supply
177+
- vddwlcx-supply
178+
- vddwlmx-supply
179+
- vddbtcmx-supply
180180
- vddrfa0p8-supply
181181
- vddrfa1p2-supply
182-
- vddrfa1p7-supply
182+
- vddrfa1p8-supply
183183
- if:
184184
properties:
185185
compatible:

MAINTAINERS

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1153,6 +1153,13 @@ S: Supported
11531153
F: arch/arm64/boot/dts/amd/amd-seattle-xgbe*.dtsi
11541154
F: drivers/net/ethernet/amd/xgbe/
11551155

1156+
AMLOGIC BLUETOOTH DRIVER
1157+
M: Yang Li <[email protected]>
1158+
1159+
S: Maintained
1160+
F: Documentation/devicetree/bindings/net/bluetooth/amlogic,w155s2-bt.yaml
1161+
F: drivers/bluetooth/hci_aml.c
1162+
11561163
AMLOGIC DDR PMU DRIVER
11571164
M: Jiucheng Xu <[email protected]>
11581165

drivers/bluetooth/Kconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,18 @@ config BT_HCIUART_MRVL
274274

275275
Say Y here to compile support for HCI MRVL protocol.
276276

277+
config BT_HCIUART_AML
278+
bool "Amlogic protocol support"
279+
depends on BT_HCIUART
280+
depends on BT_HCIUART_SERDEV
281+
select BT_HCIUART_H4
282+
select FW_LOADER
283+
help
284+
The Amlogic protocol support enables Bluetooth HCI over serial
285+
port interface for Amlogic Bluetooth controllers.
286+
287+
Say Y here to compile support for HCI AML protocol.
288+
277289
config BT_HCIBCM203X
278290
tristate "HCI BCM203x USB driver"
279291
depends on USB

drivers/bluetooth/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,5 @@ hci_uart-$(CONFIG_BT_HCIUART_BCM) += hci_bcm.o
5151
hci_uart-$(CONFIG_BT_HCIUART_QCA) += hci_qca.o
5252
hci_uart-$(CONFIG_BT_HCIUART_AG6XX) += hci_ag6xx.o
5353
hci_uart-$(CONFIG_BT_HCIUART_MRVL) += hci_mrvl.o
54+
hci_uart-$(CONFIG_BT_HCIUART_AML) += hci_aml.o
5455
hci_uart-objs := $(hci_uart-y)

drivers/bluetooth/btintel_pcie.c

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ MODULE_DEVICE_TABLE(pci, btintel_pcie_table);
4646
#define BTINTEL_PCIE_HCI_ACL_PKT 0x00000002
4747
#define BTINTEL_PCIE_HCI_SCO_PKT 0x00000003
4848
#define BTINTEL_PCIE_HCI_EVT_PKT 0x00000004
49+
#define BTINTEL_PCIE_HCI_ISO_PKT 0x00000005
4950

5051
static inline void ipc_print_ia_ring(struct hci_dev *hdev, struct ia *ia,
5152
u16 queue_num)
@@ -423,6 +424,18 @@ static int btintel_pcie_recv_frame(struct btintel_pcie_data *data,
423424
goto exit_error;
424425
}
425426
break;
427+
428+
case BTINTEL_PCIE_HCI_ISO_PKT:
429+
if (skb->len >= HCI_ISO_HDR_SIZE) {
430+
plen = HCI_ISO_HDR_SIZE + __le16_to_cpu(hci_iso_hdr(skb)->dlen);
431+
pkt_type = HCI_ISODATA_PKT;
432+
} else {
433+
bt_dev_err(hdev, "ISO packet is too short");
434+
ret = -EILSEQ;
435+
goto exit_error;
436+
}
437+
break;
438+
426439
default:
427440
bt_dev_err(hdev, "Invalid packet type received: 0x%4.4x",
428441
pcie_pkt_type);
@@ -1082,6 +1095,9 @@ static int btintel_pcie_send_frame(struct hci_dev *hdev,
10821095
type = BTINTEL_PCIE_HCI_SCO_PKT;
10831096
hdev->stat.sco_tx++;
10841097
break;
1098+
case HCI_ISODATA_PKT:
1099+
type = BTINTEL_PCIE_HCI_ISO_PKT;
1100+
break;
10851101
default:
10861102
bt_dev_err(hdev, "Unknown HCI packet type");
10871103
return -EILSEQ;
@@ -1208,7 +1224,7 @@ static int btintel_pcie_setup_hdev(struct btintel_pcie_data *data)
12081224
int err;
12091225
struct hci_dev *hdev;
12101226

1211-
hdev = hci_alloc_dev();
1227+
hdev = hci_alloc_dev_priv(sizeof(struct btintel_data));
12121228
if (!hdev)
12131229
return -ENOMEM;
12141230

drivers/bluetooth/btnxpuart.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1412,6 +1412,7 @@ static const struct h4_recv_pkt nxp_recv_pkts[] = {
14121412
{ H4_RECV_ACL, .recv = hci_recv_frame },
14131413
{ H4_RECV_SCO, .recv = hci_recv_frame },
14141414
{ H4_RECV_EVENT, .recv = hci_recv_frame },
1415+
{ H4_RECV_ISO, .recv = hci_recv_frame },
14151416
{ NXP_RECV_CHIP_VER_V1, .recv = nxp_recv_chip_ver_v1 },
14161417
{ NXP_RECV_FW_REQ_V1, .recv = nxp_recv_fw_req_v1 },
14171418
{ NXP_RECV_CHIP_VER_V3, .recv = nxp_recv_chip_ver_v3 },

drivers/bluetooth/btrtl.c

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
#define RTL_ROM_LMP_8822B 0x8822
3131
#define RTL_ROM_LMP_8852A 0x8852
3232
#define RTL_ROM_LMP_8851B 0x8851
33+
#define RTL_ROM_LMP_8922A 0x8922
3334
#define RTL_CONFIG_MAGIC 0x8723ab55
3435

3536
#define RTL_VSC_OP_COREDUMP 0xfcff
@@ -69,6 +70,7 @@ enum btrtl_chip_id {
6970
CHIP_ID_8852B = 20,
7071
CHIP_ID_8852C = 25,
7172
CHIP_ID_8851B = 36,
73+
CHIP_ID_8922A = 44,
7274
CHIP_ID_8852BT = 47,
7375
};
7476

@@ -309,6 +311,15 @@ static const struct id_table ic_id_table[] = {
309311
.cfg_name = "rtl_bt/rtl8851bu_config",
310312
.hw_info = "rtl8851bu" },
311313

314+
/* 8922A */
315+
{ IC_INFO(RTL_ROM_LMP_8922A, 0xa, 0xc, HCI_USB),
316+
.config_needed = false,
317+
.has_rom_version = true,
318+
.has_msft_ext = true,
319+
.fw_name = "rtl_bt/rtl8922au_fw",
320+
.cfg_name = "rtl_bt/rtl8922au_config",
321+
.hw_info = "rtl8922au" },
322+
312323
/* 8852BT/8852BE-VT */
313324
{ IC_INFO(RTL_ROM_LMP_8852A, 0x87, 0xc, HCI_USB),
314325
.config_needed = false,
@@ -655,6 +666,7 @@ static int rtlbt_parse_firmware(struct hci_dev *hdev,
655666
{ RTL_ROM_LMP_8852A, 20 }, /* 8852B */
656667
{ RTL_ROM_LMP_8852A, 25 }, /* 8852C */
657668
{ RTL_ROM_LMP_8851B, 36 }, /* 8851B */
669+
{ RTL_ROM_LMP_8922A, 44 }, /* 8922A */
658670
{ RTL_ROM_LMP_8852A, 47 }, /* 8852BT */
659671
};
660672

@@ -878,10 +890,8 @@ static int rtl_load_file(struct hci_dev *hdev, const char *name, u8 **buff)
878890
if (ret < 0)
879891
return ret;
880892
ret = fw->size;
881-
*buff = kvmalloc(fw->size, GFP_KERNEL);
882-
if (*buff)
883-
memcpy(*buff, fw->data, ret);
884-
else
893+
*buff = kvmemdup(fw->data, fw->size, GFP_KERNEL);
894+
if (!*buff)
885895
ret = -ENOMEM;
886896

887897
release_firmware(fw);
@@ -1255,6 +1265,7 @@ int btrtl_download_firmware(struct hci_dev *hdev,
12551265
case RTL_ROM_LMP_8852A:
12561266
case RTL_ROM_LMP_8703B:
12571267
case RTL_ROM_LMP_8851B:
1268+
case RTL_ROM_LMP_8922A:
12581269
err = btrtl_setup_rtl8723b(hdev, btrtl_dev);
12591270
break;
12601271
default:
@@ -1286,6 +1297,7 @@ void btrtl_set_quirks(struct hci_dev *hdev, struct btrtl_device_info *btrtl_dev)
12861297
case CHIP_ID_8852B:
12871298
case CHIP_ID_8852C:
12881299
case CHIP_ID_8851B:
1300+
case CHIP_ID_8922A:
12891301
case CHIP_ID_8852BT:
12901302
set_bit(HCI_QUIRK_WIDEBAND_SPEECH_SUPPORTED, &hdev->quirks);
12911303

@@ -1296,6 +1308,7 @@ void btrtl_set_quirks(struct hci_dev *hdev, struct btrtl_device_info *btrtl_dev)
12961308
btrealtek_set_flag(hdev, REALTEK_ALT6_CONTINUOUS_TX_CHIP);
12971309

12981310
if (btrtl_dev->project_id == CHIP_ID_8852A ||
1311+
btrtl_dev->project_id == CHIP_ID_8852B ||
12991312
btrtl_dev->project_id == CHIP_ID_8852C)
13001313
set_bit(HCI_QUIRK_USE_MSFT_EXT_ADDRESS_FILTER, &hdev->quirks);
13011314

@@ -1528,3 +1541,5 @@ MODULE_FIRMWARE("rtl_bt/rtl8852btu_config.bin");
15281541
MODULE_FIRMWARE("rtl_bt/rtl8852cu_fw.bin");
15291542
MODULE_FIRMWARE("rtl_bt/rtl8852cu_fw_v2.bin");
15301543
MODULE_FIRMWARE("rtl_bt/rtl8852cu_config.bin");
1544+
MODULE_FIRMWARE("rtl_bt/rtl8922au_fw.bin");
1545+
MODULE_FIRMWARE("rtl_bt/rtl8922au_config.bin");

drivers/bluetooth/btsdio.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,7 @@ static int btsdio_probe(struct sdio_func *func,
295295
case SDIO_DEVICE_ID_BROADCOM_4345:
296296
case SDIO_DEVICE_ID_BROADCOM_43455:
297297
case SDIO_DEVICE_ID_BROADCOM_4356:
298+
case SDIO_DEVICE_ID_BROADCOM_CYPRESS_4373:
298299
return -ENODEV;
299300
}
300301
}

0 commit comments

Comments
 (0)