Skip to content

Commit aa464a9

Browse files
Lukasz MajewskiMaureenHelm
authored andcommitted
spi: Fix the Pcs setup for NXP's K6xF processors
Without this change, when DTS SPI device node has node ID = <0>, the value of 0 is assigned during SPI configuration and written to whichPcs member in master_config structure. This value wrongly overrides the default value read from NXP's DSPI HAL (kDSPI_Pcs0 = 1U << 0). Such situation occurs on ip_k66f board, where the DSA device - controlled via SPI has the node ID equal to 0 (i.e. reg = <0>). Signed-off-by: Lukasz Majewski <[email protected]>
1 parent 81b1e7f commit aa464a9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/spi/spi_mcux_dspi.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -582,7 +582,7 @@ static int spi_mcux_configure(const struct device *dev,
582582

583583
DSPI_MasterGetDefaultConfig(&master_config);
584584

585-
master_config.whichPcs = spi_cfg->slave;
585+
master_config.whichPcs = 1U << spi_cfg->slave;
586586
master_config.whichCtar = config->which_ctar;
587587
master_config.pcsActiveHighOrLow =
588588
(spi_cfg->operation & SPI_CS_ACTIVE_HIGH) ?
@@ -646,7 +646,7 @@ static int spi_mcux_configure(const struct device *dev,
646646
/* record frame_size setting for DMA */
647647
data->frame_size = word_size;
648648
/* keep the pcs settings */
649-
data->which_pcs = spi_cfg->slave;
649+
data->which_pcs = 1U << spi_cfg->slave;
650650
#ifdef CONFIG_MCUX_DSPI_EDMA_SHUFFLE_DATA
651651
mcux_init_inner_buffer_with_cmd(dev, 0);
652652
#endif

0 commit comments

Comments
 (0)