linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/5] allow to define cs deassert times in us, ns and SCK-len
@ 2019-02-23  8:49 kernel
  2019-02-23  8:49 ` [PATCH 2/5] spi: core: allow reporting the effectivly used speed_hz for a transfer kernel
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: kernel @ 2019-02-23  8:49 UTC (permalink / raw)
  To: Mark Brown, Eric Anholt, Stefan Wahren, linux-spi,
	linux-rpi-kernel, linux-arm-kernel
  Cc: Martin Sperl

From: Martin Sperl <kernel@martin.sperl.org>

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

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

end of thread, other threads:[~2019-05-13 15:14 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-02-23  8:49 [PATCH 0/5] allow to define cs deassert times in us, ns and SCK-len kernel
2019-02-23  8:49 ` [PATCH 2/5] spi: core: allow reporting the effectivly used speed_hz for a transfer kernel
2019-02-23  8:49 ` [PATCH 3/5] spi: core: allow defining time that cs is deasserted as a multiple of SCK kernel
     [not found]   ` <20190223124010.y7lsncknnxoblvgz@wunner.de>
     [not found]     ` <20190223124010.y7lsncknnxoblvgz-JFq808J9C/izQB+pC5nmwQ@public.gmane.org>
2019-02-23 13:15       ` kernel-TqfNSX0MhmxHKSADF0wUEw
     [not found]         ` <20190224103913.bjw7g6ievr75iawz@wunner.de>
     [not found]           ` <20190224103913.bjw7g6ievr75iawz-JFq808J9C/izQB+pC5nmwQ@public.gmane.org>
2019-02-24 11:03             ` kernel-TqfNSX0MhmxHKSADF0wUEw
2019-02-26 11:37               ` Mark Brown
2019-05-07 10:07                 ` kernel
     [not found] ` <20190223084952.14758-1-kernel-TqfNSX0MhmxHKSADF0wUEw@public.gmane.org>
2019-02-23  8:49   ` [PATCH 1/5] spi: core: allow defining time that cs is deasserted kernel-TqfNSX0MhmxHKSADF0wUEw
     [not found]     ` <20190223084952.14758-2-kernel-TqfNSX0MhmxHKSADF0wUEw@public.gmane.org>
2019-05-08  9:34       ` Applied "spi: core: allow defining time that cs is deasserted" to the spi tree Mark Brown
2019-02-23  8:49   ` [PATCH 4/5] spi: bcm2835: support effective_speed_hz kernel-TqfNSX0MhmxHKSADF0wUEw
2019-05-13 15:14     ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).