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

drivers: bluetooth: hci: Separate ST SPI vendor driver from spi.c #67258

Merged
merged 5 commits into from
Jan 10, 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
9 changes: 4 additions & 5 deletions boards/arm/b_l4s5i_iot01a/b_l4s5i_iot01a.dts
Original file line number Diff line number Diff line change
Expand Up @@ -148,16 +148,15 @@
pinctrl-names = "default";
status = "okay";

cs-gpios = <&gpiod 13 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>,
cs-gpios = <&gpiod 13 GPIO_ACTIVE_LOW>,
<&gpioe 0 GPIO_ACTIVE_LOW>;

spbtle-rf@0 {
compatible = "zephyr,bt-hci-spi", "st,hci-spi-v1";
compatible = "st,hci-spi-v1";
reg = <0>;
reset-gpios = <&gpioa 8 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
reset-gpios = <&gpioa 8 GPIO_ACTIVE_LOW>;
irq-gpios = <&gpioe 6 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>;
spi-max-frequency = <2000000>;
controller-data-delay-us = <0>; /* No need for extra delay for BlueNRG-MS */
spi-max-frequency = <DT_FREQ_M(2)>;
spi-hold-cs;
};

Expand Down
9 changes: 4 additions & 5 deletions boards/arm/disco_l475_iot1/disco_l475_iot1.dts
Original file line number Diff line number Diff line change
Expand Up @@ -187,16 +187,15 @@
pinctrl-0 = <&spi3_sck_pc10 &spi3_miso_pc11 &spi3_mosi_pc12>;
pinctrl-names = "default";

cs-gpios = <&gpiod 13 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>,
cs-gpios = <&gpiod 13 GPIO_ACTIVE_LOW>,
<&gpioe 0 GPIO_ACTIVE_LOW>;

spbtle-rf@0 {
compatible = "zephyr,bt-hci-spi", "st,hci-spi-v1";
compatible = "st,hci-spi-v1";
reg = <0>;
reset-gpios = <&gpioa 8 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
reset-gpios = <&gpioa 8 GPIO_ACTIVE_LOW>;
irq-gpios = <&gpioe 6 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>;
spi-max-frequency = <2000000>;
controller-data-delay-us = <0>; /* No need for extra delay for BlueNRG-MS */
spi-max-frequency = <DT_FREQ_M(2)>;
spi-hold-cs;
};

Expand Down
9 changes: 4 additions & 5 deletions boards/arm/sensortile_box/sensortile_box.dts
Original file line number Diff line number Diff line change
Expand Up @@ -165,16 +165,15 @@
pinctrl-0 = <&spi2_sck_pd1 &spi2_miso_pd3 &spi2_mosi_pc3>;
pinctrl-names = "default";
status = "okay";
cs-gpios = <&gpiod 0 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
cs-gpios = <&gpiod 0 GPIO_ACTIVE_LOW>;
spbtle_1s_sensortile_box: spbtle-1s@0 {
compatible = "zephyr,bt-hci-spi", "st,hci-spi-v2";
compatible = "st,hci-spi-v2";
reg = <0>;
reset-gpios = <&gpioa 8 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
reset-gpios = <&gpioa 8 GPIO_ACTIVE_LOW>;
irq-gpios = <&gpiod 4 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>;
spi-max-frequency = <1000000>;
spi-max-frequency = <DT_FREQ_M(1)>;
spi-cpha;
spi-hold-cs;
controller-data-delay-us = <0>;
reset-assert-duration-ms = <6>;
};
};
Expand Down
2 changes: 1 addition & 1 deletion boards/arm/sensortile_box_pro/sensortile_box_pro.dts
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ stm32_lp_tick_source: &lptim1 {
status = "okay";

bluenrg-lp@0 {
compatible = "zephyr,bt-hci-spi", "st,hci-spi-v2";
compatible = "st,hci-spi-v2";
reg = <0>;
irq-gpios = <&gpiod 1 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>;
reset-gpios = <&gpiod 4 GPIO_ACTIVE_LOW>;
Expand Down
9 changes: 4 additions & 5 deletions boards/arm/stm32l562e_dk/stm32l562e_dk_common.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -111,16 +111,15 @@ stm32_lp_tick_source: &lptim1 {
&spi1 {
pinctrl-0 = <&spi1_sck_pg2 &spi1_miso_pg3 &spi1_mosi_pg4>;
pinctrl-names = "default";
cs-gpios = <&gpiog 5 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
cs-gpios = <&gpiog 5 GPIO_ACTIVE_LOW>;
status = "okay";

spbtle-rf@0 {
compatible = "zephyr,bt-hci-spi", "st,hci-spi-v1";
compatible = "st,hci-spi-v1";
reg = <0>;
irq-gpios = <&gpiog 6 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>;
reset-gpios = <&gpiog 8 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
spi-max-frequency = <2000000>;
controller-data-delay-us = <0>; /* No need for extra delay for BlueNRG-MS */
reset-gpios = <&gpiog 8 GPIO_ACTIVE_LOW>;
spi-max-frequency = <DT_FREQ_M(2)>;
spi-hold-cs;
};
};
Expand Down
9 changes: 4 additions & 5 deletions boards/shields/x_nucleo_idb05a1/x_nucleo_idb05a1.overlay
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,14 @@
*/

&arduino_spi {
cs-gpios = <&arduino_header 1 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; /* A1 */
cs-gpios = <&arduino_header 1 GPIO_ACTIVE_LOW>; /* A1 */

spbtle_rf_x_nucleo_idb05a1: spbtle-rf@0 {
compatible = "zephyr,bt-hci-spi", "st,hci-spi-v1";
compatible = "st,hci-spi-v1";
reg = <0>;
reset-gpios = <&arduino_header 13 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; /* D7 */
reset-gpios = <&arduino_header 13 GPIO_ACTIVE_LOW>; /* D7 */
irq-gpios = <&arduino_header 0 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>; /* A0 */
spi-max-frequency = <2000000>;
controller-data-delay-us = <0>; /* No need for extra delay for BlueNRG-MS */
spi-max-frequency = <DT_FREQ_M(2)>;
spi-hold-cs;
};
};
8 changes: 7 additions & 1 deletion drivers/bluetooth/hci/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,13 @@ zephyr_library_sources_ifdef(CONFIG_BT_ESP32 hci_esp32.c)
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)
zephyr_library_sources_ifdef(CONFIG_BT_SPI spi.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_STM32_IPM ipm_stm32wb.c)
zephyr_library_sources_ifdef(CONFIG_BT_STM32WBA hci_stm32wba.c)
zephyr_library_sources_ifdef(CONFIG_BT_USERCHAN userchan.c)
Expand Down
Loading
Loading