test: dm: spi: Add testcase for spi_claim_bus()
authorOvidiu Panait <ovidiu.panait@windriver.com>
Mon, 14 Dec 2020 17:06:51 +0000 (19:06 +0200)
committerSimon Glass <sjg@chromium.org>
Wed, 23 Dec 2020 03:39:26 +0000 (20:39 -0700)
commita5624c6b4c42560e6072c114ce185c9a4bb3fde4
treeba92b529da2a8e4a9689e9290245969e0e4a5aa7
parent741280e9accd3da20650a04f716538944d878482
test: dm: spi: Add testcase for spi_claim_bus()

Add testcase for spi_claim_bus(), which checks that sandbox spi bus
speed/mode settings are updated correctly when multiple slaves use
the bus consecutively. The following configurations are used for the
two spi slaves involved:
  * different max_hz / different modes
  * different max_hz / same modes
  * different modes / same max_hz

asm/test.h header is added in order to be able to retrieve the current
speed/mode of the sandbox spi bus, via sandbox_spi_get_{speed, mode}.

Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
test/dm/spi.c