summaryrefslogtreecommitdiffstats
path: root/include/spi
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2020-03-24 13:34:57 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2020-04-14 09:13:19 +0200
commit1813487725e85b6ca0b64e03965e6ac4f56e556e (patch)
tree2191ccff47cc1a1c27d11de918b08a2969411dc5 /include/spi
parentef46f2db0001d4d5b66ddd34346aa36625dbf452 (diff)
downloadbarebox-1813487725e85b6ca0b64e03965e6ac4f56e556e.tar.gz
barebox-1813487725e85b6ca0b64e03965e6ac4f56e556e.tar.xz
spi: validate spi messages
This adds __spi_validate() to validate spi messages. This function is a stripped down version from the Kernel. The motivation for adding this was to fill in xfer->bits_per_word from spi->bits_per_word so that a spi bus driver can use the former. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include/spi')
-rw-r--r--include/spi/spi.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/spi/spi.h b/include/spi/spi.h
index 48a90bcca7..66e0500d04 100644
--- a/include/spi/spi.h
+++ b/include/spi/spi.h
@@ -126,6 +126,7 @@ struct spi_message;
* SPI slaves, and are numbered from zero to num_chipselects.
* each slave has a chipselect signal, but it's common that not
* every chipselect is connected to a slave.
+ * @max_speed_hz: Highest supported transfer speed
* @setup: updates the device mode and clocking records used by a
* device's SPI controller; protocol code may call this. This
* must fail if an unrecognized or unsupported mode is requested.
@@ -171,6 +172,9 @@ struct spi_controller {
*/
u16 num_chipselect;
+ /* limits on transfer speed */
+ u32 max_speed_hz;
+
/* setup mode and clock, etc (spi driver may call many times) */
int (*setup)(struct spi_device *spi);