diff options
author | Ovidiu Panait <ovidiu.panait@windriver.com> | 2020-12-14 19:06:49 +0200 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2020-12-22 20:39:26 -0700 |
commit | add685fb6d8de91723d006a0382f76041320b529 (patch) | |
tree | 1d2cbedf8cc08a601cc899e3e54b3aaf1870f1ac /drivers/spi | |
parent | 2da1800456909944b393ad8539edb0bf3e997e2d (diff) | |
download | u-boot-add685fb6d8de91723d006a0382f76041320b529.zip u-boot-add685fb6d8de91723d006a0382f76041320b529.tar.gz u-boot-add685fb6d8de91723d006a0382f76041320b529.tar.bz2 |
test: spi: Add sandbox_spi_get_{speed, mode} interface
Introduce sandbox_spi_get_{speed, mode} public interface to retrieve the
sandbox spi bus internal state. They are meant to be used in sandbox spi
testcases.
Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/spi')
-rw-r--r-- | drivers/spi/sandbox_spi.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/spi/sandbox_spi.c b/drivers/spi/sandbox_spi.c index be516d5..0564d8b 100644 --- a/drivers/spi/sandbox_spi.c +++ b/drivers/spi/sandbox_spi.c @@ -52,6 +52,20 @@ __weak int sandbox_spi_get_emul(struct sandbox_state *state, return -ENOENT; } +uint sandbox_spi_get_speed(struct udevice *dev) +{ + struct sandbox_spi_priv *priv = dev_get_priv(dev); + + return priv->speed; +} + +uint sandbox_spi_get_mode(struct udevice *dev) +{ + struct sandbox_spi_priv *priv = dev_get_priv(dev); + + return priv->mode; +} + static int sandbox_spi_xfer(struct udevice *slave, unsigned int bitlen, const void *dout, void *din, unsigned long flags) { |