All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v0] spi: spi-rockchip spi slave mode
@ 2020-05-08  8:37 ` Chris Ruehl
  0 siblings, 0 replies; 16+ messages in thread
From: Chris Ruehl @ 2020-05-08  8:37 UTC (permalink / raw)
  To: Chris Ruehl, Jack Lo
  Cc: Mark Brown, Heiko Stuebner, linux-spi, linux-arm-kernel,
	linux-rockchip, linux-kernel

The driver spi-rockchip does not support spi slave mode, but the register map
has an entry indicate that the chip support it. An example implementation found
here: https://dev.t-firefly.com/thread-101485-1-1.html
The patch is my first approach to support slave mode which is needed
in one of our projects, the PCBA is not yet available but we think
to have it for testing very soon. Yes, the code in the patch
isn't tested yet.

I found it odd, that the num_chipselect is set fixed to the amount of 
native chip-select lines rather use the max_native_cs.
Changed it.
-   master->num_chipselect = ROCKCHIP_SPI_MAX_CS_NUM;
+       of_property_read_u32(np, "num-cs", &num_cs);
+       master->num_chipselect = num_cs;
+       master->max_native_cs = ROCKCHIP_SPI_MAX_CS_NUM;

That ask to enable cs_gpiods, and support gpio cs
+       master->use_gpio_descriptors = true;

Patch against next-20200505

Thanks for review!

Happy hacking
Chris

Signed-off-by: Chris Ruehl <chris.ruehl@gtsys.com.hk>
---


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2020-05-10 16:15 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-08  8:37 [PATCH v0] spi: spi-rockchip spi slave mode Chris Ruehl
2020-05-08  8:37 ` Chris Ruehl
2020-05-08  8:37 ` [PATCH v0 1/1] spi: spi-rockchip: add support for spi slave_mode Chris Ruehl
2020-05-08  8:37   ` Chris Ruehl
2020-05-08 13:13   ` Emil Renner Berthing
2020-05-08 13:13     ` Emil Renner Berthing
2020-05-08 13:13     ` Emil Renner Berthing
2020-05-08 13:42     ` Emil Renner Berthing
2020-05-08 13:42       ` Emil Renner Berthing
2020-05-08 13:42       ` Emil Renner Berthing
2020-05-09  0:10     ` Chris Ruehl
2020-05-09  0:10       ` Chris Ruehl
2020-05-10 16:15       ` Emil Renner Berthing
2020-05-10 16:15         ` Emil Renner Berthing
2020-05-09  9:11     ` Chris Ruehl
2020-05-09  9:11       ` Chris Ruehl

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.