linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/2] Add support for components requiring trailing clock after transfer
@ 2022-02-28 15:15 Christophe Leroy
  2022-02-28 15:15 ` [PATCH v2 1/2] spi: Add optional number of additional clock cycles to be generated Christophe Leroy
  2022-02-28 15:15 ` [PATCH v2 2/2] spi: fsl-spi: Implement trailing bits Christophe Leroy
  0 siblings, 2 replies; 16+ messages in thread
From: Christophe Leroy @ 2022-02-28 15:15 UTC (permalink / raw)
  To: Mark Brown, Rob Herring, Pratyush Yadav
  Cc: Christophe Leroy, linux-kernel, linux-spi, devicetree

Some components require a few clock cycles with chipselect off before
or/and after the data transfer done with CS on.

Typically IDT 801034 QUAD PCM CODEC datasheet states "Note *: CCLK
should have one cycle before CS goes low, and two cycles after
CS goes high".

The cycles "before" are implicitely provided by all previous activity
on the SPI bus. But the cycles "after" must be provided in order to
achieve the SPI transfer.

In order to use that kind of component, implement a new option for
SPI slaves in order to implement trailing clock of a given number of
bits with ChipSelect off at the end of the transfer.

This is based on a discussion we had a few years ago, see
https://lore.kernel.org/linux-spi/20160824112701.GE22076@sirena.org.uk/

IDT 801034 QUAD PCM CODEC datasheet can be found at
https://www.renesas.com/eu/en/document/dst/821034-data-sheet?language=en&r=24763

Changes in v2:
- Provide the number of wanted clock cycles instead of just a bool. 

Christophe Leroy (2):
  spi: Add optional number of additional clock cycles to be generated
  spi: fsl-spi: Implement trailing bits

 .../bindings/spi/spi-peripheral-props.yaml    |  5 +++++
 drivers/spi/spi-fsl-spi.c                     | 21 +++++++++++++++++--
 drivers/spi/spi.c                             |  7 +++++--
 include/linux/spi/spi.h                       |  1 +
 4 files changed, 30 insertions(+), 4 deletions(-)

-- 
2.34.1


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

end of thread, other threads:[~2022-08-22 19:33 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-28 15:15 [PATCH v2 0/2] Add support for components requiring trailing clock after transfer Christophe Leroy
2022-02-28 15:15 ` [PATCH v2 1/2] spi: Add optional number of additional clock cycles to be generated Christophe Leroy
2022-03-08  0:52   ` Rob Herring
2022-02-28 15:15 ` [PATCH v2 2/2] spi: fsl-spi: Implement trailing bits Christophe Leroy
2022-02-28 15:29   ` Mark Brown
2022-02-28 16:02     ` Christophe Leroy
2022-02-28 16:14       ` Mark Brown
2022-03-01 12:53         ` Christophe Leroy
2022-03-01 13:25           ` Mark Brown
2022-08-18 18:35         ` Christophe Leroy
2022-08-22 17:15           ` Mark Brown
2022-08-22 18:38             ` Christophe Leroy
2022-08-22 19:29               ` Mark Brown
2022-02-28 18:28   ` kernel test robot
2022-02-28 18:38   ` kernel test robot
2022-02-28 18:48   ` kernel test robot

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).