Skip to contentSkip to conversation

spi: davinci: add support for adding delay between word's transmissions

PATCH RESEND New Grygorii Strashko 2 participants 2 messages Sep 16, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH RESEND v3 1/1 spi: davinci: add support for adding delay between word's transmissions

From: Murali Karicheri <[email protected]>

This patch adds ability to configure delay between transmission of words over SPI bus if it's required by SPI slave devices.

New optional SPI slave property:
- ti,spi-word-delay : delay between transmission of words (SPIFMTn.WDELAY, SPIDAT1.WDEL)

---
Rebased on top of:
spi.git/for-next +
"[PATCH] spi: davinci: remove empty function davinci_spi_cleanup"
http://www.spinics.net/lists/arm-kernel/msg362811.html

v3:
http://www.spinics.net/lists/devicetree/msg49141.html
v2:
http://www.spinics.net/lists/devicetree/msg48514.html
v1:
http://www.spinics.net/lists/linux-spi/msg01609.html

 .../devicetree/bindings/spi/spi-davinci.txt        | 30 ++++++++++++
 drivers/spi/spi-davinci.c                          | 55 +++++++++++++++++++---
 2 files changed, 78 insertions(+), 7 deletions(-)
Documentation/devicetree/bindings/spi/spi-davinci.txt +30 -0
index f80887b..12ecfe9 100644
@@ -1,5 +1,10 @@
 Davinci SPI controller device bindings
 
+Links on DM:
+Keystone 2 - http://www.ti.com/lit/ug/sprugp2a/sprugp2a.pdf
+dm644x - http://www.ti.com/lit/ug/sprue32a/sprue32a.pdf
+OMAP-L138/da830 - http://www.ti.com/lit/ug/spruh77a/spruh77a.pdf
+
 Required properties:
 - #address-cells: number of cells required to define a chip select
 	address on the SPI bus. Should be set to 1.
@@ -24,6 +29,30 @@ Optional:
 	cs-gpios = <0>, <0>, <0>, <&gpio1 30 0>, <&gpio1 31 0>;
 	where first three are internal CS and last two are GPIO CS.
 
+Optional properties for slave devices:
+SPI slave nodes can contain the following properties.
+Not all SPI Peripherals from Texas Instruments support this.
+Please check SPI peripheral documentation for a device before using these.
+
+- ti,spi-wdelay : delay between transmission of words
+	(SPIFMTn.WDELAY, SPIDAT1.WDEL) must be specified in number of SPI module
+	clock periods.
+
+	delay = WDELAY * SPI_module_clock_period + 2 * SPI_module_clock_period
+
+Below is timing diagram which shows functional meaning of
+"ti,spi-wdelay" parameter.
+
+             +-+ +-+ +-+ +-+ +-+                           +-+ +-+ +-+
+SPI_CLK      | | | | | | | | | |                           | | | | | |
+  +----------+ +-+ +-+ +-+ +-+ +---------------------------+ +-+ +-+ +-
+
+SPI_SOMI/SIMO+-----------------+                           +-----------
+  +----------+ word1           +---------------------------+word2
+             +-----------------+                           +-----------
+                                          WDELAY
+                                <-------------------------->
+
 Example of a NOR flash slave device (n25q032) connected to DaVinci
 SPI controller device over the SPI bus.
 
@@ -43,6 +72,7 @@ spi0:spi at 20BF0000 {
 		compatible = "st,m25p32";
 		spi-max-frequency = <25000000>;
 		reg = <0>;
+		ti,spi-wdelay = <8>;
 
 		partition at 0 {
 			label = "u-boot-spl";
drivers/spi/spi-davinci.c +48 -7

116 lines not on this page · raw message

Signature · 1 line
1.9.1
maintainer
#1 lore raw

PATCH RESEND v3 1/1 spi: davinci: add support for adding delay between word's transmissions

Quoted 4 lines · Grygorii Strashko

From: Murali Karicheri <[email protected]>

This patch adds ability to configure delay between transmission of words over SPI bus if it's required by SPI slave devices.

Applied, thanks.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20140916/7bca97c8/attachment.sig>