Skip to content

Commit

Permalink
arch/arm64/src/imx9/imx9_lpspi.c: Fix 9-16 bit transfers
Browse files Browse the repository at this point in the history
Signed-off-by: Jukka Laitinen <[email protected]>
  • Loading branch information
jlaitine authored and xiaoxiang781216 committed Oct 23, 2024
1 parent 5299545 commit 6cadfc1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions arch/arm64/src/imx9/imx9_lpspi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1323,7 +1323,7 @@ static void imx9_lpspi_exchange(struct spi_dev_s *dev,

/* Convert the number of word to a number of bytes */

nbytes = (priv->nbits > 8) ? nwords << 2 : nwords;
nbytes = (priv->nbits > 8) ? nwords << 1 : nwords;

/* Invalid DMA channels fall back to non-DMA method. */

Expand Down Expand Up @@ -1404,7 +1404,7 @@ static void imx9_lpspi_exchange(struct spi_dev_s *dev,
config.daddr = (uintptr_t) (rxbuffer ? priv->rxbuf : rxdummy);
config.soff = 0;
config.doff = rxbuffer ? adjust : 0;
config.iter = nbytes;
config.iter = nwords;
config.flags = EDMA_CONFIG_LINKTYPE_LINKNONE;
config.ssize = adjust == 1 ? EDMA_8BIT : EDMA_16BIT;
config.dsize = adjust == 1 ? EDMA_8BIT : EDMA_16BIT;
Expand All @@ -1418,7 +1418,7 @@ static void imx9_lpspi_exchange(struct spi_dev_s *dev,
config.daddr = priv->spibase + IMX9_LPSPI_TDR_OFFSET;
config.soff = txbuffer ? adjust : 0;
config.doff = 0;
config.iter = nbytes;
config.iter = nwords;
config.flags = EDMA_CONFIG_LINKTYPE_LINKNONE;
config.ssize = adjust == 1 ? EDMA_8BIT : EDMA_16BIT;
config.dsize = adjust == 1 ? EDMA_8BIT : EDMA_16BIT;
Expand Down

0 comments on commit 6cadfc1

Please sign in to comment.