pwm: stm32: Add support for all PWMs up to PWM20

All the PWM between 1 and 20 can be found on the STM32 depending on the
serie and the specific model. Add all the missing PWMs up to PWM20 to
plan for the future needs.

Tested on STM32L496 with available PWMs.

Signed-off-by: Florian Vaussard <florian.vaussard@gmail.com>
This commit is contained in:
Florian Vaussard 2017-08-17 16:18:36 +02:00 committed by Kumar Gala
commit f34e74dba2
2 changed files with 340 additions and 0 deletions

View file

@ -60,3 +60,258 @@ config PWM_STM32_3_DEV_NAME
depends on PWM_STM32_3
help
Specify the device name for the PWM driver.
config PWM_STM32_4
bool "STM32 PWM 4 Output"
depends on PWM_STM32
default n
help
Enable output for PWM4 in the driver. Say y here
if you want to use PWM4 output.
config PWM_STM32_4_DEV_NAME
string "STM32 PWM Device Name"
default "PWM_4"
depends on PWM_STM32_4
help
Specify the device name for the PWM driver.
config PWM_STM32_5
bool "STM32 PWM 5 Output"
depends on PWM_STM32
default n
help
Enable output for PWM5 in the driver. Say y here
if you want to use PWM5 output.
config PWM_STM32_5_DEV_NAME
string "STM32 PWM Device Name"
default "PWM_5"
depends on PWM_STM32_5
help
Specify the device name for the PWM driver.
config PWM_STM32_6
bool "STM32 PWM 6 Output"
depends on PWM_STM32
default n
help
Enable output for PWM6 in the driver. Say y here
if you want to use PWM6 output.
config PWM_STM32_6_DEV_NAME
string "STM32 PWM Device Name"
default "PWM_6"
depends on PWM_STM32_6
help
Specify the device name for the PWM driver.
config PWM_STM32_7
bool "STM32 PWM 7 Output"
depends on PWM_STM32
default n
help
Enable output for PWM7 in the driver. Say y here
if you want to use PWM7 output.
config PWM_STM32_7_DEV_NAME
string "STM32 PWM Device Name"
default "PWM_7"
depends on PWM_STM32_7
help
Specify the device name for the PWM driver.
config PWM_STM32_8
bool "STM32 PWM 8 Output"
depends on PWM_STM32
default n
help
Enable output for PWM8 in the driver. Say y here
if you want to use PWM8 output.
config PWM_STM32_8_DEV_NAME
string "STM32 PWM Device Name"
default "PWM_8"
depends on PWM_STM32_8
help
Specify the device name for the PWM driver.
config PWM_STM32_9
bool "STM32 PWM 9 Output"
depends on PWM_STM32
default n
help
Enable output for PWM9 in the driver. Say y here
if you want to use PWM9 output.
config PWM_STM32_9_DEV_NAME
string "STM32 PWM Device Name"
default "PWM_9"
depends on PWM_STM32_9
help
Specify the device name for the PWM driver.
config PWM_STM32_10
bool "STM32 PWM 10 Output"
depends on PWM_STM32
default n
help
Enable output for PWM10 in the driver. Say y here
if you want to use PWM10 output.
config PWM_STM32_10_DEV_NAME
string "STM32 PWM Device Name"
default "PWM_10"
depends on PWM_STM32_10
help
Specify the device name for the PWM driver.
config PWM_STM32_11
bool "STM32 PWM 11 Output"
depends on PWM_STM32
default n
help
Enable output for PWM11 in the driver. Say y here
if you want to use PWM11 output.
config PWM_STM32_11_DEV_NAME
string "STM32 PWM Device Name"
default "PWM_11"
depends on PWM_STM32_11
help
Specify the device name for the PWM driver.
config PWM_STM32_12
bool "STM32 PWM 12 Output"
depends on PWM_STM32
default n
help
Enable output for PWM12 in the driver. Say y here
if you want to use PWM12 output.
config PWM_STM32_12_DEV_NAME
string "STM32 PWM Device Name"
default "PWM_12"
depends on PWM_STM32_12
help
Specify the device name for the PWM driver.
config PWM_STM32_13
bool "STM32 PWM 13 Output"
depends on PWM_STM32
default n
help
Enable output for PWM13 in the driver. Say y here
if you want to use PWM13 output.
config PWM_STM32_13_DEV_NAME
string "STM32 PWM Device Name"
default "PWM_13"
depends on PWM_STM32_13
help
Specify the device name for the PWM driver.
config PWM_STM32_14
bool "STM32 PWM 14 Output"
depends on PWM_STM32
default n
help
Enable output for PWM14 in the driver. Say y here
if you want to use PWM14 output.
config PWM_STM32_14_DEV_NAME
string "STM32 PWM Device Name"
default "PWM_14"
depends on PWM_STM32_14
help
Specify the device name for the PWM driver.
config PWM_STM32_15
bool "STM32 PWM 15 Output"
depends on PWM_STM32
default n
help
Enable output for PWM15 in the driver. Say y here
if you want to use PWM15 output.
config PWM_STM32_15_DEV_NAME
string "STM32 PWM Device Name"
default "PWM_15"
depends on PWM_STM32_15
help
Specify the device name for the PWM driver.
config PWM_STM32_16
bool "STM32 PWM 16 Output"
depends on PWM_STM32
default n
help
Enable output for PWM16 in the driver. Say y here
if you want to use PWM16 output.
config PWM_STM32_16_DEV_NAME
string "STM32 PWM Device Name"
default "PWM_16"
depends on PWM_STM32_16
help
Specify the device name for the PWM driver.
config PWM_STM32_17
bool "STM32 PWM 17 Output"
depends on PWM_STM32
default n
help
Enable output for PWM17 in the driver. Say y here
if you want to use PWM17 output.
config PWM_STM32_17_DEV_NAME
string "STM32 PWM Device Name"
default "PWM_17"
depends on PWM_STM32_17
help
Specify the device name for the PWM driver.
config PWM_STM32_18
bool "STM32 PWM 18 Output"
depends on PWM_STM32
default n
help
Enable output for PWM18 in the driver. Say y here
if you want to use PWM18 output.
config PWM_STM32_18_DEV_NAME
string "STM32 PWM Device Name"
default "PWM_18"
depends on PWM_STM32_18
help
Specify the device name for the PWM driver.
config PWM_STM32_19
bool "STM32 PWM 19 Output"
depends on PWM_STM32
default n
help
Enable output for PWM19 in the driver. Say y here
if you want to use PWM19 output.
config PWM_STM32_19_DEV_NAME
string "STM32 PWM Device Name"
default "PWM_19"
depends on PWM_STM32_19
help
Specify the device name for the PWM driver.
config PWM_STM32_20
bool "STM32 PWM 20 Output"
depends on PWM_STM32
default n
help
Enable output for PWM20 in the driver. Say y here
if you want to use PWM20 output.
config PWM_STM32_20_DEV_NAME
string "STM32 PWM Device Name"
default "PWM_20"
depends on PWM_STM32_20
help
Specify the device name for the PWM driver.

View file

@ -233,3 +233,88 @@ PWM_DEVICE_INIT_STM32(2, APB1, 0)
/* 16-bit general-purpose timer */
PWM_DEVICE_INIT_STM32(3, APB1, 10000)
#endif /* CONFIG_PWM_STM32_3 */
#ifdef CONFIG_PWM_STM32_4
/* 16-bit general-purpose timer */
PWM_DEVICE_INIT_STM32(4, APB1, 10000)
#endif /* CONFIG_PWM_STM32_4 */
#ifdef CONFIG_PWM_STM32_5
/* 32-bit general-purpose timer */
PWM_DEVICE_INIT_STM32(5, APB1, 0)
#endif /* CONFIG_PWM_STM32_5 */
#ifdef CONFIG_PWM_STM32_6
/* 16-bit basic timer */
PWM_DEVICE_INIT_STM32(6, APB1, 10000)
#endif /* CONFIG_PWM_STM32_6 */
#ifdef CONFIG_PWM_STM32_7
/* 16-bit basic timer */
PWM_DEVICE_INIT_STM32(7, APB1, 10000)
#endif /* CONFIG_PWM_STM32_7 */
#ifdef CONFIG_PWM_STM32_8
/* 16-bit advanced-control timer */
PWM_DEVICE_INIT_STM32(8, APB2, 10000)
#endif /* CONFIG_PWM_STM32_8 */
#ifdef CONFIG_PWM_STM32_9
/* 16-bit general-purpose timer */
PWM_DEVICE_INIT_STM32(9, APB2, 10000)
#endif /* CONFIG_PWM_STM32_9 */
#ifdef CONFIG_PWM_STM32_10
/* 16-bit general-purpose timer */
PWM_DEVICE_INIT_STM32(10, APB2, 10000)
#endif /* CONFIG_PWM_STM32_10 */
#ifdef CONFIG_PWM_STM32_11
/* 16-bit general-purpose timer */
PWM_DEVICE_INIT_STM32(11, APB2, 10000)
#endif /* CONFIG_PWM_STM32_11 */
#ifdef CONFIG_PWM_STM32_12
/* 16-bit general-purpose timer */
PWM_DEVICE_INIT_STM32(12, APB1, 10000)
#endif /* CONFIG_PWM_STM32_12 */
#ifdef CONFIG_PWM_STM32_13
/* 16-bit general-purpose timer */
PWM_DEVICE_INIT_STM32(13, APB1, 10000)
#endif /* CONFIG_PWM_STM32_13 */
#ifdef CONFIG_PWM_STM32_14
/* 16-bit general-purpose timer */
PWM_DEVICE_INIT_STM32(14, APB1, 10000)
#endif /* CONFIG_PWM_STM32_14 */
#ifdef CONFIG_PWM_STM32_15
/* 16-bit general-purpose timer */
PWM_DEVICE_INIT_STM32(15, APB2, 10000)
#endif /* CONFIG_PWM_STM32_15 */
#ifdef CONFIG_PWM_STM32_16
/* 16-bit general-purpose timer */
PWM_DEVICE_INIT_STM32(16, APB2, 10000)
#endif /* CONFIG_PWM_STM32_16 */
#ifdef CONFIG_PWM_STM32_17
/* 16-bit general-purpose timer */
PWM_DEVICE_INIT_STM32(17, APB2, 10000)
#endif /* CONFIG_PWM_STM32_17 */
#ifdef CONFIG_PWM_STM32_18
/* 16-bit advanced timer */
PWM_DEVICE_INIT_STM32(18, APB1, 10000)
#endif /* CONFIG_PWM_STM32_18 */
#ifdef CONFIG_PWM_STM32_19
/* 16-bit general-purpose timer */
PWM_DEVICE_INIT_STM32(19, APB2, 10000)
#endif /* CONFIG_PWM_STM32_19 */
#ifdef CONFIG_PWM_STM32_20
/* 16-bit advanced timer */
PWM_DEVICE_INIT_STM32(20, APB2, 10000)
#endif /* CONFIG_PWM_STM32_20 */