summaryrefslogtreecommitdiff
path: root/include/spi.h
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2015-02-17 15:29:35 -0700
committerSimon Glass <sjg@chromium.org>2015-05-05 20:58:18 -0600
commit60e2809a848bccd3a8090d3f2237964670f2780c (patch)
tree0e48144601cecacb6f58b2e32cf516c7281204f5 /include/spi.h
parent172a31bf87bf299130a68320f08aa492c34ea3e0 (diff)
dm: spi: Avoid setting the speed with every transfer
Only set the speed if it has changed from last time. Since the speed will be 0 when the device is probed it will always be changed on the first transfer after the device is probed. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/spi.h')
-rw-r--r--include/spi.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/spi.h b/include/spi.h
index 9495ca53c9b..3f198f87497 100644
--- a/include/spi.h
+++ b/include/spi.h
@@ -100,6 +100,8 @@ struct dm_spi_slave_platdata {
* @dev: SPI slave device
* @max_hz: Maximum speed for this slave
* @mode: SPI mode to use for this slave (see SPI mode flags)
+ * @speed: Current bus speed. This is 0 until the bus is first
+ * claimed.
* @bus: ID of the bus that the slave is attached to. For
* driver model this is the sequence number of the SPI
* bus (bus->seq) so does not need to be stored
@@ -117,6 +119,7 @@ struct spi_slave {
#ifdef CONFIG_DM_SPI
struct udevice *dev; /* struct spi_slave is dev->parentdata */
uint max_hz;
+ uint speed;
uint mode;
#else
unsigned int bus;