diff mbox

[v3,2/5] spi: dw: document device tree binding

Message ID a978b266a9b8827747054a689e014ca9efbec235.1391162172.git.baruch@tkos.co.il (mailing list archive)
State Under Review, archived
Headers show

Commit Message

Baruch Siach Jan. 31, 2014, 10:07 a.m. UTC
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
---
 Documentation/devicetree/bindings/spi/spi-dw.txt | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/spi/spi-dw.txt

Comments

Gerhard Sittig Feb. 2, 2014, 12:23 p.m. UTC | #1
On Fri, Jan 31, 2014 at 12:07 +0200, Baruch Siach wrote:
> 
> Signed-off-by: Baruch Siach <baruch@tkos.co.il>
> ---
>  Documentation/devicetree/bindings/spi/spi-dw.txt | 24 ++++++++++++++++++++++++
>  1 file changed, 24 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/spi/spi-dw.txt

You introduce a new binding, but don't Cc: the devicetree list
for review.

> --- /dev/null
> +++ b/Documentation/devicetree/bindings/spi/spi-dw.txt
> @@ -0,0 +1,24 @@
> +Synopsys DesignWare SPI master
> +
> +Required properties:
> +- compatible: should be "snps,designware-spi"
> +- #address-cells: see spi-bus.txt
> +- #size-cells: see spi-bus.txt
> +- reg: address and length of the spi master registers
> +- interrupts: should contain one interrupt
> +- clocks: spi clock phandle
> +- num-cs: see spi-bus.txt

You may want to check Mark Rutland's replies in the DT list
archives with his nits about speaking of phandles only where
specifiers are involved as well, and how he several times
suggested improved descriptions that you can adopt or copy.

Is 'num-cs' really required and not optional?  (It may be, I'm
just asking.  Given that there has not been a binding before,
there is no compatibility issue either.)

> +
> +Optional properties:
> +- cs-gpios: see spi-bus.txt
> +
> +Example:
> +
> +spi: spi@4020a000 {
> +	compatible = "snps,designware-spi";
> +	interrupts = <11 1>;
> +	reg = <0x4020a000 0x1000>;
> +	clocks = <&pclk>;
> +	num-cs = <2>;
> +	cs-gpios = <&banka 0 0>;
> +};


virtually yours
Gerhard Sittig
Baruch Siach Feb. 3, 2014, 5:30 a.m. UTC | #2
Hi Gerhard,

Thanks for reviewing.

On Sun, Feb 02, 2014 at 01:23:20PM +0100, Gerhard Sittig wrote:
> On Fri, Jan 31, 2014 at 12:07 +0200, Baruch Siach wrote:
> > 
> > Signed-off-by: Baruch Siach <baruch@tkos.co.il>
> > ---
> >  Documentation/devicetree/bindings/spi/spi-dw.txt | 24 ++++++++++++++++++++++++
> >  1 file changed, 24 insertions(+)
> >  create mode 100644 Documentation/devicetree/bindings/spi/spi-dw.txt
> 
> You introduce a new binding, but don't Cc: the devicetree list
> for review.

I wanted to do that but forgot.

> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/spi/spi-dw.txt
> > @@ -0,0 +1,24 @@
> > +Synopsys DesignWare SPI master
> > +
> > +Required properties:
> > +- compatible: should be "snps,designware-spi"
> > +- #address-cells: see spi-bus.txt
> > +- #size-cells: see spi-bus.txt
> > +- reg: address and length of the spi master registers
> > +- interrupts: should contain one interrupt
> > +- clocks: spi clock phandle
> > +- num-cs: see spi-bus.txt
> 
> You may want to check Mark Rutland's replies in the DT list
> archives with his nits about speaking of phandles only where
> specifiers are involved as well, and how he several times
> suggested improved descriptions that you can adopt or copy.

I've see one of these messages last week. I'll try to look them up and update 
the wording. If you have a pointer to a properly written in-tree 'clocks' 
description please let me know.

> Is 'num-cs' really required and not optional?  (It may be, I'm
> just asking.  Given that there has not been a binding before,
> there is no compatibility issue either.)

Yes. With this version of the series 'num-cs' is mandatory for the DT case. In 
the non-DT case the deriver defaults to 4 as before.

baruch
diff mbox

Patch

diff --git a/Documentation/devicetree/bindings/spi/spi-dw.txt b/Documentation/devicetree/bindings/spi/spi-dw.txt
new file mode 100644
index 000000000000..7b63ed601990
--- /dev/null
+++ b/Documentation/devicetree/bindings/spi/spi-dw.txt
@@ -0,0 +1,24 @@ 
+Synopsys DesignWare SPI master
+
+Required properties:
+- compatible: should be "snps,designware-spi"
+- #address-cells: see spi-bus.txt
+- #size-cells: see spi-bus.txt
+- reg: address and length of the spi master registers
+- interrupts: should contain one interrupt
+- clocks: spi clock phandle
+- num-cs: see spi-bus.txt
+
+Optional properties:
+- cs-gpios: see spi-bus.txt
+
+Example:
+
+spi: spi@4020a000 {
+	compatible = "snps,designware-spi";
+	interrupts = <11 1>;
+	reg = <0x4020a000 0x1000>;
+	clocks = <&pclk>;
+	num-cs = <2>;
+	cs-gpios = <&banka 0 0>;
+};