| Message ID | 20260221094252.3103034-5-dario.binacchi@amarulasolutions.com |
|---|---|
| State | New |
| Headers | show |
| Series |
|
| Related | show |
On Sat, 21 Feb 2026 at 02:43, Dario Binacchi <dario.binacchi@amarulasolutions.com> wrote: > > Add a unit test to verify that the SPI word length configuration is > correctly handled by the SPI uclass and successfully passed down to > the sandbox driver. > > Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com> > --- > > (no changes since v1) > > test/dm/spi.c | 16 ++++++++++++++++ > 1 file changed, 16 insertions(+) > Reviewed-by: Simon Glass <simon.glass@canonical.com> To unsubscribe from this group and stop receiving emails from it, send an email to linux-amarula+unsubscribe@amarulasolutions.com.
diff --git a/test/dm/spi.c b/test/dm/spi.c index 249a9238fedc..a89ba06274fc 100644 --- a/test/dm/spi.c +++ b/test/dm/spi.c @@ -170,6 +170,22 @@ static int dm_test_spi_claim_bus(struct unit_test_state *uts) } DM_TEST(dm_test_spi_claim_bus, UTF_SCAN_PDATA | UTF_SCAN_FDT); +static int dm_test_spi_set_wordlen(struct unit_test_state *uts) +{ + struct spi_slave *slave; + struct udevice *bus; + const int busnum = 0, cs = 0; + + ut_assertok(spi_get_bus_and_cs(busnum, cs, &bus, &slave)); + ut_assertok(spi_set_wordlen(slave, 8)); + ut_asserteq(8, sandbox_spi_get_wordlen(slave->dev)); + ut_assertok(spi_set_wordlen(slave, 9)); + ut_asserteq(9, sandbox_spi_get_wordlen(slave->dev)); + + return 0; +} +DM_TEST(dm_test_spi_set_wordlen, UTF_SCAN_PDATA | UTF_SCAN_FDT); + /* Test that sandbox SPI works correctly */ static int dm_test_spi_xfer(struct unit_test_state *uts) {
Add a unit test to verify that the SPI word length configuration is correctly handled by the SPI uclass and successfully passed down to the sandbox driver. Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com> --- (no changes since v1) test/dm/spi.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)