drivers: pwm: stm32: remove remaining Kconfig instances

Following other drivers, Kconfig based instances are now entirely
removed. In order to do this change, PWM nodes in board DT files have
been given a pwm{N} label so that both:

- DT API checks such as #if DT_HAS_NODE(DT_NODELABEL(pwmN)) can be
  used (N being PWM instance number).
- DT references can be written as pwms = <&pwmN x y>; instead of
  pwms = <&{/soc/timers@XXXXXXXX/pwm} x y>;

This approach is also used on the Linux Kernel.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
This commit is contained in:
Gerard Marull-Paretas 2020-05-01 16:13:37 +02:00 committed by Kumar Gala
commit c6b1375400
94 changed files with 115 additions and 467 deletions

View file

@ -107,7 +107,7 @@
&timers3 { &timers3 {
status = "okay"; status = "okay";
pwm { pwm3: pwm {
status = "okay"; status = "okay";
}; };
}; };
@ -115,7 +115,7 @@
&timers4 { &timers4 {
status = "okay"; status = "okay";
pwm { pwm4: pwm {
status = "okay"; status = "okay";
}; };
}; };
@ -123,7 +123,7 @@
&timers9 { &timers9 {
status = "okay"; status = "okay";
pwm { pwm9: pwm {
status = "okay"; status = "okay";
}; };
}; };

View file

@ -32,17 +32,4 @@ config SPI_STM32_INTERRUPT
default y default y
depends on SPI depends on SPI
if PWM
config PWM_STM32_3
default y
config PWM_STM32_4
default y
config PWM_STM32_9
default y
endif # PWM
endif # BOARD_96B_STM32_SENSOR_MEZ endif # BOARD_96B_STM32_SENSOR_MEZ

View file

@ -72,18 +72,18 @@ static const struct pin_config pinconf[] = {
{STM32_PIN_PC7, STM32F4_PINMUX_FUNC_PC7_I2S2_CK}, {STM32_PIN_PC7, STM32F4_PINMUX_FUNC_PC7_I2S2_CK},
{STM32_PIN_PC1, STM32F4_PINMUX_FUNC_PC1_I2S2_SD}, {STM32_PIN_PC1, STM32F4_PINMUX_FUNC_PC1_I2S2_SD},
#endif #endif
#ifdef CONFIG_PWM_STM32_3 #if DT_HAS_NODE(DT_NODELABEL(pwm3))
{ STM32_PIN_PB4, STM32F4_PINMUX_FUNC_PB4_PWM3_CH1 }, { STM32_PIN_PB4, STM32F4_PINMUX_FUNC_PB4_PWM3_CH1 },
{ STM32_PIN_PC8, STM32F4_PINMUX_FUNC_PC8_PWM3_CH3 }, { STM32_PIN_PC8, STM32F4_PINMUX_FUNC_PC8_PWM3_CH3 },
#endif /* CONFIG_PWM_STM32_3 */ #endif
#ifdef CONFIG_PWM_STM32_4 #if DT_HAS_NODE(DT_NODELABEL(pwm4))
{ STM32_PIN_PD14, STM32F4_PINMUX_FUNC_PD14_PWM4_CH3 }, { STM32_PIN_PD14, STM32F4_PINMUX_FUNC_PD14_PWM4_CH3 },
{ STM32_PIN_PD15, STM32F4_PINMUX_FUNC_PD15_PWM4_CH4 }, { STM32_PIN_PD15, STM32F4_PINMUX_FUNC_PD15_PWM4_CH4 },
#endif /* CONFIG_PWM_STM32_4 */ #endif
#ifdef CONFIG_PWM_STM32_9 #if DT_HAS_NODE(DT_NODELABEL(pwm9))
{ STM32_PIN_PE5, STM32F4_PINMUX_FUNC_PE5_PWM9_CH1 }, { STM32_PIN_PE5, STM32F4_PINMUX_FUNC_PE5_PWM9_CH1 },
{ STM32_PIN_PE6, STM32F4_PINMUX_FUNC_PE6_PWM9_CH2 }, { STM32_PIN_PE6, STM32F4_PINMUX_FUNC_PE6_PWM9_CH2 },
#endif /* CONFIG_PWM_STM32_9 */ #endif
}; };
static int pinmux_stm32_init(struct device *port) static int pinmux_stm32_init(struct device *port)

View file

@ -8,10 +8,6 @@ if BOARD_BLACK_F407VE
config BOARD config BOARD
default "black_f407ve" default "black_f407ve"
config PWM_STM32_2
default y
depends on PWM
config SPI_STM32_INTERRUPT config SPI_STM32_INTERRUPT
default y default y
depends on SPI depends on SPI

View file

@ -68,7 +68,7 @@
&timers2 { &timers2 {
status = "okay"; status = "okay";
pwm { pwm2: pwm {
status = "okay"; status = "okay";
}; };
}; };

View file

@ -22,9 +22,9 @@ static const struct pin_config pinconf[] = {
{STM32_PIN_PA2, STM32F4_PINMUX_FUNC_PA2_USART2_TX}, {STM32_PIN_PA2, STM32F4_PINMUX_FUNC_PA2_USART2_TX},
{STM32_PIN_PA3, STM32F4_PINMUX_FUNC_PA3_USART2_RX}, {STM32_PIN_PA3, STM32F4_PINMUX_FUNC_PA3_USART2_RX},
#endif #endif
#ifdef CONFIG_PWM_STM32_2 #if DT_HAS_NODE(DT_NODELABEL(pwm2))
{STM32_PIN_PA0, STM32F4_PINMUX_FUNC_PA0_PWM2_CH1}, {STM32_PIN_PA0, STM32F4_PINMUX_FUNC_PA0_PWM2_CH1},
#endif /* CONFIG_PWM_STM32_2 */ #endif
#ifdef CONFIG_USB_DC_STM32 #ifdef CONFIG_USB_DC_STM32
{STM32_PIN_PA11, STM32F4_PINMUX_FUNC_PA11_OTG_FS_DM}, {STM32_PIN_PA11, STM32F4_PINMUX_FUNC_PA11_OTG_FS_DM},
{STM32_PIN_PA12, STM32F4_PINMUX_FUNC_PA12_OTG_FS_DP}, {STM32_PIN_PA12, STM32F4_PINMUX_FUNC_PA12_OTG_FS_DP},

View file

@ -8,10 +8,6 @@ if BOARD_BLACK_F407ZG_PRO
config BOARD config BOARD
default "black_f407zg_pro" default "black_f407zg_pro"
config PWM_STM32_2
default y
depends on PWM
config SPI_STM32_INTERRUPT config SPI_STM32_INTERRUPT
default y default y
depends on SPI depends on SPI

View file

@ -68,7 +68,7 @@
&timers2 { &timers2 {
status = "okay"; status = "okay";
pwm { pwm2: pwm {
status = "okay"; status = "okay";
}; };
}; };

View file

@ -22,9 +22,9 @@ static const struct pin_config pinconf[] = {
{STM32_PIN_PA2, STM32F4_PINMUX_FUNC_PA2_USART2_TX}, {STM32_PIN_PA2, STM32F4_PINMUX_FUNC_PA2_USART2_TX},
{STM32_PIN_PA3, STM32F4_PINMUX_FUNC_PA3_USART2_RX}, {STM32_PIN_PA3, STM32F4_PINMUX_FUNC_PA3_USART2_RX},
#endif #endif
#ifdef CONFIG_PWM_STM32_2 #if DT_HAS_NODE(DT_NODELABEL(pwm2))
{STM32_PIN_PA0, STM32F4_PINMUX_FUNC_PA0_PWM2_CH1}, {STM32_PIN_PA0, STM32F4_PINMUX_FUNC_PA0_PWM2_CH1},
#endif /* CONFIG_PWM_STM32_2 */ #endif
#ifdef CONFIG_USB_DC_STM32 #ifdef CONFIG_USB_DC_STM32
{STM32_PIN_PA11, STM32F4_PINMUX_FUNC_PA11_OTG_FS_DM}, {STM32_PIN_PA11, STM32F4_PINMUX_FUNC_PA11_OTG_FS_DM},
{STM32_PIN_PA12, STM32F4_PINMUX_FUNC_PA12_OTG_FS_DP}, {STM32_PIN_PA12, STM32F4_PINMUX_FUNC_PA12_OTG_FS_DP},

View file

@ -17,10 +17,6 @@ config SPI_STM32_INTERRUPT
default y default y
depends on SPI depends on SPI
config PWM_STM32_2
default y
depends on PWM
choice LIS3MDL_TRIGGER_MODE choice LIS3MDL_TRIGGER_MODE
default LIS3MDL_TRIGGER_NONE default LIS3MDL_TRIGGER_NONE
endchoice endchoice

View file

@ -185,7 +185,7 @@
&timers2 { &timers2 {
status = "okay"; status = "okay";
pwm { pwm2: pwm {
status = "okay"; status = "okay";
}; };
}; };

View file

@ -47,9 +47,9 @@ static const struct pin_config pinconf[] = {
STM32_OSPEEDR_VERY_HIGH_SPEED}, STM32_OSPEEDR_VERY_HIGH_SPEED},
{STM32_PIN_PC12, STM32L4X_PINMUX_FUNC_PC12_SPI3_MOSI}, {STM32_PIN_PC12, STM32L4X_PINMUX_FUNC_PC12_SPI3_MOSI},
#endif #endif
#ifdef CONFIG_PWM_STM32_2 #if DT_HAS_NODE(DT_NODELABEL(pwm2))
{STM32_PIN_PA15, STM32L4X_PINMUX_FUNC_PA15_PWM2_CH1}, {STM32_PIN_PA15, STM32L4X_PINMUX_FUNC_PA15_PWM2_CH1},
#endif /* CONFIG_PWM_STM32_2 */ #endif
#ifdef CONFIG_USB_DC_STM32 #ifdef CONFIG_USB_DC_STM32
{STM32_PIN_PA10, STM32L4X_PINMUX_FUNC_PA10_OTG_FS_ID}, {STM32_PIN_PA10, STM32L4X_PINMUX_FUNC_PA10_OTG_FS_ID},
{STM32_PIN_PA11, STM32L4X_PINMUX_FUNC_PA11_OTG_FS_DM}, {STM32_PIN_PA11, STM32L4X_PINMUX_FUNC_PA11_OTG_FS_DM},

View file

@ -12,10 +12,6 @@ config SPI_STM32_INTERRUPT
default y default y
depends on SPI depends on SPI
config PWM_STM32_3
default y
depends on PWM
config USB_DC_STM32 config USB_DC_STM32
default y default y
depends on USB depends on USB

View file

@ -53,7 +53,7 @@
&timers3 { &timers3 {
status = "okay"; status = "okay";
pwm { pwm3: pwm {
status = "okay"; status = "okay";
}; };
}; };

View file

@ -30,9 +30,9 @@ static const struct pin_config pinconf[] = {
{STM32_PIN_PA6, STM32F4_PINMUX_FUNC_PA6_SPI1_MISO}, {STM32_PIN_PA6, STM32F4_PINMUX_FUNC_PA6_SPI1_MISO},
{STM32_PIN_PA7, STM32F4_PINMUX_FUNC_PA7_SPI1_MOSI}, {STM32_PIN_PA7, STM32F4_PINMUX_FUNC_PA7_SPI1_MOSI},
#endif #endif
#ifdef CONFIG_PWM_STM32_3 #if DT_HAS_NODE(DT_NODELABEL(pwm3))
{STM32_PIN_PB4, STM32F4_PINMUX_FUNC_PB4_PWM3_CH1}, {STM32_PIN_PB4, STM32F4_PINMUX_FUNC_PB4_PWM3_CH1},
#endif /* CONFIG_PWM_STM32_3 */ #endif
#ifdef CONFIG_USB_DC_STM32 #ifdef CONFIG_USB_DC_STM32
{STM32_PIN_PA11, STM32F4_PINMUX_FUNC_PA11_OTG_FS_DM}, {STM32_PIN_PA11, STM32F4_PINMUX_FUNC_PA11_OTG_FS_DM},
{STM32_PIN_PA12, STM32F4_PINMUX_FUNC_PA12_OTG_FS_DP}, {STM32_PIN_PA12, STM32F4_PINMUX_FUNC_PA12_OTG_FS_DP},

View file

@ -8,8 +8,4 @@ if BOARD_NUCLEO_F103RB
config BOARD config BOARD
default "nucleo_f103rb" default "nucleo_f103rb"
config PWM_STM32_1
default y
depends on PWM
endif # BOARD_NUCLEO_F103RB endif # BOARD_NUCLEO_F103RB

View file

@ -65,7 +65,7 @@
&timers1 { &timers1 {
status = "okay"; status = "okay";
pwm { pwm1: pwm {
status = "okay"; status = "okay";
}; };
}; };

View file

@ -26,9 +26,9 @@ static const struct pin_config pinconf[] = {
{STM32_PIN_PB10, STM32F1_PINMUX_FUNC_PB10_USART3_TX}, {STM32_PIN_PB10, STM32F1_PINMUX_FUNC_PB10_USART3_TX},
{STM32_PIN_PB11, STM32F1_PINMUX_FUNC_PB11_USART3_RX}, {STM32_PIN_PB11, STM32F1_PINMUX_FUNC_PB11_USART3_RX},
#endif #endif
#ifdef CONFIG_PWM_STM32_1 #if DT_HAS_NODE(DT_NODELABEL(pwm1))
{STM32_PIN_PA8, STM32F1_PINMUX_FUNC_PA8_PWM1_CH1}, {STM32_PIN_PA8, STM32F1_PINMUX_FUNC_PA8_PWM1_CH1},
#endif /* CONFIG_PWM_STM32_1 */ #endif
#if DT_HAS_NODE(DT_NODELABEL(spi1)) #if DT_HAS_NODE(DT_NODELABEL(spi1))
#ifdef CONFIG_SPI_STM32_USE_HW_SS #ifdef CONFIG_SPI_STM32_USE_HW_SS
{STM32_PIN_PA4, STM32F1_PINMUX_FUNC_PA4_SPI1_MASTER_NSS}, {STM32_PIN_PA4, STM32F1_PINMUX_FUNC_PA4_SPI1_MASTER_NSS},

View file

@ -8,9 +8,4 @@ if BOARD_NUCLEO_F302R8
config BOARD config BOARD
default "nucleo_f302r8" default "nucleo_f302r8"
config PWM_STM32_2
default y
depends on PWM
endif # BOARD_NUCLEO_F302R8 endif # BOARD_NUCLEO_F302R8

View file

@ -66,7 +66,7 @@
&timers2 { &timers2 {
status = "okay"; status = "okay";
pwm { pwm2: pwm {
status = "okay"; status = "okay";
}; };
}; };

View file

@ -38,9 +38,9 @@ static const struct pin_config pinconf[] = {
{STM32_PIN_PB14, STM32F3_PINMUX_FUNC_PB14_SPI2_MISO}, {STM32_PIN_PB14, STM32F3_PINMUX_FUNC_PB14_SPI2_MISO},
{STM32_PIN_PB15, STM32F3_PINMUX_FUNC_PB15_SPI2_MOSI}, {STM32_PIN_PB15, STM32F3_PINMUX_FUNC_PB15_SPI2_MOSI},
#endif #endif
#ifdef CONFIG_PWM_STM32_2 #if DT_HAS_NODE(DT_NODELABEL(pwm2))
{STM32_PIN_PA0, STM32F3_PINMUX_FUNC_PA0_PWM2_CH1}, {STM32_PIN_PA0, STM32F3_PINMUX_FUNC_PA0_PWM2_CH1},
#endif /* CONFIG_PWM_STM32_2 */ #endif
#if DT_HAS_NODE(DT_NODELABEL(adc1)) #if DT_HAS_NODE(DT_NODELABEL(adc1))
{STM32_PIN_PA0, STM32F3_PINMUX_FUNC_PA0_ADC1_IN1}, {STM32_PIN_PA0, STM32F3_PINMUX_FUNC_PA0_ADC1_IN1},
#endif #endif

View file

@ -67,7 +67,7 @@
&timers1 { &timers1 {
status = "okay"; status = "okay";
pwm { pwm1: pwm {
status = "okay"; status = "okay";
}; };
}; };

View file

@ -38,9 +38,9 @@ static const struct pin_config pinconf[] = {
{STM32_PIN_PA6, STM32F3_PINMUX_FUNC_PA6_SPI1_MISO}, {STM32_PIN_PA6, STM32F3_PINMUX_FUNC_PA6_SPI1_MISO},
{STM32_PIN_PA7, STM32F3_PINMUX_FUNC_PA7_SPI1_MOSI}, {STM32_PIN_PA7, STM32F3_PINMUX_FUNC_PA7_SPI1_MOSI},
#endif #endif
#ifdef CONFIG_PWM_STM32_1 #if DT_HAS_NODE(DT_NODELABEL(pwm1))
{STM32_PIN_PA8, STM32F3_PINMUX_FUNC_PA8_PWM1_CH1}, {STM32_PIN_PA8, STM32F3_PINMUX_FUNC_PA8_PWM1_CH1},
#endif /* CONFIG_PWM_STM32_1 */ #endif
}; };
static int pinmux_stm32_init(struct device *port) static int pinmux_stm32_init(struct device *port)

View file

@ -13,10 +13,6 @@ config SPI_STM32_INTERRUPT
default y default y
depends on SPI depends on SPI
config PWM_STM32_2
default y
depends on PWM
if WATCHDOG if WATCHDOG
config WWDG_STM32 config WWDG_STM32

View file

@ -105,7 +105,7 @@
&timers2 { &timers2 {
status = "okay"; status = "okay";
pwm { pwm2: pwm {
status = "okay"; status = "okay";
}; };
}; };

View file

@ -22,9 +22,9 @@ static const struct pin_config pinconf[] = {
{STM32_PIN_PA2, STM32F4_PINMUX_FUNC_PA2_USART2_TX}, {STM32_PIN_PA2, STM32F4_PINMUX_FUNC_PA2_USART2_TX},
{STM32_PIN_PA3, STM32F4_PINMUX_FUNC_PA3_USART2_RX}, {STM32_PIN_PA3, STM32F4_PINMUX_FUNC_PA3_USART2_RX},
#endif #endif
#ifdef CONFIG_PWM_STM32_2 #if DT_HAS_NODE(DT_NODELABEL(pwm2))
{STM32_PIN_PA0, STM32F4_PINMUX_FUNC_PA0_PWM2_CH1}, {STM32_PIN_PA0, STM32F4_PINMUX_FUNC_PA0_PWM2_CH1},
#endif /* CONFIG_PWM_STM32_2 */ #endif
#if DT_HAS_NODE(DT_NODELABEL(i2c1)) #if DT_HAS_NODE(DT_NODELABEL(i2c1))
{STM32_PIN_PB8, STM32F4_PINMUX_FUNC_PB8_I2C1_SCL}, {STM32_PIN_PB8, STM32F4_PINMUX_FUNC_PB8_I2C1_SCL},
{STM32_PIN_PB9, STM32F4_PINMUX_FUNC_PB9_I2C1_SDA}, {STM32_PIN_PB9, STM32F4_PINMUX_FUNC_PB9_I2C1_SDA},

View file

@ -21,8 +21,4 @@ config USB_DEVICE_NETWORK_ECM
endif # NETWORKING endif # NETWORKING
config PWM_STM32_2
default y
depends on PWM
endif # BOARD_NUCLEO_F412ZG endif # BOARD_NUCLEO_F412ZG

View file

@ -77,7 +77,7 @@
&timers2 { &timers2 {
status = "okay"; status = "okay";
pwm { pwm2: pwm {
status = "okay"; status = "okay";
}; };
}; };

View file

@ -22,9 +22,9 @@ static const struct pin_config pinconf[] = {
{STM32_PIN_PG14, STM32F4_PINMUX_FUNC_PG14_USART6_TX}, {STM32_PIN_PG14, STM32F4_PINMUX_FUNC_PG14_USART6_TX},
{STM32_PIN_PG9, STM32F4_PINMUX_FUNC_PG9_USART6_RX}, {STM32_PIN_PG9, STM32F4_PINMUX_FUNC_PG9_USART6_RX},
#endif #endif
#ifdef CONFIG_PWM_STM32_2 #if DT_HAS_NODE(DT_NODELABEL(pwm2))
{STM32_PIN_PA0, STM32F4_PINMUX_FUNC_PA0_PWM2_CH1}, {STM32_PIN_PA0, STM32F4_PINMUX_FUNC_PA0_PWM2_CH1},
#endif /* CONFIG_PWM_STM32_2 */ #endif
#ifdef CONFIG_USB_DC_STM32 #ifdef CONFIG_USB_DC_STM32
{STM32_PIN_PA11, STM32F4_PINMUX_FUNC_PA11_OTG_FS_DM}, {STM32_PIN_PA11, STM32F4_PINMUX_FUNC_PA11_OTG_FS_DM},
{STM32_PIN_PA12, STM32F4_PINMUX_FUNC_PA12_OTG_FS_DP}, {STM32_PIN_PA12, STM32F4_PINMUX_FUNC_PA12_OTG_FS_DP},

View file

@ -21,8 +21,4 @@ config USB_DEVICE_NETWORK_ECM
endif # NETWORKING endif # NETWORKING
config PWM_STM32_2
default y
depends on PWM
endif # BOARD_NUCLEO_F413ZH endif # BOARD_NUCLEO_F413ZH

View file

@ -77,7 +77,7 @@
&timers2 { &timers2 {
status = "okay"; status = "okay";
pwm { pwm2: pwm {
status = "okay"; status = "okay";
}; };
}; };

View file

@ -22,9 +22,9 @@ static const struct pin_config pinconf[] = {
{STM32_PIN_PG14, STM32F4_PINMUX_FUNC_PG14_USART6_TX}, {STM32_PIN_PG14, STM32F4_PINMUX_FUNC_PG14_USART6_TX},
{STM32_PIN_PG9, STM32F4_PINMUX_FUNC_PG9_USART6_RX}, {STM32_PIN_PG9, STM32F4_PINMUX_FUNC_PG9_USART6_RX},
#endif #endif
#ifdef CONFIG_PWM_STM32_2 #if DT_HAS_NODE(DT_NODELABEL(pwm2))
{STM32_PIN_PA0, STM32F4_PINMUX_FUNC_PA0_PWM2_CH1}, {STM32_PIN_PA0, STM32F4_PINMUX_FUNC_PA0_PWM2_CH1},
#endif /* CONFIG_PWM_STM32_2 */ #endif
#ifdef CONFIG_USB_DC_STM32 #ifdef CONFIG_USB_DC_STM32
{STM32_PIN_PA11, STM32F4_PINMUX_FUNC_PA11_OTG_FS_DM}, {STM32_PIN_PA11, STM32F4_PINMUX_FUNC_PA11_OTG_FS_DM},
{STM32_PIN_PA12, STM32F4_PINMUX_FUNC_PA12_OTG_FS_DP}, {STM32_PIN_PA12, STM32F4_PINMUX_FUNC_PA12_OTG_FS_DP},

View file

@ -18,9 +18,4 @@ config ETH_STM32_HAL
endif # NETWORKING endif # NETWORKING
config PWM_STM32_1
default y
depends on PWM
endif # BOARD_NUCLEO_F429ZI endif # BOARD_NUCLEO_F429ZI

View file

@ -78,7 +78,7 @@
&timers1 { &timers1 {
status = "okay"; status = "okay";
pwm { pwm1: pwm {
status = "okay"; status = "okay";
}; };
}; };

View file

@ -22,9 +22,9 @@ static const struct pin_config pinconf[] = {
{STM32_PIN_PG14, STM32F4_PINMUX_FUNC_PG14_USART6_TX}, {STM32_PIN_PG14, STM32F4_PINMUX_FUNC_PG14_USART6_TX},
{STM32_PIN_PG9, STM32F4_PINMUX_FUNC_PG9_USART6_RX}, {STM32_PIN_PG9, STM32F4_PINMUX_FUNC_PG9_USART6_RX},
#endif #endif
#ifdef CONFIG_PWM_STM32_1 #if DT_HAS_NODE(DT_NODELABEL(pwm1))
{STM32_PIN_PE13, STM32F4_PINMUX_FUNC_PE13_PWM1_CH3}, {STM32_PIN_PE13, STM32F4_PINMUX_FUNC_PE13_PWM1_CH3},
#endif /* CONFIG_PWM_STM32_1 */ #endif
#ifdef CONFIG_ETH_STM32_HAL #ifdef CONFIG_ETH_STM32_HAL
{STM32_PIN_PC1, STM32F4_PINMUX_FUNC_PC1_ETH}, {STM32_PIN_PC1, STM32F4_PINMUX_FUNC_PC1_ETH},
{STM32_PIN_PC4, STM32F4_PINMUX_FUNC_PC4_ETH}, {STM32_PIN_PC4, STM32F4_PINMUX_FUNC_PC4_ETH},

View file

@ -18,9 +18,4 @@ config ETH_STM32_HAL
endif # NETWORKING endif # NETWORKING
config PWM_STM32_1
default y
depends on PWM
endif # BOARD_NUCLEO_F746ZG endif # BOARD_NUCLEO_F746ZG

View file

@ -75,7 +75,7 @@
&timers1 { &timers1 {
status = "okay"; status = "okay";
pwm { pwm1: pwm {
status = "okay"; status = "okay";
}; };
}; };

View file

@ -53,9 +53,9 @@ static const struct pin_config pinconf[] = {
{ STM32_PIN_PB8, STM32F7_PINMUX_FUNC_PB8_I2C1_SCL }, { STM32_PIN_PB8, STM32F7_PINMUX_FUNC_PB8_I2C1_SCL },
{ STM32_PIN_PB9, STM32F7_PINMUX_FUNC_PB9_I2C1_SDA }, { STM32_PIN_PB9, STM32F7_PINMUX_FUNC_PB9_I2C1_SDA },
#endif #endif
#ifdef CONFIG_PWM_STM32_1 #if DT_HAS_NODE(DT_NODELABEL(pwm1))
{ STM32_PIN_PE13, STM32F7_PINMUX_FUNC_PE13_PWM1_CH3 }, { STM32_PIN_PE13, STM32F7_PINMUX_FUNC_PE13_PWM1_CH3 },
#endif /* CONFIG_PWM_STM32_1 */ #endif
#if DT_HAS_NODE(DT_NODELABEL(spi1)) #if DT_HAS_NODE(DT_NODELABEL(spi1))
#ifdef CONFIG_SPI_STM32_USE_HW_SS #ifdef CONFIG_SPI_STM32_USE_HW_SS
{ STM32_PIN_PA4, STM32F7_PINMUX_FUNC_PA4_SPI1_NSS }, { STM32_PIN_PA4, STM32F7_PINMUX_FUNC_PA4_SPI1_NSS },

View file

@ -18,9 +18,4 @@ config ETH_STM32_HAL
endif # NETWORKING endif # NETWORKING
config PWM_STM32_1
default y
depends on PWM
endif # BOARD_NUCLEO_F756ZG endif # BOARD_NUCLEO_F756ZG

View file

@ -79,7 +79,7 @@
&timers1 { &timers1 {
status = "okay"; status = "okay";
pwm { pwm1: pwm {
status = "okay"; status = "okay";
}; };
}; };

View file

@ -53,9 +53,9 @@ static const struct pin_config pinconf[] = {
{ STM32_PIN_PB8, STM32F7_PINMUX_FUNC_PB8_I2C1_SCL }, { STM32_PIN_PB8, STM32F7_PINMUX_FUNC_PB8_I2C1_SCL },
{ STM32_PIN_PB9, STM32F7_PINMUX_FUNC_PB9_I2C1_SDA }, { STM32_PIN_PB9, STM32F7_PINMUX_FUNC_PB9_I2C1_SDA },
#endif #endif
#ifdef CONFIG_PWM_STM32_1 #if DT_HAS_NODE(DT_NODELABEL(pwm1))
{ STM32_PIN_PE13, STM32F7_PINMUX_FUNC_PE13_PWM1_CH3 }, { STM32_PIN_PE13, STM32F7_PINMUX_FUNC_PE13_PWM1_CH3 },
#endif /* CONFIG_PWM_STM32_1 */ #endif
#if DT_HAS_NODE(DT_NODELABEL(spi1)) #if DT_HAS_NODE(DT_NODELABEL(spi1))
#ifdef CONFIG_SPI_STM32_USE_HW_SS #ifdef CONFIG_SPI_STM32_USE_HW_SS
{ STM32_PIN_PA4, STM32F7_PINMUX_FUNC_PA4_SPI1_NSS }, { STM32_PIN_PA4, STM32F7_PINMUX_FUNC_PA4_SPI1_NSS },

View file

@ -18,9 +18,4 @@ config ETH_STM32_HAL
endif # NETWORKING endif # NETWORKING
config PWM_STM32_1
default y
depends on PWM
endif # BOARD_NUCLEO_F767ZI endif # BOARD_NUCLEO_F767ZI

View file

@ -75,7 +75,7 @@
&timers1 { &timers1 {
status = "okay"; status = "okay";
pwm { pwm1: pwm {
status = "okay"; status = "okay";
}; };
}; };

View file

@ -53,9 +53,9 @@ static const struct pin_config pinconf[] = {
{ STM32_PIN_PB8, STM32F7_PINMUX_FUNC_PB8_I2C1_SCL }, { STM32_PIN_PB8, STM32F7_PINMUX_FUNC_PB8_I2C1_SCL },
{ STM32_PIN_PB9, STM32F7_PINMUX_FUNC_PB9_I2C1_SDA }, { STM32_PIN_PB9, STM32F7_PINMUX_FUNC_PB9_I2C1_SDA },
#endif #endif
#ifdef CONFIG_PWM_STM32_1 #if DT_HAS_NODE(DT_NODELABEL(pwm1))
{ STM32_PIN_PE13, STM32F7_PINMUX_FUNC_PE13_PWM1_CH3 }, { STM32_PIN_PE13, STM32F7_PINMUX_FUNC_PE13_PWM1_CH3 },
#endif /* CONFIG_PWM_STM32_1 */ #endif
#if DT_HAS_NODE(DT_NODELABEL(spi1)) #if DT_HAS_NODE(DT_NODELABEL(spi1))
#ifdef CONFIG_SPI_STM32_USE_HW_SS #ifdef CONFIG_SPI_STM32_USE_HW_SS
{ STM32_PIN_PA4, STM32F7_PINMUX_FUNC_PA4_SPI1_NSS }, { STM32_PIN_PA4, STM32F7_PINMUX_FUNC_PA4_SPI1_NSS },

View file

@ -8,10 +8,6 @@ if BOARD_NUCLEO_G431RB
config BOARD config BOARD
default "nucleo_g431rb" default "nucleo_g431rb"
config PWM_STM32_2
default y
depends on PWM
config SPI_STM32_INTERRUPT config SPI_STM32_INTERRUPT
default y default y
depends on SPI depends on SPI

View file

@ -31,7 +31,7 @@
compatible = "pwm-leds"; compatible = "pwm-leds";
green_pwm_led: green_pwm_led { green_pwm_led: green_pwm_led {
pwms = <&{/soc/timers@40000000/pwm} 1 4>; pwms = <&pwm2 1 4>;
}; };
}; };
@ -71,7 +71,7 @@
&timers2 { &timers2 {
status = "okay"; status = "okay";
pwm { pwm2: pwm {
status = "okay"; status = "okay";
}; };
}; };

View file

@ -26,9 +26,9 @@ static const struct pin_config pinconf[] = {
{STM32_PIN_PB8, STM32G4X_PINMUX_FUNC_PB8_I2C1_SCL}, {STM32_PIN_PB8, STM32G4X_PINMUX_FUNC_PB8_I2C1_SCL},
{STM32_PIN_PB9, STM32G4X_PINMUX_FUNC_PB9_I2C1_SDA}, {STM32_PIN_PB9, STM32G4X_PINMUX_FUNC_PB9_I2C1_SDA},
#endif #endif
#ifdef CONFIG_PWM_STM32_2 #if DT_HAS_NODE(DT_NODELABEL(pwm2))
{STM32_PIN_PA5, STM32G4X_PINMUX_FUNC_PA5_PWM2_CH1}, {STM32_PIN_PA5, STM32G4X_PINMUX_FUNC_PA5_PWM2_CH1},
#endif /* CONFIG_PWM_STM32_2 */ #endif
#if DT_HAS_NODE(DT_NODELABEL(spi1)) #if DT_HAS_NODE(DT_NODELABEL(spi1))
/* SPI1 on the Arduino connectors pins A2, D3, D11, D12 */ /* SPI1 on the Arduino connectors pins A2, D3, D11, D12 */
#ifdef CONFIG_SPI_STM32_USE_HW_SS #ifdef CONFIG_SPI_STM32_USE_HW_SS

View file

@ -8,11 +8,6 @@ if BOARD_NUCLEO_G474RE
config BOARD config BOARD
default "nucleo_g474re" default "nucleo_g474re"
config PWM_STM32_2
default y
depends on PWM
config SPI_STM32_INTERRUPT config SPI_STM32_INTERRUPT
default y default y
depends on SPI depends on SPI

View file

@ -31,7 +31,7 @@
compatible = "pwm-leds"; compatible = "pwm-leds";
green_pwm_led: green_pwm_led { green_pwm_led: green_pwm_led {
pwms = <&{/soc/timers@40000000/pwm} 1 4>; pwms = <&pwm2 1 4>;
}; };
}; };
@ -71,7 +71,7 @@
&timers2 { &timers2 {
status = "okay"; status = "okay";
pwm { pwm2: pwm {
status = "okay"; status = "okay";
}; };
}; };

View file

@ -26,9 +26,9 @@ static const struct pin_config pinconf[] = {
{STM32_PIN_PB8, STM32G4X_PINMUX_FUNC_PB8_I2C1_SCL}, {STM32_PIN_PB8, STM32G4X_PINMUX_FUNC_PB8_I2C1_SCL},
{STM32_PIN_PB9, STM32G4X_PINMUX_FUNC_PB9_I2C1_SDA}, {STM32_PIN_PB9, STM32G4X_PINMUX_FUNC_PB9_I2C1_SDA},
#endif #endif
#ifdef CONFIG_PWM_STM32_2 #if DT_HAS_NODE(DT_NODELABEL(pwm2))
{STM32_PIN_PA5, STM32G4X_PINMUX_FUNC_PA5_PWM2_CH1}, {STM32_PIN_PA5, STM32G4X_PINMUX_FUNC_PA5_PWM2_CH1},
#endif /* CONFIG_PWM_STM32_2 */ #endif
#if DT_HAS_NODE(DT_NODELABEL(spi1)) #if DT_HAS_NODE(DT_NODELABEL(spi1))
/* SPI1 on the Arduino connectors pins A2, D3, D11, D12 */ /* SPI1 on the Arduino connectors pins A2, D3, D11, D12 */
#ifdef CONFIG_SPI_STM32_USE_HW_SS #ifdef CONFIG_SPI_STM32_USE_HW_SS

View file

@ -8,9 +8,4 @@ if BOARD_NUCLEO_H743ZI
config BOARD config BOARD
default "nucleo_h743zi" default "nucleo_h743zi"
config PWM_STM32_12
default y
depends on PWM
endif # BOARD_NUCLEO_H743ZI endif # BOARD_NUCLEO_H743ZI

View file

@ -36,7 +36,7 @@
compatible = "pwm-leds"; compatible = "pwm-leds";
red_pwm_led: red_pwm_led { red_pwm_led: red_pwm_led {
pwms = <&{/soc/timers@40001800/pwm} 1 4>; pwms = <&pwm12 1 4>;
}; };
}; };
@ -73,7 +73,7 @@
&timers12 { &timers12 {
status = "okay"; status = "okay";
pwm { pwm12: pwm {
status = "okay"; status = "okay";
}; };
}; };

View file

@ -22,9 +22,9 @@ static const struct pin_config pinconf[] = {
{ STM32_PIN_PB8, STM32H7_PINMUX_FUNC_PB8_I2C1_SCL }, { STM32_PIN_PB8, STM32H7_PINMUX_FUNC_PB8_I2C1_SCL },
{ STM32_PIN_PB9, STM32H7_PINMUX_FUNC_PB9_I2C1_SDA }, { STM32_PIN_PB9, STM32H7_PINMUX_FUNC_PB9_I2C1_SDA },
#endif #endif
#ifdef CONFIG_PWM_STM32_12 #if DT_HAS_NODE(DT_NODELABEL(pwm12))
{ STM32_PIN_PB14, STM32H7_PINMUX_FUNC_PB14_PWM12_CH1 } { STM32_PIN_PB14, STM32H7_PINMUX_FUNC_PB14_PWM12_CH1 }
#endif /* CONFIG_PWM_STM32_12 */ #endif
}; };
static int pinmux_stm32_init(struct device *port) static int pinmux_stm32_init(struct device *port)

View file

@ -9,10 +9,6 @@ if BOARD_NUCLEO_L432KC
config BOARD config BOARD
default "nucleo_l432kc" default "nucleo_l432kc"
config PWM_STM32_2
default y
depends on PWM
config SPI_STM32_INTERRUPT config SPI_STM32_INTERRUPT
default y default y
depends on SPI depends on SPI

View file

@ -48,7 +48,7 @@
&timers2 { &timers2 {
status = "okay"; status = "okay";
pwm { pwm2: pwm {
status = "okay"; status = "okay";
}; };
}; };

View file

@ -27,9 +27,9 @@ static const struct pin_config pinconf[] = {
{STM32_PIN_PB6, STM32L4X_PINMUX_FUNC_PB6_I2C1_SCL}, {STM32_PIN_PB6, STM32L4X_PINMUX_FUNC_PB6_I2C1_SCL},
{STM32_PIN_PB7, STM32L4X_PINMUX_FUNC_PB7_I2C1_SDA}, {STM32_PIN_PB7, STM32L4X_PINMUX_FUNC_PB7_I2C1_SDA},
#endif #endif
#ifdef CONFIG_PWM_STM32_2 #if DT_HAS_NODE(DT_NODELABEL(pwm2))
{STM32_PIN_PA0, STM32L4X_PINMUX_FUNC_PA0_PWM2_CH1}, {STM32_PIN_PA0, STM32L4X_PINMUX_FUNC_PA0_PWM2_CH1},
#endif /* CONFIG_PWM_STM32_2 */ #endif
#if DT_HAS_NODE(DT_NODELABEL(spi1)) #if DT_HAS_NODE(DT_NODELABEL(spi1))
#ifdef CONFIG_SPI_STM32_USE_HW_SS #ifdef CONFIG_SPI_STM32_USE_HW_SS
{STM32_PIN_PA4, STM32L4X_PINMUX_FUNC_PA4_SPI1_NSS}, {STM32_PIN_PA4, STM32L4X_PINMUX_FUNC_PA4_SPI1_NSS},

View file

@ -9,10 +9,6 @@ if BOARD_NUCLEO_L452RE
config BOARD config BOARD
default "nucleo_l452re" default "nucleo_l452re"
config PWM_STM32_2
default y
depends on PWM
config SPI_STM32_INTERRUPT config SPI_STM32_INTERRUPT
default y default y
depends on SPI depends on SPI

View file

@ -58,7 +58,7 @@
&timers2 { &timers2 {
status = "okay"; status = "okay";
pwm { pwm2: pwm {
status = "okay"; status = "okay";
}; };
}; };

View file

@ -26,9 +26,9 @@ static const struct pin_config pinconf[] = {
{STM32_PIN_PB6, STM32L4X_PINMUX_FUNC_PB6_I2C1_SCL}, {STM32_PIN_PB6, STM32L4X_PINMUX_FUNC_PB6_I2C1_SCL},
{STM32_PIN_PB7, STM32L4X_PINMUX_FUNC_PB7_I2C1_SDA}, {STM32_PIN_PB7, STM32L4X_PINMUX_FUNC_PB7_I2C1_SDA},
#endif #endif
#ifdef CONFIG_PWM_STM32_2 #if DT_HAS_NODE(DT_NODELABEL(pwm2))
{STM32_PIN_PA0, STM32L4X_PINMUX_FUNC_PA0_PWM2_CH1}, {STM32_PIN_PA0, STM32L4X_PINMUX_FUNC_PA0_PWM2_CH1},
#endif /* CONFIG_PWM_STM32_2 */ #endif
#if DT_HAS_NODE(DT_NODELABEL(spi1)) #if DT_HAS_NODE(DT_NODELABEL(spi1))
#ifdef CONFIG_SPI_STM32_USE_HW_SS #ifdef CONFIG_SPI_STM32_USE_HW_SS
{STM32_PIN_PA4, STM32L4X_PINMUX_FUNC_PA4_SPI1_NSS}, {STM32_PIN_PA4, STM32L4X_PINMUX_FUNC_PA4_SPI1_NSS},

View file

@ -13,9 +13,4 @@ config SPI_STM32_INTERRUPT
default y default y
depends on SPI depends on SPI
config PWM_STM32_2
default y
depends on PWM
endif # BOARD_NUCLEO_L476RG endif # BOARD_NUCLEO_L476RG

View file

@ -68,7 +68,7 @@
&timers2 { &timers2 {
status = "okay"; status = "okay";
pwm { pwm2: pwm {
status = "okay"; status = "okay";
}; };
}; };

View file

@ -35,9 +35,9 @@ static const struct pin_config pinconf[] = {
{STM32_PIN_PC0, STM32L4X_PINMUX_FUNC_PC0_I2C3_SCL}, {STM32_PIN_PC0, STM32L4X_PINMUX_FUNC_PC0_I2C3_SCL},
{STM32_PIN_PC1, STM32L4X_PINMUX_FUNC_PC1_I2C3_SDA}, {STM32_PIN_PC1, STM32L4X_PINMUX_FUNC_PC1_I2C3_SDA},
#endif #endif
#ifdef CONFIG_PWM_STM32_2 #if DT_HAS_NODE(DT_NODELABEL(pwm2))
{STM32_PIN_PA0, STM32L4X_PINMUX_FUNC_PA0_PWM2_CH1}, {STM32_PIN_PA0, STM32L4X_PINMUX_FUNC_PA0_PWM2_CH1},
#endif /* CONFIG_PWM_STM32_2 */ #endif
#if DT_HAS_NODE(DT_NODELABEL(spi1)) #if DT_HAS_NODE(DT_NODELABEL(spi1))
/* SPI1 on the Arduino connectors pins A2, D3, D12, D11 */ /* SPI1 on the Arduino connectors pins A2, D3, D12, D11 */
#ifdef CONFIG_SPI_STM32_USE_HW_SS #ifdef CONFIG_SPI_STM32_USE_HW_SS

View file

@ -12,22 +12,6 @@ config SPI_STM32_INTERRUPT
default y default y
depends on SPI depends on SPI
if PWM
config PWM_STM32_1
default y
config PWM_STM32_2
default y
config PWM_STM32_4
default y
config PWM_STM32_15
default y
endif # PWM
if WATCHDOG if WATCHDOG
config WWDG_STM32 config WWDG_STM32

View file

@ -39,7 +39,7 @@
compatible = "pwm-leds"; compatible = "pwm-leds";
red_pwm_led: red_pwm_led { red_pwm_led: red_pwm_led {
pwms = <&{/soc/timers@40014000/pwm} 1 4>; pwms = <&pwm15 1 4>;
}; };
}; };
@ -78,7 +78,7 @@
&timers1 { &timers1 {
status = "okay"; status = "okay";
pwm { pwm1: pwm {
status = "okay"; status = "okay";
}; };
}; };
@ -86,7 +86,7 @@
&timers2 { &timers2 {
status = "okay"; status = "okay";
pwm { pwm2: pwm {
status = "okay"; status = "okay";
}; };
}; };
@ -94,7 +94,7 @@
&timers4 { &timers4 {
status = "okay"; status = "okay";
pwm { pwm4: pwm {
status = "okay"; status = "okay";
}; };
}; };
@ -102,7 +102,7 @@
&timers15 { &timers15 {
status = "okay"; status = "okay";
pwm { pwm15: pwm {
status = "okay"; status = "okay";
}; };
}; };

View file

@ -31,17 +31,17 @@ static const struct pin_config pinconf[] = {
{STM32_PIN_PA6, STM32L4X_PINMUX_FUNC_PA6_SPI1_MISO}, {STM32_PIN_PA6, STM32L4X_PINMUX_FUNC_PA6_SPI1_MISO},
{STM32_PIN_PA7, STM32L4X_PINMUX_FUNC_PA7_SPI1_MOSI}, {STM32_PIN_PA7, STM32L4X_PINMUX_FUNC_PA7_SPI1_MOSI},
#endif #endif
#ifdef CONFIG_PWM_STM32_1 #if DT_HAS_NODE(DT_NODELABEL(pwm1))
{STM32_PIN_PE9, STM32L4X_PINMUX_FUNC_PE9_PWM1_CH1}, {STM32_PIN_PE9, STM32L4X_PINMUX_FUNC_PE9_PWM1_CH1},
{STM32_PIN_PE11, STM32L4X_PINMUX_FUNC_PE11_PWM1_CH2}, {STM32_PIN_PE11, STM32L4X_PINMUX_FUNC_PE11_PWM1_CH2},
{STM32_PIN_PE13, STM32L4X_PINMUX_FUNC_PE13_PWM1_CH3}, {STM32_PIN_PE13, STM32L4X_PINMUX_FUNC_PE13_PWM1_CH3},
#endif /* CONFIG_PWM_STM32_1 */ #endif
#ifdef CONFIG_PWM_STM32_2 #if DT_HAS_NODE(DT_NODELABEL(pwm2))
{STM32_PIN_PA0, STM32L4X_PINMUX_FUNC_PA0_PWM2_CH1}, {STM32_PIN_PA0, STM32L4X_PINMUX_FUNC_PA0_PWM2_CH1},
#endif /* CONFIG_PWM_STM32_2 */ #endif
#ifdef CONFIG_PWM_STM32_15 #if DT_HAS_NODE(DT_NODELABEL(pwm15))
{STM32_PIN_PB14, STM32L4X_PINMUX_FUNC_PB14_PWM15_CH1}, {STM32_PIN_PB14, STM32L4X_PINMUX_FUNC_PB14_PWM15_CH1},
#endif /* CONFIG_PWM_STM32_15 */ #endif
}; };
static int pinmux_stm32_init(struct device *port) static int pinmux_stm32_init(struct device *port)

View file

@ -17,10 +17,6 @@ config SPI_STM32_INTERRUPT
default y default y
depends on SPI depends on SPI
config PWM_STM32_2
default y
depends on PWM
if NETWORKING if NETWORKING
config USB config USB

View file

@ -88,7 +88,7 @@
&timers2 { &timers2 {
status = "okay"; status = "okay";
pwm { pwm2: pwm {
status = "okay"; status = "okay";
}; };
}; };

View file

@ -34,9 +34,9 @@ static const struct pin_config pinconf[] = {
{STM32_PIN_PB6, STM32L4X_PINMUX_FUNC_PB6_I2C1_SCL}, {STM32_PIN_PB6, STM32L4X_PINMUX_FUNC_PB6_I2C1_SCL},
{STM32_PIN_PB7, STM32L4X_PINMUX_FUNC_PB7_I2C1_SDA}, {STM32_PIN_PB7, STM32L4X_PINMUX_FUNC_PB7_I2C1_SDA},
#endif #endif
#ifdef CONFIG_PWM_STM32_2 #if DT_HAS_NODE(DT_NODELABEL(pwm2))
{STM32_PIN_PA0, STM32L4X_PINMUX_FUNC_PA0_PWM2_CH1}, {STM32_PIN_PA0, STM32L4X_PINMUX_FUNC_PA0_PWM2_CH1},
#endif /* CONFIG_PWM_STM32_2 */ #endif
#if DT_HAS_NODE(DT_NODELABEL(spi1)) #if DT_HAS_NODE(DT_NODELABEL(spi1))
/* SPI1 on the Arduino connectors pins A2, D3, D12, D11 */ /* SPI1 on the Arduino connectors pins A2, D3, D12, D11 */
#ifdef CONFIG_SPI_STM32_USE_HW_SS #ifdef CONFIG_SPI_STM32_USE_HW_SS

View file

@ -85,7 +85,7 @@
&timers2 { &timers2 {
status = "okay"; status = "okay";
pwm { pwm2: pwm {
status = "okay"; status = "okay";
}; };
}; };

View file

@ -38,9 +38,9 @@ static const struct pin_config pinconf[] = {
{STM32_PIN_PA6, STM32WBX_PINMUX_FUNC_PA6_SPI1_MISO}, {STM32_PIN_PA6, STM32WBX_PINMUX_FUNC_PA6_SPI1_MISO},
{STM32_PIN_PA7, STM32WBX_PINMUX_FUNC_PA7_SPI1_MOSI}, {STM32_PIN_PA7, STM32WBX_PINMUX_FUNC_PA7_SPI1_MOSI},
#endif #endif
#ifdef CONFIG_PWM_STM32_2 #if DT_HAS_NODE(DT_NODELABEL(pwm2))
{STM32_PIN_PA0, STM32WBX_PINMUX_FUNC_PA0_TMR2_CH1}, {STM32_PIN_PA0, STM32WBX_PINMUX_FUNC_PA0_TMR2_CH1},
#endif /* CONFIG_PWM_STM32_2 */ #endif
#if DT_HAS_NODE(DT_NODELABEL(adc1)) #if DT_HAS_NODE(DT_NODELABEL(adc1))
{STM32_PIN_PC2, STM32WBX_PINMUX_FUNC_PC2_ADC1_IN3}, {STM32_PIN_PC2, STM32WBX_PINMUX_FUNC_PC2_ADC1_IN3},
#endif #endif

View file

@ -12,8 +12,4 @@ config SPI_STM32_INTERRUPT
default y default y
depends on SPI depends on SPI
config PWM_STM32_1
default y
depends on PWM
endif # BOARD_OLIMEXINO_STM32 endif # BOARD_OLIMEXINO_STM32

View file

@ -98,7 +98,7 @@ uext_serial: &usart1 {};
&timers1 { &timers1 {
status = "okay"; status = "okay";
pwm { pwm1: pwm {
status = "okay"; status = "okay";
}; };
}; };

View file

@ -51,9 +51,9 @@ static const struct pin_config pinconf[] = {
{STM32_PIN_PB14, STM32F1_PINMUX_FUNC_PB14_SPI2_MASTER_MISO}, {STM32_PIN_PB14, STM32F1_PINMUX_FUNC_PB14_SPI2_MASTER_MISO},
{STM32_PIN_PB15, STM32F1_PINMUX_FUNC_PB15_SPI2_MASTER_MOSI}, {STM32_PIN_PB15, STM32F1_PINMUX_FUNC_PB15_SPI2_MASTER_MOSI},
#endif #endif
#ifdef CONFIG_PWM_STM32_1 #if DT_HAS_NODE(DT_NODELABEL(pwm1))
{STM32_PIN_PA8, STM32F1_PINMUX_FUNC_PA8_PWM1_CH1}, {STM32_PIN_PA8, STM32F1_PINMUX_FUNC_PA8_PWM1_CH1},
#endif /* CONFIG_PWM_STM32_1 */ #endif
#ifdef CONFIG_USB_DC_STM32 #ifdef CONFIG_USB_DC_STM32
{STM32_PIN_PA11, STM32F1_PINMUX_FUNC_PA11_USB_DM}, {STM32_PIN_PA11, STM32F1_PINMUX_FUNC_PA11_USB_DM},
{STM32_PIN_PA12, STM32F1_PINMUX_FUNC_PA12_USB_DP}, {STM32_PIN_PA12, STM32F1_PINMUX_FUNC_PA12_USB_DP},

View file

@ -8,9 +8,4 @@ if BOARD_STEVAL_FCU001V1
config BOARD config BOARD
default "steval_fcu001v1" default "steval_fcu001v1"
config PWM_STM32_2
default y
depends on PWM
endif # BOARD_STEVAL_FCU001V1 endif # BOARD_STEVAL_FCU001V1

View file

@ -18,9 +18,9 @@ static const struct pin_config pinconf[] = {
{STM32_PIN_PA9, STM32F4_PINMUX_FUNC_PA9_USART1_TX}, {STM32_PIN_PA9, STM32F4_PINMUX_FUNC_PA9_USART1_TX},
{STM32_PIN_PA10, STM32F4_PINMUX_FUNC_PA10_USART1_RX}, {STM32_PIN_PA10, STM32F4_PINMUX_FUNC_PA10_USART1_RX},
#endif #endif
#ifdef CONFIG_PWM_STM32_2 #if DT_HAS_NODE(DT_NODELABEL(pwm2))
{STM32_PIN_PA0, STM32F4_PINMUX_FUNC_PA0_PWM2_CH1}, {STM32_PIN_PA0, STM32F4_PINMUX_FUNC_PA0_PWM2_CH1},
#endif /* CONFIG_PWM_STM32_2 */ #endif
#if DT_HAS_NODE(DT_NODELABEL(i2c2)) #if DT_HAS_NODE(DT_NODELABEL(i2c2))
{STM32_PIN_PB3, STM32F4_PINMUX_FUNC_PB3_I2C2_SDA}, {STM32_PIN_PB3, STM32F4_PINMUX_FUNC_PB3_I2C2_SDA},
{STM32_PIN_PB10, STM32F4_PINMUX_FUNC_PB10_I2C2_SCL}, {STM32_PIN_PB10, STM32F4_PINMUX_FUNC_PB10_I2C2_SCL},

View file

@ -50,7 +50,7 @@
&timers2 { &timers2 {
status = "okay"; status = "okay";
pwm { pwm2: pwm {
status = "okay"; status = "okay";
}; };
}; };

View file

@ -9,11 +9,4 @@ config BOARD
default "stm32_min_dev_blue" if BOARD_STM32_MIN_DEV_BLUE default "stm32_min_dev_blue" if BOARD_STM32_MIN_DEV_BLUE
default "stm32_min_dev_black" if BOARD_STM32_MIN_DEV_BLACK default "stm32_min_dev_black" if BOARD_STM32_MIN_DEV_BLACK
config PWM_STM32_1
default y
depends on PWM
endif # BOARD_STM32_MIN_DEV_BLUE || BOARD_STM32_MIN_DEV_BLACK endif # BOARD_STM32_MIN_DEV_BLUE || BOARD_STM32_MIN_DEV_BLACK

View file

@ -34,9 +34,9 @@ static const struct pin_config pinconf[] = {
{STM32_PIN_PB10, STM32F1_PINMUX_FUNC_PB10_I2C2_SCL}, {STM32_PIN_PB10, STM32F1_PINMUX_FUNC_PB10_I2C2_SCL},
{STM32_PIN_PB11, STM32F1_PINMUX_FUNC_PB11_I2C2_SDA}, {STM32_PIN_PB11, STM32F1_PINMUX_FUNC_PB11_I2C2_SDA},
#endif #endif
#ifdef CONFIG_PWM_STM32_1 #if DT_HAS_NODE(DT_NODELABEL(pwm1))
{STM32_PIN_PA8, STM32F1_PINMUX_FUNC_PA8_PWM1_CH1}, {STM32_PIN_PA8, STM32F1_PINMUX_FUNC_PA8_PWM1_CH1},
#endif /* CONFIG_PWM_STM32_1 */ #endif
#if DT_HAS_NODE(DT_NODELABEL(spi1)) #if DT_HAS_NODE(DT_NODELABEL(spi1))
#ifdef CONFIG_SPI_STM32_USE_HW_SS #ifdef CONFIG_SPI_STM32_USE_HW_SS
{STM32_PIN_PA4, STM32F1_PINMUX_FUNC_PA4_SPI1_MASTER_NSS_OE}, {STM32_PIN_PA4, STM32F1_PINMUX_FUNC_PA4_SPI1_MASTER_NSS_OE},

View file

@ -67,7 +67,7 @@
&timers1 { &timers1 {
status = "okay"; status = "okay";
pwm { pwm1: pwm {
status = "okay"; status = "okay";
}; };
}; };

View file

@ -8,8 +8,4 @@ if BOARD_STM32F411E_DISCO
config BOARD config BOARD
default "stm32f411e_disco" default "stm32f411e_disco"
config PWM_STM32_4
default y
depends on PWM
endif # BOARD_STM32F411E_DISCO endif # BOARD_STM32F411E_DISCO

View file

@ -18,9 +18,9 @@ static const struct pin_config pinconf[] = {
{STM32_PIN_PA2, STM32F4_PINMUX_FUNC_PA2_USART2_TX}, {STM32_PIN_PA2, STM32F4_PINMUX_FUNC_PA2_USART2_TX},
{STM32_PIN_PA3, STM32F4_PINMUX_FUNC_PA3_USART2_RX}, {STM32_PIN_PA3, STM32F4_PINMUX_FUNC_PA3_USART2_RX},
#endif #endif
#ifdef CONFIG_PWM_STM32_4 #if DT_HAS_NODE(DT_NODELABEL(pwm4))
{STM32_PIN_PD12, STM32F4_PINMUX_FUNC_PD12_PWM4_CH1 }, {STM32_PIN_PD12, STM32F4_PINMUX_FUNC_PD12_PWM4_CH1 },
#endif /* CONFIG_PWM_STM32_4 */ #endif
}; };
static int pinmux_stm32_init(struct device *port) static int pinmux_stm32_init(struct device *port)

View file

@ -41,7 +41,7 @@
pwmleds { pwmleds {
compatible = "pwm-leds"; compatible = "pwm-leds";
green_pwm_led: green_pwm_led { green_pwm_led: green_pwm_led {
pwms = <&{/soc/timers@40000800/pwm} 1 0>; pwms = <&pwm4 1 0>;
}; };
}; };
@ -66,7 +66,7 @@
&timers4 { &timers4 {
status = "okay"; status = "okay";
pwm { pwm4: pwm {
status = "okay"; status = "okay";
}; };
}; };

View file

@ -8,8 +8,4 @@ if BOARD_STM32F4_DISCO
config BOARD config BOARD
default "stm32f4_disco" default "stm32f4_disco"
config PWM_STM32_2
default y
depends on PWM
endif # BOARD_STM32F4_DISCO endif # BOARD_STM32F4_DISCO

View file

@ -22,9 +22,9 @@ static const struct pin_config pinconf[] = {
{STM32_PIN_PA2, STM32F4_PINMUX_FUNC_PA2_USART2_TX}, {STM32_PIN_PA2, STM32F4_PINMUX_FUNC_PA2_USART2_TX},
{STM32_PIN_PA3, STM32F4_PINMUX_FUNC_PA3_USART2_RX}, {STM32_PIN_PA3, STM32F4_PINMUX_FUNC_PA3_USART2_RX},
#endif #endif
#ifdef CONFIG_PWM_STM32_2 #if DT_HAS_NODE(DT_NODELABEL(pwm2))
{STM32_PIN_PA0, STM32F4_PINMUX_FUNC_PA0_PWM2_CH1}, {STM32_PIN_PA0, STM32F4_PINMUX_FUNC_PA0_PWM2_CH1},
#endif /* CONFIG_PWM_STM32_2 */ #endif
#ifdef CONFIG_USB_DC_STM32 #ifdef CONFIG_USB_DC_STM32
{STM32_PIN_PA11, STM32F4_PINMUX_FUNC_PA11_OTG_FS_DM}, {STM32_PIN_PA11, STM32F4_PINMUX_FUNC_PA11_OTG_FS_DM},
{STM32_PIN_PA12, STM32F4_PINMUX_FUNC_PA12_OTG_FS_DP}, {STM32_PIN_PA12, STM32F4_PINMUX_FUNC_PA12_OTG_FS_DP},

View file

@ -70,7 +70,7 @@
&timers2 { &timers2 {
status = "okay"; status = "okay";
pwm { pwm2: pwm {
status = "okay"; status = "okay";
}; };
}; };

View file

@ -18,11 +18,6 @@ config ETH_STM32_HAL
endif # NETWORKING endif # NETWORKING
config PWM_STM32_1
default y
depends on PWM
config I2C config I2C
default y if KSCAN default y if KSCAN

View file

@ -22,9 +22,9 @@ static const struct pin_config pinconf[] = {
{STM32_PIN_PC6, STM32F7_PINMUX_FUNC_PC6_USART6_TX}, {STM32_PIN_PC6, STM32F7_PINMUX_FUNC_PC6_USART6_TX},
{STM32_PIN_PC7, STM32F7_PINMUX_FUNC_PC7_USART6_RX}, {STM32_PIN_PC7, STM32F7_PINMUX_FUNC_PC7_USART6_RX},
#endif #endif
#ifdef CONFIG_PWM_STM32_3 #if DT_HAS_NODE(DT_NODELABEL(pwm3))
{STM32_PIN_PB4, STM32F7_PINMUX_FUNC_PB4_PWM3_CH1}, {STM32_PIN_PB4, STM32F7_PINMUX_FUNC_PB4_PWM3_CH1},
#endif /* CONFIG_PWM_STM32_3 */ #endif
#ifdef CONFIG_ETH_STM32_HAL #ifdef CONFIG_ETH_STM32_HAL
{STM32_PIN_PC1, STM32F7_PINMUX_FUNC_PC1_ETH}, {STM32_PIN_PC1, STM32F7_PINMUX_FUNC_PC1_ETH},
{STM32_PIN_PC4, STM32F7_PINMUX_FUNC_PC4_ETH}, {STM32_PIN_PC4, STM32F7_PINMUX_FUNC_PC4_ETH},

View file

@ -84,7 +84,7 @@ arduino_serial: &usart6 {};
&timers1 { &timers1 {
status = "okay"; status = "okay";
pwm { pwm1: pwm {
status = "okay"; status = "okay";
}; };
}; };

View file

@ -13,8 +13,4 @@ config SPI_STM32_INTERRUPT
default y default y
depends on SPI depends on SPI
config PWM_STM32_2
default y
depends on PWM
endif # BOARD_STM32L496G_DISCO endif # BOARD_STM32L496G_DISCO

View file

@ -36,9 +36,9 @@ static const struct pin_config pinconf[] = {
{STM32_PIN_PB4, STM32L4X_PINMUX_FUNC_PB4_SPI1_MISO}, {STM32_PIN_PB4, STM32L4X_PINMUX_FUNC_PB4_SPI1_MISO},
{STM32_PIN_PB5, STM32L4X_PINMUX_FUNC_PB5_SPI1_MOSI}, {STM32_PIN_PB5, STM32L4X_PINMUX_FUNC_PB5_SPI1_MOSI},
#endif #endif
#ifdef CONFIG_PWM_STM32_2 #if DT_HAS_NODE(DT_NODELABEL(pwm2))
{STM32_PIN_PA0, STM32L4X_PINMUX_FUNC_PA0_PWM2_CH1}, {STM32_PIN_PA0, STM32L4X_PINMUX_FUNC_PA0_PWM2_CH1},
#endif /* CONFIG_PWM_STM32_2 */ #endif
}; };
static int pinmux_stm32_init(struct device *port) static int pinmux_stm32_init(struct device *port)

View file

@ -78,7 +78,7 @@ arduino_serial: &lpuart1 {};
&timers2 { &timers2 {
status = "okay"; status = "okay";
pwm { pwm2: pwm {
status = "okay"; status = "okay";
}; };
}; };

View file

@ -26,9 +26,9 @@ static const struct pin_config pinconf[] = {
{ STM32_PIN_PB10, STM32F1_PINMUX_FUNC_PB10_USART3_TX }, { STM32_PIN_PB10, STM32F1_PINMUX_FUNC_PB10_USART3_TX },
{ STM32_PIN_PB11, STM32F1_PINMUX_FUNC_PB11_USART3_RX }, { STM32_PIN_PB11, STM32F1_PINMUX_FUNC_PB11_USART3_RX },
#endif #endif
#ifdef CONFIG_PWM_STM32_1 #if DT_HAS_NODE(DT_NODELABEL(pwm1))
{ STM32_PIN_PA8, STM32F1_PINMUX_FUNC_PA8_PWM1_CH1 }, { STM32_PIN_PA8, STM32F1_PINMUX_FUNC_PA8_PWM1_CH1 },
#endif /* CONFIG_PWM_STM32_1 */ #endif
#if DT_HAS_NODE(DT_NODELABEL(spi1)) #if DT_HAS_NODE(DT_NODELABEL(spi1))
#ifdef CONFIG_SPI_STM32_USE_HW_SS #ifdef CONFIG_SPI_STM32_USE_HW_SS
{ STM32_PIN_PA4, STM32F1_PINMUX_FUNC_PA4_SPI1_MASTER_NSS }, { STM32_PIN_PA4, STM32F1_PINMUX_FUNC_PA4_SPI1_MASTER_NSS },

View file

@ -3,7 +3,7 @@
# Copyright (c) 2016 Linaro Limited. # Copyright (c) 2016 Linaro Limited.
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
menuconfig PWM_STM32 config PWM_STM32
bool "STM32 MCU PWM driver" bool "STM32 MCU PWM driver"
depends on SOC_FAMILY_STM32 depends on SOC_FAMILY_STM32
select USE_STM32_HAL_TIM select USE_STM32_HAL_TIM
@ -11,127 +11,3 @@ menuconfig PWM_STM32
This option enables the PWM driver for STM32 family of This option enables the PWM driver for STM32 family of
processors. Say y if you wish to use PWM port on STM32 processors. Say y if you wish to use PWM port on STM32
MCU. MCU.
if PWM_STM32
config PWM_STM32_1
bool "STM32 PWM 1 Output"
help
Enable output for PWM1 in the driver. Say y here
if you want to use PWM1 output.
config PWM_STM32_2
bool "STM32 PWM 2 Output"
help
Enable output for PWM2 in the driver. Say y here
if you want to use PWM2 output.
config PWM_STM32_3
bool "STM32 PWM 3 Output"
help
Enable output for PWM3 in the driver. Say y here
if you want to use PWM3 output.
config PWM_STM32_4
bool "STM32 PWM 4 Output"
help
Enable output for PWM4 in the driver. Say y here
if you want to use PWM4 output.
config PWM_STM32_5
bool "STM32 PWM 5 Output"
help
Enable output for PWM5 in the driver. Say y here
if you want to use PWM5 output.
config PWM_STM32_6
bool "STM32 PWM 6 Output"
help
Enable output for PWM6 in the driver. Say y here
if you want to use PWM6 output.
config PWM_STM32_7
bool "STM32 PWM 7 Output"
help
Enable output for PWM7 in the driver. Say y here
if you want to use PWM7 output.
config PWM_STM32_8
bool "STM32 PWM 8 Output"
help
Enable output for PWM8 in the driver. Say y here
if you want to use PWM8 output.
config PWM_STM32_9
bool "STM32 PWM 9 Output"
help
Enable output for PWM9 in the driver. Say y here
if you want to use PWM9 output.
config PWM_STM32_10
bool "STM32 PWM 10 Output"
help
Enable output for PWM10 in the driver. Say y here
if you want to use PWM10 output.
config PWM_STM32_11
bool "STM32 PWM 11 Output"
help
Enable output for PWM11 in the driver. Say y here
if you want to use PWM11 output.
config PWM_STM32_12
bool "STM32 PWM 12 Output"
help
Enable output for PWM12 in the driver. Say y here
if you want to use PWM12 output.
config PWM_STM32_13
bool "STM32 PWM 13 Output"
help
Enable output for PWM13 in the driver. Say y here
if you want to use PWM13 output.
config PWM_STM32_14
bool "STM32 PWM 14 Output"
help
Enable output for PWM14 in the driver. Say y here
if you want to use PWM14 output.
config PWM_STM32_15
bool "STM32 PWM 15 Output"
help
Enable output for PWM15 in the driver. Say y here
if you want to use PWM15 output.
config PWM_STM32_16
bool "STM32 PWM 16 Output"
help
Enable output for PWM16 in the driver. Say y here
if you want to use PWM16 output.
config PWM_STM32_17
bool "STM32 PWM 17 Output"
help
Enable output for PWM17 in the driver. Say y here
if you want to use PWM17 output.
config PWM_STM32_18
bool "STM32 PWM 18 Output"
help
Enable output for PWM18 in the driver. Say y here
if you want to use PWM18 output.
config PWM_STM32_19
bool "STM32 PWM 19 Output"
help
Enable output for PWM19 in the driver. Say y here
if you want to use PWM19 output.
config PWM_STM32_20
bool "STM32 PWM 20 Output"
help
Enable output for PWM20 in the driver. Say y here
if you want to use PWM20 output.
endif # PWM_STM32

View file

@ -275,82 +275,4 @@ static int pwm_stm32_init(struct device *dev)
POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,\ POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,\
&pwm_stm32_drv_api_funcs) &pwm_stm32_drv_api_funcs)
#if DT_HAS_DRV_INST(0) DT_INST_FOREACH(PWM_DEVICE_INIT_STM32)
PWM_DEVICE_INIT_STM32(0);
#endif /* DT_HAS_DRV_INST(0) */
#if DT_HAS_DRV_INST(1)
PWM_DEVICE_INIT_STM32(1);
#endif /* DT_HAS_DRV_INST(1) */
#if DT_HAS_DRV_INST(2)
PWM_DEVICE_INIT_STM32(2);
#endif /* DT_HAS_DRV_INST(2) */
#if DT_HAS_DRV_INST(3)
PWM_DEVICE_INIT_STM32(3);
#endif /* DT_HAS_DRV_INST(3) */
#if DT_HAS_DRV_INST(4)
PWM_DEVICE_INIT_STM32(4);
#endif /* DT_HAS_DRV_INST(4) */
#if DT_HAS_DRV_INST(5)
PWM_DEVICE_INIT_STM32(5);
#endif /* DT_HAS_DRV_INST(5) */
#if DT_HAS_DRV_INST(6)
PWM_DEVICE_INIT_STM32(6);
#endif /* DT_HAS_DRV_INST(6) */
#if DT_HAS_DRV_INST(7)
PWM_DEVICE_INIT_STM32(7);
#endif /* DT_HAS_DRV_INST(7) */
#if DT_HAS_DRV_INST(8)
PWM_DEVICE_INIT_STM32(8);
#endif /* DT_HAS_DRV_INST(8) */
#if DT_HAS_DRV_INST(9)
PWM_DEVICE_INIT_STM32(9);
#endif /* DT_HAS_DRV_INST(9) */
#if DT_HAS_DRV_INST(10)
PWM_DEVICE_INIT_STM32(10);
#endif /* DT_HAS_DRV_INST(10) */
#if DT_HAS_DRV_INST(11)
PWM_DEVICE_INIT_STM32(11);
#endif /* DT_HAS_DRV_INST(11) */
#if DT_HAS_DRV_INST(12)
PWM_DEVICE_INIT_STM32(12);
#endif /* DT_HAS_DRV_INST(12) */
#if DT_HAS_DRV_INST(13)
PWM_DEVICE_INIT_STM32(13);
#endif /* DT_HAS_DRV_INST(13) */
#if DT_HAS_DRV_INST(14)
PWM_DEVICE_INIT_STM32(14);
#endif /* DT_HAS_DRV_INST(14) */
#if DT_HAS_DRV_INST(15)
PWM_DEVICE_INIT_STM32(15);
#endif /* DT_HAS_DRV_INST(15) */
#if DT_HAS_DRV_INST(16)
PWM_DEVICE_INIT_STM32(16);
#endif /* DT_HAS_DRV_INST(16) */
#if DT_HAS_DRV_INST(17)
PWM_DEVICE_INIT_STM32(17);
#endif /* DT_HAS_DRV_INST(17) */
#if DT_HAS_DRV_INST(18)
PWM_DEVICE_INIT_STM32(18);
#endif /* DT_HAS_DRV_INST(18) */
#if DT_HAS_DRV_INST(19)
PWM_DEVICE_INIT_STM32(19);
#endif /* DT_HAS_DRV_INST(19) */