summaryrefslogtreecommitdiffstats
path: root/sys/arm/lpc/lpc_spi.c
diff options
context:
space:
mode:
authormanu <manu@FreeBSD.org>2016-12-18 14:54:20 +0000
committerLuiz Souza <luiz@netgate.com>2017-10-17 20:17:35 -0500
commitf5562aa9f85e400ab2f90aa64d735ad01d7bc9ae (patch)
tree4bb3e73d23968dfed5b17187f41e9923c620a238 /sys/arm/lpc/lpc_spi.c
parent1d1327eef601aba35e784b04d6e1fc93c0b507ac (diff)
downloadFreeBSD-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/lpc/lpc_spi.c')
-rw-r--r--sys/arm/lpc/lpc_spi.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/arm/lpc/lpc_spi.c b/sys/arm/lpc/lpc_spi.c
index c9accc8..87d3dcf 100644
--- a/sys/arm/lpc/lpc_spi.c
+++ b/sys/arm/lpc/lpc_spi.c
@@ -147,6 +147,8 @@ lpc_spi_transfer(device_t dev, device_t child, struct spi_command *cmd)
spibus_get_cs(child, &cs);
+ cs &= ~SPIBUS_CS_HIGH;
+
/* Set CS active */
lpc_gpio_set_state(child, cs, 0);
OpenPOWER on IntegriCloud