Skip to contentSkip to conversation

of: added documentation for spi chipselects

PATCH Applied Ernst Schwab 3 participants 8 messages Feb 16, 2010 – Feb 17, 2010 4 messages not in the archive

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

PATCH 1/1 of: added documentation for spi chipselects

From: Ernst Schwab <[email protected]>

Added devicetree binding documentation for gpios used as chipselect. The code to evaluate these is already present in spi_mpc8xxx.c.

---

Documentation/powerpc/dts-bindings/fsl/spi.txt +7 -0
diff -upr a/Documentation/powerpc/dts-bindings/fsl/spi.txt b/Documentation/powerpc/dts-bindings/fsl/spi.txt
@@ -13,6 +13,11 @@ Required properties:
 - interrupt-parent : the phandle for the interrupt controller that
   services interrupts for this device.
 
+Optional properties:
+- gpios : specifies the gpio pins to be used for chipselects. 
+  The gpios will be referred to as reg=<index> in the SPI child nodes.
+  If unspecified, a single SPI device without a chip select can be used.
+
 Example:
 	spi@4c0 {
 		cell-index = <0>;
@@ -21,4 +26,6 @@ Example:
 		interrupts = <82 0>;
 		interrupt-parent = <700>;
 		mode = "cpu";
+		gpios = <&gpio 18 1	// device reg=<0>, low-active
+			 &gpio 19 1>;	// device reg=<1>, low-active
 	};

A message that is not in the archive (sent off-list or not yet received): 20100216193957.ccdffee2.eschwab-BGeptl67XyCzQB+pC5nmwQ@public.gmane.org

Applied
#2 lore raw
Quoted 6 lines · Ernst Schwab

From: Ernst Schwab <[email protected]>

Added devicetree binding documentation for gpios used as chipselect. The code to evaluate these is already present in spi_mpc8xxx.c.

Merged, thanks.

Quoted 26 lines

---
diff -upr a/Documentation/powerpc/dts-bindings/fsl/spi.txt b/Documentation/powerpc/dts-bindings/fsl/spi.txt

Documentation/powerpc/dts-bindings/fsl/spi.txt +0 -0
@@ -13,6 +13,11 @@ Required properties:

 - interrupt-parent : the phandle for the interrupt controller that services interrupts for this device.

Documentation/powerpc/dts-bindings/fsl/spi.txt +5 -0
+Optional properties:
+- gpios : specifies the gpio pins to be used for chipselects.
+  The gpios will be referred to as reg=<index> in the SPI child nodes.
+  If unspecified, a single SPI device without a chip select can be used.
+

 Example:
       spi@4c0 {
               cell-index = <0>;

Documentation/powerpc/dts-bindings/fsl/spi.txt +2 -0
@@ -21,4 +26,6 @@ Example:
                interrupts = <82 0>;
                interrupt-parent = <700>;
                mode = "cpu";
+               gpios = <&gpio 18 1     // device reg=<0>, low-active
+                        &gpio 19 1>;   // device reg=<1>, low-active
        };
Signature · 2 lines
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
#3 lore raw
In reply to a message not in the archive
Quoted 11 lines · Ernst Schwab

From: Ernst Schwab <[email protected]>

Added devicetree binding documentation for gpios used as chipselect. The code to evaluate these is already present in spi_mpc8xxx.c.

---
diff -upr a/Documentation/powerpc/dts-bindings/fsl/spi.txt b/Documentation/powerpc/dts-bindings/fsl/spi.txt

Documentation/powerpc/dts-bindings/fsl/spi.txt Required properties: · line 19

Quoted 7 lines
Documentation/powerpc/dts-bindings/fsl/spi.txt +4 -0
@@ -13,6 +13,11 @@ Required properties:
 - interrupt-parent : the phandle for the interrupt controller that
   services interrupts for this device.
 
+Optional properties:
+- gpios : specifies the gpio pins to be used for chipselects. 
+  The gpios will be referred to as reg=<index> in the SPI child nodes.
+  If unspecified, a single SPI device without a chip select can be used.

Minor: I'd prefer spaces around the '='.

Documentation/powerpc/dts-bindings/fsl/spi.txt Example: · line 30

Quoted 10 lines
Documentation/powerpc/dts-bindings/fsl/spi.txt +3 -0
+
 Example:
 	spi@4c0 {
 		cell-index = <0>;
@@ -21,4 +26,6 @@ Example:
 		interrupts = <82 0>;
 		interrupt-parent = <700>;
 		mode = "cpu";
+		gpios = <&gpio 18 1	// device reg=<0>, low-active
+			 &gpio 19 1>;	// device reg=<1>, low-active

I'd drop the comments. GPIO controllers may have private xlate-functions, so '1' could theoretically mean something else than "low-active" (although in practice it hopefully won't).

Quoted 7 lines
Documentation/powerpc/dts-bindings/fsl/spi.txt +0 -0
 	};

_______________________________________________
devicetree-discuss mailing list devicetree-discuss-uLR06cmDAlY/[email protected]
https://lists.ozlabs.org/listinfo/devicetree-discuss

Signature · 2 lines
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

_______________________________________________
devicetree-discuss mailing list devicetree-discuss-uLR06cmDAlY/[email protected]
https://lists.ozlabs.org/listinfo/devicetree-discuss

A message that is not in the archive (sent off-list or not yet received): [email protected]

#5 lore raw
Quoted 1 line · Wolfram Sang

Minor: I'd prefer spaces around the '='.

Done.

Quoted 3 lines

I'd drop the comments. GPIO controllers may have private xlate-functions, so '1' could theoretically mean something else than "low-active" (although in practice it hopefully won't).

I dropped the polarity stuff. The "reg =" comment seems important to me, I had to find this out by grep'ing and looking at the SPI master sourcecode.
Patch V2 will be reposted.

Regards
Ernst

#6 lore raw

PATCH v2 1/1 of: added documentation for spi chipselects

In reply to a message not in the archive

From: Ernst Schwab <[email protected]>

Added devicetree binding documentation for gpios used as chipselect. The code to evaluate these is already present in spi_mpc8xxx.c.

---

Documentation/powerpc/dts-bindings/fsl/spi.txt +7 -0
diff -upr a/Documentation/powerpc/dts-bindings/fsl/spi.txt b/Documentation/powerpc/dts-bindings/fsl/spi.txt
@@ -13,6 +13,11 @@ Required properties:
 - interrupt-parent : the phandle for the interrupt controller that
   services interrupts for this device.
 
+Optional properties:
+- gpios : specifies the gpio pins to be used for chipselects. 
+  The gpios will be referred to as reg = <index> in the SPI child nodes.
+  If unspecified, a single SPI device without a chip select can be used.
+
 Example:
 	spi@4c0 {
 		cell-index = <0>;
@@ -21,4 +26,6 @@ Example:
 		interrupts = <82 0>;
 		interrupt-parent = <700>;
 		mode = "cpu";
+		gpios = <&gpio 18 1	// device reg = <0>
+			 &gpio 19 1>;	// device reg = <1>
 	};

A message that is not in the archive (sent off-list or not yet received): 20100217132322.76cea805.eschwab-BGeptl67XyCzQB+pC5nmwQ@public.gmane.org

Reviewed-by
#8 lore raw
Quoted 6 lines · Ernst Schwab

From: Ernst Schwab <[email protected]>

Added devicetree binding documentation for gpios used as chipselect. The code to evaluate these is already present in spi_mpc8xxx.c.

Hmm, as Grant merged the original patch already, it might be necessary to convert this into a follow-up patch. He will surely tell you. For both versions, you can add my

...

Documentation/powerpc/dts-bindings/fsl/spi.txt Required properties: · line 17

Quoted 10 lines

---
diff -upr a/Documentation/powerpc/dts-bindings/fsl/spi.txt b/Documentation/powerpc/dts-bindings/fsl/spi.txt

Documentation/powerpc/dts-bindings/fsl/spi.txt +2 -0
@@ -13,6 +13,11 @@ Required properties:
 - interrupt-parent : the phandle for the interrupt controller that
   services interrupts for this device.
 
+Optional properties:
+- gpios : specifies the gpio pins to be used for chipselects. 

...and perhaps remove the trailing white space here.

Quoted 21 lines
Documentation/powerpc/dts-bindings/fsl/spi.txt +5 -0
+  The gpios will be referred to as reg = <index> in the SPI child nodes.
+  If unspecified, a single SPI device without a chip select can be used.
+
 Example:
 	spi@4c0 {
 		cell-index = <0>;
@@ -21,4 +26,6 @@ Example:
 		interrupts = <82 0>;
 		interrupt-parent = <700>;
 		mode = "cpu";
+		gpios = <&gpio 18 1	// device reg = <0>
+			 &gpio 19 1>;	// device reg = <1>
 	};

_______________________________________________
devicetree-discuss mailing list devicetree-discuss-uLR06cmDAlY/[email protected]
https://lists.ozlabs.org/listinfo/devicetree-discuss

Signature · 2 lines
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

_______________________________________________
devicetree-discuss mailing list devicetree-discuss-uLR06cmDAlY/[email protected]
https://lists.ozlabs.org/listinfo/devicetree-discuss

A message that is not in the archive (sent off-list or not yet received): [email protected]

#10 lore raw

PATCH 1/1 of: added documentation for spi chipselects, follow-up patch

From: Ernst Schwab <[email protected]>

Improved comments and formatting of devicetree binding documentation for gpios used as chipselect.

---

Quoted 5 lines · Wolfram Sang

Hmm, as Grant merged the original patch already, it might be necessary to convert this into a follow-up patch. He will surely tell you. For both versions, you can add my

Ok, I understand - I have to get used to it...

Documentation/powerpc/dts-bindings/fsl/spi.txt +4 -4
diff -upr a/Documentation/powerpc/dts-bindings/fsl/spi.txt b/Documentation/powerpc/dts-bindings/fsl/spi.txt
@@ -14,8 +14,8 @@ Required properties:
   services interrupts for this device.
 
 Optional properties:
-- gpios : specifies the gpio pins to be used for chipselects. 
-  The gpios will be referred to as reg=<index> in the SPI child nodes.
+- gpios : specifies the gpio pins to be used for chipselects.
+  The gpios will be referred to as reg = <index> in the SPI child nodes.
   If unspecified, a single SPI device without a chip select can be used.
 
 Example:
@@ -26,6 +26,6 @@ Example:
 		interrupts = <82 0>;
 		interrupt-parent = <700>;
 		mode = "cpu";
-		gpios = <&gpio 18 1	// device reg=<0>, low-active
-			 &gpio 19 1>;	// device reg=<1>, low-active
+		gpios = <&gpio 18 1	// device reg = <0>
+			 &gpio 19 1>;	// device reg = <1>
 	};
#11 lore raw
In reply to a message not in the archive
Quoted 6 lines · Wolfram Sang
Quoted 5 lines · Ernst Schwab

From: Ernst Schwab <[email protected]>

Added devicetree binding documentation for gpios used as chipselect. The code to evaluate these is already present in spi_mpc8xxx.c.

Quoted 7 lines
Quoted 1 line

Hmm, as Grant merged the original patch already, it might be necessary to convert this into a follow-up patch. He will surely tell you. For both versions, you can add my

I'll just patch up the one in my tree. Don't worry about it.

g.