diff options
author | manu <manu@FreeBSD.org> | 2016-12-18 14:54:20 +0000 |
---|---|---|
committer | Luiz Souza <luiz@netgate.com> | 2017-10-17 20:17:35 -0500 |
commit | f5562aa9f85e400ab2f90aa64d735ad01d7bc9ae (patch) | |
tree | 4bb3e73d23968dfed5b17187f41e9923c620a238 /sys/arm/ti | |
parent | 1d1327eef601aba35e784b04d6e1fc93c0b507ac (diff) | |
download | FreeBSD-src-f5562aa9f85e400ab2f90aa64d735ad01d7bc9ae.zip FreeBSD-src-f5562aa9f85e400ab2f90aa64d735ad01d7bc9ae.tar.gz |
ofw_spi: Parse property for the SPI mode and CS polarity.
As cs is stored in a uint32_t, use the last bit to store the
active high flag as it's unlikely that we will have that much CS.
Reviewed by: loos
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D8614
(cherry picked from commit f5f9058ccaec11fccc18817f45fff8859798a317)
Diffstat (limited to 'sys/arm/ti')
-rw-r--r-- | sys/arm/ti/ti_spi.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/arm/ti/ti_spi.c b/sys/arm/ti/ti_spi.c index 68805a8..199bc06 100644 --- a/sys/arm/ti/ti_spi.c +++ b/sys/arm/ti/ti_spi.c @@ -458,6 +458,9 @@ ti_spi_transfer(device_t dev, device_t child, struct spi_command *cmd) /* Get the proper chip select for this child. */ spibus_get_cs(child, &cs); + + cs &= ~SPIBUS_CS_HIGH; + if (cs > sc->sc_numcs) { device_printf(dev, "Invalid chip select %d requested by %s\n", cs, device_get_nameunit(child)); |