All SPI-based device drivers needs to call SPI_HWFEATURES() with zero in order to co-exist with drivers that use H/W features

This commit is contained in:
Gregory Nutt
2016-01-23 16:18:13 -06:00
parent c36c49657b
commit f6e49caba8
35 changed files with 88 additions and 42 deletions
+4 -2
View File
@@ -365,9 +365,10 @@ static void mmcsd_semtake(FAR struct mmcsd_slot_s *slot)
* changed those since the last time that we had the SPI bus.
*/
SPI_SETFREQUENCY(slot->spi, slot->spispeed);
SPI_SETMODE(slot->spi, CONFIG_MMCSD_SPIMODE);
SPI_SETBITS(slot->spi, 8);
(void)SPI_HWFEATURES(slot->spi, 0);
(void)SPI_SETFREQUENCY(slot->spi, slot->spispeed);
#endif
/* Get exclusive access to the MMC/SD device (possibly unnecessary if
@@ -425,6 +426,7 @@ static inline void mmcsd_spiinit(FAR struct mmcsd_slot_s *slot)
{
SPI_SETMODE(slot->spi, CONFIG_MMCSD_SPIMODE);
SPI_SETBITS(slot->spi, 8);
(void)SPI_HWFEATURES(slot->spi, 0);
}
#endif
@@ -1608,7 +1610,7 @@ static int mmcsd_mediainitialize(FAR struct mmcsd_slot_s *slot)
#ifndef CONFIG_SPI_OWNBUS
slot->spispeed = MMCSD_IDMODE_CLOCK;
#endif
SPI_SETFREQUENCY(spi, MMCSD_IDMODE_CLOCK);
(void)SPI_SETFREQUENCY(spi, MMCSD_IDMODE_CLOCK);
/* Set the maximum access time out */