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 <jordan@embeint.com>
diff --git a/drivers/bluetooth/hci/CMakeLists.txt b/drivers/bluetooth/hci/CMakeLists.txt
index 91daa9d..954477a 100644
--- a/drivers/bluetooth/hci/CMakeLists.txt
+++ b/drivers/bluetooth/hci/CMakeLists.txt
@@ -20,13 +20,8 @@
zephyr_library_sources_ifdef(CONFIG_BT_H4 h4.c)
zephyr_library_sources_ifdef(CONFIG_BT_H5 h5.c)
zephyr_library_sources_ifdef(CONFIG_BT_HCI_IPC ipc.c)
-if(CONFIG_BT_SPI)
- if ((CONFIG_DT_HAS_ST_HCI_SPI_V1_ENABLED) OR (CONFIG_DT_HAS_ST_HCI_SPI_V2_ENABLED))
- zephyr_library_sources(hci_spi_st.c)
- else()
- zephyr_library_sources(spi.c)
- endif()
-endif()
+zephyr_library_sources_ifdef(CONFIG_BT_SPI_ZEPHYR spi.c)
+zephyr_library_sources_ifdef(CONFIG_BT_SPI_BLUENRG hci_spi_st.c)
zephyr_library_sources_ifdef(CONFIG_BT_CYW43XX h4_ifx_cyw43xxx.c)
zephyr_library_sources_ifdef(CONFIG_BT_CYW208XX hci_ifx_cyw208xx.c)
diff --git a/drivers/bluetooth/hci/Kconfig b/drivers/bluetooth/hci/Kconfig
index 32ad3b7..9355f40 100644
--- a/drivers/bluetooth/hci/Kconfig
+++ b/drivers/bluetooth/hci/Kconfig
@@ -48,15 +48,46 @@
using the IPC subsystem.
config BT_SPI
- bool "SPI HCI"
+ bool
select SPI
help
Supports Bluetooth ICs using SPI as the communication protocol.
HCI packets are sent and received as single Byte transfers,
- prepended after a known header. Headers may vary per device, so
+ prepended after a known header. Headers may vary per device, so
additional platform specific knowledge may need to be added as
devices are.
+config BT_SPI_INIT_PRIORITY
+ int "BT SPI init priority"
+ depends on BT_SPI
+ default 75
+
+config BT_SPI_ZEPHYR
+ bool
+ default y
+ depends on DT_HAS_ZEPHYR_BT_HCI_SPI_ENABLED
+ select BT_SPI
+ help
+ Bluetooth HCI over SPI driver for communication with Bluetooth
+ controllers running Zephyr.
+
+config BT_SPI_BLUENRG
+ bool
+ default y
+ depends on DT_HAS_ST_HCI_SPI_V1_ENABLED || DT_HAS_ST_HCI_SPI_V2_ENABLED
+ select BT_SPI
+ help
+ Bluetooth HCI over SPI driver for communication with
+ STMicroelectronics BlueNRG devices.
+
+config BT_BLUENRG_ACI
+ bool "ACI message with BlueNRG-based devices"
+ depends on BT_SPI_BLUENRG
+ select BT_HCI_SET_PUBLIC_ADDR
+ help
+ Enable support for devices compatible with the BlueNRG Bluetooth
+ Stack. Current driver supports: ST BLUENRG-MS.
+
config BT_STM32_IPM
bool
default y
@@ -159,22 +190,6 @@
Supports Ambiq Bluetooth SoC using SPI as the communication protocol.
HCI packets are sent and received as single Byte transfers.
-
-if BT_SPI
-
-config BT_SPI_INIT_PRIORITY
- int "BT SPI init priority"
- default 75
-
-config BT_BLUENRG_ACI
- bool "ACI message with BlueNRG-based devices"
- select BT_HCI_SET_PUBLIC_ADDR
- help
- Enable support for devices compatible with the BlueNRG Bluetooth
- Stack. Current driver supports: ST BLUENRG-MS.
-
-endif # BT_SPI
-
config BT_HCI_INIT_PRIORITY
int "BT HCI init priority"
default 75 if BT_AMBIQ_HCI