Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bluetooth: HCI: Use lower-case values for bus and quirks in devicetree #79878

Merged
merged 2 commits into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions doc/releases/migration-guide-4.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,9 @@ Bluetooth
Bluetooth HCI
=============

* The ``bt-hci-bus`` and ``bt-hci-quirks`` devicetree properties for HCI bindings have been changed
to use lower-case strings without the ``BT_HCI_QUIRK_`` and ``BT_HCI_BUS_`` prefixes.

Bluetooth Mesh
==============

Expand Down
2 changes: 1 addition & 1 deletion dts/bindings/bluetooth/ambiq,bt-hci-spi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ properties:
default: "ambiq hci"

bt-hci-bus:
default: "BT_HCI_BUS_SPI"
default: "spi"
23 changes: 13 additions & 10 deletions dts/bindings/bluetooth/bt-hci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,22 @@ properties:
type: string
description: Bus of the transport
enum:
- "BT_HCI_BUS_VIRTUAL"
- "BT_HCI_BUS_USB"
- "BT_HCI_BUS_PCCARD"
- "BT_HCI_BUS_UART"
- "BT_HCI_BUS_RS232"
- "BT_HCI_BUS_PCI"
- "BT_HCI_BUS_SDIO"
- "BT_HCI_BUS_SPI"
- "BT_HCI_BUS_I2C"
- "BT_HCI_BUS_IPM"
- "virtual"
- "usb"
- "pccard"
- "uart"
- "rs232"
- "pci"
- "sdio"
- "spi"
- "i2c"
- "ipm"
bt-hci-quirks:
type: string-array
description: HCI device quirks
enum:
- "no-reset"
- "no-auto-dle"
bt-hci-vs-ext:
type: boolean
description: Zephyr HCI vendor extensions are supported
4 changes: 2 additions & 2 deletions dts/bindings/bluetooth/espressif,esp32-bt-hci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ properties:
bt-hci-name:
default: "BT ESP32"
bt-hci-bus:
default: "BT_HCI_BUS_IPM"
default: "ipm"
bt-hci-quirks:
default: ["BT_HCI_QUIRK_NO_AUTO_DLE"]
default: ["no-auto-dle"]
4 changes: 2 additions & 2 deletions dts/bindings/bluetooth/infineon,cat1-bless-hci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ properties:
bt-hci-name:
default: "PSoC 6 BLESS"
bt-hci-bus:
default: "BT_HCI_BUS_VIRTUAL"
default: "virtual"
bt-hci-quirks:
default: ["BT_HCI_QUIRK_NO_RESET"]
default: ["no-reset"]
interrupts:
required: true
2 changes: 1 addition & 1 deletion dts/bindings/bluetooth/infineon,cyw208xx-hci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ properties:
bt-hci-name:
default: "CYW208XX"
bt-hci-bus:
default: "BT_HCI_BUS_VIRTUAL"
default: "virtual"
2 changes: 1 addition & 1 deletion dts/bindings/bluetooth/nxp,hci-ble.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ properties:
bt-hci-name:
default: "BT NXP"
bt-hci-bus:
default: "BT_HCI_BUS_IPM"
default: "ipm"
2 changes: 1 addition & 1 deletion dts/bindings/bluetooth/renesas,bt-hci-da1469x.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ properties:
bt-hci-name:
default: "BT DA1469x"
bt-hci-bus:
default: "BT_HCI_BUS_IPM"
default: "ipm"
4 changes: 2 additions & 2 deletions dts/bindings/bluetooth/silabs,bt-hci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ properties:
bt-hci-name:
default: "sl:bt"
bt-hci-bus:
default: "BT_HCI_BUS_VIRTUAL"
default: "virtual"
bt-hci-quirks:
default: ["BT_HCI_QUIRK_NO_RESET"]
default: ["no-reset"]
2 changes: 1 addition & 1 deletion dts/bindings/bluetooth/st,hci-spi-v1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ include: zephyr,bt-hci-spi.yaml

properties:
bt-hci-quirks:
default: ["BT_HCI_QUIRK_NO_RESET"]
default: ["no-reset"]
2 changes: 1 addition & 1 deletion dts/bindings/bluetooth/st,hci-spi-v2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ include: zephyr,bt-hci-spi.yaml

properties:
bt-hci-quirks:
default: ["BT_HCI_QUIRK_NO_RESET"]
default: ["no-reset"]
2 changes: 1 addition & 1 deletion dts/bindings/bluetooth/st,hci-stm32wba.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ properties:
bt-hci-name:
default: "BT IPM"
bt-hci-bus:
default: "BT_HCI_BUS_IPM"
default: "ipm"
2 changes: 1 addition & 1 deletion dts/bindings/bluetooth/st,stm32wb-ble-rf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ properties:
bt-hci-name:
default: "BT IPM"
bt-hci-bus:
default: "BT_HCI_BUS_IPM"
default: "ipm"
2 changes: 1 addition & 1 deletion dts/bindings/bluetooth/zephyr,bt-hci-3wire-uart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ properties:
bt-hci-name:
default: "H:5"
bt-hci-bus:
default: "BT_HCI_BUS_UART"
default: "uart"
4 changes: 2 additions & 2 deletions dts/bindings/bluetooth/zephyr,bt-hci-ipc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ properties:
bt-hci-name:
default: "IPC"
bt-hci-bus:
default: "BT_HCI_BUS_IPM"
default: "ipm"
bt-hci-quirks:
default: ["BT_HCI_QUIRK_NO_AUTO_DLE"]
default: ["no-auto-dle"]
bt-hci-ipc-name:
type: string
default: "nrf_bt_hci"
Expand Down
4 changes: 2 additions & 2 deletions dts/bindings/bluetooth/zephyr,bt-hci-ll-sw-split.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ properties:
bt-hci-name:
default: "Controller"
bt-hci-bus:
default: "BT_HCI_BUS_VIRTUAL"
default: "virtual"
bt-hci-quirks:
default: ["BT_HCI_QUIRK_NO_AUTO_DLE"]
default: ["no-auto-dle"]
2 changes: 1 addition & 1 deletion dts/bindings/bluetooth/zephyr,bt-hci-spi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ properties:
default: "SPI"

bt-hci-bus:
default: "BT_HCI_BUS_SPI"
default: "spi"
2 changes: 1 addition & 1 deletion dts/bindings/bluetooth/zephyr,bt-hci-uart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ properties:
bt-hci-name:
default: "H:4"
bt-hci-bus:
default: "BT_HCI_BUS_UART"
default: "uart"
2 changes: 1 addition & 1 deletion dts/bindings/bluetooth/zephyr,bt-hci-userchan.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ properties:
bt-hci-name:
default: "HCI User Channel"
bt-hci-bus:
default: "BT_HCI_BUS_UART"
default: "uart"
6 changes: 4 additions & 2 deletions include/zephyr/drivers/bluetooth.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@
BT_HCI_BUS_IPM = 9,
};

#define BT_DT_HCI_QUIRK_OR(node_id, prop, idx) DT_STRING_TOKEN_BY_IDX(node_id, prop, idx)
#define BT_DT_HCI_QUIRK_OR(node_id, prop, idx) \
UTIL_CAT(BT_HCI_QUIRK_, DT_STRING_UPPER_TOKEN_BY_IDX(node_id, prop, idx))

Check notice on line 76 in include/zephyr/drivers/bluetooth.h

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

You may want to run clang-format on this change

include/zephyr/drivers/bluetooth.h:76 -#define BT_DT_HCI_QUIRK_OR(node_id, prop, idx) \ +#define BT_DT_HCI_QUIRK_OR(node_id, prop, idx) \
#define BT_DT_HCI_QUIRKS_GET(node_id) COND_CODE_1(DT_NODE_HAS_PROP(node_id, bt_hci_quirks), \
(DT_FOREACH_PROP_ELEM_SEP(node_id, \
bt_hci_quirks, \
Expand All @@ -84,7 +85,8 @@
#define BT_DT_HCI_NAME_GET(node_id) DT_PROP_OR(node_id, bt_hci_name, "HCI")
#define BT_DT_HCI_NAME_INST_GET(inst) BT_DT_HCI_NAME_GET(DT_DRV_INST(inst))

#define BT_DT_HCI_BUS_GET(node_id) DT_STRING_TOKEN_OR(node_id, bt_hci_bus, BT_HCI_BUS_VIRTUAL)
#define BT_DT_HCI_BUS_GET(node_id) \
UTIL_CAT(BT_HCI_BUS_, DT_STRING_UPPER_TOKEN_OR(node_id, bt_hci_bus, VIRTUAL))

Check notice on line 89 in include/zephyr/drivers/bluetooth.h

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

You may want to run clang-format on this change

include/zephyr/drivers/bluetooth.h:89 -#define BT_DT_HCI_BUS_GET(node_id) \ +#define BT_DT_HCI_BUS_GET(node_id) \
#define BT_DT_HCI_BUS_INST_GET(inst) BT_DT_HCI_BUS_GET(DT_DRV_INST(inst))

typedef int (*bt_hci_recv_t)(const struct device *dev, struct net_buf *buf);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ properties:
bt-hci-name:
default: "test"
bt-hci-bus:
default: "BT_HCI_BUS_VIRTUAL"
default: "virtual"
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ properties:
bt-hci-name:
default: "test"
bt-hci-bus:
default: "BT_HCI_BUS_VIRTUAL"
default: "virtual"
bt-hci-quirks:
default: ["BT_HCI_QUIRK_NO_RESET"]
default: ["no-reset"]
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ properties:
bt-hci-name:
default: "Mock Controller"
bt-hci-bus:
default: "BT_HCI_BUS_VIRTUAL"
default: "virtual"
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ properties:
bt-hci-name:
default: "test"
bt-hci-bus:
default: "BT_HCI_BUS_VIRTUAL"
default: "virtual"
bt-hci-quirks:
default: ["BT_HCI_QUIRK_NO_RESET"]
default: ["no-reset"]
Loading