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 <hebad@vestas.com>
This commit is contained in:
Henrik Brix Andersen 2019-11-13 12:48:29 +01:00 committed by Maureen Helm
commit eb42a24dc6
4 changed files with 9 additions and 9 deletions

View file

@ -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

View file

@ -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));

View file

@ -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));

View file

@ -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));