Skip to contentSkip to conversation

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

PATCH Superseded Grygorii Strashko 2 participants 4 messages Sep 12, 2014 – Sep 15, 2014

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

PATCH 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's property:
- ti,spi-word-delay : delay between transmission of words (SPIFMTn.WDELAY, SPIDAT1.WDEL)

---
Changes in v3:
- removed C2TDELAY, T2CDELAY parameters

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                          | 50 +++++++++++++++++++---
 2 files changed, 73 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 +43 -7

109 lines not on this page · raw message

Signature · 1 line
1.9.1
maintainer
#1 lore raw

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

This is fine but it doesn't appear to apply against current code. Can
you please check and resend?
-------------- 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/20140913/6cbdbbdd/attachment.sig>

#2 lore raw

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

Quoted 9 lines · Mark Brown
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.

This is fine but it doesn't appear to apply against current code. Can you please check and resend?

This one should be applied without conflicts on top of
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git
branch: for-next

since you've applied the patch:
"[PATCH] spi: davinci: request cs_gpio's from probe"
http://www.spinics.net/lists/linux-spi/msg01811.html

I have to mention about this dependency, sorry for that.

Regards,
-grygorii

maintainer
#3 lore raw

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

Quoted 9 lines · Grygorii Strashko
Quoted 2 lines · Mark Brown

This is fine but it doesn't appear to apply against current code. Can you please check and resend?

This one should be applied without conflicts on top of
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git
branch: for-next

Quoted 5 lines

since you've applied the patch:
"[PATCH] spi: davinci: request cs_gpio's from probe"
http://www.spinics.net/lists/linux-spi/msg01811.html

I have to mention about this dependency, sorry for that.

Please resend then as I asked.
-------------- 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/20140915/8560607a/attachment.sig>