STM32/EFM32: If any hardware feature other and LSBFIRST is selected, return -ENOSYS.

This commit is contained in:
Gregory Nutt 2016-08-08 10:37:28 -06:00
parent 21859af6d9
commit 2ae3953f9e
4 changed files with 4 additions and 4 deletions

View File

@ -1121,7 +1121,7 @@ static int spi_hwfeatures(FAR struct spi_dev_s *dev, spi_hwfeatures_t features)
priv->lsbfirst = lsbfirst;
}
return OK;
return ((hwfeatures & ~HWFEAT_LSBFIRST) == 0) ? OK : -ENOSYS;
}
#endif

View File

@ -1221,7 +1221,7 @@ static int spi_hwfeatures(FAR struct spi_dev_s *dev, spi_hwfeatures_t features)
spi_modifycr1(priv, setbits, clrbits);
spi_modifycr1(priv, SPI_CR1_SPE, 0);
return OK;
return ((hwfeatures & ~HWFEAT_LSBFIRST) == 0) ? OK : -ENOSYS;
}
#endif

View File

@ -1327,7 +1327,7 @@ static int spi_hwfeatures(FAR struct spi_dev_s *dev, spi_hwfeatures_t features)
spi_modifycr1(priv, setbits, clrbits);
spi_modifycr1(priv, SPI_CR1_SPE, 0);
return OK;
return ((hwfeatures & ~HWFEAT_LSBFIRST) == 0) ? OK : -ENOSYS;
}
#endif

View File

@ -1188,7 +1188,7 @@ static int spi_hwfeatures(FAR struct spi_dev_s *dev, spi_hwfeatures_t features)
spi_modifycr(STM32L4_SPI_CR1_OFFSET, priv, setbits, clrbits);
spi_modifycr(STM32L4_SPI_CR1_OFFSET, priv, SPI_CR1_SPE, 0);
return OK;
return ((hwfeatures & ~HWFEAT_LSBFIRST) == 0) ? OK : -ENOSYS;
}
#endif