Skip to content

allow to define cs deassert times in us, ns and SCK-len

[email protected] linux-arm-kernel linux-spi 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 of 5 patches 6 repliesIn review

4 of 5 patches are in this archive. The cover letter announces 5.

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5spi: core: allow defining time that cs is deasserteddrivers/spi/spi.c include/linux/spi/spi.h+56 -101 reply
2/5spi: core: allow reporting the effectivly used speed_hz for a transferdrivers/spi/spi.c include/linux/spi/spi.h+6 -00 replies
3/5spi: core: allow defining time that cs is deasserted as a multiple of SCKdrivers/spi/spi.c include/linux/spi/spi.h+9 -04 replies
4/5spi: bcm2835: support effective_speed_hzdrivers/spi/spi-bcm2835.c+2 -31 reply

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/5] allow to define cs deassert times in us, ns and SCK-len

From: Martin Sperl <[email protected]>

Using spi_transfer.cs_change right now means that there is a hard-coded 10 us delay between deassert and re-assert of cs.

For some devices this is way too long and either wastes resources unecessarily or the driver works arround this currently with multiple spi messages.

So this patch set modifies the spie core and some drivers so that in spi_transfer we now can now define the minimum delay in units of:
microseconds, nanoseconds or spi clock length.

But note that on lower specs machines those ns delays are not realistic. Lower limits on the actual delay are put by the gpio framework latency for setting gpio level.
On a Raspberry Pi 3 this overhead has been observed to be in the order 1.2us.

As an idea: the xfer->cs_change_delay_unit could become more generic by renaming it to delay_unit and then also us it as a modifier when using xfer->delay_usecs.

Martin Sperl (5):
spi: core: allow defining time that cs is deasserted
spi: core: allow reporting the effectivly used speed_hz for a transfer
spi: core: allow defining time that cs is deasserted as a multiple of
SCK
spi: bcm2835: support effective_speed_hz
spi: bcm2835aux: support effective_speed_hz

 drivers/spi/spi-bcm2835.c    |  5 ++--
 drivers/spi/spi-bcm2835aux.c |  5 ++--
 drivers/spi/spi.c            | 68 +++++++++++++++++++++++++++++++++++++-------
 include/linux/spi/spi.h      | 13 +++++++++
 4 files changed, 75 insertions(+), 16 deletions(-)

--
2.11.0