[v3,2/9] spi: sandbox_spi: support wordlen setup

Message ID 20260225161851.2475274-3-dario.binacchi@amarulasolutions.com
State New
Headers show
Series
  • video: support Rocktech RK050HR345-CT106A panel
Related show

Commit Message

Dario Binacchi Feb. 25, 2026, 4:16 p.m. UTC
The driver currently ignores the word length configuration. Implement
the set_wordlen operation to store and track the current word length.

Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Reviewed-by: Simon Glass <simon.glass@canonical.com>

---

Changes in v3:
- Add Reviewed-by tag of Simon Glass
- Store wordlen in struct spi_slave data instead of driver private
  data.

 drivers/spi/sandbox_spi.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

Patch

diff --git a/drivers/spi/sandbox_spi.c b/drivers/spi/sandbox_spi.c
index 4cc016138b11..7c237ac8d371 100644
--- a/drivers/spi/sandbox_spi.c
+++ b/drivers/spi/sandbox_spi.c
@@ -61,6 +61,15 @@  uint sandbox_spi_get_mode(struct udevice *dev)
 	return priv->mode;
 }
 
+static int sandbox_spi_set_wordlen(struct udevice *dev, unsigned int wordlen)
+{
+	struct spi_slave *slave = dev_get_parent_priv(dev);
+
+	slave->wordlen = wordlen;
+
+	return 0;
+}
+
 static int sandbox_spi_xfer(struct udevice *slave, unsigned int bitlen,
 			    const void *dout, void *din, unsigned long flags)
 {
@@ -158,6 +167,7 @@  static const struct dm_spi_ops sandbox_spi_ops = {
 	.set_mode	= sandbox_spi_set_mode,
 	.cs_info	= sandbox_cs_info,
 	.get_mmap	= sandbox_spi_get_mmap,
+	.set_wordlen	= sandbox_spi_set_wordlen,
 };
 
 static const struct udevice_id sandbox_spi_ids[] = {