xtensa/esp32: Fix esp32_spi_setbits for Polling when DMA is also enabled

Commit 6382b2ba introduced the possibility of using SPI in Mixed mode,
i.e. performing SPI transfers via both polling and interrupts. However,
setbits was only applying the configuration if DMA was not enabled.
This commit is contained in:
Gustavo Henrique Nihei 2021-03-20 22:31:09 -03:00 committed by Xiang Xiao
parent 27e2da33b4
commit 20d24fe148
1 changed files with 5 additions and 21 deletions

View File

@ -784,28 +784,12 @@ static void esp32_spi_setbits(FAR struct spi_dev_s *dev, int nbits)
spiinfo("nbits=%d\n", nbits);
/* Has the number of bits changed? */
if (nbits != priv->nbits)
{
/* Save the selection so that subsequent re-configurations
* will be faster.
*/
priv->nbits = nbits;
/* Each DMA transmission will set these value according to
* calculated buffer length.
*/
if (!priv->config->use_dma)
{
esp32_spi_set_reg(priv, SPI_MISO_DLEN_OFFSET,
(priv->nbits - 1) << SPI_USR_MISO_DBITLEN_S);
esp32_spi_set_reg(priv, SPI_MOSI_DLEN_OFFSET,
(priv->nbits - 1) << SPI_USR_MOSI_DBITLEN_S);
}
}
}
/****************************************************************************