arch: imxrt, s32k1xx, stm32f7 spi: fix CONFIG_SPI_BITORDER build errors
Signed-off-by: Juha Niskanen <juha.niskanen@haltian.com>
This commit is contained in:
parent
e437bbd47e
commit
77bbb07749
@ -1187,7 +1187,6 @@ static int imxrt_lpspi_hwfeatures(FAR struct spi_dev_s *dev,
|
||||
FAR struct imxrt_lpspidev_s *priv = (FAR struct imxrt_lpspidev_s *)dev;
|
||||
uint32_t setbits;
|
||||
uint32_t clrbits;
|
||||
int savbits = nbits;
|
||||
|
||||
spiinfo("features=%08x\n", features);
|
||||
|
||||
@ -1204,7 +1203,7 @@ static int imxrt_lpspi_hwfeatures(FAR struct spi_dev_s *dev,
|
||||
clrbits = LPSPI_TCR_LSBF;
|
||||
}
|
||||
|
||||
imxrt_lpspi_modigyreg32(priv, IMXRT_LPSPI_TCR_OFFSET, clrbits, setbits);
|
||||
imxrt_lpspi_modifyreg32(priv, IMXRT_LPSPI_TCR_OFFSET, clrbits, setbits);
|
||||
|
||||
/* Other H/W features are not supported */
|
||||
|
||||
|
@ -1147,7 +1147,6 @@ static int s32k1xx_lpspi_hwfeatures(FAR struct spi_dev_s *dev,
|
||||
FAR struct s32k1xx_lpspidev_s *priv = (FAR struct s32k1xx_lpspidev_s *)dev;
|
||||
uint32_t setbits;
|
||||
uint32_t clrbits;
|
||||
int savbits = nbits;
|
||||
|
||||
spiinfo("features=%08x\n", features);
|
||||
|
||||
@ -1164,7 +1163,7 @@ static int s32k1xx_lpspi_hwfeatures(FAR struct spi_dev_s *dev,
|
||||
clrbits = LPSPI_TCR_LSBF;
|
||||
}
|
||||
|
||||
s32k1xx_lpspi_modigyreg32(priv, S32K1XX_LPSPI_TCR_OFFSET, clrbits, setbits);
|
||||
s32k1xx_lpspi_modifyreg32(priv, S32K1XX_LPSPI_TCR_OFFSET, clrbits, setbits);
|
||||
|
||||
/* Other H/W features are not supported */
|
||||
|
||||
|
@ -1545,11 +1545,8 @@ static int spi_hwfeatures(FAR struct spi_dev_s *dev,
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_SPI_BITORDER
|
||||
uint16_t setbitscr1;
|
||||
uint16_t clrbitscr1;
|
||||
uint16_t setbitscr2;
|
||||
uint16_t clrbitscr2;
|
||||
int savbits = nbits;
|
||||
uint16_t setbits;
|
||||
uint16_t clrbits;
|
||||
|
||||
spiinfo("features=%08x\n", features);
|
||||
|
||||
@ -1791,13 +1788,15 @@ static void spi_exchange(FAR struct spi_dev_s *dev, FAR const void *txbuffer,
|
||||
|
||||
DEBUGASSERT(priv != NULL);
|
||||
|
||||
/* Convert the number of word to a number of bytes */
|
||||
/* Convert the number of word to a number of bytes. */
|
||||
|
||||
size_t nbytes = (priv->nbits > 8) ? nwords << 1 : nwords;
|
||||
|
||||
#ifdef CONFIG_STM32F7_SPI_DMATHRESHOLD
|
||||
|
||||
/* If this is a small SPI transfer, then let spi_exchange_nodma() do the work. */
|
||||
/* If this is a small SPI transfer, then let spi_exchange_nodma()
|
||||
* do the work.
|
||||
*/
|
||||
|
||||
if (nbytes <= CONFIG_STM32F7_SPI_DMATHRESHOLD)
|
||||
{
|
||||
@ -1847,10 +1846,10 @@ static void spi_exchange(FAR struct spi_dev_s *dev, FAR const void *txbuffer,
|
||||
|
||||
/* If this bus uses a in driver buffers we will incur 2 copies,
|
||||
* The copy cost is << less the non DMA transfer time and having
|
||||
* the buffer in the driver ensures DMA can be used. This is bacause
|
||||
* the buffer in the driver ensures DMA can be used. This is because
|
||||
* the API does not support passing the buffer extent so the only
|
||||
* extent is buffer + the transfer size. These can sizes be less than
|
||||
* the cache line size, and not aligned and tyicaly greater then 4
|
||||
* the cache line size, and not aligned and typically greater then 4
|
||||
* bytes, which is about the break even point for the DMA IO overhead.
|
||||
*/
|
||||
|
||||
@ -2081,7 +2080,9 @@ static int spi_pm_prepare(FAR struct pm_callback_s *cb, int domain,
|
||||
|
||||
if (sval <= 0)
|
||||
{
|
||||
/* Exclusive lock is held, do not allow entry to deeper PM states. */
|
||||
/* Exclusive lock is held, do not allow entry to deeper
|
||||
* PM states.
|
||||
*/
|
||||
|
||||
return -EBUSY;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user