From eb42a24dc69cb5b0a24c7ce5bc4d76d281377f72 Mon Sep 17 00:00:00 2001 From: Henrik Brix Andersen Date: Wed, 13 Nov 2019 12:48:29 +0100 Subject: [PATCH] boards: nxp: pinmux: enable ftm pwm outputs based on DT_INST_* defines Enable the NXP FTM PWM outputs in the board pinmux files based on the DT_INST_* defines instead of CONFIG_PWM_* to match the pwm_mcux_ftm driver. Signed-off-by: Henrik Brix Andersen --- boards/arm/frdm_k64f/pinmux.c | 2 +- boards/arm/frdm_k82f/pinmux.c | 2 +- boards/arm/hexiwear_k64/pinmux.c | 2 +- boards/arm/twr_ke18f/pinmux.c | 12 ++++++------ 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/boards/arm/frdm_k64f/pinmux.c b/boards/arm/frdm_k64f/pinmux.c index 35f3c9e44cf..18633d604cf 100644 --- a/boards/arm/frdm_k64f/pinmux.c +++ b/boards/arm/frdm_k64f/pinmux.c @@ -122,7 +122,7 @@ static int frdm_k64f_pinmux_init(struct device *dev) pinmux_pin_set(portb, 10, PORT_PCR_MUX(kPORT_PinDisabledOrAnalog)); #endif -#ifdef CONFIG_PWM_3 +#ifdef DT_NXP_KINETIS_FTM_PWM_3_BASE_ADDRESS pinmux_pin_set(portc, 8, PORT_PCR_MUX(kPORT_MuxAlt3)); pinmux_pin_set(portc, 9, PORT_PCR_MUX(kPORT_MuxAlt3)); #endif diff --git a/boards/arm/frdm_k82f/pinmux.c b/boards/arm/frdm_k82f/pinmux.c index e99ca5255ae..d8e5939ac69 100644 --- a/boards/arm/frdm_k82f/pinmux.c +++ b/boards/arm/frdm_k82f/pinmux.c @@ -33,7 +33,7 @@ static int frdm_k82f_pinmux_init(struct device *dev) device_get_binding(CONFIG_PINMUX_MCUX_PORTE_NAME); #endif -#ifdef CONFIG_PWM_3 +#ifdef DT_NXP_KINETIS_FTM_PWM_3_BASE_ADDRESS /* Red, green, blue LEDs as PWM channels */ pinmux_pin_set(portc, 8, PORT_PCR_MUX(kPORT_MuxAlt3)); pinmux_pin_set(portc, 9, PORT_PCR_MUX(kPORT_MuxAlt3)); diff --git a/boards/arm/hexiwear_k64/pinmux.c b/boards/arm/hexiwear_k64/pinmux.c index 5aa29d17482..d9e2368e270 100644 --- a/boards/arm/hexiwear_k64/pinmux.c +++ b/boards/arm/hexiwear_k64/pinmux.c @@ -34,7 +34,7 @@ static int hexiwear_k64_pinmux_init(struct device *dev) device_get_binding(CONFIG_PINMUX_MCUX_PORTE_NAME); #endif -#ifdef CONFIG_PWM_3 +#ifdef DT_NXP_KINETIS_FTM_PWM_3_BASE_ADDRESS /* Red, green, blue LEDs as PWM channels */ pinmux_pin_set(portc, 8, PORT_PCR_MUX(kPORT_MuxAlt3)); pinmux_pin_set(portc, 9, PORT_PCR_MUX(kPORT_MuxAlt3)); diff --git a/boards/arm/twr_ke18f/pinmux.c b/boards/arm/twr_ke18f/pinmux.c index e608cb620b3..b30fe13a59e 100644 --- a/boards/arm/twr_ke18f/pinmux.c +++ b/boards/arm/twr_ke18f/pinmux.c @@ -34,31 +34,31 @@ static int twr_ke18f_pinmux_init(struct device *dev) device_get_binding(CONFIG_PINMUX_MCUX_PORTE_NAME); #endif -#ifdef CONFIG_PWM_0 +#ifdef DT_NXP_KINETIS_FTM_PWM_0_BASE_ADDRESS /* Tri-color LED as PWM */ pinmux_pin_set(portb, 5, PORT_PCR_MUX(kPORT_MuxAlt2)); pinmux_pin_set(portd, 15, PORT_PCR_MUX(kPORT_MuxAlt2)); pinmux_pin_set(portd, 16, PORT_PCR_MUX(kPORT_MuxAlt2)); -#else /* !CONFIG_PWM_0 */ +#else /* !DT_NXP_KINETIS_FTM_PWM_0_BASE_ADDRESS */ /* Tri-color LED as GPIO */ pinmux_pin_set(portb, 5, PORT_PCR_MUX(kPORT_MuxAsGpio)); pinmux_pin_set(portd, 15, PORT_PCR_MUX(kPORT_MuxAsGpio)); pinmux_pin_set(portd, 16, PORT_PCR_MUX(kPORT_MuxAsGpio)); -#endif /* !CONFIG_PWM_0 */ +#endif /* !DT_NXP_KINETIS_FTM_PWM_0_BASE_ADDRESS */ -#ifdef CONFIG_PWM_3 +#ifdef DT_NXP_KINETIS_FTM_PWM_3_BASE_ADDRESS /* User LEDs as PWM */ pinmux_pin_set(portc, 10, PORT_PCR_MUX(kPORT_MuxAlt2)); pinmux_pin_set(portc, 11, PORT_PCR_MUX(kPORT_MuxAlt2)); pinmux_pin_set(portc, 12, PORT_PCR_MUX(kPORT_MuxAlt2)); pinmux_pin_set(portc, 13, PORT_PCR_MUX(kPORT_MuxAlt2)); -#else /* !CONFIG_PWM_3 */ +#else /* !DT_NXP_KINETIS_FTM_PWM_3_BASE_ADDRESS */ /* User LEDs as GPIO */ pinmux_pin_set(portc, 10, PORT_PCR_MUX(kPORT_MuxAsGpio)); pinmux_pin_set(portc, 11, PORT_PCR_MUX(kPORT_MuxAsGpio)); pinmux_pin_set(portc, 12, PORT_PCR_MUX(kPORT_MuxAsGpio)); pinmux_pin_set(portc, 13, PORT_PCR_MUX(kPORT_MuxAsGpio)); -#endif /* !CONFIG_PWM_3 */ +#endif /* !DT_NXP_KINETIS_FTM_PWM_3_BASE_ADDRESS */ /* Buttons */ pinmux_pin_set(portd, 3, PORT_PCR_MUX(kPORT_MuxAsGpio));