Thread (1 message) 1 message, 1 author, 2012-07-25

Re: [PATCH 2/2] SPI: spi-gpio: Add DT bindings

From: Daniel Mack <hidden>
Date: 2012-07-25 12:17:15
Also in: linux-spi

On 25.07.2012 14:11, Wolfram Sang wrote:
On Wed, Jul 25, 2012 at 01:44:12PM +0200, Daniel Mack wrote:
quoted
This patch adds DT bindings to the spi-gpio driver and some
documentation about how to use it.

Signed-off-by: Daniel Mack <redacted>
---
 Documentation/devicetree/bindings/spi/spi-gpio.txt |   29 ++++++
 drivers/spi/spi-gpio.c                             |   99 +++++++++++++++++++-
 2 files changed, 125 insertions(+), 3 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/spi/spi-gpio.txt
diff --git a/Documentation/devicetree/bindings/spi/spi-gpio.txt b/Documentation/devicetree/bindings/spi/spi-gpio.txt
new file mode 100644
index 0000000..8a824be
--- /dev/null
+++ b/Documentation/devicetree/bindings/spi/spi-gpio.txt
@@ -0,0 +1,29 @@
+SPI-GPIO devicetree bindings
+
+Required properties:
+
+ - compatible: should be set to "spi-gpio"
+ - #address-cells: should be set to <0x1>
+ - ranges
+ - gpio-sck: GPIO spec for the SCK line to use
+ - gpio-miso: GPIO spec for the MISO line to use
+ - gpio-mosi: GPIO spec for the MOSI line to use
+ - cs-gpios: GPIOs to use for chipselect lines
+ - num-chipselects: number of chipselect lines
+
+Example:
+
+	spi {
+		compatible = "spi-gpio";
+		#address-cells = <0x1>;
+		ranges;
+
+		gpio-sck = <&gpio 95 0>;
+		gpio-miso = <&gpio 98 0>;
+		gpio-mosi = <&gpio 97 0>;
+		cs-gpios = <&gpio 125 0>;
+		num-chipselects = <1>;
Can't we use of_gpio_named_count() instead of this property?
I thought so too, but it's probably also a good idea to keep this driver
in line to what other drivers do, no? Anyway, I can of course change it
if desired.
quoted
+
+		/* clients */
Minor: A simple example is helpful for people new to devicetree as I
experienced in the last days.
Hmm, aren't there enough examples in a) the full dts files in the kernel
and b) in the documenation of spi clients?


Thanks,
Daniel


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help