arch/stm32xx/Kconfig: simplify PWM options and unify them among stm32 chips

This commit is contained in:
raiden00pl 2022-08-03 10:59:04 +02:00 committed by Xiang Xiao
parent 935f110438
commit 981ad9fc1e
8 changed files with 56 additions and 82 deletions

View File

@ -3430,6 +3430,7 @@ config STM32_TIM
config STM32_PWM
bool
default n
select ARCH_HAVE_PWM_PULSECOUNT
config STM32_CAP
bool
@ -3845,7 +3846,6 @@ config STM32_TIM1_PWM
bool "TIM1 PWM"
default n
depends on STM32_TIM1
select ARCH_HAVE_PWM_PULSECOUNT
select STM32_PWM
---help---
Reserve timer 1 for use by PWM
@ -4135,7 +4135,6 @@ config STM32_TIM2_PWM
bool "TIM2 PWM"
default n
depends on STM32_TIM2
select ARCH_HAVE_PWM_PULSECOUNT
select STM32_PWM
---help---
Reserve timer 2 for use by PWM
@ -4320,7 +4319,6 @@ config STM32_TIM3_PWM
bool "TIM3 PWM"
default n
depends on STM32_TIM3
select ARCH_HAVE_PWM_PULSECOUNT
select STM32_PWM
---help---
Reserve timer 3 for use by PWM
@ -4505,7 +4503,6 @@ config STM32_TIM4_PWM
bool "TIM4 PWM"
default n
depends on STM32_TIM4
select ARCH_HAVE_PWM_PULSECOUNT
select STM32_PWM
---help---
Reserve timer 4 for use by PWM
@ -4690,7 +4687,6 @@ config STM32_TIM5_PWM
bool "TIM5 PWM"
default n
depends on STM32_TIM5
select ARCH_HAVE_PWM_PULSECOUNT
select STM32_PWM
---help---
Reserve timer 5 for use by PWM
@ -4875,7 +4871,6 @@ config STM32_TIM8_PWM
bool "TIM8 PWM"
default n
depends on STM32_TIM8
select ARCH_HAVE_PWM_PULSECOUNT
select STM32_PWM
---help---
Reserve timer 8 for use by PWM
@ -5165,7 +5160,6 @@ config STM32_TIM9_PWM
bool "TIM9 PWM"
default n
depends on STM32_TIM9
select ARCH_HAVE_PWM_PULSECOUNT
select STM32_PWM
---help---
Reserve timer 9 for use by PWM
@ -5275,7 +5269,6 @@ config STM32_TIM10_PWM
bool "TIM10 PWM"
default n
depends on STM32_TIM10
select ARCH_HAVE_PWM_PULSECOUNT
select STM32_PWM
---help---
Reserve timer 10 for use by PWM
@ -5351,7 +5344,6 @@ config STM32_TIM11_PWM
bool "TIM11 PWM"
default n
depends on STM32_TIM11
select ARCH_HAVE_PWM_PULSECOUNT
select STM32_PWM
---help---
Reserve timer 11 for use by PWM
@ -5427,7 +5419,6 @@ config STM32_TIM12_PWM
bool "TIM12 PWM"
default n
depends on STM32_TIM12
select ARCH_HAVE_PWM_PULSECOUNT
select STM32_PWM
---help---
Reserve timer 12 for use by PWM
@ -5537,7 +5528,6 @@ config STM32_TIM13_PWM
bool "TIM13 PWM"
default n
depends on STM32_TIM13
select ARCH_HAVE_PWM_PULSECOUNT
select STM32_PWM
---help---
Reserve timer 13 for use by PWM
@ -5613,7 +5603,6 @@ config STM32_TIM14_PWM
bool "TIM14 PWM"
default n
depends on STM32_TIM14
select ARCH_HAVE_PWM_PULSECOUNT
select STM32_PWM
---help---
Reserve timer 14 for use by PWM
@ -6024,7 +6013,7 @@ endif # STM32_TIM17_PWM
config STM32_PWM_MULTICHAN
bool "PWM Multiple Output Channels"
default n
depends on STM32_TIM1_PWM || STM32_TIM2_PWM || STM32_TIM3_PWM || STM32_TIM4_PWM || STM32_TIM5_PWM || STM32_TIM8_PWM || STM32_TIM9_PWM || STM32_TIM10_PWM || STM32_TIM11_PWM || STM32_TIM12_PWM || STM32_TIM13_PWM || STM32_TIM14_PWM || STM32_TIM15_PWM || STM32_TIM16_PWM || STM32_TIM17_PWM
depends on STM32_PWM
select ARCH_HAVE_PWM_MULTICHAN
---help---
Specifies that the PWM driver supports multiple output

View File

@ -1439,6 +1439,7 @@ config STM32F0L0G0_CAN
config STM32F0L0G0_PWM
bool
default n
select ARCH_HAVE_PWM_PULSECOUNT
config STM32F0L0G0_USART
bool
@ -1462,9 +1463,7 @@ config STM32F0L0G0_TIM1_PWM
bool "TIM1 PWM"
default n
depends on STM32F0L0G0_TIM1
select PWM
select STM32F0L0G0_PWM
select ARCH_HAVE_PWM_PULSECOUNT
---help---
Reserve timer 1 for use by PWM
@ -1639,9 +1638,7 @@ config STM32F0L0G0_TIM2_PWM
bool "TIM2 PWM"
default n
depends on STM32F0L0G0_TIM2
select PWM
select STM32F0L0G0_PWM
select ARCH_HAVE_PWM_PULSECOUNT
---help---
Reserve timer 2 for use by PWM
@ -1795,9 +1792,7 @@ config STM32F0L0G0_TIM3_PWM
bool "TIM3 PWM"
default n
depends on STM32F0L0G0_TIM3
select PWM
select STM32F0L0G0_PWM
select ARCH_HAVE_PWM_PULSECOUNT
---help---
Reserve timer 3 for use by PWM
@ -1951,7 +1946,6 @@ config STM32F0L0G0_TIM14_PWM
bool "TIM14 PWM"
default n
depends on STM32F0L0G0_TIM14
select PWM
select STM32F0L0G0_PWM
---help---
Reserve timer 14 for use by PWM
@ -2015,7 +2009,6 @@ config STM32F0L0G0_TIM15_PWM
bool "TIM15 PWM"
default n
depends on STM32F0L0G0_TIM15
select PWM
select STM32F0L0G0_PWM
---help---
Reserve timer 15 for use by PWM
@ -2109,7 +2102,6 @@ config STM32F0L0G0_TIM16_PWM
bool "TIM16 PWM"
default n
depends on STM32F0L0G0_TIM16
select PWM
select STM32F0L0G0_PWM
---help---
Reserve timer 16 for use by PWM
@ -2180,7 +2172,6 @@ config STM32F0L0G0_TIM17_PWM
bool "TIM17 PWM"
default n
depends on STM32F0L0G0_TIM17
select PWM
select STM32F0L0G0_PWM
---help---
Reserve timer 17 for use by PWM
@ -2250,9 +2241,8 @@ endif # STM32F0L0G0_TIM17_PWM
config STM32F0L0G0_PWM_MULTICHAN
bool "PWM Multiple Output Channels"
default n
depends on STM32F0L0G0_TIM1_PWM || STM32F0L0G0_TIM2_PWM || STM32F0L0G0_TIM3_PWM || STM32F0L0G0_TIM15_PWM
depends on STM32F0L0G0_PWM
select ARCH_HAVE_PWM_MULTICHAN
select PWM_MULTICHAN
---help---
Specifies that the PWM driver supports multiple output channels per timer.

View File

@ -1265,6 +1265,11 @@ config STM32F7_TIM
bool
default n
config STM32F7_PWM
bool
default n
select ARCH_HAVE_PWM_PULSECOUNT
config STM32F7_USART
bool
default n
@ -2695,7 +2700,7 @@ config STM32F7_TIM1_PWM
bool "TIM1 PWM"
default n
depends on STM32F7_TIM1
select ARCH_HAVE_PWM_PULSECOUNT
select STM32F7_PWM
---help---
Reserve timer 1 for use by PWM
@ -2834,7 +2839,7 @@ config STM32F7_TIM2_PWM
bool "TIM2 PWM"
default n
depends on STM32F7_TIM2
select ARCH_HAVE_PWM_PULSECOUNT
select STM32F7_PWM
---help---
Reserve timer 2 for use by PWM
@ -2973,7 +2978,7 @@ config STM32F7_TIM3_PWM
bool "TIM3 PWM"
default n
depends on STM32F7_TIM3
select ARCH_HAVE_PWM_PULSECOUNT
select STM32F7_PWM
---help---
Reserve timer 3 for use by PWM
@ -3112,7 +3117,7 @@ config STM32F7_TIM4_PWM
bool "TIM4 PWM"
default n
depends on STM32F7_TIM4
select ARCH_HAVE_PWM_PULSECOUNT
select STM32F7_PWM
---help---
Reserve timer 4 for use by PWM
@ -3251,7 +3256,7 @@ config STM32F7_TIM5_PWM
bool "TIM5 PWM"
default n
depends on STM32F7_TIM5
select ARCH_HAVE_PWM_PULSECOUNT
select STM32F7_PWM
---help---
Reserve timer 5 for use by PWM
@ -3390,7 +3395,7 @@ config STM32F7_TIM8_PWM
bool "TIM8 PWM"
default n
depends on STM32F7_TIM8
select ARCH_HAVE_PWM_PULSECOUNT
select STM32F7_PWM
---help---
Reserve timer 8 for use by PWM
@ -3529,7 +3534,7 @@ config STM32F7_TIM9_PWM
bool "TIM9 PWM"
default n
depends on STM32F7_TIM9
select ARCH_HAVE_PWM_PULSECOUNT
select STM32F7_PWM
---help---
Reserve timer 9 for use by PWM
@ -3661,7 +3666,7 @@ config STM32F7_TIM10_PWM
bool "TIM10 PWM"
default n
depends on STM32F7_TIM10
select ARCH_HAVE_PWM_PULSECOUNT
select STM32F7_PWM
---help---
Reserve timer 10 for use by PWM
@ -3793,7 +3798,7 @@ config STM32F7_TIM11_PWM
bool "TIM11 PWM"
default n
depends on STM32F7_TIM11
select ARCH_HAVE_PWM_PULSECOUNT
select STM32F7_PWM
---help---
Reserve timer 11 for use by PWM
@ -3925,7 +3930,7 @@ config STM32F7_TIM12_PWM
bool "TIM12 PWM"
default n
depends on STM32F7_TIM12
select ARCH_HAVE_PWM_PULSECOUNT
select STM32F7_PWM
---help---
Reserve timer 12 for use by PWM
@ -4057,7 +4062,7 @@ config STM32F7_TIM13_PWM
bool "TIM13 PWM"
default n
depends on STM32F7_TIM13
select ARCH_HAVE_PWM_PULSECOUNT
select STM32F7_PWM
---help---
Reserve timer 13 for use by PWM
@ -4189,7 +4194,7 @@ config STM32F7_TIM14_PWM
bool "TIM14 PWM"
default n
depends on STM32F7_TIM14
select ARCH_HAVE_PWM_PULSECOUNT
select STM32F7_PWM
---help---
Reserve timer 14 for use by PWM
@ -4320,7 +4325,7 @@ endif # STM32F7_TIM14_PWM
config STM32F7_PWM_MULTICHAN
bool "PWM Multiple Output Channels"
default n
depends on STM32F7_TIM1_PWM || STM32F7_TIM2_PWM || STM32F7_TIM3_PWM || STM32F7_TIM4_PWM || STM32F7_TIM5_PWM || STM32F7_TIM8_PWM || STM32F7_TIM9_PWM || STM32F7_TIM10_PWM || STM32F7_TIM11_PWM || STM32F7_TIM12_PWM || STM32F7_TIM13_PWM || STM32F7_TIM14_PWM
depends on STM32F7_PWM
select ARCH_HAVE_PWM_MULTICHAN
---help---
Specifies that the PWM driver supports multiple output

View File

@ -163,6 +163,6 @@ ifeq ($(CONFIG_STM32F7_SAI),y)
CHIP_CSRCS += stm32_sai.c
endif
ifeq ($(CONFIG_PWM),y)
ifeq ($(CONFIG_STM32F7_PWM),y)
CHIP_CSRCS += stm32_pwm.c
endif

View File

@ -475,6 +475,7 @@ config STM32H7_PWR
config STM32H7_PWM
bool
default n
select ARCH_HAVE_PWM_PULSECOUNT
config STM32H7_USART
bool
@ -1946,7 +1947,6 @@ config STM32H7_TIM1_PWM
bool "TIM1 PWM"
default n
depends on STM32H7_TIM1
select ARCH_HAVE_PWM_PULSECOUNT
select STM32H7_PWM
---help---
Reserve timer 1 for use by PWM
@ -2229,7 +2229,6 @@ config STM32H7_TIM2_PWM
bool "TIM2 PWM"
default n
depends on STM32H7_TIM2
select ARCH_HAVE_PWM_PULSECOUNT
select STM32H7_PWM
---help---
Reserve timer 2 for use by PWM
@ -2409,7 +2408,6 @@ config STM32H7_TIM3_PWM
bool "TIM3 PWM"
default n
depends on STM32H7_TIM3
select ARCH_HAVE_PWM_PULSECOUNT
select STM32H7_PWM
---help---
Reserve timer 3 for use by PWM
@ -2589,7 +2587,6 @@ config STM32H7_TIM4_PWM
bool "TIM4 PWM"
default n
depends on STM32H7_TIM4
select ARCH_HAVE_PWM_PULSECOUNT
select STM32H7_PWM
---help---
Reserve timer 4 for use by PWM
@ -2769,7 +2766,6 @@ config STM32H7_TIM5_PWM
bool "TIM5 PWM"
default n
depends on STM32H7_TIM5
select ARCH_HAVE_PWM_PULSECOUNT
select STM32H7_PWM
---help---
Reserve timer 5 for use by PWM
@ -2949,7 +2945,6 @@ config STM32H7_TIM8_PWM
bool "TIM8 PWM"
default n
depends on STM32H7_TIM8
select ARCH_HAVE_PWM_PULSECOUNT
select STM32H7_PWM
---help---
Reserve timer 8 for use by PWM
@ -3232,7 +3227,6 @@ config STM32H7_TIM12_PWM
bool "TIM12 PWM"
default n
depends on STM32H7_TIM12
select ARCH_HAVE_PWM_PULSECOUNT
select STM32H7_PWM
---help---
Reserve timer 12 for use by PWM
@ -3339,7 +3333,6 @@ config STM32H7_TIM13_PWM
bool "TIM13 PWM"
default n
depends on STM32H7_TIM13
select ARCH_HAVE_PWM_PULSECOUNT
select STM32H7_PWM
---help---
Reserve timer 13 for use by PWM
@ -3413,7 +3406,6 @@ config STM32H7_TIM14_PWM
bool "TIM14 PWM"
default n
depends on STM32H7_TIM14
select ARCH_HAVE_PWM_PULSECOUNT
select STM32H7_PWM
---help---
Reserve timer 14 for use by PWM
@ -3819,7 +3811,7 @@ endif # STM32H7_TIM17_PWM
config STM32H7_PWM_MULTICHAN
bool "PWM Multiple Output Channels"
default n
depends on STM32H7_TIM1_PWM || STM32H7_TIM2_PWM || STM32H7_TIM3_PWM || STM32H7_TIM4_PWM || STM32H7_TIM5_PWM || STM32H7_TIM8_PWM || STM32H7_TIM12_PWM || STM32H7_TIM15_PWM
depends on STM32H7_PWM
select ARCH_HAVE_PWM_MULTICHAN
---help---
Specifies that the PWM driver supports multiple output

View File

@ -1216,6 +1216,11 @@ config STM32L4_SPI
bool
default n
config STM32L4_PWM
bool
default n
select ARCH_HAVE_PWM_PULSECOUNT
config STM32L4_USART
bool
default n
@ -2044,8 +2049,7 @@ config STM32L4_TIM1_PWM
bool "TIM1 PWM"
default n
depends on STM32L4_TIM1
select PWM
select ARCH_HAVE_PWM_PULSECOUNT
select STM32L4_PWM
---help---
Reserve timer 1 for use by PWM
@ -2284,8 +2288,7 @@ config STM32L4_TIM2_PWM
bool "TIM2 PWM"
default n
depends on STM32L4_TIM2
select PWM
select ARCH_HAVE_PWM_PULSECOUNT
select STM32L4_PWM
---help---
Reserve timer 2 for use by PWM
@ -2464,8 +2467,7 @@ config STM32L4_TIM3_PWM
bool "TIM3 PWM"
default n
depends on STM32L4_TIM3
select PWM
select ARCH_HAVE_PWM_PULSECOUNT
select STM32L4_PWM
---help---
Reserve timer 3 for use by PWM
@ -2644,8 +2646,7 @@ config STM32L4_TIM4_PWM
bool "TIM4 PWM"
default n
depends on STM32L4_TIM4
select PWM
select ARCH_HAVE_PWM_PULSECOUNT
select STM32L4_PWM
---help---
Reserve timer 4 for use by PWM
@ -2824,8 +2825,7 @@ config STM32L4_TIM5_PWM
bool "TIM5 PWM"
default n
depends on STM32L4_TIM5
select PWM
select ARCH_HAVE_PWM_PULSECOUNT
select STM32L4_PWM
---help---
Reserve timer 5 for use by PWM
@ -3004,8 +3004,7 @@ config STM32L4_TIM8_PWM
bool "TIM8 PWM"
default n
depends on STM32L4_TIM8
select PWM
select ARCH_HAVE_PWM_PULSECOUNT
select STM32L4_PWM
---help---
Reserve timer 8 for use by PWM
@ -3244,7 +3243,7 @@ config STM32L4_TIM15_PWM
bool "TIM15 PWM"
default n
depends on STM32L4_TIM15
select PWM
select STM32L4_PWM
---help---
Reserve timer 15 for use by PWM
@ -3390,7 +3389,7 @@ config STM32L4_TIM16_PWM
bool "TIM16 PWM"
default n
depends on STM32L4_TIM16
select PWM
select STM32L4_PWM
---help---
Reserve timer 16 for use by PWM
@ -3491,7 +3490,7 @@ config STM32L4_TIM17_PWM
bool "TIM17 PWM"
default n
depends on STM32L4_TIM17
select PWM
select STM32L4_PWM
---help---
Reserve timer 17 for use by PWM
@ -3709,7 +3708,7 @@ endif # STM32L4_LPTIM2_PWM
config STM32L4_PWM_MULTICHAN
bool "PWM Multiple Output Channels"
default n
depends on STM32L4_TIM1_PWM || STM32L4_TIM2_PWM || STM32L4_TIM3_PWM || STM32L4_TIM4_PWM || STM32L4_TIM5_PWM || STM32L4_TIM8_PWM || STM32L4_TIM15_PWM || STM32L4_TIM16_PWM || STM32L4_TIM17_PWM || STM32L4_LPTIM1_PWM || STM32L4_LPTIM2_PWM
depends on STM32L4_PWM
select ARCH_HAVE_PWM_MULTICHAN
---help---
Specifies that the PWM driver supports multiple output

View File

@ -151,7 +151,7 @@ ifeq ($(CONFIG_STM32L4_LPTIM),y)
CHIP_CSRCS += stm32l4_lptim.c
endif
ifeq ($(CONFIG_PWM),y)
ifeq ($(CONFIG_STM32L4_PWM),y)
CHIP_CSRCS += stm32l4_pwm.c
endif

View File

@ -221,6 +221,11 @@ config STM32U5_SPI
bool
default n
config STM32U5_PWM
bool
default n
select ARCH_HAVE_PWM_PULSECOUNT
config STM32U5_USART
bool
default n
@ -832,8 +837,7 @@ config STM32U5_TIM1_PWM
bool "TIM1 PWM"
default n
depends on STM32U5_TIM1
select PWM
select ARCH_HAVE_PWM_PULSECOUNT
select STM32U5_PWM
---help---
Reserve timer 1 for use by PWM
@ -993,8 +997,7 @@ config STM32U5_TIM2_PWM
bool "TIM2 PWM"
default n
depends on STM32U5_TIM2
select PWM
select ARCH_HAVE_PWM_PULSECOUNT
select STM32U5_PWM
---help---
Reserve timer 2 for use by PWM
@ -1133,8 +1136,7 @@ config STM32U5_TIM3_PWM
bool "TIM3 PWM"
default n
depends on STM32U5_TIM3
select PWM
select ARCH_HAVE_PWM_PULSECOUNT
select STM32U5_PWM
---help---
Reserve timer 3 for use by PWM
@ -1273,8 +1275,7 @@ config STM32U5_TIM4_PWM
bool "TIM4 PWM"
default n
depends on STM32U5_TIM4
select PWM
select ARCH_HAVE_PWM_PULSECOUNT
select STM32U5_PWM
---help---
Reserve timer 4 for use by PWM
@ -1413,8 +1414,7 @@ config STM32U5_TIM5_PWM
bool "TIM5 PWM"
default n
depends on STM32U5_TIM5
select PWM
select ARCH_HAVE_PWM_PULSECOUNT
select STM32U5_PWM
---help---
Reserve timer 5 for use by PWM
@ -1553,8 +1553,7 @@ config STM32U5_TIM8_PWM
bool "TIM8 PWM"
default n
depends on STM32U5_TIM8
select PWM
select ARCH_HAVE_PWM_PULSECOUNT
select STM32U5_PWM
---help---
Reserve timer 8 for use by PWM
@ -1714,7 +1713,7 @@ config STM32U5_TIM15_PWM
bool "TIM15 PWM"
default n
depends on STM32U5_TIM15
select PWM
select STM32U5_PWM
---help---
Reserve timer 15 for use by PWM
@ -1807,7 +1806,7 @@ config STM32U5_TIM16_PWM
bool "TIM16 PWM"
default n
depends on STM32U5_TIM16
select PWM
select STM32U5_PWM
---help---
Reserve timer 16 for use by PWM
@ -1877,7 +1876,7 @@ config STM32U5_TIM17_PWM
bool "TIM17 PWM"
default n
depends on STM32U5_TIM17
select PWM
select STM32U5_PWM
---help---
Reserve timer 17 for use by PWM
@ -1946,7 +1945,7 @@ endif # STM32U5_TIM17_PWM
config STM32U5_PWM_MULTICHAN
bool "PWM Multiple Output Channels"
default n
depends on STM32U5_TIM1_PWM || STM32U5_TIM2_PWM || STM32U5_TIM3_PWM || STM32U5_TIM4_PWM || STM32U5_TIM5_PWM || STM32U5_TIM8_PWM || STM32U5_TIM15_PWM || STM32U5_TIM16_PWM || STM32U5_TIM17_PWM
depends on STM32U5_PWM
select ARCH_HAVE_PWM_MULTICHAN
---help---
Specifies that the PWM driver supports multiple output