diff options
author | Ovidiu Panait <ovidiu.panait@windriver.com> | 2020-12-14 19:06:47 +0200 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2020-12-22 20:39:25 -0700 |
commit | 1dc53ce71d961a0404c0d785fb0b66f351a7b730 (patch) | |
tree | a7710af87cc6f698b8d8ea33391ef370d38f4ef7 /drivers | |
parent | 1f6d618bb16e10bdba5cb08733e228367662b12c (diff) | |
download | u-boot-1dc53ce71d961a0404c0d785fb0b66f351a7b730.zip u-boot-1dc53ce71d961a0404c0d785fb0b66f351a7b730.tar.gz u-boot-1dc53ce71d961a0404c0d785fb0b66f351a7b730.tar.bz2 |
sandbox: test: Add a second SPI slave on sandbox_spi bus
Place a second spi slave on the sandbox_spi bus, to be used by the
spi_claim_bus() testcase we are about to introduce. We need to make sure
that jumping between slaves calling spi_claim_bus() sets the bus speed and
mode appropriately. Use different max-hz and mode properties for this new
slave.
Also, update sandbox_spi cs_info call to allow activity on CS0/CS1 and
adapt dm_test_spi_find() testcase for this new setup.
Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/spi/sandbox_spi.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/spi/sandbox_spi.c b/drivers/spi/sandbox_spi.c index 6adddd7..58f80c6 100644 --- a/drivers/spi/sandbox_spi.c +++ b/drivers/spi/sandbox_spi.c @@ -101,8 +101,8 @@ static int sandbox_spi_set_mode(struct udevice *bus, uint mode) static int sandbox_cs_info(struct udevice *bus, uint cs, struct spi_cs_info *info) { - /* Always allow activity on CS 0 */ - if (cs >= 1) + /* Always allow activity on CS 0, CS 1 */ + if (cs >= 2) return -EINVAL; return 0; |