arch/arm: spi: fix incorrect comment about nbits being clobbered
Signed-off-by: Juha Niskanen <juha.niskanen@haltian.com>
This commit is contained in:
parent
de53ea3871
commit
e437bbd47e
@ -1122,7 +1122,6 @@ static void imxrt_lpspi_setbits(FAR struct spi_dev_s *dev, int nbits)
|
||||
{
|
||||
FAR struct imxrt_lpspidev_s *priv = (FAR struct imxrt_lpspidev_s *)dev;
|
||||
uint32_t men;
|
||||
int savbits = nbits;
|
||||
|
||||
spiinfo("nbits=%d\n", nbits);
|
||||
|
||||
@ -1148,12 +1147,11 @@ static void imxrt_lpspi_setbits(FAR struct spi_dev_s *dev, int nbits)
|
||||
LPSPI_TCR_FRAMESZ_MASK,
|
||||
LPSPI_TCR_FRAMESZ(nbits - 1));
|
||||
|
||||
/* Save the selection so the subsequence re-configurations
|
||||
* will be faster
|
||||
/* Save the selection so the subsequent re-configurations
|
||||
* will be faster.
|
||||
*/
|
||||
|
||||
priv->nbits = savbits; /* nbits has been clobbered... save the signed
|
||||
* value. */
|
||||
priv->nbits = nbits;
|
||||
|
||||
/* Re-enable LPSPI if it was enabled previously */
|
||||
|
||||
|
@ -1084,7 +1084,6 @@ static void s32k1xx_lpspi_setbits(FAR struct spi_dev_s *dev, int nbits)
|
||||
FAR struct s32k1xx_lpspidev_s *priv = (FAR struct s32k1xx_lpspidev_s *)dev;
|
||||
uint32_t regval;
|
||||
uint32_t men;
|
||||
int savbits = nbits;
|
||||
|
||||
spiinfo("nbits=%d\n", nbits);
|
||||
|
||||
@ -1111,10 +1110,9 @@ static void s32k1xx_lpspi_setbits(FAR struct spi_dev_s *dev, int nbits)
|
||||
|
||||
s32k1xx_lpspi_putreg32(priv, S32K1XX_LPSPI_TCR_OFFSET, regval);
|
||||
|
||||
/* Save the selection so the subsequence re-configurations will be faster */
|
||||
/* Save the selection so that subsequent re-configurations will be faster. */
|
||||
|
||||
priv->nbits = savbits; /* nbits has been clobbered... save the signed
|
||||
* value. */
|
||||
priv->nbits = nbits;
|
||||
|
||||
/* Re-enable LPSPI if it was enabled previously */
|
||||
|
||||
|
@ -1095,7 +1095,6 @@ static void spi_setbits(FAR struct spi_dev_s *dev, int nbits)
|
||||
FAR struct stm32_spidev_s *priv = (FAR struct stm32_spidev_s *)dev;
|
||||
uint16_t setbits;
|
||||
uint16_t clrbits;
|
||||
int savbits = nbits;
|
||||
|
||||
spiinfo("nbits=%d\n", nbits);
|
||||
|
||||
@ -1157,9 +1156,9 @@ static void spi_setbits(FAR struct spi_dev_s *dev, int nbits)
|
||||
spi_modifycr(STM32_SPI_CR1_OFFSET, priv, SPI_CR1_SPE, 0);
|
||||
#endif
|
||||
|
||||
/* Save the selection so the subsequence re-configurations will be faster */
|
||||
/* Save the selection so that subsequent re-configurations will be faster. */
|
||||
|
||||
priv->nbits = savbits; /* nbits has been clobbered... save the signed value. */
|
||||
priv->nbits = nbits;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1476,7 +1476,6 @@ static void spi_setbits(FAR struct spi_dev_s *dev, int nbits)
|
||||
FAR struct stm32_spidev_s *priv = (FAR struct stm32_spidev_s *)dev;
|
||||
uint16_t setbits;
|
||||
uint16_t clrbits;
|
||||
int savbits = nbits;
|
||||
|
||||
spiinfo("nbits=%d\n", nbits);
|
||||
|
||||
@ -1513,9 +1512,11 @@ static void spi_setbits(FAR struct spi_dev_s *dev, int nbits)
|
||||
spi_modifycr2(priv, setbits, clrbits);
|
||||
spi_modifycr1(priv, SPI_CR1_SPE, 0);
|
||||
|
||||
/* Save the selection so the subsequence re-configurations will be faster */
|
||||
/* Save the selection so that subsequent re-configurations will
|
||||
* be faster.
|
||||
*/
|
||||
|
||||
priv->nbits = savbits; /* nbits has been clobbered... save the signed value. */
|
||||
priv->nbits = nbits;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1594,7 +1594,6 @@ static void spi_setbits(FAR struct spi_dev_s *dev, int nbits)
|
||||
FAR struct stm32_spidev_s *priv = (FAR struct stm32_spidev_s *)dev;
|
||||
uint32_t setbits = 0;
|
||||
uint32_t clrbits = 0;
|
||||
int savbits = nbits;
|
||||
|
||||
spiinfo("nbits=%d\n", nbits);
|
||||
|
||||
@ -1633,11 +1632,11 @@ static void spi_setbits(FAR struct spi_dev_s *dev, int nbits)
|
||||
spi_modifyreg(priv, STM32_SPI_CFG1_OFFSET, clrbits, setbits);
|
||||
spi_enable(priv, true);
|
||||
|
||||
/* Save the selection so the subsequence re-configurations will be
|
||||
* faster
|
||||
/* Save the selection so that subsequent re-configurations will be
|
||||
* faster.
|
||||
*/
|
||||
|
||||
priv->nbits = savbits; /* nbits has been clobbered... save the signed value */
|
||||
priv->nbits = nbits;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1028,7 +1028,6 @@ static void spi_setbits(FAR struct spi_sctrlr_s *sctrlr, int nbits)
|
||||
FAR struct stm32_spidev_s *priv = (FAR struct stm32_spidev_s *)sctrlr;
|
||||
uint32_t setbits = 0;
|
||||
uint32_t clrbits = 0;
|
||||
int savbits = nbits;
|
||||
|
||||
spiinfo("nbits=%d\n", nbits);
|
||||
|
||||
@ -1065,7 +1064,7 @@ static void spi_setbits(FAR struct spi_sctrlr_s *sctrlr, int nbits)
|
||||
|
||||
spi_modifyreg(priv, STM32_SPI_CFG1_OFFSET, clrbits, setbits);
|
||||
|
||||
priv->nbits = savbits;
|
||||
priv->nbits = nbits;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1149,7 +1149,6 @@ static void spi_setbits(FAR struct spi_dev_s *dev, int nbits)
|
||||
FAR struct stm32l4_spidev_s *priv = (FAR struct stm32l4_spidev_s *)dev;
|
||||
uint16_t setbits;
|
||||
uint16_t clrbits;
|
||||
int savbits = nbits;
|
||||
|
||||
spiinfo("nbits=%d\n", nbits);
|
||||
|
||||
@ -1187,11 +1186,11 @@ static void spi_setbits(FAR struct spi_dev_s *dev, int nbits)
|
||||
spi_modifycr(STM32L4_SPI_CR2_OFFSET, priv, setbits, clrbits);
|
||||
spi_modifycr(STM32L4_SPI_CR1_OFFSET, priv, SPI_CR1_SPE, 0);
|
||||
|
||||
/* Save the selection so the subsequence re-configurations will be
|
||||
* faster. nbits has been clobbered... save the signed value.
|
||||
/* Save the selection so that subsequent re-configurations will be
|
||||
* faster.
|
||||
*/
|
||||
|
||||
priv->nbits = savbits;
|
||||
priv->nbits = nbits;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user