aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorPaul Barker <paul.barker@sancloud.com>2022-10-05 13:18:34 +0100
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>2022-10-16 12:23:22 +0200
commitc98f6fed93ca49a956d628200b2dfa1454ce6fbb (patch)
treeda69733fed050f319e35332aa052cfee314b1efc /include
parent0e49f5c26caf9972137a474065afd4bdfe5ec062 (diff)
downloadu-boot-c98f6fed93ca49a956d628200b2dfa1454ce6fbb.zip
u-boot-c98f6fed93ca49a956d628200b2dfa1454ce6fbb.tar.gz
u-boot-c98f6fed93ca49a956d628200b2dfa1454ce6fbb.tar.bz2
spi: Implement spi_set_speed
This function is already defined in spi.h but no implementation of it currently exists in the tree. The implementation is based on the static function spi_set_speed_mode(). The function prototype is modified so that an success or error condition can be returned to the caller. Signed-off-by: Paul Barker <paul.barker@sancloud.com> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Diffstat (limited to 'include')
-rw-r--r--include/spi.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/include/spi.h b/include/spi.h
index 9a8c1fb..1bc18e6 100644
--- a/include/spi.h
+++ b/include/spi.h
@@ -352,8 +352,10 @@ void spi_cs_deactivate(struct spi_slave *slave);
* This sets a new speed to be applied for next spi_xfer().
* @slave: The SPI slave
* @hz: The transfer speed
+ *
+ * Returns: 0 on success, or a negative value on error.
*/
-void spi_set_speed(struct spi_slave *slave, uint hz);
+int spi_set_speed(struct spi_slave *slave, uint hz);
/**
* Write 8 bits, then read 8 bits.