From 54f606eec00ab2b1eaf141cde6fbd08ba86e70a0 Mon Sep 17 00:00:00 2001 From: Maureen Helm Date: Thu, 21 May 2020 09:02:02 -0500 Subject: [PATCH] boards: arm: Conditionalize adc pinmuxes on nxp boards Conditionalizes adc pinmuxes on CONFIG_ADC for all nxp boards (kinetis, lpc, and imx families) to avoid possible conflicts between peripherals. Signed-off-by: Maureen Helm --- boards/arm/frdm_k64f/pinmux.c | 2 +- boards/arm/frdm_k82f/pinmux.c | 2 +- boards/arm/frdm_kl25z/pinmux.c | 2 +- boards/arm/frdm_kw41z/Kconfig.defconfig | 2 +- boards/arm/frdm_kw41z/pinmux.c | 2 +- boards/arm/hexiwear_kw40z/Kconfig.defconfig | 2 +- boards/arm/hexiwear_kw40z/pinmux.c | 2 +- boards/arm/twr_ke18f/pinmux.c | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/boards/arm/frdm_k64f/pinmux.c b/boards/arm/frdm_k64f/pinmux.c index 1cd90170e34..b9ddb1d43a5 100644 --- a/boards/arm/frdm_k64f/pinmux.c +++ b/boards/arm/frdm_k64f/pinmux.c @@ -117,7 +117,7 @@ static int frdm_k64f_pinmux_init(struct device *dev) | PORT_PCR_ODE_MASK); #endif -#if DT_NODE_HAS_STATUS(DT_NODELABEL(adc1), okay) +#if DT_NODE_HAS_STATUS(DT_NODELABEL(adc1), okay) && CONFIG_ADC /* ADC1_SE14 */ pinmux_pin_set(portb, 10, PORT_PCR_MUX(kPORT_PinDisabledOrAnalog)); #endif diff --git a/boards/arm/frdm_k82f/pinmux.c b/boards/arm/frdm_k82f/pinmux.c index 748e68b5384..89a433eef17 100644 --- a/boards/arm/frdm_k82f/pinmux.c +++ b/boards/arm/frdm_k82f/pinmux.c @@ -77,7 +77,7 @@ static int frdm_k82f_pinmux_init(struct device *dev) pinmux_pin_set(portc, 15, PORT_PCR_MUX(kPORT_MuxAlt3)); #endif -#if DT_NODE_HAS_STATUS(DT_NODELABEL(adc0), okay) +#if DT_NODE_HAS_STATUS(DT_NODELABEL(adc0), okay) && CONFIG_ADC /* ADC0_SE15 */ pinmux_pin_set(portc, 1, PORT_PCR_MUX(kPORT_PinDisabledOrAnalog)); #endif diff --git a/boards/arm/frdm_kl25z/pinmux.c b/boards/arm/frdm_kl25z/pinmux.c index 451c52c66d0..936639a4ead 100644 --- a/boards/arm/frdm_kl25z/pinmux.c +++ b/boards/arm/frdm_kl25z/pinmux.c @@ -60,7 +60,7 @@ static int frdm_kl25z_pinmux_init(struct device *dev) | PORT_PCR_PS_MASK); #endif -#if DT_NODE_HAS_STATUS(DT_NODELABEL(adc0), okay) +#if DT_NODE_HAS_STATUS(DT_NODELABEL(adc0), okay) && CONFIG_ADC /* ADC0_SE12 */ pinmux_pin_set(portb, 2, PORT_PCR_MUX(kPORT_PinDisabledOrAnalog)); #endif diff --git a/boards/arm/frdm_kw41z/Kconfig.defconfig b/boards/arm/frdm_kw41z/Kconfig.defconfig index f5e44038944..a98da409a60 100644 --- a/boards/arm/frdm_kw41z/Kconfig.defconfig +++ b/boards/arm/frdm_kw41z/Kconfig.defconfig @@ -23,7 +23,7 @@ config PINMUX_MCUX_PORTA default y config PINMUX_MCUX_PORTB - default y if "$(dt_nodelabel_enabled,adc0)" + default y if "$(dt_nodelabel_enabled,adc0)" && ADC default y if "$(dt_nodelabel_enabled,tpm1)" config PINMUX_MCUX_PORTC diff --git a/boards/arm/frdm_kw41z/pinmux.c b/boards/arm/frdm_kw41z/pinmux.c index 2f5bba856b8..c27637da47a 100644 --- a/boards/arm/frdm_kw41z/pinmux.c +++ b/boards/arm/frdm_kw41z/pinmux.c @@ -46,7 +46,7 @@ static int frdm_kw41z_pinmux_init(struct device *dev) | PORT_PCR_PS_MASK); #endif -#if DT_NODE_HAS_STATUS(DT_NODELABEL(adc0), okay) +#if DT_NODE_HAS_STATUS(DT_NODELABEL(adc0), okay) && CONFIG_ADC /* ADC0_SE3 */ pinmux_pin_set(portb, 2, PORT_PCR_MUX(kPORT_PinDisabledOrAnalog)); #endif diff --git a/boards/arm/hexiwear_kw40z/Kconfig.defconfig b/boards/arm/hexiwear_kw40z/Kconfig.defconfig index d7d9f97df6a..76589ceeac1 100644 --- a/boards/arm/hexiwear_kw40z/Kconfig.defconfig +++ b/boards/arm/hexiwear_kw40z/Kconfig.defconfig @@ -23,7 +23,7 @@ config PINMUX_MCUX_PORTA default y config PINMUX_MCUX_PORTB - default y if "$(dt_nodelabel_enabled,adc0)" + default y if "$(dt_nodelabel_enabled,adc0)" && ADC config PINMUX_MCUX_PORTC default y if "$(dt_nodelabel_enabled,lpuart0)" && SERIAL diff --git a/boards/arm/hexiwear_kw40z/pinmux.c b/boards/arm/hexiwear_kw40z/pinmux.c index 1788b437c8f..76c2c8af6c6 100644 --- a/boards/arm/hexiwear_kw40z/pinmux.c +++ b/boards/arm/hexiwear_kw40z/pinmux.c @@ -36,7 +36,7 @@ static int hexiwear_kw40z_pinmux_init(struct device *dev) | PORT_PCR_PS_MASK); #endif -#if DT_NODE_HAS_STATUS(DT_NODELABEL(adc0), okay) +#if DT_NODE_HAS_STATUS(DT_NODELABEL(adc0), okay) && CONFIG_ADC /* ADC0_SE1 */ pinmux_pin_set(portb, 1, PORT_PCR_MUX(kPORT_PinDisabledOrAnalog)); #endif diff --git a/boards/arm/twr_ke18f/pinmux.c b/boards/arm/twr_ke18f/pinmux.c index 8cc337b0886..7990374afeb 100644 --- a/boards/arm/twr_ke18f/pinmux.c +++ b/boards/arm/twr_ke18f/pinmux.c @@ -134,7 +134,7 @@ static int twr_ke18f_pinmux_init(struct device *dev) #endif pinmux_pin_set(portc, 15, PORT_PCR_MUX(kPORT_MuxAsGpio)); -#if DT_NODE_HAS_STATUS(DT_NODELABEL(adc0), okay) +#if DT_NODE_HAS_STATUS(DT_NODELABEL(adc0), okay) && CONFIG_ADC /* Thermistor A, B */ pinmux_pin_set(porta, 0, PORT_PCR_MUX(kPORT_PinDisabledOrAnalog)); pinmux_pin_set(porta, 1, PORT_PCR_MUX(kPORT_PinDisabledOrAnalog));