diff --git a/boards/arm/96b_aerocore2/96b_aerocore2.dts b/boards/arm/96b_aerocore2/96b_aerocore2.dts index aba85bfc7d4..881595cfb45 100644 --- a/boards/arm/96b_aerocore2/96b_aerocore2.dts +++ b/boards/arm/96b_aerocore2/96b_aerocore2.dts @@ -87,6 +87,7 @@ }; &i2c2 { + pinctrl-0 = <&i2c2_scl_pb10 &i2c2_sda_pb11>; status = "okay"; clock-frequency = ; }; diff --git a/boards/arm/96b_aerocore2/pinmux.c b/boards/arm/96b_aerocore2/pinmux.c index e741b95671c..850f05bdfd4 100644 --- a/boards/arm/96b_aerocore2/pinmux.c +++ b/boards/arm/96b_aerocore2/pinmux.c @@ -50,10 +50,6 @@ static const struct pin_config pinconf[] = { {STM32_PIN_PE13, STM32F4_PINMUX_FUNC_PE13_SPI4_MISO}, {STM32_PIN_PE14, STM32F4_PINMUX_FUNC_PE14_SPI4_MOSI}, #endif -#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c2), okay) && CONFIG_I2C - {STM32_PIN_PB10, STM32F4_PINMUX_FUNC_PB10_I2C2_SCL}, - {STM32_PIN_PB11, STM32F4_PINMUX_FUNC_PB11_I2C2_SDA}, -#endif #ifdef CONFIG_USB_DC_STM32 {STM32_PIN_PA11, STM32F4_PINMUX_FUNC_PA11_OTG_FS_DM}, {STM32_PIN_PA12, STM32F4_PINMUX_FUNC_PA12_OTG_FS_DP}, diff --git a/boards/arm/96b_argonkey/96b_argonkey.dts b/boards/arm/96b_argonkey/96b_argonkey.dts index 63863e2be12..05ed1028d5e 100644 --- a/boards/arm/96b_argonkey/96b_argonkey.dts +++ b/boards/arm/96b_argonkey/96b_argonkey.dts @@ -84,11 +84,13 @@ }; &i2c1 { + pinctrl-0 = <&i2c1_scl_pb6 &i2c1_sda_pb7>; status = "okay"; clock-frequency = ; }; &i2c2 { + pinctrl-0 = <&i2c2_scl_pb10 &i2c2_sda_pb9>; status = "okay"; clock-frequency = ; @@ -113,6 +115,7 @@ }; &i2c3 { + pinctrl-0 = <&i2c3_scl_pa8 &i2c3_sda_pb4>; status = "okay"; clock-frequency = ; diff --git a/boards/arm/96b_argonkey/pinmux.c b/boards/arm/96b_argonkey/pinmux.c index 29bf094fa05..ac835489faf 100644 --- a/boards/arm/96b_argonkey/pinmux.c +++ b/boards/arm/96b_argonkey/pinmux.c @@ -14,18 +14,6 @@ /* pin assignments for 96boards Argonkey board */ static const struct pin_config pinconf[] = { -#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c1), okay) && CONFIG_I2C - {STM32_PIN_PB6, STM32F4_PINMUX_FUNC_PB6_I2C1_SCL}, - {STM32_PIN_PB7, STM32F4_PINMUX_FUNC_PB7_I2C1_SDA}, -#endif -#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c2), okay) && CONFIG_I2C - {STM32_PIN_PB10, STM32F4_PINMUX_FUNC_PB10_I2C2_SCL}, - {STM32_PIN_PB9, STM32F4_PINMUX_FUNC_PB9_I2C2_SDA}, -#endif -#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c3), okay) && CONFIG_I2C - {STM32_PIN_PA8, STM32F4_PINMUX_FUNC_PA8_I2C3_SCL}, - {STM32_PIN_PB4, STM32F4_PINMUX_FUNC_PB4_I2C3_SDA}, -#endif #if DT_NODE_HAS_STATUS(DT_NODELABEL(spi1), okay) && CONFIG_SPI #ifdef CONFIG_SPI_STM32_USE_HW_SS {STM32_PIN_PA4, STM32F4_PINMUX_FUNC_PA4_SPI1_NSS | diff --git a/boards/arm/96b_carbon/96b_carbon.dts b/boards/arm/96b_carbon/96b_carbon.dts index 5a5d363591c..25aa2b37434 100644 --- a/boards/arm/96b_carbon/96b_carbon.dts +++ b/boards/arm/96b_carbon/96b_carbon.dts @@ -72,11 +72,13 @@ }; &i2c1 { + pinctrl-0 = <&i2c1_scl_pb6 &i2c1_sda_pb7>; status = "okay"; clock-frequency = ; }; &i2c2 { + pinctrl-0 = <&i2c2_scl_pb10 &i2c2_sda_pb3>; status = "okay"; clock-frequency = ; }; diff --git a/boards/arm/96b_carbon/pinmux.c b/boards/arm/96b_carbon/pinmux.c index 9a07acd2057..e7353c16b33 100644 --- a/boards/arm/96b_carbon/pinmux.c +++ b/boards/arm/96b_carbon/pinmux.c @@ -14,14 +14,6 @@ /* pin assignments for 96boards Carbon board */ static const struct pin_config pinconf[] = { -#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c1), okay) && CONFIG_I2C - {STM32_PIN_PB6, STM32F4_PINMUX_FUNC_PB6_I2C1_SCL}, - {STM32_PIN_PB7, STM32F4_PINMUX_FUNC_PB7_I2C1_SDA}, -#endif -#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c2), okay) && CONFIG_I2C - {STM32_PIN_PB10, STM32F4_PINMUX_FUNC_PB10_I2C2_SCL}, - {STM32_PIN_PB3, STM32F4_PINMUX_FUNC_PB3_I2C2_SDA}, -#endif #if DT_NODE_HAS_STATUS(DT_NODELABEL(spi1), okay) && CONFIG_SPI #ifdef CONFIG_SPI_STM32_USE_HW_SS {STM32_PIN_PA4, STM32F4_PINMUX_FUNC_PA4_SPI1_NSS}, diff --git a/boards/arm/96b_neonkey/96b_neonkey.dts b/boards/arm/96b_neonkey/96b_neonkey.dts index 51f61d53472..f957f6adf06 100644 --- a/boards/arm/96b_neonkey/96b_neonkey.dts +++ b/boards/arm/96b_neonkey/96b_neonkey.dts @@ -63,16 +63,19 @@ }; &i2c1 { + pinctrl-0 = <&i2c1_scl_pb6 &i2c1_sda_pb7>; status = "okay"; clock-frequency = ; }; &i2c2 { + pinctrl-0 = <&i2c2_scl_pb10 &i2c2_sda_pb3>; status = "okay"; clock-frequency = ; }; &i2c3 { + pinctrl-0 = <&i2c3_scl_pa8 &i2c3_sda_pb4>; status = "okay"; clock-frequency = ; diff --git a/boards/arm/96b_neonkey/pinmux.c b/boards/arm/96b_neonkey/pinmux.c index ce49204c82c..f72d346f4be 100644 --- a/boards/arm/96b_neonkey/pinmux.c +++ b/boards/arm/96b_neonkey/pinmux.c @@ -14,18 +14,6 @@ /* pin assignments for 96boards Neonkey board */ static const struct pin_config pinconf[] = { -#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c1), okay) && CONFIG_I2C - {STM32_PIN_PB6, STM32F4_PINMUX_FUNC_PB6_I2C1_SCL}, - {STM32_PIN_PB7, STM32F4_PINMUX_FUNC_PB7_I2C1_SDA}, -#endif -#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c2), okay) && CONFIG_I2C - {STM32_PIN_PB10, STM32F4_PINMUX_FUNC_PB10_I2C2_SCL}, - {STM32_PIN_PB3, STM32F4_PINMUX_FUNC_PB3_I2C2_SDA}, -#endif -#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c3), okay) && CONFIG_I2C - {STM32_PIN_PA8, STM32F4_PINMUX_FUNC_PA8_I2C3_SCL}, - {STM32_PIN_PB4, STM32F4_PINMUX_FUNC_PB4_I2C3_SDA}, -#endif #if DT_NODE_HAS_STATUS(DT_NODELABEL(spi1), okay) && CONFIG_SPI #ifdef CONFIG_SPI_STM32_USE_HW_SS {STM32_PIN_PA4, STM32F4_PINMUX_FUNC_PA4_SPI1_NSS}, diff --git a/boards/arm/96b_stm32_sensor_mez/96b_stm32_sensor_mez.dts b/boards/arm/96b_stm32_sensor_mez/96b_stm32_sensor_mez.dts index 9b4adcee950..d9335a9a693 100644 --- a/boards/arm/96b_stm32_sensor_mez/96b_stm32_sensor_mez.dts +++ b/boards/arm/96b_stm32_sensor_mez/96b_stm32_sensor_mez.dts @@ -62,6 +62,7 @@ }; &i2c1 { + pinctrl-0 = <&i2c1_scl_pb6 &i2c1_sda_pb7>; status = "okay"; clock-frequency = ; @@ -81,6 +82,7 @@ }; &i2c2 { + pinctrl-0 = <&i2c2_scl_pb10 &i2c2_sda_pc12>; status = "okay"; clock-frequency = ; }; diff --git a/boards/arm/96b_stm32_sensor_mez/pinmux.c b/boards/arm/96b_stm32_sensor_mez/pinmux.c index b82930b5986..ceff57681b2 100644 --- a/boards/arm/96b_stm32_sensor_mez/pinmux.c +++ b/boards/arm/96b_stm32_sensor_mez/pinmux.c @@ -14,14 +14,6 @@ /* pin assignments for 96b_stm32_sensor_mez board */ static const struct pin_config pinconf[] = { -#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c1), okay) && CONFIG_I2C - {STM32_PIN_PB6, STM32F4_PINMUX_FUNC_PB6_I2C1_SCL}, - {STM32_PIN_PB7, STM32F4_PINMUX_FUNC_PB7_I2C1_SDA}, -#endif -#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c2), okay) && CONFIG_I2C - {STM32_PIN_PB10, STM32F4_PINMUX_FUNC_PB10_I2C2_SCL}, - {STM32_PIN_PC12, STM32F4_PINMUX_FUNC_PC12_I2C2_SDA}, -#endif #if DT_NODE_HAS_STATUS(DT_NODELABEL(spi1), okay) && CONFIG_SPI #ifdef CONFIG_SPI_STM32_USE_HW_SS {STM32_PIN_PA4, STM32F4_PINMUX_FUNC_PA4_SPI1_NSS | diff --git a/boards/arm/96b_wistrio/96b_wistrio.dts b/boards/arm/96b_wistrio/96b_wistrio.dts index 83d0597bd50..04f7bc6e7eb 100644 --- a/boards/arm/96b_wistrio/96b_wistrio.dts +++ b/boards/arm/96b_wistrio/96b_wistrio.dts @@ -52,6 +52,7 @@ }; &i2c1 { + pinctrl-0 = <&i2c1_scl_pb8 &i2c1_sda_pb9>; status = "okay"; lis3dh@32 { diff --git a/boards/arm/96b_wistrio/pinmux.c b/boards/arm/96b_wistrio/pinmux.c index 42fa00aead1..c250aa00fe6 100644 --- a/boards/arm/96b_wistrio/pinmux.c +++ b/boards/arm/96b_wistrio/pinmux.c @@ -14,10 +14,6 @@ #include static const struct pin_config pinconf[] = { -#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c1), okay) && CONFIG_I2C - {STM32_PIN_PB8, STM32L1X_PINMUX_FUNC_PB8_I2C1_SCL}, - {STM32_PIN_PB9, STM32L1X_PINMUX_FUNC_PB9_I2C1_SDA}, -#endif #if DT_NODE_HAS_STATUS(DT_NODELABEL(spi1), okay) && CONFIG_SPI {STM32_PIN_PA5, STM32L1X_PINMUX_FUNC_PA5_SPI1_SCK | STM32_OSPEEDR_VERY_HIGH_SPEED}, diff --git a/boards/arm/adafruit_feather_stm32f405/adafruit_feather_stm32f405.dts b/boards/arm/adafruit_feather_stm32f405/adafruit_feather_stm32f405.dts index 4351e00a1be..7bbb280806e 100644 --- a/boards/arm/adafruit_feather_stm32f405/adafruit_feather_stm32f405.dts +++ b/boards/arm/adafruit_feather_stm32f405/adafruit_feather_stm32f405.dts @@ -41,6 +41,7 @@ }; &i2c1 { + pinctrl-0 = <&i2c1_scl_pb6 &i2c1_sda_pb7>; status = "okay"; clock-frequency = ; }; diff --git a/boards/arm/adafruit_feather_stm32f405/pinmux.c b/boards/arm/adafruit_feather_stm32f405/pinmux.c index 860d2bfd5a3..81cf4f35b1a 100644 --- a/boards/arm/adafruit_feather_stm32f405/pinmux.c +++ b/boards/arm/adafruit_feather_stm32f405/pinmux.c @@ -14,10 +14,6 @@ /* pin assignments for Feather STM32F405 board */ static const struct pin_config pinconf[] = { -#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c1), okay) && CONFIG_I2C - {STM32_PIN_PB6, STM32F4_PINMUX_FUNC_PB6_I2C1_SCL}, - {STM32_PIN_PB7, STM32F4_PINMUX_FUNC_PB7_I2C1_SDA}, -#endif #if DT_NODE_HAS_STATUS(DT_NODELABEL(spi1), okay) && CONFIG_SPI #ifdef CONFIG_SPI_STM32_USE_HW_SS {STM32_PIN_PA15, STM32F4_PINMUX_FUNC_PA15_SPI1_NSS | diff --git a/boards/arm/b_l072z_lrwan1/b_l072z_lrwan1.dts b/boards/arm/b_l072z_lrwan1/b_l072z_lrwan1.dts index 2967c5b796a..5b650a4baa9 100644 --- a/boards/arm/b_l072z_lrwan1/b_l072z_lrwan1.dts +++ b/boards/arm/b_l072z_lrwan1/b_l072z_lrwan1.dts @@ -104,6 +104,7 @@ arduino_i2c: &i2c1 {}; }; &i2c1 { + pinctrl-0 = <&i2c1_scl_pb8 &i2c1_sda_pb9>; status = "okay"; clock-frequency = ; }; diff --git a/boards/arm/b_l072z_lrwan1/pinmux.c b/boards/arm/b_l072z_lrwan1/pinmux.c index 2ce57c2f1ea..de9c406af61 100644 --- a/boards/arm/b_l072z_lrwan1/pinmux.c +++ b/boards/arm/b_l072z_lrwan1/pinmux.c @@ -30,10 +30,6 @@ static const struct pin_config pinconf[] = { {STM32_PIN_PB14, STM32L0_PINMUX_FUNC_PB14_SPI2_MISO}, {STM32_PIN_PB15, STM32L0_PINMUX_FUNC_PB15_SPI2_MOSI}, #endif -#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c1), okay) && CONFIG_I2C - {STM32_PIN_PB8, STM32L0_PINMUX_FUNC_PB8_I2C1_SCL}, - {STM32_PIN_PB9, STM32L0_PINMUX_FUNC_PB9_I2C1_SDA}, -#endif #ifdef CONFIG_USB_DC_STM32 {STM32_PIN_PA11, STM32L0_PINMUX_FUNC_PA11_USB_DM}, {STM32_PIN_PA12, STM32L0_PINMUX_FUNC_PA12_USB_DP}, diff --git a/boards/arm/b_l4s5i_iot01a/b_l4s5i_iot01a.dts b/boards/arm/b_l4s5i_iot01a/b_l4s5i_iot01a.dts index b5a16c2e9b2..0a1c09ffbed 100644 --- a/boards/arm/b_l4s5i_iot01a/b_l4s5i_iot01a.dts +++ b/boards/arm/b_l4s5i_iot01a/b_l4s5i_iot01a.dts @@ -58,11 +58,13 @@ }; &i2c1 { + pinctrl-0 = <&i2c1_scl_pb8 &i2c1_sda_pb9>; status = "okay"; clock-frequency = ; }; &i2c2 { + pinctrl-0 = <&i2c2_scl_pb10 &i2c2_sda_pb11>; status = "okay"; clock-frequency = ; diff --git a/boards/arm/b_l4s5i_iot01a/pinmux.c b/boards/arm/b_l4s5i_iot01a/pinmux.c index dd5ea8e23dd..d2c5c6fdb39 100644 --- a/boards/arm/b_l4s5i_iot01a/pinmux.c +++ b/boards/arm/b_l4s5i_iot01a/pinmux.c @@ -14,15 +14,6 @@ /* pin assignments for B_L4S5I_IOT01A board */ static const struct pin_config pinconf[] = { -#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c1), okay) && CONFIG_I2C - {STM32_PIN_PB8, STM32L4X_PINMUX_FUNC_PB8_I2C1_SCL}, - {STM32_PIN_PB9, STM32L4X_PINMUX_FUNC_PB9_I2C1_SDA}, -#endif -#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c2), okay) && CONFIG_I2C - /* I2C2 is used for NFC, STSAFE, ToF & MEMS sensors */ - {STM32_PIN_PB10, STM32L4X_PINMUX_FUNC_PB10_I2C2_SCL}, - {STM32_PIN_PB11, STM32L4X_PINMUX_FUNC_PB11_I2C2_SDA}, -#endif #if DT_NODE_HAS_STATUS(DT_NODELABEL(spi1), okay) && CONFIG_SPI {STM32_PIN_PA5, STM32L4X_PINMUX_FUNC_PA5_SPI1_SCK}, {STM32_PIN_PA6, STM32L4X_PINMUX_FUNC_PA6_SPI1_MISO}, diff --git a/boards/arm/blackpill_f411ce/blackpill_f411ce.dts b/boards/arm/blackpill_f411ce/blackpill_f411ce.dts index 06353a33b23..cde5671118b 100644 --- a/boards/arm/blackpill_f411ce/blackpill_f411ce.dts +++ b/boards/arm/blackpill_f411ce/blackpill_f411ce.dts @@ -94,6 +94,7 @@ }; &i2c1 { + pinctrl-0 = <&i2c1_scl_pb8 &i2c1_sda_pb9>; status = "okay"; clock-frequency = ; }; diff --git a/boards/arm/blackpill_f411ce/pinmux.c b/boards/arm/blackpill_f411ce/pinmux.c index a5e13974c06..593188963c7 100644 --- a/boards/arm/blackpill_f411ce/pinmux.c +++ b/boards/arm/blackpill_f411ce/pinmux.c @@ -14,10 +14,6 @@ /* pin assignments for Black Pill V2.0 board */ static const struct pin_config pinconf[] = { -#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c1), okay) && CONFIG_I2C - {STM32_PIN_PB8, STM32F4_PINMUX_FUNC_PB8_I2C1_SCL}, - {STM32_PIN_PB9, STM32F4_PINMUX_FUNC_PB9_I2C1_SDA}, -#endif #if (DT_NODE_HAS_STATUS(DT_NODELABEL(spi1), okay) && CONFIG_SPI) #ifdef CONFIG_SPI_STM32_USE_HW_SS {STM32_PIN_PA4, STM32F4_PINMUX_FUNC_PA4_SPI1_NSS}, diff --git a/boards/arm/disco_l475_iot1/disco_l475_iot1.dts b/boards/arm/disco_l475_iot1/disco_l475_iot1.dts index 9e2c83cb2a2..f603cbb4ce5 100644 --- a/boards/arm/disco_l475_iot1/disco_l475_iot1.dts +++ b/boards/arm/disco_l475_iot1/disco_l475_iot1.dts @@ -68,11 +68,13 @@ }; &i2c1 { + pinctrl-0 = <&i2c1_scl_pb8 &i2c1_sda_pb9>; status = "okay"; clock-frequency = ; }; &i2c2 { + pinctrl-0 = <&i2c2_scl_pb10 &i2c2_sda_pb11>; status = "okay"; clock-frequency = ; @@ -110,6 +112,7 @@ }; &i2c3 { + pinctrl-0 = <&i2c3_scl_pc0 &i2c3_sda_pc1>; status = "okay"; clock-frequency = ; }; diff --git a/boards/arm/disco_l475_iot1/pinmux.c b/boards/arm/disco_l475_iot1/pinmux.c index c439eeb05e2..a1808c10c4d 100644 --- a/boards/arm/disco_l475_iot1/pinmux.c +++ b/boards/arm/disco_l475_iot1/pinmux.c @@ -14,19 +14,6 @@ /* pin assignments for Disco L475 IOT1 board */ static const struct pin_config pinconf[] = { -#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c1), okay) && CONFIG_I2C - {STM32_PIN_PB8, STM32L4X_PINMUX_FUNC_PB8_I2C1_SCL}, - {STM32_PIN_PB9, STM32L4X_PINMUX_FUNC_PB9_I2C1_SDA}, -#endif -#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c2), okay) && CONFIG_I2C - /* I2C2 is used for NFC, STSAFE, ToF & MEMS sensors */ - {STM32_PIN_PB10, STM32L4X_PINMUX_FUNC_PB10_I2C2_SCL}, - {STM32_PIN_PB11, STM32L4X_PINMUX_FUNC_PB11_I2C2_SDA}, -#endif -#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c3), okay) && CONFIG_I2C - {STM32_PIN_PC0, STM32L4X_PINMUX_FUNC_PC0_I2C3_SCL}, - {STM32_PIN_PC1, STM32L4X_PINMUX_FUNC_PC1_I2C3_SDA}, -#endif #if DT_NODE_HAS_STATUS(DT_NODELABEL(spi1), okay) && CONFIG_SPI {STM32_PIN_PA5, STM32L4X_PINMUX_FUNC_PA5_SPI1_SCK}, {STM32_PIN_PA6, STM32L4X_PINMUX_FUNC_PA6_SPI1_MISO}, diff --git a/boards/arm/google_kukui/google_kukui.dts b/boards/arm/google_kukui/google_kukui.dts index 0aeaa802937..e4968a20112 100644 --- a/boards/arm/google_kukui/google_kukui.dts +++ b/boards/arm/google_kukui/google_kukui.dts @@ -41,11 +41,13 @@ }; &i2c1 { + pinctrl-0 = <&i2c1_scl_pb8 &i2c1_sda_pb9>; status = "okay"; clock-frequency = ; }; &i2c2 { + pinctrl-0 = <&i2c2_scl_pa11 &i2c2_sda_pa12>; status = "okay"; clock-frequency = ; }; diff --git a/boards/arm/google_kukui/pinmux.c b/boards/arm/google_kukui/pinmux.c index bbf049b78e8..fd9fcf91db5 100644 --- a/boards/arm/google_kukui/pinmux.c +++ b/boards/arm/google_kukui/pinmux.c @@ -13,14 +13,6 @@ #include static const struct pin_config pinconf[] = { -#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c1), okay) && CONFIG_I2C - {STM32_PIN_PB8, STM32F0_PINMUX_FUNC_PB8_I2C1_SCL}, - {STM32_PIN_PB9, STM32F0_PINMUX_FUNC_PB9_I2C1_SDA}, -#endif -#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c2), okay) && CONFIG_I2C - {STM32_PIN_PA11, STM32F0_PINMUX_FUNC_PA11_I2C2_SCL}, - {STM32_PIN_PA12, STM32F0_PINMUX_FUNC_PA12_I2C2_SDA}, -#endif }; static int pinmux_stm32_init(const struct device *port) diff --git a/boards/arm/mikroe_mini_m4_for_stm32/mikroe_mini_m4_for_stm32.dts b/boards/arm/mikroe_mini_m4_for_stm32/mikroe_mini_m4_for_stm32.dts index 5c993d6c5a5..b6729c3e2c3 100644 --- a/boards/arm/mikroe_mini_m4_for_stm32/mikroe_mini_m4_for_stm32.dts +++ b/boards/arm/mikroe_mini_m4_for_stm32/mikroe_mini_m4_for_stm32.dts @@ -45,6 +45,7 @@ }; &i2c2 { + pinctrl-0 = <&i2c2_scl_pb10 &i2c2_sda_pb11>; status = "okay"; }; diff --git a/boards/arm/mikroe_mini_m4_for_stm32/pinmux.c b/boards/arm/mikroe_mini_m4_for_stm32/pinmux.c index 676a6e2469b..6841c60a46b 100644 --- a/boards/arm/mikroe_mini_m4_for_stm32/pinmux.c +++ b/boards/arm/mikroe_mini_m4_for_stm32/pinmux.c @@ -14,10 +14,6 @@ /* pin assignments for MINI-M4 board */ static const struct pin_config pinconf[] = { -#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c2), okay) && CONFIG_I2C - {STM32_PIN_PB10, STM32F4_PINMUX_FUNC_PB10_I2C2_SCL}, - {STM32_PIN_PB11, STM32F4_PINMUX_FUNC_PB11_I2C2_SDA}, -#endif #if DT_NODE_HAS_STATUS(DT_NODELABEL(spi1), okay) && CONFIG_SPI #ifdef CONFIG_SPI_STM32_USE_HW_SS {STM32_PIN_PA4, STM32F4_PINMUX_FUNC_PA4_SPI1_NSS}, diff --git a/boards/arm/nucleo_f030r8/nucleo_f030r8.dts b/boards/arm/nucleo_f030r8/nucleo_f030r8.dts index 77a6026a29d..90cb098dd6f 100644 --- a/boards/arm/nucleo_f030r8/nucleo_f030r8.dts +++ b/boards/arm/nucleo_f030r8/nucleo_f030r8.dts @@ -60,11 +60,13 @@ }; &i2c1 { + pinctrl-0 = <&i2c1_scl_pb8 &i2c1_sda_pb9>; status = "okay"; clock-frequency = ; }; &i2c2 { + pinctrl-0 = <&i2c2_scl_pb10 &i2c2_sda_pb11>; status = "okay"; clock-frequency = ; }; diff --git a/boards/arm/nucleo_f030r8/pinmux.c b/boards/arm/nucleo_f030r8/pinmux.c index dfa3734f9f1..7af1994d4fb 100644 --- a/boards/arm/nucleo_f030r8/pinmux.c +++ b/boards/arm/nucleo_f030r8/pinmux.c @@ -15,14 +15,6 @@ /* pin assignments for NUCLEO-F030R8 board */ static const struct pin_config pinconf[] = { -#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c1), okay) && CONFIG_I2C - {STM32_PIN_PB8, STM32F0_PINMUX_FUNC_PB8_I2C1_SCL}, - {STM32_PIN_PB9, STM32F0_PINMUX_FUNC_PB9_I2C1_SDA}, -#endif -#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c2), okay) && CONFIG_I2C - {STM32_PIN_PA11, STM32F0_PINMUX_FUNC_PB10_I2C2_SCL}, - {STM32_PIN_PA12, STM32F0_PINMUX_FUNC_PB11_I2C2_SDA}, -#endif #if DT_NODE_HAS_STATUS(DT_NODELABEL(spi1), okay) && CONFIG_SPI #ifdef CONFIG_SPI_STM32_USE_HW_SS {STM32_PIN_PA4, STM32F0_PINMUX_FUNC_PA4_SPI1_NSS}, diff --git a/boards/arm/nucleo_f070rb/nucleo_f070rb.dts b/boards/arm/nucleo_f070rb/nucleo_f070rb.dts index 24bd19948c3..2231ea70421 100644 --- a/boards/arm/nucleo_f070rb/nucleo_f070rb.dts +++ b/boards/arm/nucleo_f070rb/nucleo_f070rb.dts @@ -55,11 +55,13 @@ }; &i2c1 { + pinctrl-0 = <&i2c1_scl_pb8 &i2c1_sda_pb9>; status = "okay"; clock-frequency = ; }; &i2c2 { + pinctrl-0 = <&i2c2_scl_pb10 &i2c2_sda_pb11>; status = "okay"; clock-frequency = ; }; diff --git a/boards/arm/nucleo_f070rb/pinmux.c b/boards/arm/nucleo_f070rb/pinmux.c index 5f50289957f..546b26e27fd 100644 --- a/boards/arm/nucleo_f070rb/pinmux.c +++ b/boards/arm/nucleo_f070rb/pinmux.c @@ -15,14 +15,6 @@ /* pin assignments for NUCLEO_F070RB board */ static const struct pin_config pinconf[] = { -#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c1), okay) && CONFIG_I2C - {STM32_PIN_PB8, STM32F0_PINMUX_FUNC_PB8_I2C1_SCL}, - {STM32_PIN_PB9, STM32F0_PINMUX_FUNC_PB9_I2C1_SDA}, -#endif -#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c2), okay) && CONFIG_I2C - {STM32_PIN_PB10, STM32F0_PINMUX_FUNC_PB10_I2C2_SCL}, - {STM32_PIN_PB11, STM32F0_PINMUX_FUNC_PB11_I2C2_SDA}, -#endif #if DT_NODE_HAS_STATUS(DT_NODELABEL(spi1), okay) && CONFIG_SPI {STM32_PIN_PA5, STM32F0_PINMUX_FUNC_PA5_SPI1_SCK}, {STM32_PIN_PA6, STM32F0_PINMUX_FUNC_PA6_SPI1_MISO}, diff --git a/boards/arm/nucleo_f091rc/nucleo_f091rc.dts b/boards/arm/nucleo_f091rc/nucleo_f091rc.dts index 9fc4540f534..f88c32f811f 100644 --- a/boards/arm/nucleo_f091rc/nucleo_f091rc.dts +++ b/boards/arm/nucleo_f091rc/nucleo_f091rc.dts @@ -54,11 +54,13 @@ }; &i2c1 { + pinctrl-0 = <&i2c1_scl_pb8 &i2c1_sda_pb9>; status = "okay"; clock-frequency = ; }; &i2c2 { + pinctrl-0 = <&i2c2_scl_pa11 &i2c2_sda_pa12>; status = "okay"; clock-frequency = ; }; diff --git a/boards/arm/nucleo_f091rc/pinmux.c b/boards/arm/nucleo_f091rc/pinmux.c index c77fdd4e75d..18b4e910c26 100644 --- a/boards/arm/nucleo_f091rc/pinmux.c +++ b/boards/arm/nucleo_f091rc/pinmux.c @@ -14,14 +14,6 @@ /* pin assignments for NUCLEO-F091RC board */ static const struct pin_config pinconf[] = { -#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c1), okay) && CONFIG_I2C - {STM32_PIN_PB8, STM32F0_PINMUX_FUNC_PB8_I2C1_SCL}, - {STM32_PIN_PB9, STM32F0_PINMUX_FUNC_PB9_I2C1_SDA}, -#endif -#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c2), okay) && CONFIG_I2C - {STM32_PIN_PA11, STM32F0_PINMUX_FUNC_PA11_I2C2_SCL}, - {STM32_PIN_PA12, STM32F0_PINMUX_FUNC_PA12_I2C2_SDA}, -#endif #if DT_NODE_HAS_STATUS(DT_NODELABEL(spi1), okay) && CONFIG_SPI {STM32_PIN_PA5, STM32F0_PINMUX_FUNC_PA5_SPI1_SCK}, {STM32_PIN_PA6, STM32F0_PINMUX_FUNC_PA6_SPI1_MISO}, diff --git a/boards/arm/nucleo_f302r8/nucleo_f302r8.dts b/boards/arm/nucleo_f302r8/nucleo_f302r8.dts index b9bc2bc1aad..c28e0b2a4db 100644 --- a/boards/arm/nucleo_f302r8/nucleo_f302r8.dts +++ b/boards/arm/nucleo_f302r8/nucleo_f302r8.dts @@ -43,6 +43,7 @@ }; &i2c1 { + pinctrl-0 = <&i2c1_scl_pb8 &i2c1_sda_pb9>; status = "okay"; clock-frequency = ; }; diff --git a/boards/arm/nucleo_f302r8/pinmux.c b/boards/arm/nucleo_f302r8/pinmux.c index 413dc379763..b7520f4fa84 100644 --- a/boards/arm/nucleo_f302r8/pinmux.c +++ b/boards/arm/nucleo_f302r8/pinmux.c @@ -14,10 +14,6 @@ /* pin assignments for NUCLEO-F302R8 board */ static const struct pin_config pinconf[] = { -#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c1), okay) && CONFIG_I2C - {STM32_PIN_PB8, STM32F3_PINMUX_FUNC_PB8_I2C1_SCL}, - {STM32_PIN_PB9, STM32F3_PINMUX_FUNC_PB9_I2C1_SDA}, -#endif #if DT_NODE_HAS_STATUS(DT_NODELABEL(spi2), okay) && CONFIG_SPI #ifdef CONFIG_SPI_STM32_USE_HW_SS {STM32_PIN_PB12, STM32F3_PINMUX_FUNC_PB12_SPI2_NSS}, diff --git a/boards/arm/nucleo_f334r8/nucleo_f334r8.dts b/boards/arm/nucleo_f334r8/nucleo_f334r8.dts index 7446a4f3aa3..15b7c29e819 100644 --- a/boards/arm/nucleo_f334r8/nucleo_f334r8.dts +++ b/boards/arm/nucleo_f334r8/nucleo_f334r8.dts @@ -60,6 +60,7 @@ }; &i2c1 { + pinctrl-0 = <&i2c1_scl_pb8 &i2c1_sda_pb9>; status = "okay"; clock-frequency = ; }; diff --git a/boards/arm/nucleo_f334r8/pinmux.c b/boards/arm/nucleo_f334r8/pinmux.c index 1e3e132f387..4a118645a49 100644 --- a/boards/arm/nucleo_f334r8/pinmux.c +++ b/boards/arm/nucleo_f334r8/pinmux.c @@ -14,10 +14,6 @@ /* pin assignments for NUCLEO-F334RB board */ static const struct pin_config pinconf[] = { -#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c1), okay) && CONFIG_I2C - {STM32_PIN_PB8, STM32F3_PINMUX_FUNC_PB8_I2C1_SCL}, - {STM32_PIN_PB9, STM32F3_PINMUX_FUNC_PB9_I2C1_SDA}, -#endif #if DT_NODE_HAS_STATUS(DT_NODELABEL(spi1), okay) && CONFIG_SPI #ifdef CONFIG_SPI_STM32_USE_HW_SS {STM32_PIN_PA4, STM32F3_PINMUX_FUNC_PA4_SPI1_NSS}, diff --git a/boards/arm/nucleo_f401re/nucleo_f401re.dts b/boards/arm/nucleo_f401re/nucleo_f401re.dts index 299f8d5b9ec..4c71c6c29a5 100644 --- a/boards/arm/nucleo_f401re/nucleo_f401re.dts +++ b/boards/arm/nucleo_f401re/nucleo_f401re.dts @@ -65,6 +65,7 @@ }; &i2c1 { + pinctrl-0 = <&i2c1_scl_pb8 &i2c1_sda_pb9>; status = "okay"; clock-frequency = ; }; diff --git a/boards/arm/nucleo_f401re/pinmux.c b/boards/arm/nucleo_f401re/pinmux.c index 521a6122142..0093687da2a 100644 --- a/boards/arm/nucleo_f401re/pinmux.c +++ b/boards/arm/nucleo_f401re/pinmux.c @@ -14,10 +14,6 @@ /* pin assignments for NUCLEO-F401RE board */ static const struct pin_config pinconf[] = { -#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c1), okay) && CONFIG_I2C - {STM32_PIN_PB8, STM32F4_PINMUX_FUNC_PB8_I2C1_SCL}, - {STM32_PIN_PB9, STM32F4_PINMUX_FUNC_PB9_I2C1_SDA}, -#endif #if DT_NODE_HAS_STATUS(DT_NODELABEL(spi1), okay) && CONFIG_SPI #ifdef CONFIG_SPI_STM32_USE_HW_SS {STM32_PIN_PA4, STM32F4_PINMUX_FUNC_PA4_SPI1_NSS}, diff --git a/boards/arm/nucleo_f411re/nucleo_f411re.dts b/boards/arm/nucleo_f411re/nucleo_f411re.dts index eddcc619eb1..dc6113dace0 100644 --- a/boards/arm/nucleo_f411re/nucleo_f411re.dts +++ b/boards/arm/nucleo_f411re/nucleo_f411re.dts @@ -55,15 +55,18 @@ }; &i2c1 { + pinctrl-0 = <&i2c1_scl_pb8 &i2c1_sda_pb9>; status = "okay"; clock-frequency = ; }; &i2c2 { + pinctrl-0 = <&i2c2_scl_pb10 &i2c2_sda_pb3>; clock-frequency = ; }; &i2c3 { + pinctrl-0 = <&i2c3_scl_pa8 &i2c3_sda_pb4>; clock-frequency = ; }; diff --git a/boards/arm/nucleo_f411re/pinmux.c b/boards/arm/nucleo_f411re/pinmux.c index b9c9e0ee59f..744e3b6844e 100644 --- a/boards/arm/nucleo_f411re/pinmux.c +++ b/boards/arm/nucleo_f411re/pinmux.c @@ -14,18 +14,6 @@ /* pin assignments for NUCLEO-F411RE board */ static const struct pin_config pinconf[] = { -#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c1), okay) && CONFIG_I2C - {STM32_PIN_PB8, STM32F4_PINMUX_FUNC_PB8_I2C1_SCL}, - {STM32_PIN_PB9, STM32F4_PINMUX_FUNC_PB9_I2C1_SDA}, -#endif -#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c2), okay) && CONFIG_I2C - {STM32_PIN_PB10, STM32F4_PINMUX_FUNC_PB10_I2C2_SCL}, - {STM32_PIN_PB3, STM32F4_PINMUX_FUNC_PB3_I2C2_SDA}, -#endif -#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c3), okay) && CONFIG_I2C - {STM32_PIN_PA8, STM32F4_PINMUX_FUNC_PA8_I2C3_SCL}, - {STM32_PIN_PB4, STM32F4_PINMUX_FUNC_PB4_I2C3_SDA}, -#endif #if (DT_NODE_HAS_STATUS(DT_NODELABEL(spi1), okay) && CONFIG_SPI) || \ (DT_NODE_HAS_STATUS(DT_NODELABEL(i2s1), okay) && CONFIG_I2S) #ifdef CONFIG_SPI_STM32_USE_HW_SS diff --git a/boards/arm/nucleo_f412zg/nucleo_f412zg.dts b/boards/arm/nucleo_f412zg/nucleo_f412zg.dts index 06c13f23ef7..2f5d3cc6f18 100644 --- a/boards/arm/nucleo_f412zg/nucleo_f412zg.dts +++ b/boards/arm/nucleo_f412zg/nucleo_f412zg.dts @@ -65,6 +65,7 @@ }; &i2c1 { + pinctrl-0 = <&i2c1_scl_pb8 &i2c1_sda_pb9>; status = "okay"; clock-frequency = ; }; diff --git a/boards/arm/nucleo_f412zg/pinmux.c b/boards/arm/nucleo_f412zg/pinmux.c index 2d3324b4cf1..ac582c79459 100644 --- a/boards/arm/nucleo_f412zg/pinmux.c +++ b/boards/arm/nucleo_f412zg/pinmux.c @@ -18,10 +18,6 @@ static const struct pin_config pinconf[] = { {STM32_PIN_PA11, STM32F4_PINMUX_FUNC_PA11_OTG_FS_DM}, {STM32_PIN_PA12, STM32F4_PINMUX_FUNC_PA12_OTG_FS_DP}, #endif /* CONFIG_USB_DC_STM32 */ -#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c1), okay) && CONFIG_I2C - {STM32_PIN_PB8, STM32F4_PINMUX_FUNC_PB8_I2C1_SCL}, - {STM32_PIN_PB9, STM32F4_PINMUX_FUNC_PB9_I2C1_SDA}, -#endif #if DT_NODE_HAS_STATUS(DT_NODELABEL(spi1), okay) && CONFIG_SPI #ifdef CONFIG_SPI_STM32_USE_HW_SS {STM32_PIN_PA4, STM32F4_PINMUX_FUNC_PA4_SPI1_NSS}, diff --git a/boards/arm/nucleo_f413zh/nucleo_f413zh.dts b/boards/arm/nucleo_f413zh/nucleo_f413zh.dts index 635a245aaed..28187dd46b1 100644 --- a/boards/arm/nucleo_f413zh/nucleo_f413zh.dts +++ b/boards/arm/nucleo_f413zh/nucleo_f413zh.dts @@ -65,6 +65,7 @@ }; &i2c1 { + pinctrl-0 = <&i2c1_scl_pb8 &i2c1_sda_pb9>; status = "okay"; clock-frequency = ; }; diff --git a/boards/arm/nucleo_f413zh/pinmux.c b/boards/arm/nucleo_f413zh/pinmux.c index a298ab6db0d..a7564c1dbcd 100644 --- a/boards/arm/nucleo_f413zh/pinmux.c +++ b/boards/arm/nucleo_f413zh/pinmux.c @@ -18,10 +18,6 @@ static const struct pin_config pinconf[] = { {STM32_PIN_PA11, STM32F4_PINMUX_FUNC_PA11_OTG_FS_DM}, {STM32_PIN_PA12, STM32F4_PINMUX_FUNC_PA12_OTG_FS_DP}, #endif /* CONFIG_USB_DC_STM32 */ -#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c1), okay) && CONFIG_I2C - {STM32_PIN_PB8, STM32F4_PINMUX_FUNC_PB8_I2C1_SCL}, - {STM32_PIN_PB9, STM32F4_PINMUX_FUNC_PB9_I2C1_SDA}, -#endif #if DT_NODE_HAS_STATUS(DT_NODELABEL(spi1), okay) && CONFIG_SPI #ifdef CONFIG_SPI_STM32_USE_HW_SS {STM32_PIN_PA4, STM32F4_PINMUX_FUNC_PA4_SPI1_NSS}, diff --git a/boards/arm/nucleo_f429zi/nucleo_f429zi.dts b/boards/arm/nucleo_f429zi/nucleo_f429zi.dts index 0a72fe9c50a..950b1abacc0 100644 --- a/boards/arm/nucleo_f429zi/nucleo_f429zi.dts +++ b/boards/arm/nucleo_f429zi/nucleo_f429zi.dts @@ -60,6 +60,7 @@ }; &i2c1 { + pinctrl-0 = <&i2c1_scl_pb8 &i2c1_sda_pb9>; status = "okay"; clock-frequency = ; }; diff --git a/boards/arm/nucleo_f429zi/pinmux.c b/boards/arm/nucleo_f429zi/pinmux.c index b3dab3f903c..d18f4e32d06 100644 --- a/boards/arm/nucleo_f429zi/pinmux.c +++ b/boards/arm/nucleo_f429zi/pinmux.c @@ -27,10 +27,6 @@ static const struct pin_config pinconf[] = { {STM32_PIN_PG13, STM32F4_PINMUX_FUNC_PG13_ETH}, {STM32_PIN_PB13, STM32F4_PINMUX_FUNC_PB13_ETH}, #endif -#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c1), okay) && CONFIG_I2C - {STM32_PIN_PB8, STM32F4_PINMUX_FUNC_PB8_I2C1_SCL}, - {STM32_PIN_PB9, STM32F4_PINMUX_FUNC_PB9_I2C1_SDA}, -#endif #if DT_NODE_HAS_STATUS(DT_NODELABEL(spi1), okay) && CONFIG_SPI #ifdef CONFIG_SPI_STM32_USE_HW_SS {STM32_PIN_PA4, STM32F4_PINMUX_FUNC_PA4_SPI1_NSS}, diff --git a/boards/arm/nucleo_f446re/nucleo_f446re.dts b/boards/arm/nucleo_f446re/nucleo_f446re.dts index 6ea4f03be1f..706b5ad9c42 100644 --- a/boards/arm/nucleo_f446re/nucleo_f446re.dts +++ b/boards/arm/nucleo_f446re/nucleo_f446re.dts @@ -55,16 +55,19 @@ }; &i2c1 { + pinctrl-0 = <&i2c1_scl_pb8 &i2c1_sda_pb9>; status = "okay"; clock-frequency = ; }; &i2c2 { + pinctrl-0 = <&i2c2_scl_pb10 &i2c2_sda_pb3>; status = "okay"; clock-frequency = ; }; &i2c3 { + pinctrl-0 = <&i2c3_scl_pa8 &i2c3_sda_pb4>; status = "okay"; clock-frequency = ; }; diff --git a/boards/arm/nucleo_f446re/pinmux.c b/boards/arm/nucleo_f446re/pinmux.c index 92d80c8c228..1c9e158abb2 100644 --- a/boards/arm/nucleo_f446re/pinmux.c +++ b/boards/arm/nucleo_f446re/pinmux.c @@ -14,18 +14,6 @@ /* pin assignments for stm32F446RE Nucleo board */ static const struct pin_config pinconf[] = { -#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c1), okay) && CONFIG_I2C - {STM32_PIN_PB8, STM32F4_PINMUX_FUNC_PB8_I2C1_SCL}, - {STM32_PIN_PB9, STM32F4_PINMUX_FUNC_PB9_I2C1_SDA}, -#endif -#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c2), okay) && CONFIG_I2C - {STM32_PIN_PB10, STM32F4_PINMUX_FUNC_PB10_I2C2_SCL}, - {STM32_PIN_PB3, STM32F4_PINMUX_FUNC_PB3_I2C2_SDA}, -#endif -#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c3), okay) && CONFIG_I2C - {STM32_PIN_PA8, STM32F4_PINMUX_FUNC_PA8_I2C3_SCL}, - {STM32_PIN_PB4, STM32F4_PINMUX_FUNC_PB4_I2C3_SDA}, -#endif #if DT_NODE_HAS_STATUS(DT_NODELABEL(spi1), okay) && CONFIG_SPI #ifdef CONFIG_SPI_STM32_USE_HW_SS {STM32_PIN_PA4, STM32F4_PINMUX_FUNC_PA4_SPI1_NSS}, diff --git a/boards/arm/nucleo_f746zg/nucleo_f746zg.dts b/boards/arm/nucleo_f746zg/nucleo_f746zg.dts index 650aea43a2b..b64bf0189df 100644 --- a/boards/arm/nucleo_f746zg/nucleo_f746zg.dts +++ b/boards/arm/nucleo_f746zg/nucleo_f746zg.dts @@ -77,6 +77,7 @@ }; &i2c1 { + pinctrl-0 = <&i2c1_scl_pb8 &i2c1_sda_pb9>; status = "okay"; clock-frequency = ; }; diff --git a/boards/arm/nucleo_f746zg/pinmux.c b/boards/arm/nucleo_f746zg/pinmux.c index e794fb867f3..2caa5ba22a8 100644 --- a/boards/arm/nucleo_f746zg/pinmux.c +++ b/boards/arm/nucleo_f746zg/pinmux.c @@ -35,10 +35,6 @@ static const struct pin_config pinconf[] = { { STM32_PIN_PA11, STM32F7_PINMUX_FUNC_PA11_OTG_FS_DM }, { STM32_PIN_PA12, STM32F7_PINMUX_FUNC_PA12_OTG_FS_DP }, #endif /* CONFIG_USB_DC_STM32 */ -#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c1), okay) && CONFIG_I2C - { STM32_PIN_PB8, STM32F7_PINMUX_FUNC_PB8_I2C1_SCL }, - { STM32_PIN_PB9, STM32F7_PINMUX_FUNC_PB9_I2C1_SDA }, -#endif #if DT_NODE_HAS_STATUS(DT_NODELABEL(spi1), okay) && CONFIG_SPI #ifdef CONFIG_SPI_STM32_USE_HW_SS { STM32_PIN_PA4, STM32F7_PINMUX_FUNC_PA4_SPI1_NSS }, diff --git a/boards/arm/nucleo_f756zg/nucleo_f756zg.dts b/boards/arm/nucleo_f756zg/nucleo_f756zg.dts index d9464afef4b..bef08ca2217 100644 --- a/boards/arm/nucleo_f756zg/nucleo_f756zg.dts +++ b/boards/arm/nucleo_f756zg/nucleo_f756zg.dts @@ -77,6 +77,7 @@ }; &i2c1 { + pinctrl-0 = <&i2c1_scl_pb8 &i2c1_sda_pb9>; status = "okay"; clock-frequency = ; }; diff --git a/boards/arm/nucleo_f756zg/pinmux.c b/boards/arm/nucleo_f756zg/pinmux.c index c10dfc5d16f..4b03d9be0e6 100644 --- a/boards/arm/nucleo_f756zg/pinmux.c +++ b/boards/arm/nucleo_f756zg/pinmux.c @@ -35,10 +35,6 @@ static const struct pin_config pinconf[] = { { STM32_PIN_PA11, STM32F7_PINMUX_FUNC_PA11_OTG_FS_DM }, { STM32_PIN_PA12, STM32F7_PINMUX_FUNC_PA12_OTG_FS_DP }, #endif /* CONFIG_USB_DC_STM32 */ -#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c1), okay) && CONFIG_I2C - { STM32_PIN_PB8, STM32F7_PINMUX_FUNC_PB8_I2C1_SCL }, - { STM32_PIN_PB9, STM32F7_PINMUX_FUNC_PB9_I2C1_SDA }, -#endif #if DT_NODE_HAS_STATUS(DT_NODELABEL(spi1), okay) && CONFIG_SPI #ifdef CONFIG_SPI_STM32_USE_HW_SS { STM32_PIN_PA4, STM32F7_PINMUX_FUNC_PA4_SPI1_NSS }, diff --git a/boards/arm/nucleo_f767zi/nucleo_f767zi.dts b/boards/arm/nucleo_f767zi/nucleo_f767zi.dts index 445d730a01d..7ff0f947c71 100644 --- a/boards/arm/nucleo_f767zi/nucleo_f767zi.dts +++ b/boards/arm/nucleo_f767zi/nucleo_f767zi.dts @@ -80,6 +80,7 @@ }; &i2c1 { + pinctrl-0 = <&i2c1_scl_pb8 &i2c1_sda_pb9>; status = "okay"; clock-frequency = ; }; diff --git a/boards/arm/nucleo_f767zi/pinmux.c b/boards/arm/nucleo_f767zi/pinmux.c index eb9f0951d55..4567199fdff 100644 --- a/boards/arm/nucleo_f767zi/pinmux.c +++ b/boards/arm/nucleo_f767zi/pinmux.c @@ -35,10 +35,6 @@ static const struct pin_config pinconf[] = { { STM32_PIN_PA11, STM32F7_PINMUX_FUNC_PA11_OTG_FS_DM }, { STM32_PIN_PA12, STM32F7_PINMUX_FUNC_PA12_OTG_FS_DP }, #endif /* CONFIG_USB_DC_STM32 */ -#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c1), okay) && CONFIG_I2C - { STM32_PIN_PB8, STM32F7_PINMUX_FUNC_PB8_I2C1_SCL }, - { STM32_PIN_PB9, STM32F7_PINMUX_FUNC_PB9_I2C1_SDA }, -#endif #if DT_NODE_HAS_STATUS(DT_NODELABEL(spi1), okay) && CONFIG_SPI #ifdef CONFIG_SPI_STM32_USE_HW_SS { STM32_PIN_PA4, STM32F7_PINMUX_FUNC_PA4_SPI1_NSS }, diff --git a/boards/arm/nucleo_g431rb/nucleo_g431rb.dts b/boards/arm/nucleo_g431rb/nucleo_g431rb.dts index 5f6a793e31d..18fc146d881 100644 --- a/boards/arm/nucleo_g431rb/nucleo_g431rb.dts +++ b/boards/arm/nucleo_g431rb/nucleo_g431rb.dts @@ -64,6 +64,7 @@ }; &i2c1 { + pinctrl-0 = <&i2c1_scl_pb8 &i2c1_sda_pb9>; status = "okay"; }; diff --git a/boards/arm/nucleo_g431rb/pinmux.c b/boards/arm/nucleo_g431rb/pinmux.c index 75d7ad91e98..f33096ffa71 100644 --- a/boards/arm/nucleo_g431rb/pinmux.c +++ b/boards/arm/nucleo_g431rb/pinmux.c @@ -14,10 +14,6 @@ /* pin assignments for NUCLEO-G431RB board */ static const struct pin_config pinconf[] = { -#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c1), okay) && CONFIG_I2C - {STM32_PIN_PB8, STM32G4X_PINMUX_FUNC_PB8_I2C1_SCL}, - {STM32_PIN_PB9, STM32G4X_PINMUX_FUNC_PB9_I2C1_SDA}, -#endif #if DT_NODE_HAS_STATUS(DT_NODELABEL(spi1), okay) && CONFIG_SPI /* SPI1 on the Arduino connectors pins A2, D3, D11, D12 */ #ifdef CONFIG_SPI_STM32_USE_HW_SS diff --git a/boards/arm/nucleo_g474re/nucleo_g474re.dts b/boards/arm/nucleo_g474re/nucleo_g474re.dts index 0675b592f93..acd0410f9cd 100644 --- a/boards/arm/nucleo_g474re/nucleo_g474re.dts +++ b/boards/arm/nucleo_g474re/nucleo_g474re.dts @@ -64,6 +64,7 @@ }; &i2c1 { + pinctrl-0 = <&i2c1_scl_pb8 &i2c1_sda_pb9>; status = "okay"; }; diff --git a/boards/arm/nucleo_g474re/pinmux.c b/boards/arm/nucleo_g474re/pinmux.c index 49f046dff8a..909da9066ca 100644 --- a/boards/arm/nucleo_g474re/pinmux.c +++ b/boards/arm/nucleo_g474re/pinmux.c @@ -14,10 +14,6 @@ /* pin assignments for NUCLEO-G474RE board */ static const struct pin_config pinconf[] = { -#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c1), okay) && CONFIG_I2C - {STM32_PIN_PB8, STM32G4X_PINMUX_FUNC_PB8_I2C1_SCL}, - {STM32_PIN_PB9, STM32G4X_PINMUX_FUNC_PB9_I2C1_SDA}, -#endif #if DT_NODE_HAS_STATUS(DT_NODELABEL(spi1), okay) && CONFIG_SPI /* SPI1 on the Arduino connectors pins A2, D3, D11, D12 */ #ifdef CONFIG_SPI_STM32_USE_HW_SS diff --git a/boards/arm/nucleo_h743zi/nucleo_h743zi.dts b/boards/arm/nucleo_h743zi/nucleo_h743zi.dts index e9d4f582156..c9c8a073476 100644 --- a/boards/arm/nucleo_h743zi/nucleo_h743zi.dts +++ b/boards/arm/nucleo_h743zi/nucleo_h743zi.dts @@ -68,6 +68,7 @@ }; &i2c1 { + pinctrl-0 = <&i2c1_scl_pb8 &i2c1_sda_pb9>; status = "okay"; clock-frequency = ; }; diff --git a/boards/arm/nucleo_h743zi/pinmux.c b/boards/arm/nucleo_h743zi/pinmux.c index 65ab316a874..12c491c73cc 100644 --- a/boards/arm/nucleo_h743zi/pinmux.c +++ b/boards/arm/nucleo_h743zi/pinmux.c @@ -14,10 +14,6 @@ /* NUCLEO-H743ZI pin configurations */ static const struct pin_config pinconf[] = { -#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c1), okay) && CONFIG_I2C - { STM32_PIN_PB8, STM32H7_PINMUX_FUNC_PB8_I2C1_SCL }, - { STM32_PIN_PB9, STM32H7_PINMUX_FUNC_PB9_I2C1_SDA }, -#endif }; static int pinmux_stm32_init(const struct device *port) diff --git a/boards/arm/nucleo_h745zi_q/nucleo_h745zi_q_m7.dts b/boards/arm/nucleo_h745zi_q/nucleo_h745zi_q_m7.dts index a3087240445..90e738f2872 100644 --- a/boards/arm/nucleo_h745zi_q/nucleo_h745zi_q_m7.dts +++ b/boards/arm/nucleo_h745zi_q/nucleo_h745zi_q_m7.dts @@ -50,6 +50,7 @@ }; &i2c1 { + pinctrl-0 = <&i2c1_scl_pb8 &i2c1_sda_pb9>; status = "okay"; clock-frequency = ; }; diff --git a/boards/arm/nucleo_h745zi_q/pinmux.c b/boards/arm/nucleo_h745zi_q/pinmux.c index 022d583baf7..f6d2362adcb 100644 --- a/boards/arm/nucleo_h745zi_q/pinmux.c +++ b/boards/arm/nucleo_h745zi_q/pinmux.c @@ -34,10 +34,6 @@ static const struct pin_config pinconf[] = { { STM32_PIN_PG13, STM32H7_PINMUX_FUNC_PG13_ETH_TXD0 }, { STM32_PIN_PB13, STM32H7_PINMUX_FUNC_PB13_ETH_TXD1 }, #endif -#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c1), okay) && CONFIG_I2C - { STM32_PIN_PB8, STM32H7_PINMUX_FUNC_PB8_I2C1_SCL }, - { STM32_PIN_PB9, STM32H7_PINMUX_FUNC_PB9_I2C1_SDA }, -#endif }; static int pinmux_stm32_init(const struct device *port) diff --git a/boards/arm/nucleo_l053r8/nucleo_l053r8.dts b/boards/arm/nucleo_l053r8/nucleo_l053r8.dts index 731829a22f6..95821e2c3af 100644 --- a/boards/arm/nucleo_l053r8/nucleo_l053r8.dts +++ b/boards/arm/nucleo_l053r8/nucleo_l053r8.dts @@ -60,6 +60,7 @@ }; &i2c1 { + pinctrl-0 = <&i2c1_scl_pb8 &i2c1_sda_pb9>; status = "okay"; clock-frequency = ; }; diff --git a/boards/arm/nucleo_l053r8/pinmux.c b/boards/arm/nucleo_l053r8/pinmux.c index ff3a62239a8..f2bcf447717 100644 --- a/boards/arm/nucleo_l053r8/pinmux.c +++ b/boards/arm/nucleo_l053r8/pinmux.c @@ -14,10 +14,6 @@ /* pin assignments for NUCLEO-L053R8 board */ static const struct pin_config pinconf[] = { -#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c1), okay) && CONFIG_I2C - {STM32_PIN_PB8, STM32L0_PINMUX_FUNC_PB8_I2C1_SCL}, - {STM32_PIN_PB9, STM32L0_PINMUX_FUNC_PB9_I2C1_SDA}, -#endif #if DT_NODE_HAS_STATUS(DT_NODELABEL(spi1), okay) && CONFIG_SPI {STM32_PIN_PA5, STM32L0_PINMUX_FUNC_PA5_SPI1_SCK}, {STM32_PIN_PA6, STM32L0_PINMUX_FUNC_PA6_SPI1_MISO}, diff --git a/boards/arm/nucleo_l073rz/nucleo_l073rz.dts b/boards/arm/nucleo_l073rz/nucleo_l073rz.dts index baf4aa917fb..dcbf89a475c 100644 --- a/boards/arm/nucleo_l073rz/nucleo_l073rz.dts +++ b/boards/arm/nucleo_l073rz/nucleo_l073rz.dts @@ -54,6 +54,7 @@ }; &i2c1 { + pinctrl-0 = <&i2c1_scl_pb8 &i2c1_sda_pb9>; status = "okay"; clock-frequency = ; }; diff --git a/boards/arm/nucleo_l073rz/pinmux.c b/boards/arm/nucleo_l073rz/pinmux.c index eb20965e7f4..3a783f4ad0e 100644 --- a/boards/arm/nucleo_l073rz/pinmux.c +++ b/boards/arm/nucleo_l073rz/pinmux.c @@ -14,10 +14,6 @@ /* pin assignments for NUCLEO-L073RZ board */ static const struct pin_config pinconf[] = { -#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c1), okay) && CONFIG_I2C - {STM32_PIN_PB8, STM32L0_PINMUX_FUNC_PB8_I2C1_SCL}, - {STM32_PIN_PB9, STM32L0_PINMUX_FUNC_PB9_I2C1_SDA}, -#endif #if DT_NODE_HAS_STATUS(DT_NODELABEL(spi1), okay) && CONFIG_SPI {STM32_PIN_PA5, STM32L0_PINMUX_FUNC_PA5_SPI1_SCK}, {STM32_PIN_PA6, STM32L0_PINMUX_FUNC_PA6_SPI1_MISO}, diff --git a/boards/arm/nucleo_l152re/nucleo_l152re.dts b/boards/arm/nucleo_l152re/nucleo_l152re.dts index 33d63ef0982..187ec056227 100644 --- a/boards/arm/nucleo_l152re/nucleo_l152re.dts +++ b/boards/arm/nucleo_l152re/nucleo_l152re.dts @@ -50,6 +50,7 @@ }; &i2c1 { + pinctrl-0 = <&i2c1_scl_pb8 &i2c1_sda_pb9>; status = "okay"; }; diff --git a/boards/arm/nucleo_l152re/pinmux.c b/boards/arm/nucleo_l152re/pinmux.c index 2c585c3ae42..c2be31ac580 100644 --- a/boards/arm/nucleo_l152re/pinmux.c +++ b/boards/arm/nucleo_l152re/pinmux.c @@ -13,10 +13,6 @@ #include static const struct pin_config pinconf[] = { -#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c1), okay) && CONFIG_I2C - {STM32_PIN_PB8, STM32L1X_PINMUX_FUNC_PB8_I2C1_SCL}, - {STM32_PIN_PB9, STM32L1X_PINMUX_FUNC_PB9_I2C1_SDA}, -#endif }; static int pinmux_stm32_init(const struct device *port) diff --git a/boards/arm/nucleo_l432kc/nucleo_l432kc.dts b/boards/arm/nucleo_l432kc/nucleo_l432kc.dts index ac9080f296c..cccfb8122ec 100644 --- a/boards/arm/nucleo_l432kc/nucleo_l432kc.dts +++ b/boards/arm/nucleo_l432kc/nucleo_l432kc.dts @@ -48,6 +48,12 @@ status = "okay"; }; +&i2c1 { + pinctrl-0 = <&i2c1_scl_pb6 &i2c1_sda_pb7>; + clock-frequency = ; + status = "okay"; +}; + &timers2 { status = "okay"; diff --git a/boards/arm/nucleo_l432kc/pinmux.c b/boards/arm/nucleo_l432kc/pinmux.c index 256f5c99edb..87aaaf39318 100644 --- a/boards/arm/nucleo_l432kc/pinmux.c +++ b/boards/arm/nucleo_l432kc/pinmux.c @@ -15,10 +15,6 @@ /* pin assignments for NUCLEO-L432KC board */ static const struct pin_config pinconf[] = { -#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c1), okay) && CONFIG_I2C - {STM32_PIN_PB6, STM32L4X_PINMUX_FUNC_PB6_I2C1_SCL}, - {STM32_PIN_PB7, STM32L4X_PINMUX_FUNC_PB7_I2C1_SDA}, -#endif #if DT_NODE_HAS_STATUS(DT_NODELABEL(spi1), okay) && CONFIG_SPI #ifdef CONFIG_SPI_STM32_USE_HW_SS {STM32_PIN_PA4, STM32L4X_PINMUX_FUNC_PA4_SPI1_NSS}, diff --git a/boards/arm/nucleo_l452re/nucleo_l452re_common.dtsi b/boards/arm/nucleo_l452re/nucleo_l452re_common.dtsi index 858d42b7889..7ed51189661 100644 --- a/boards/arm/nucleo_l452re/nucleo_l452re_common.dtsi +++ b/boards/arm/nucleo_l452re/nucleo_l452re_common.dtsi @@ -49,6 +49,12 @@ status = "okay"; }; +&i2c1 { + pinctrl-0 = <&i2c1_scl_pb6 &i2c1_sda_pb7>; + clock-frequency = ; + status = "okay"; +}; + &timers2 { status = "okay"; diff --git a/boards/arm/nucleo_l452re/pinmux.c b/boards/arm/nucleo_l452re/pinmux.c index 32f34921021..78c50d9ed13 100644 --- a/boards/arm/nucleo_l452re/pinmux.c +++ b/boards/arm/nucleo_l452re/pinmux.c @@ -14,10 +14,6 @@ /* pin assignments for NUCLEO-L452RE board */ static const struct pin_config pinconf[] = { -#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c1), okay) && CONFIG_I2C - {STM32_PIN_PB6, STM32L4X_PINMUX_FUNC_PB6_I2C1_SCL}, - {STM32_PIN_PB7, STM32L4X_PINMUX_FUNC_PB7_I2C1_SDA}, -#endif #if DT_NODE_HAS_STATUS(DT_NODELABEL(spi1), okay) && CONFIG_SPI #ifdef CONFIG_SPI_STM32_USE_HW_SS {STM32_PIN_PA4, STM32L4X_PINMUX_FUNC_PA4_SPI1_NSS}, diff --git a/boards/arm/nucleo_l476rg/nucleo_l476rg.dts b/boards/arm/nucleo_l476rg/nucleo_l476rg.dts index ef8cc3b90aa..8ce429fc6fa 100644 --- a/boards/arm/nucleo_l476rg/nucleo_l476rg.dts +++ b/boards/arm/nucleo_l476rg/nucleo_l476rg.dts @@ -60,11 +60,13 @@ }; &i2c1 { + pinctrl-0 = <&i2c1_scl_pb8 &i2c1_sda_pb9>; status = "okay"; clock-frequency = ; }; &i2c3 { + pinctrl-0 = <&i2c3_scl_pc0 &i2c3_sda_pc1>; status = "okay"; clock-frequency = ; }; diff --git a/boards/arm/nucleo_l476rg/pinmux.c b/boards/arm/nucleo_l476rg/pinmux.c index 769005d901b..c4f8634a030 100644 --- a/boards/arm/nucleo_l476rg/pinmux.c +++ b/boards/arm/nucleo_l476rg/pinmux.c @@ -15,14 +15,6 @@ /* pin assignments for NUCLEO-L476RG board */ static const struct pin_config pinconf[] = { -#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c1), okay) && CONFIG_I2C - {STM32_PIN_PB8, STM32L4X_PINMUX_FUNC_PB8_I2C1_SCL}, - {STM32_PIN_PB9, STM32L4X_PINMUX_FUNC_PB9_I2C1_SDA}, -#endif -#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c3), okay) && CONFIG_I2C - {STM32_PIN_PC0, STM32L4X_PINMUX_FUNC_PC0_I2C3_SCL}, - {STM32_PIN_PC1, STM32L4X_PINMUX_FUNC_PC1_I2C3_SDA}, -#endif #if DT_NODE_HAS_STATUS(DT_NODELABEL(spi1), okay) && CONFIG_SPI /* SPI1 on the Arduino connectors pins A2, D3, D12, D11 */ #ifdef CONFIG_SPI_STM32_USE_HW_SS diff --git a/boards/arm/nucleo_l496zg/nucleo_l496zg.dts b/boards/arm/nucleo_l496zg/nucleo_l496zg.dts index 0df0d85939e..5dd678f9a10 100644 --- a/boards/arm/nucleo_l496zg/nucleo_l496zg.dts +++ b/boards/arm/nucleo_l496zg/nucleo_l496zg.dts @@ -108,6 +108,7 @@ }; &i2c1 { + pinctrl-0 = <&i2c1_scl_pb8 &i2c1_sda_pb9>; status = "okay"; clock-frequency = ; }; diff --git a/boards/arm/nucleo_l496zg/pinmux.c b/boards/arm/nucleo_l496zg/pinmux.c index d57cd6df73b..020def962a9 100644 --- a/boards/arm/nucleo_l496zg/pinmux.c +++ b/boards/arm/nucleo_l496zg/pinmux.c @@ -14,10 +14,6 @@ /* pin assignments for NUCLEO-L496ZG board */ static const struct pin_config pinconf[] = { -#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c1), okay) && CONFIG_I2C - {STM32_PIN_PB8, STM32L4X_PINMUX_FUNC_PB8_I2C1_SCL}, - {STM32_PIN_PB9, STM32L4X_PINMUX_FUNC_PB9_I2C1_SDA}, -#endif #if DT_NODE_HAS_STATUS(DT_NODELABEL(spi1), okay) && CONFIG_SPI {STM32_PIN_PA5, STM32L4X_PINMUX_FUNC_PA5_SPI1_SCK}, {STM32_PIN_PA6, STM32L4X_PINMUX_FUNC_PA6_SPI1_MISO}, diff --git a/boards/arm/nucleo_l4r5zi/nucleo_l4r5zi.dts b/boards/arm/nucleo_l4r5zi/nucleo_l4r5zi.dts index 4ca92d5c1bd..a14a18429ee 100644 --- a/boards/arm/nucleo_l4r5zi/nucleo_l4r5zi.dts +++ b/boards/arm/nucleo_l4r5zi/nucleo_l4r5zi.dts @@ -79,6 +79,7 @@ }; &i2c1 { + pinctrl-0 = <&i2c1_scl_pb6 &i2c1_sda_pb7>; status = "okay"; }; diff --git a/boards/arm/nucleo_l4r5zi/pinmux.c b/boards/arm/nucleo_l4r5zi/pinmux.c index ddb4b2b2ded..b8cc2631a5b 100644 --- a/boards/arm/nucleo_l4r5zi/pinmux.c +++ b/boards/arm/nucleo_l4r5zi/pinmux.c @@ -14,10 +14,6 @@ /* pin assignments for NUCLEO-L4R5ZI board */ static const struct pin_config pinconf[] = { -#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c1), okay) && CONFIG_I2C - {STM32_PIN_PB6, STM32L4X_PINMUX_FUNC_PB6_I2C1_SCL}, - {STM32_PIN_PB7, STM32L4X_PINMUX_FUNC_PB7_I2C1_SDA}, -#endif #if DT_NODE_HAS_STATUS(DT_NODELABEL(spi1), okay) && CONFIG_SPI /* SPI1 on the Arduino connectors pins A2, D3, D12, D11 */ #ifdef CONFIG_SPI_STM32_USE_HW_SS diff --git a/boards/arm/nucleo_wb55rg/nucleo_wb55rg.dts b/boards/arm/nucleo_wb55rg/nucleo_wb55rg.dts index d77df390fc5..e5d557b938c 100644 --- a/boards/arm/nucleo_wb55rg/nucleo_wb55rg.dts +++ b/boards/arm/nucleo_wb55rg/nucleo_wb55rg.dts @@ -69,11 +69,13 @@ }; &i2c1 { + pinctrl-0 = <&i2c1_scl_pb8 &i2c1_sda_pb9>; status = "okay"; clock-frequency = ; }; &i2c3 { + pinctrl-0 = <&i2c3_scl_pc0 &i2c3_sda_pc1>; status = "okay"; clock-frequency = ; }; diff --git a/boards/arm/nucleo_wb55rg/pinmux.c b/boards/arm/nucleo_wb55rg/pinmux.c index 567e8a732e3..d11c080ef25 100644 --- a/boards/arm/nucleo_wb55rg/pinmux.c +++ b/boards/arm/nucleo_wb55rg/pinmux.c @@ -14,14 +14,6 @@ /* pin assignments for NUCLEO-WB55RG board */ static const struct pin_config pinconf[] = { -#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c1), okay) && CONFIG_I2C - {STM32_PIN_PB8, STM32WBX_PINMUX_FUNC_PB8_I2C1_SCL}, - {STM32_PIN_PB9, STM32WBX_PINMUX_FUNC_PB9_I2C1_SDA}, -#endif -#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c3), okay) && CONFIG_I2C - {STM32_PIN_PC0, STM32WBX_PINMUX_FUNC_PC0_I2C3_SCL}, - {STM32_PIN_PC1, STM32WBX_PINMUX_FUNC_PC1_I2C3_SDA}, -#endif #if DT_NODE_HAS_STATUS(DT_NODELABEL(spi1), okay) && CONFIG_SPI #ifdef CONFIG_SPI_STM32_USE_HW_SS {STM32_PIN_PA4, STM32WBX_PINMUX_FUNC_PA4_SPI1_NSS}, diff --git a/boards/arm/olimex_stm32_h103/olimex_stm32_h103.dts b/boards/arm/olimex_stm32_h103/olimex_stm32_h103.dts index 6ef19470cc5..8d3bccd180d 100644 --- a/boards/arm/olimex_stm32_h103/olimex_stm32_h103.dts +++ b/boards/arm/olimex_stm32_h103/olimex_stm32_h103.dts @@ -58,11 +58,13 @@ }; &i2c1 { + pinctrl-0 = <&i2c1_scl_pb6 &i2c1_sda_pb7>; status = "okay"; clock-frequency = ; }; &i2c2 { + pinctrl-0 = <&i2c2_scl_pb10 &i2c2_sda_pb11>; status = "okay"; clock-frequency = ; }; diff --git a/boards/arm/olimex_stm32_h103/pinmux.c b/boards/arm/olimex_stm32_h103/pinmux.c index 7400155343e..fc678dbb426 100644 --- a/boards/arm/olimex_stm32_h103/pinmux.c +++ b/boards/arm/olimex_stm32_h103/pinmux.c @@ -14,14 +14,6 @@ /* pin assignments for OLIMEX-STM32-H103 board */ static const struct pin_config pinconf[] = { -#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c1), okay) && CONFIG_I2C - {STM32_PIN_PB6, STM32F1_PINMUX_FUNC_PB6_I2C1_SCL}, - {STM32_PIN_PB7, STM32F1_PINMUX_FUNC_PB7_I2C1_SDA}, -#endif -#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c2), okay) && CONFIG_I2C - {STM32_PIN_PB10, STM32F1_PINMUX_FUNC_PB10_I2C2_SCL}, - {STM32_PIN_PB11, STM32F1_PINMUX_FUNC_PB11_I2C2_SDA}, -#endif #if DT_NODE_HAS_STATUS(DT_NODELABEL(spi1), okay) && CONFIG_SPI #ifdef CONFIG_SPI_STM32_USE_HW_SS {STM32_PIN_PA4, STM32F1_PINMUX_FUNC_PA4_SPI1_MASTER_NSS_OE}, diff --git a/boards/arm/olimexino_stm32/olimexino_stm32.dts b/boards/arm/olimexino_stm32/olimexino_stm32.dts index c7d10fd06d9..7cc16889d7c 100644 --- a/boards/arm/olimexino_stm32/olimexino_stm32.dts +++ b/boards/arm/olimexino_stm32/olimexino_stm32.dts @@ -68,11 +68,13 @@ uext_serial: &usart1 {}; }; &i2c1 { + pinctrl-0 = <&i2c1_scl_pb6 &i2c1_sda_pb7>; status = "okay"; clock-frequency = ; }; &i2c2 { + pinctrl-0 = <&i2c2_scl_pb10 &i2c2_sda_pb11>; status = "okay"; clock-frequency = ; }; diff --git a/boards/arm/olimexino_stm32/pinmux.c b/boards/arm/olimexino_stm32/pinmux.c index 4f1b874c0f7..ddbbf963dd7 100644 --- a/boards/arm/olimexino_stm32/pinmux.c +++ b/boards/arm/olimexino_stm32/pinmux.c @@ -15,14 +15,6 @@ /* pin assignments for OLIMEXINO-STM32 board */ static const struct pin_config pinconf[] = { -#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c1), okay) && CONFIG_I2C - {STM32_PIN_PB6, STM32F1_PINMUX_FUNC_PB6_I2C1_SCL}, - {STM32_PIN_PB7, STM32F1_PINMUX_FUNC_PB7_I2C1_SDA}, -#endif -#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c2), okay) && CONFIG_I2C - {STM32_PIN_PB10, STM32F1_PINMUX_FUNC_PB10_I2C2_SCL}, - {STM32_PIN_PB11, STM32F1_PINMUX_FUNC_PB11_I2C2_SDA}, -#endif #if DT_NODE_HAS_STATUS(DT_NODELABEL(spi1), okay) && CONFIG_SPI #ifdef CONFIG_SPI_STM32_USE_HW_SS {STM32_PIN_PA4, STM32F1_PINMUX_FUNC_PA4_SPI1_MASTER_NSS_OE}, diff --git a/boards/arm/sensortile_box/pinmux.c b/boards/arm/sensortile_box/pinmux.c index e40736efd4b..c0071e50260 100644 --- a/boards/arm/sensortile_box/pinmux.c +++ b/boards/arm/sensortile_box/pinmux.c @@ -14,14 +14,6 @@ /* pin assignments for SensorTile.box board */ static const struct pin_config pinconf[] = { -#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c1), okay) && CONFIG_I2C - {STM32_PIN_PB6, STM32L4X_PINMUX_FUNC_PB6_I2C1_SCL}, - {STM32_PIN_PB7, STM32L4X_PINMUX_FUNC_PB7_I2C1_SDA}, -#endif -#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c3), okay) && CONFIG_I2C - {STM32_PIN_PG7, STM32L4X_PINMUX_FUNC_PG7_I2C3_SCL}, - {STM32_PIN_PG8, STM32L4X_PINMUX_FUNC_PG8_I2C3_SDA}, -#endif #if DT_NODE_HAS_STATUS(DT_NODELABEL(spi1), okay) && CONFIG_SPI {STM32_PIN_PE12, STM32L4X_PINMUX_FUNC_PE12_SPI1_NSS}, {STM32_PIN_PE13, STM32L4X_PINMUX_FUNC_PE13_SPI1_SCK}, diff --git a/boards/arm/sensortile_box/sensortile_box.dts b/boards/arm/sensortile_box/sensortile_box.dts index c03d8618773..09973def5d3 100644 --- a/boards/arm/sensortile_box/sensortile_box.dts +++ b/boards/arm/sensortile_box/sensortile_box.dts @@ -60,6 +60,7 @@ }; &i2c1 { + pinctrl-0 = <&i2c1_scl_pb6 &i2c1_sda_pb7>; status = "okay"; clock-frequency = ; @@ -79,6 +80,7 @@ }; &i2c3 { + pinctrl-0 = <&i2c3_scl_pg7 &i2c3_sda_pg8>; status = "okay"; clock-frequency = ; diff --git a/boards/arm/steval_fcu001v1/pinmux.c b/boards/arm/steval_fcu001v1/pinmux.c index 05d71d6b5ee..cf918a554e2 100644 --- a/boards/arm/steval_fcu001v1/pinmux.c +++ b/boards/arm/steval_fcu001v1/pinmux.c @@ -14,10 +14,6 @@ /* pin assignments for STEVAL-FCU001V1 */ static const struct pin_config pinconf[] = { -#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c2), okay) && CONFIG_I2C - {STM32_PIN_PB3, STM32F4_PINMUX_FUNC_PB3_I2C2_SDA}, - {STM32_PIN_PB10, STM32F4_PINMUX_FUNC_PB10_I2C2_SCL}, -#endif }; static int pinmux_stm32_init(const struct device *port) diff --git a/boards/arm/steval_fcu001v1/steval_fcu001v1.dts b/boards/arm/steval_fcu001v1/steval_fcu001v1.dts index 1c5b7dd96e1..d3c8f1b3e4d 100644 --- a/boards/arm/steval_fcu001v1/steval_fcu001v1.dts +++ b/boards/arm/steval_fcu001v1/steval_fcu001v1.dts @@ -39,6 +39,7 @@ }; &i2c2 { + pinctrl-0 = <&i2c2_sda_pb3 &i2c2_scl_pb10>; status = "okay"; clock-frequency = ; }; diff --git a/boards/arm/stm32_min_dev/pinmux.c b/boards/arm/stm32_min_dev/pinmux.c index 4f924f5175c..b4734439e2c 100644 --- a/boards/arm/stm32_min_dev/pinmux.c +++ b/boards/arm/stm32_min_dev/pinmux.c @@ -14,14 +14,6 @@ /* pin assignments for STM32_MIN_DEV board */ static const struct pin_config pinconf[] = { -#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c1), okay) && CONFIG_I2C - {STM32_PIN_PB6, STM32F1_PINMUX_FUNC_PB6_I2C1_SCL}, - {STM32_PIN_PB7, STM32F1_PINMUX_FUNC_PB7_I2C1_SDA}, -#endif -#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c2), okay) && CONFIG_I2C - {STM32_PIN_PB10, STM32F1_PINMUX_FUNC_PB10_I2C2_SCL}, - {STM32_PIN_PB11, STM32F1_PINMUX_FUNC_PB11_I2C2_SDA}, -#endif #if DT_NODE_HAS_STATUS(DT_NODELABEL(spi1), okay) && CONFIG_SPI #ifdef CONFIG_SPI_STM32_USE_HW_SS {STM32_PIN_PA4, STM32F1_PINMUX_FUNC_PA4_SPI1_MASTER_NSS_OE}, diff --git a/boards/arm/stm32_min_dev/stm32_min_dev.dtsi b/boards/arm/stm32_min_dev/stm32_min_dev.dtsi index 945c6439499..dc52bf63633 100644 --- a/boards/arm/stm32_min_dev/stm32_min_dev.dtsi +++ b/boards/arm/stm32_min_dev/stm32_min_dev.dtsi @@ -52,11 +52,13 @@ }; &i2c1 { + pinctrl-0 = < &i2c1_scl_pb6 &i2c1_sda_pb7 >; status = "okay"; clock-frequency = ; }; &i2c2 { + pinctrl-0 = < &i2c2_scl_pb10 &i2c2_sda_pb11 >; status = "okay"; clock-frequency = ; }; diff --git a/boards/arm/stm32f072b_disco/pinmux.c b/boards/arm/stm32f072b_disco/pinmux.c index ed33a2ed9af..a24461eb156 100644 --- a/boards/arm/stm32f072b_disco/pinmux.c +++ b/boards/arm/stm32f072b_disco/pinmux.c @@ -15,14 +15,6 @@ /* pin assignments for STM32F072B-DISCO board */ static const struct pin_config pinconf[] = { -#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c1), okay) && CONFIG_I2C - {STM32_PIN_PB8, STM32F0_PINMUX_FUNC_PB8_I2C1_SCL}, - {STM32_PIN_PB9, STM32F0_PINMUX_FUNC_PB9_I2C1_SDA}, -#endif -#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c2), okay) && CONFIG_I2C - {STM32_PIN_PB10, STM32F0_PINMUX_FUNC_PB10_I2C2_SCL}, - {STM32_PIN_PB11, STM32F0_PINMUX_FUNC_PB11_I2C2_SDA}, -#endif #if DT_NODE_HAS_STATUS(DT_NODELABEL(spi1), okay) && CONFIG_SPI {STM32_PIN_PB3, STM32F0_PINMUX_FUNC_PB3_SPI1_SCK}, {STM32_PIN_PB4, STM32F0_PINMUX_FUNC_PB4_SPI1_MISO}, diff --git a/boards/arm/stm32f072b_disco/stm32f072b_disco.dts b/boards/arm/stm32f072b_disco/stm32f072b_disco.dts index cdce44ae580..ec802e9de0f 100644 --- a/boards/arm/stm32f072b_disco/stm32f072b_disco.dts +++ b/boards/arm/stm32f072b_disco/stm32f072b_disco.dts @@ -64,11 +64,13 @@ }; &i2c1 { + pinctrl-0 = <&i2c1_scl_pb8 &i2c1_sda_pb9>; status = "okay"; clock-frequency = ; }; &i2c2 { + pinctrl-0 = <&i2c2_scl_pb10 &i2c2_sda_pb11>; status = "okay"; clock-frequency = ; }; diff --git a/boards/arm/stm32f3_disco/pinmux.c b/boards/arm/stm32f3_disco/pinmux.c index fc7300e6ec3..b194bbe813b 100644 --- a/boards/arm/stm32f3_disco/pinmux.c +++ b/boards/arm/stm32f3_disco/pinmux.c @@ -14,14 +14,6 @@ /* pin assignments for STM32F3DISCOVERY board */ static const struct pin_config pinconf[] = { -#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c1), okay) && CONFIG_I2C - {STM32_PIN_PB6, STM32F3_PINMUX_FUNC_PB6_I2C1_SCL}, - {STM32_PIN_PB7, STM32F3_PINMUX_FUNC_PB7_I2C1_SDA}, -#endif -#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c2), okay) && CONFIG_I2C - {STM32_PIN_PA9, STM32F3_PINMUX_FUNC_PA9_I2C2_SCL}, - {STM32_PIN_PA10, STM32F3_PINMUX_FUNC_PA10_I2C2_SDA}, -#endif #if DT_NODE_HAS_STATUS(DT_NODELABEL(spi1), okay) && CONFIG_SPI #ifdef CONFIG_SPI_STM32_USE_HW_SS {STM32_PIN_PA4, STM32F3_PINMUX_FUNC_PA4_SPI1_NSS}, diff --git a/boards/arm/stm32f3_disco/stm32f3_disco.dts b/boards/arm/stm32f3_disco/stm32f3_disco.dts index e78607986e3..c4be66131bb 100644 --- a/boards/arm/stm32f3_disco/stm32f3_disco.dts +++ b/boards/arm/stm32f3_disco/stm32f3_disco.dts @@ -84,6 +84,7 @@ }; &i2c1 { + pinctrl-0 = <&i2c1_scl_pb6 &i2c1_sda_pb7>; status = "okay"; clock-frequency = ; @@ -103,6 +104,7 @@ }; &i2c2 { + pinctrl-0 = <&i2c2_scl_pa9 &i2c2_sda_pa10>; status = "okay"; clock-frequency = ; }; diff --git a/boards/arm/stm32f429i_disc1/pinmux.c b/boards/arm/stm32f429i_disc1/pinmux.c index d4cdbc3b8aa..4c286dd17f5 100644 --- a/boards/arm/stm32f429i_disc1/pinmux.c +++ b/boards/arm/stm32f429i_disc1/pinmux.c @@ -22,18 +22,6 @@ static const struct pin_config pinconf[] = { {STM32_PIN_PF8, STM32F4_PINMUX_FUNC_PF8_SPI5_MASTER_MISO}, {STM32_PIN_PF9, STM32F4_PINMUX_FUNC_PF9_SPI5_MASTER_MOSI}, #endif -#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c1), okay) && CONFIG_I2C - {STM32_PIN_PB8, STM32F4_PINMUX_FUNC_PB8_I2C1_SCL}, - {STM32_PIN_PB9, STM32F4_PINMUX_FUNC_PB9_I2C1_SDA}, -#endif -#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c2), okay) && CONFIG_I2C - {STM32_PIN_PB10, STM32F4_PINMUX_FUNC_PB10_I2C2_SCL}, - {STM32_PIN_PB11, STM32F4_PINMUX_FUNC_PB11_I2C2_SDA}, -#endif -#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c3), okay) && CONFIG_I2C - {STM32_PIN_PA8, STM32F4_PINMUX_FUNC_PA8_I2C3_SCL}, - {STM32_PIN_PC9, STM32F4_PINMUX_FUNC_PC9_I2C3_SDA}, -#endif }; static int pinmux_stm32_init(const struct device *port) diff --git a/boards/arm/stm32f429i_disc1/stm32f429i_disc1.dts b/boards/arm/stm32f429i_disc1/stm32f429i_disc1.dts index f10d0cfc601..23f0b3a719f 100644 --- a/boards/arm/stm32f429i_disc1/stm32f429i_disc1.dts +++ b/boards/arm/stm32f429i_disc1/stm32f429i_disc1.dts @@ -62,11 +62,26 @@ status = "okay"; }; -&i2c3 { +&i2c1 { + pinctrl-0 = <&i2c1_scl_pb8 &i2c1_sda_pb9>; status = "okay"; clock-frequency = ; }; +&i2c2 { + pinctrl-0 = <&i2c2_scl_pb10 &i2c2_sda_pb11>; + status = "okay"; + clock-frequency = ; +}; + +&i2c3 { + pinctrl-0 = <&i2c3_scl_pa8 &i2c3_sda_pc9>; + status = "okay"; + clock-frequency = ; +}; + + + &spi5 { status = "okay"; cs-gpios = <&gpioc 2 GPIO_ACTIVE_LOW>; diff --git a/boards/arm/stm32f469i_disco/pinmux.c b/boards/arm/stm32f469i_disco/pinmux.c index 3c865fa2a1b..aba67b24792 100644 --- a/boards/arm/stm32f469i_disco/pinmux.c +++ b/boards/arm/stm32f469i_disco/pinmux.c @@ -14,10 +14,6 @@ /* pin assignments for STM32F469I-DISCO board */ static const struct pin_config pinconf[] = { -#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c1), okay) && CONFIG_I2C - {STM32_PIN_PB8, STM32F4_PINMUX_FUNC_PB8_I2C1_SCL}, - {STM32_PIN_PB9, STM32F4_PINMUX_FUNC_PB9_I2C1_SDA}, -#endif #if DT_NODE_HAS_STATUS(DT_NODELABEL(spi2), okay) && CONFIG_SPI {STM32_PIN_PD3, STM32F4_PINMUX_FUNC_PD3_SPI2_SCK}, {STM32_PIN_PB14, STM32F4_PINMUX_FUNC_PB14_SPI2_MISO}, diff --git a/boards/arm/stm32f469i_disco/stm32f469i_disco.dts b/boards/arm/stm32f469i_disco/stm32f469i_disco.dts index 8bab3e00224..a4c0fe9dedc 100644 --- a/boards/arm/stm32f469i_disco/stm32f469i_disco.dts +++ b/boards/arm/stm32f469i_disco/stm32f469i_disco.dts @@ -74,6 +74,7 @@ arduino_serial: &usart6 {}; }; &i2c1 { + pinctrl-0 = <&i2c1_scl_pb8 &i2c1_sda_pb9>; status = "okay"; }; diff --git a/boards/arm/stm32f723e_disco/pinmux.c b/boards/arm/stm32f723e_disco/pinmux.c index 5c26e89a09e..e382257d3a9 100644 --- a/boards/arm/stm32f723e_disco/pinmux.c +++ b/boards/arm/stm32f723e_disco/pinmux.c @@ -14,18 +14,6 @@ /* pin assignments for STM32F723E-DISCO board */ static const struct pin_config pinconf[] = { -#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c1), okay) && CONFIG_I2C - {STM32_PIN_PB8, STM32F7_PINMUX_FUNC_PB8_I2C1_SCL}, - {STM32_PIN_PB9, STM32F7_PINMUX_FUNC_PB9_I2C1_SDA}, -#endif -#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c2), okay) && CONFIG_I2C - {STM32_PIN_PH4, STM32F7_PINMUX_FUNC_PH4_I2C2_SCL}, - {STM32_PIN_PH5, STM32F7_PINMUX_FUNC_PH5_I2C2_SDA}, -#endif -#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c3), okay) && CONFIG_I2C - {STM32_PIN_PA8, STM32F7_PINMUX_FUNC_PA8_I2C3_SCL}, - {STM32_PIN_PH8, STM32F7_PINMUX_FUNC_PH8_I2C3_SDA}, -#endif #if DT_NODE_HAS_STATUS(DT_NODELABEL(spi1), okay) && CONFIG_SPI {STM32_PIN_PA5, STM32F7_PINMUX_FUNC_PA5_SPI1_SCK}, {STM32_PIN_PB4, STM32F7_PINMUX_FUNC_PB4_SPI1_MISO}, diff --git a/boards/arm/stm32f723e_disco/stm32f723e_disco.dts b/boards/arm/stm32f723e_disco/stm32f723e_disco.dts index f57d6f6810b..6775f2c5c5b 100644 --- a/boards/arm/stm32f723e_disco/stm32f723e_disco.dts +++ b/boards/arm/stm32f723e_disco/stm32f723e_disco.dts @@ -68,14 +68,17 @@ arduino_serial: &usart2 {}; }; &i2c1 { + pinctrl-0 = <&i2c1_scl_pb8 &i2c1_sda_pb9>; status = "okay"; }; &i2c2 { + pinctrl-0 = <&i2c2_scl_ph4 &i2c2_sda_ph5>; status = "okay"; }; &i2c3 { + pinctrl-0 = <&i2c3_scl_pa8 &i2c3_sda_ph8>; status = "okay"; }; diff --git a/boards/arm/stm32f746g_disco/pinmux.c b/boards/arm/stm32f746g_disco/pinmux.c index 73621d942ab..5c71f58abe7 100644 --- a/boards/arm/stm32f746g_disco/pinmux.c +++ b/boards/arm/stm32f746g_disco/pinmux.c @@ -27,14 +27,6 @@ static const struct pin_config pinconf[] = { {STM32_PIN_PG13, STM32F7_PINMUX_FUNC_PG13_ETH}, {STM32_PIN_PG14, STM32F7_PINMUX_FUNC_PG14_ETH}, #endif -#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c1), okay) && CONFIG_I2C - {STM32_PIN_PB8, STM32F7_PINMUX_FUNC_PB8_I2C1_SCL}, - {STM32_PIN_PB9, STM32F7_PINMUX_FUNC_PB9_I2C1_SDA}, -#endif -#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c3), okay) && CONFIG_I2C - {STM32_PIN_PH7, STM32F7_PINMUX_FUNC_PH7_I2C3_SCL}, - {STM32_PIN_PH8, STM32F7_PINMUX_FUNC_PH8_I2C3_SDA}, -#endif #if DT_NODE_HAS_STATUS(DT_NODELABEL(spi2), okay) && CONFIG_SPI #ifdef CONFIG_SPI_STM32_USE_HW_SS {STM32_PIN_PI0, STM32F7_PINMUX_FUNC_PI0_SPI2_NSS}, diff --git a/boards/arm/stm32f746g_disco/stm32f746g_disco.dts b/boards/arm/stm32f746g_disco/stm32f746g_disco.dts index a5d835ada44..1a59055e2b3 100644 --- a/boards/arm/stm32f746g_disco/stm32f746g_disco.dts +++ b/boards/arm/stm32f746g_disco/stm32f746g_disco.dts @@ -45,11 +45,13 @@ }; &i2c1 { + pinctrl-0 = <&i2c1_scl_pb8 &i2c1_sda_pb9>; status = "okay"; clock-frequency = ; }; &i2c3 { + pinctrl-0 = <&i2c3_scl_ph7 &i2c3_sda_ph8>; status = "okay"; clock-frequency = ; diff --git a/boards/arm/stm32f769i_disco/pinmux.c b/boards/arm/stm32f769i_disco/pinmux.c index e1656b2e4ee..c6d77887772 100644 --- a/boards/arm/stm32f769i_disco/pinmux.c +++ b/boards/arm/stm32f769i_disco/pinmux.c @@ -14,10 +14,6 @@ /* pin assignments for STM32F769I-DISCO board */ static const struct pin_config pinconf[] = { -#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c1), okay) && CONFIG_I2C - {STM32_PIN_PB8, STM32F7_PINMUX_FUNC_PB8_I2C1_SCL}, - {STM32_PIN_PB9, STM32F7_PINMUX_FUNC_PB9_I2C1_SDA}, -#endif #if DT_NODE_HAS_STATUS(DT_NODELABEL(spi2), okay) && CONFIG_SPI {STM32_PIN_PA12, STM32F7_PINMUX_FUNC_PA12_SPI2_SCK}, {STM32_PIN_PB14, STM32F7_PINMUX_FUNC_PB14_SPI2_MISO}, diff --git a/boards/arm/stm32f769i_disco/stm32f769i_disco.dts b/boards/arm/stm32f769i_disco/stm32f769i_disco.dts index 0c00501c99c..ad7a99c3241 100644 --- a/boards/arm/stm32f769i_disco/stm32f769i_disco.dts +++ b/boards/arm/stm32f769i_disco/stm32f769i_disco.dts @@ -74,6 +74,7 @@ arduino_serial: &usart6 {}; }; &i2c1 { + pinctrl-0 = <&i2c1_scl_pb8 &i2c1_sda_pb9>; status = "okay"; clock-frequency = ; }; diff --git a/boards/arm/stm32l1_disco/pinmux.c b/boards/arm/stm32l1_disco/pinmux.c index b7ae8df202e..53dd3fc5d0e 100644 --- a/boards/arm/stm32l1_disco/pinmux.c +++ b/boards/arm/stm32l1_disco/pinmux.c @@ -13,14 +13,6 @@ #include static const struct pin_config pinconf[] = { -#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c1), okay) && CONFIG_I2C - {STM32_PIN_PB6, STM32L1X_PINMUX_FUNC_PB6_I2C1_SCL}, - {STM32_PIN_PB7, STM32L1X_PINMUX_FUNC_PB7_I2C1_SDA}, -#endif -#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c2), okay) && CONFIG_I2C - {STM32_PIN_PB10, STM32L1X_PINMUX_FUNC_PB10_I2C2_SCL}, - {STM32_PIN_PB11, STM32L1X_PINMUX_FUNC_PB11_I2C2_SDA}, -#endif #if DT_NODE_HAS_STATUS(DT_NODELABEL(spi1), okay) && CONFIG_SPI #ifdef CONFIG_SPI_STM32_USE_HW_SS {STM32_PIN_PA4, STM32L1X_PINMUX_FUNC_PA4_SPI1_NSS}, diff --git a/boards/arm/stm32l1_disco/stm32l1_disco.dts b/boards/arm/stm32l1_disco/stm32l1_disco.dts index 780c7f4cef4..54affb91c38 100644 --- a/boards/arm/stm32l1_disco/stm32l1_disco.dts +++ b/boards/arm/stm32l1_disco/stm32l1_disco.dts @@ -65,11 +65,13 @@ }; &i2c1 { + pinctrl-0 = <&i2c1_scl_pb6 &i2c1_sda_pb7>; status = "okay"; clock-frequency = ; }; &i2c2 { + pinctrl-0 = <&i2c2_scl_pb10 &i2c2_sda_pb11>; status = "okay"; clock-frequency = ; }; diff --git a/boards/arm/stm32l496g_disco/pinmux.c b/boards/arm/stm32l496g_disco/pinmux.c index fac66ee4a16..aef4d7f0e12 100644 --- a/boards/arm/stm32l496g_disco/pinmux.c +++ b/boards/arm/stm32l496g_disco/pinmux.c @@ -15,10 +15,6 @@ /* pin assignments for STM32L476G-DISCO board */ static const struct pin_config pinconf[] = { -#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c1), okay) && CONFIG_I2C - {STM32_PIN_PB8, STM32L4X_PINMUX_FUNC_PB8_I2C1_SCL}, - {STM32_PIN_PB7, STM32L4X_PINMUX_FUNC_PB7_I2C1_SDA}, -#endif #if DT_NODE_HAS_STATUS(DT_NODELABEL(spi1), okay) && CONFIG_SPI {STM32_PIN_PA5, STM32L4X_PINMUX_FUNC_PA5_SPI1_SCK}, {STM32_PIN_PB4, STM32L4X_PINMUX_FUNC_PB4_SPI1_MISO}, diff --git a/boards/arm/stm32l496g_disco/stm32l496g_disco.dts b/boards/arm/stm32l496g_disco/stm32l496g_disco.dts index dabdb9929f0..980e5f66f42 100644 --- a/boards/arm/stm32l496g_disco/stm32l496g_disco.dts +++ b/boards/arm/stm32l496g_disco/stm32l496g_disco.dts @@ -89,6 +89,7 @@ arduino_serial: &lpuart1 {}; }; &i2c1 { + pinctrl-0 = <&i2c1_scl_pb8 &i2c1_sda_pb7>; status = "okay"; clock-frequency = ; }; diff --git a/boards/arm/stm32mp157c_dk2/pinmux.c b/boards/arm/stm32mp157c_dk2/pinmux.c index 7609d113d38..1e83950bfe9 100644 --- a/boards/arm/stm32mp157c_dk2/pinmux.c +++ b/boards/arm/stm32mp157c_dk2/pinmux.c @@ -14,10 +14,6 @@ /* pin assignments for STM32MP157c_dk2 board */ static const struct pin_config pinconf[] = { -#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c5), okay) && CONFIG_I2C - { STM32_PIN_PA11, STM32MP1X_PINMUX_FUNC_PA11_I2C5_SCL }, - { STM32_PIN_PA12, STM32MP1X_PINMUX_FUNC_PA12_I2C5_SDA }, -#endif #if DT_NODE_HAS_STATUS(DT_NODELABEL(spi4), okay) && CONFIG_SPI #ifdef CONFIG_SPI_STM32_USE_HW_SS {STM32_PIN_PE11, STM32MP1X_PINMUX_FUNC_PE11_SPI4_NSS}, diff --git a/boards/arm/stm32mp157c_dk2/stm32mp157c_dk2.dts b/boards/arm/stm32mp157c_dk2/stm32mp157c_dk2.dts index 319dc82bcd3..a85b571da3e 100644 --- a/boards/arm/stm32mp157c_dk2/stm32mp157c_dk2.dts +++ b/boards/arm/stm32mp157c_dk2/stm32mp157c_dk2.dts @@ -74,6 +74,7 @@ }; &i2c5 { + pinctrl-0 = <&i2c5_scl_pa11 &i2c5_sda_pa12>; status = "okay"; clock-frequency = ; }; diff --git a/boards/arm/stm32vl_disco/pinmux.c b/boards/arm/stm32vl_disco/pinmux.c index 1eead4ebe1f..26db47eb388 100644 --- a/boards/arm/stm32vl_disco/pinmux.c +++ b/boards/arm/stm32vl_disco/pinmux.c @@ -30,14 +30,6 @@ static const struct pin_config pinconf[] = { { STM32_PIN_PB14, STM32F1_PINMUX_FUNC_PB14_SPI2_MASTER_MISO }, { STM32_PIN_PB15, STM32F1_PINMUX_FUNC_PB15_SPI2_MASTER_MOSI }, #endif -#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c1), okay) && CONFIG_I2C - { STM32_PIN_PB6, STM32F1_PINMUX_FUNC_PB6_I2C1_SCL }, - { STM32_PIN_PB7, STM32F1_PINMUX_FUNC_PB7_I2C1_SDA }, -#endif -#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c2), okay) && CONFIG_I2C - { STM32_PIN_PB10, STM32F1_PINMUX_FUNC_PB10_I2C2_SCL }, - { STM32_PIN_PB11, STM32F1_PINMUX_FUNC_PB11_I2C2_SDA }, -#endif }; static int pinmux_stm32_init(const struct device *port) diff --git a/boards/arm/stm32vl_disco/stm32vl_disco.dts b/boards/arm/stm32vl_disco/stm32vl_disco.dts index 84c602777bb..8562bed0007 100644 --- a/boards/arm/stm32vl_disco/stm32vl_disco.dts +++ b/boards/arm/stm32vl_disco/stm32vl_disco.dts @@ -65,11 +65,13 @@ }; &i2c1 { + pinctrl-0 = <&i2c1_scl_pb6 &i2c1_sda_pb7>; status = "okay"; clock-frequency = ; }; &i2c2 { + pinctrl-0 = <&i2c2_scl_pb10 &i2c2_sda_pb11>; status = "okay"; clock-frequency = ; }; diff --git a/boards/arm/waveshare_open103z/pinmux.c b/boards/arm/waveshare_open103z/pinmux.c index 93f62a2f79f..7df503422be 100644 --- a/boards/arm/waveshare_open103z/pinmux.c +++ b/boards/arm/waveshare_open103z/pinmux.c @@ -30,14 +30,6 @@ static const struct pin_config pinconf[] = { {STM32_PIN_PB14, STM32F1_PINMUX_FUNC_PB14_SPI2_MASTER_MISO}, {STM32_PIN_PB15, STM32F1_PINMUX_FUNC_PB15_SPI2_MASTER_MOSI}, #endif -#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c1), okay) && CONFIG_I2C - {STM32_PIN_PB7, STM32F1_PINMUX_FUNC_PB7_I2C1_SDA}, - {STM32_PIN_PB6, STM32F1_PINMUX_FUNC_PB6_I2C1_SCL}, -#endif -#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c2), okay) && CONFIG_I2C - {STM32_PIN_PB11, STM32F1_PINMUX_FUNC_PB11_I2C2_SDA}, - {STM32_PIN_PB10, STM32F1_PINMUX_FUNC_PB10_I2C2_SCL}, -#endif #if DT_NODE_HAS_STATUS(DT_NODELABEL(usb), okay) && CONFIG_USB {STM32_PIN_PA11, STM32F1_PINMUX_FUNC_PA11_USB_DM}, {STM32_PIN_PA12, STM32F1_PINMUX_FUNC_PA12_USB_DP}, diff --git a/boards/arm/waveshare_open103z/waveshare_open103z.dts b/boards/arm/waveshare_open103z/waveshare_open103z.dts index 6e956c58dad..29fab04c03e 100644 --- a/boards/arm/waveshare_open103z/waveshare_open103z.dts +++ b/boards/arm/waveshare_open103z/waveshare_open103z.dts @@ -98,11 +98,13 @@ }; &i2c1 { + pinctrl-0 = <&i2c1_sda_pb7 &i2c1_scl_pb6>; status = "okay"; clock-frequency = ; }; &i2c2 { + pinctrl-0 = <&i2c2_sda_pb11 &i2c2_scl_pb10>; status = "okay"; clock-frequency = ; };