diff --git a/boards/arm/frdm_k22f/pinmux.c b/boards/arm/frdm_k22f/pinmux.c index c8904c7bd27..7c0974f976b 100644 --- a/boards/arm/frdm_k22f/pinmux.c +++ b/boards/arm/frdm_k22f/pinmux.c @@ -38,14 +38,6 @@ static int frdm_k22f_pinmux_init(const struct device *dev) __ASSERT_NO_MSG(device_is_ready(porte)); #endif -#if DT_NODE_HAS_STATUS(DT_NODELABEL(spi0), okay) && CONFIG_SPI - /* SPI0 CS0, SCK, SOUT, SIN */ - pinmux_pin_set(portc, 4, PORT_PCR_MUX(kPORT_MuxAlt2)); - pinmux_pin_set(portd, 1, PORT_PCR_MUX(kPORT_MuxAlt2)); - pinmux_pin_set(portd, 2, PORT_PCR_MUX(kPORT_MuxAlt2)); - pinmux_pin_set(portd, 3, PORT_PCR_MUX(kPORT_MuxAlt2)); -#endif - return 0; } diff --git a/boards/arm/frdm_k64f/pinmux.c b/boards/arm/frdm_k64f/pinmux.c index 94365a3637d..5d0374cf291 100644 --- a/boards/arm/frdm_k64f/pinmux.c +++ b/boards/arm/frdm_k64f/pinmux.c @@ -38,14 +38,6 @@ static int frdm_k64f_pinmux_init(const struct device *dev) __ASSERT_NO_MSG(device_is_ready(porte)); #endif -#if DT_NODE_HAS_STATUS(DT_NODELABEL(spi0), okay) && CONFIG_SPI - /* SPI0 CS0, SCK, SOUT, SIN */ - pinmux_pin_set(portd, 0, PORT_PCR_MUX(kPORT_MuxAlt2)); - pinmux_pin_set(portd, 1, PORT_PCR_MUX(kPORT_MuxAlt2)); - pinmux_pin_set(portd, 2, PORT_PCR_MUX(kPORT_MuxAlt2)); - pinmux_pin_set(portd, 3, PORT_PCR_MUX(kPORT_MuxAlt2)); -#endif - #if DT_NODE_HAS_STATUS(DT_NODELABEL(adc1), okay) && CONFIG_ADC /* ADC1_SE14 */ pinmux_pin_set(portb, 10, PORT_PCR_MUX(kPORT_PinDisabledOrAnalog)); diff --git a/boards/arm/frdm_k82f/pinmux.c b/boards/arm/frdm_k82f/pinmux.c index a9b938df1fd..14c8759401e 100644 --- a/boards/arm/frdm_k82f/pinmux.c +++ b/boards/arm/frdm_k82f/pinmux.c @@ -38,22 +38,6 @@ static int frdm_k82f_pinmux_init(const struct device *dev) __ASSERT_NO_MSG(device_is_ready(porte)); #endif -#if DT_NODE_HAS_STATUS(DT_NODELABEL(spi1), okay) && CONFIG_SPI - /* SPI1 SCK, SOUT, SIN, PCS0 */ - pinmux_pin_set(porte, 1, PORT_PCR_MUX(kPORT_MuxAlt2)); - pinmux_pin_set(porte, 2, PORT_PCR_MUX(kPORT_MuxAlt2)); - pinmux_pin_set(porte, 4, PORT_PCR_MUX(kPORT_MuxAlt2)); - pinmux_pin_set(porte, 5, PORT_PCR_MUX(kPORT_MuxAlt2)); -#endif - -#if DT_NODE_HAS_STATUS(DT_NODELABEL(spi0), okay) && CONFIG_SPI - /* SPI0 SCK, SOUT, SIN, PCS1 */ - pinmux_pin_set(portd, 1, PORT_PCR_MUX(kPORT_MuxAlt2)); - pinmux_pin_set(portd, 2, PORT_PCR_MUX(kPORT_MuxAlt2)); - pinmux_pin_set(portd, 3, PORT_PCR_MUX(kPORT_MuxAlt2)); - pinmux_pin_set(portd, 4, PORT_PCR_MUX(kPORT_MuxAlt2)); -#endif - #if DT_NODE_HAS_STATUS(DT_NODELABEL(adc0), okay) && CONFIG_ADC /* ADC0_SE15 */ pinmux_pin_set(portc, 1, PORT_PCR_MUX(kPORT_PinDisabledOrAnalog)); diff --git a/boards/arm/frdm_kw41z/pinmux.c b/boards/arm/frdm_kw41z/pinmux.c index e569cd5fc6d..c029402f675 100644 --- a/boards/arm/frdm_kw41z/pinmux.c +++ b/boards/arm/frdm_kw41z/pinmux.c @@ -51,14 +51,6 @@ static int frdm_kw41z_pinmux_init(const struct device *dev) pinmux_pin_set(portc, 7, PORT_PCR_MUX(kPORT_MuxAlt4)); #endif -#if DT_NODE_HAS_STATUS(DT_NODELABEL(spi0), okay) && CONFIG_SPI - /* SPI0 CS0, SCK, SOUT, SIN */ - pinmux_pin_set(portc, 16, PORT_PCR_MUX(kPORT_MuxAlt2)); - pinmux_pin_set(portc, 17, PORT_PCR_MUX(kPORT_MuxAlt2)); - pinmux_pin_set(portc, 18, PORT_PCR_MUX(kPORT_MuxAlt2)); - pinmux_pin_set(portc, 19, PORT_PCR_MUX(kPORT_MuxAlt2)); -#endif - return 0; } diff --git a/boards/arm/ip_k66f/pinmux.c b/boards/arm/ip_k66f/pinmux.c index c7399b29e86..4c7df528eda 100644 --- a/boards/arm/ip_k66f/pinmux.c +++ b/boards/arm/ip_k66f/pinmux.c @@ -51,14 +51,6 @@ static int ip_k66f_pinmux_init(const struct device *dev) #endif #endif -#if DT_NODE_HAS_STATUS(DT_NODELABEL(spi1), okay) && CONFIG_SPI - /* SPI1 CS0, SCK, SOUT, SIN - Control of KSZ8794 */ - pinmux_pin_set(portb, 10, PORT_PCR_MUX(kPORT_MuxAlt2)); - pinmux_pin_set(portb, 11, PORT_PCR_MUX(kPORT_MuxAlt2)); - pinmux_pin_set(portb, 16, PORT_PCR_MUX(kPORT_MuxAlt2)); - pinmux_pin_set(portb, 17, PORT_PCR_MUX(kPORT_MuxAlt2)); -#endif - return 0; } diff --git a/boards/arm/rddrone_fmuk66/pinmux.c b/boards/arm/rddrone_fmuk66/pinmux.c index 08d59d3645c..81a3dce927b 100644 --- a/boards/arm/rddrone_fmuk66/pinmux.c +++ b/boards/arm/rddrone_fmuk66/pinmux.c @@ -58,31 +58,6 @@ static int rddrone_fmuk66_pinmux_init(const struct device *dev) pinmux_pin_set(portc, 16, PORT_PCR_MUX(kPORT_MuxAlt2)); #endif -#if DT_NODE_HAS_STATUS(DT_NODELABEL(spi0), okay) && CONFIG_SPI - /* SPI0 CS2, SCK, SIN, SOUT */ - pinmux_pin_set(portc, 2, PORT_PCR_MUX(kPORT_MuxAlt2)); - pinmux_pin_set(portc, 5, PORT_PCR_MUX(kPORT_MuxAlt2)); - pinmux_pin_set(portc, 6, PORT_PCR_MUX(kPORT_MuxAlt2)); - pinmux_pin_set(portc, 7, PORT_PCR_MUX(kPORT_MuxAlt2)); -#endif - -#if DT_NODE_HAS_STATUS(DT_NODELABEL(spi1), okay) && CONFIG_SPI - /* SPI1 CS0, CS1, SCK, SIN, SOUT */ - pinmux_pin_set(portb, 10, PORT_PCR_MUX(kPORT_MuxAlt2)); - pinmux_pin_set(portb, 9, PORT_PCR_MUX(kPORT_MuxAlt2)); - pinmux_pin_set(portb, 11, PORT_PCR_MUX(kPORT_MuxAlt2)); - pinmux_pin_set(portb, 16, PORT_PCR_MUX(kPORT_MuxAlt2)); - pinmux_pin_set(portb, 17, PORT_PCR_MUX(kPORT_MuxAlt2)); -#endif - -#if DT_NODE_HAS_STATUS(DT_NODELABEL(spi2), okay) && CONFIG_SPI - /* SPI2 CS0, SCK, SIN, SOUT */ - pinmux_pin_set(portb, 20, PORT_PCR_MUX(kPORT_MuxAlt2)); - pinmux_pin_set(portb, 21, PORT_PCR_MUX(kPORT_MuxAlt2)); - pinmux_pin_set(portb, 22, PORT_PCR_MUX(kPORT_MuxAlt2)); - pinmux_pin_set(portb, 23, PORT_PCR_MUX(kPORT_MuxAlt2)); -#endif - return 0; } diff --git a/boards/arm/usb_kw24d512/pinmux.c b/boards/arm/usb_kw24d512/pinmux.c index fd23091163f..e0b95699eed 100644 --- a/boards/arm/usb_kw24d512/pinmux.c +++ b/boards/arm/usb_kw24d512/pinmux.c @@ -44,14 +44,6 @@ static int usb_kw24d512_pinmux_init(const struct device *dev) pinmux_pin_set(porta, 2, PORT_PCR_MUX(kPORT_MuxAlt2)); #endif -#if DT_NODE_HAS_STATUS(DT_NODELABEL(spi1), okay) && CONFIG_SPI - /* SPI1 CS0, SCK, SOUT, SIN */ - pinmux_pin_set(portb, 10, PORT_PCR_MUX(kPORT_MuxAlt2)); - pinmux_pin_set(portb, 11, PORT_PCR_MUX(kPORT_MuxAlt2)); - pinmux_pin_set(portb, 16, PORT_PCR_MUX(kPORT_MuxAlt2)); - pinmux_pin_set(portb, 17, PORT_PCR_MUX(kPORT_MuxAlt2)); -#endif - return 0; } diff --git a/drivers/spi/spi_mcux_dspi.c b/drivers/spi/spi_mcux_dspi.c index a46200e20b5..5eb8da0f1cf 100644 --- a/drivers/spi/spi_mcux_dspi.c +++ b/drivers/spi/spi_mcux_dspi.c @@ -754,6 +754,8 @@ static int spi_mcux_init(const struct device *dev) { int err; struct spi_mcux_data *data = dev->data; + const struct spi_mcux_config *config = dev->config; + #ifdef CONFIG_DSPI_MCUX_EDMA enum dma_channel_filter spi_filter = DMA_CHANNEL_NORMAL; const struct device *dma_dev; @@ -765,8 +767,6 @@ static int spi_mcux_init(const struct device *dev) data->tx_dma_config.dma_channel = dma_request_channel(dma_dev, (void *)&spi_filter); #else - const struct spi_mcux_config *config = dev->config; - config->irq_config_func(dev); #endif err = pinctrl_apply_state(config->pincfg, PINCTRL_STATE_DEFAULT);