Skip to content

Commit 573c18f

Browse files
JordanYateshenrikbrixandersen
authored andcommitted
bluetooth: hci: dedicated symbols for SPI variants
Add dedicated Kconfig symbols for the two SPI backend variants. This allows enabling the symbols by default from devicetree, and cleans up the cmake logic. Signed-off-by: Jordan Yates <[email protected]>
1 parent 5e41249 commit 573c18f

File tree

2 files changed

+35
-25
lines changed

2 files changed

+35
-25
lines changed

drivers/bluetooth/hci/CMakeLists.txt

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,8 @@ endif()
2020
zephyr_library_sources_ifdef(CONFIG_BT_H4 h4.c)
2121
zephyr_library_sources_ifdef(CONFIG_BT_H5 h5.c)
2222
zephyr_library_sources_ifdef(CONFIG_BT_HCI_IPC ipc.c)
23-
if(CONFIG_BT_SPI)
24-
if ((CONFIG_DT_HAS_ST_HCI_SPI_V1_ENABLED) OR (CONFIG_DT_HAS_ST_HCI_SPI_V2_ENABLED))
25-
zephyr_library_sources(hci_spi_st.c)
26-
else()
27-
zephyr_library_sources(spi.c)
28-
endif()
29-
endif()
23+
zephyr_library_sources_ifdef(CONFIG_BT_SPI_ZEPHYR spi.c)
24+
zephyr_library_sources_ifdef(CONFIG_BT_SPI_BLUENRG hci_spi_st.c)
3025
zephyr_library_sources_ifdef(CONFIG_BT_CYW43XX h4_ifx_cyw43xxx.c)
3126
zephyr_library_sources_ifdef(CONFIG_BT_CYW208XX hci_ifx_cyw208xx.c)
3227

drivers/bluetooth/hci/Kconfig

Lines changed: 33 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,46 @@ config BT_HCI_IPC
4848
using the IPC subsystem.
4949

5050
config BT_SPI
51-
bool "SPI HCI"
51+
bool
5252
select SPI
5353
help
5454
Supports Bluetooth ICs using SPI as the communication protocol.
5555
HCI packets are sent and received as single Byte transfers,
56-
prepended after a known header. Headers may vary per device, so
56+
prepended after a known header. Headers may vary per device, so
5757
additional platform specific knowledge may need to be added as
5858
devices are.
5959

60+
config BT_SPI_INIT_PRIORITY
61+
int "BT SPI init priority"
62+
depends on BT_SPI
63+
default 75
64+
65+
config BT_SPI_ZEPHYR
66+
bool
67+
default y
68+
depends on DT_HAS_ZEPHYR_BT_HCI_SPI_ENABLED
69+
select BT_SPI
70+
help
71+
Bluetooth HCI over SPI driver for communication with Bluetooth
72+
controllers running Zephyr.
73+
74+
config BT_SPI_BLUENRG
75+
bool
76+
default y
77+
depends on DT_HAS_ST_HCI_SPI_V1_ENABLED || DT_HAS_ST_HCI_SPI_V2_ENABLED
78+
select BT_SPI
79+
help
80+
Bluetooth HCI over SPI driver for communication with
81+
STMicroelectronics BlueNRG devices.
82+
83+
config BT_BLUENRG_ACI
84+
bool "ACI message with BlueNRG-based devices"
85+
depends on BT_SPI_BLUENRG
86+
select BT_HCI_SET_PUBLIC_ADDR
87+
help
88+
Enable support for devices compatible with the BlueNRG Bluetooth
89+
Stack. Current driver supports: ST BLUENRG-MS.
90+
6091
config BT_STM32_IPM
6192
bool
6293
default y
@@ -159,22 +190,6 @@ config BT_AMBIQ_HCI
159190
Supports Ambiq Bluetooth SoC using SPI as the communication protocol.
160191
HCI packets are sent and received as single Byte transfers.
161192

162-
163-
if BT_SPI
164-
165-
config BT_SPI_INIT_PRIORITY
166-
int "BT SPI init priority"
167-
default 75
168-
169-
config BT_BLUENRG_ACI
170-
bool "ACI message with BlueNRG-based devices"
171-
select BT_HCI_SET_PUBLIC_ADDR
172-
help
173-
Enable support for devices compatible with the BlueNRG Bluetooth
174-
Stack. Current driver supports: ST BLUENRG-MS.
175-
176-
endif # BT_SPI
177-
178193
config BT_HCI_INIT_PRIORITY
179194
int "BT HCI init priority"
180195
default 75 if BT_AMBIQ_HCI

0 commit comments

Comments
 (0)