diff mbox series

[1/3] dt-bindings: spi: Provide bindings for fsl dspi working in slave mode

Message ID 20180918093437.26799-2-lukma@denx.de (mailing list archive)
State New, archived
Headers show
Series ARM: dspi: Provide slave mode support for Vybryd vf610 | expand

Commit Message

Lukasz Majewski Sept. 18, 2018, 9:34 a.m. UTC
This commit provides the description of new property: "fsl,spi-slave-mode"
which enables support for DSPI driver working in slave mode.

As the new compatible shall be used with SPI bus equipped with master
device a new "spidev" based node has been introduced to avoid confusion.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
---
 Documentation/devicetree/bindings/spi/spi-fsl-dspi.txt | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Lukasz Majewski Sept. 26, 2018, 2:32 p.m. UTC | #1
Hi Rob,

> On Tue, Sep 18, 2018 at 11:34:35AM +0200, Lukasz Majewski wrote:
> > This commit provides the description of new property:
> > "fsl,spi-slave-mode" which enables support for DSPI driver working
> > in slave mode.
> > 
> > As the new compatible shall be used with SPI bus equipped with
> > master device a new "spidev" based node has been introduced to
> > avoid confusion.
> > 
> > Signed-off-by: Lukasz Majewski <lukma@denx.de>
> > ---
> >  Documentation/devicetree/bindings/spi/spi-fsl-dspi.txt | 8 ++++++++
> >  1 file changed, 8 insertions(+)
> > 
> > diff --git a/Documentation/devicetree/bindings/spi/spi-fsl-dspi.txt
> > b/Documentation/devicetree/bindings/spi/spi-fsl-dspi.txt index
> > 18eeafe359d8..b30af19a2bc5 100644 ---
> > a/Documentation/devicetree/bindings/spi/spi-fsl-dspi.txt +++
> > b/Documentation/devicetree/bindings/spi/spi-fsl-dspi.txt @@ -26,6
> > +26,7 @@ Optional SPI properties for slave nodes:
> >  - fsl,spi-sck-cs-delay: a delay in nanoseconds between stopping
> > the clock signal and deactivating chip select, at the end of a
> > transfer.
> >  - bus-num : the slave chip chipselect signal number.
> > +- fsl,spi-slave-mode: if present, controller runs in slave mode.  
> 
> There's a standard property for this.

I've just realised that there is "spi-slave" property in the
Documentation/devicetree/bindings/spi/spi-bus.txt

I will convert the code to use it.

> 
> >  
> >  Example:
> >  
> > @@ -56,6 +57,13 @@ dspi0@4002c000 {
> >  		fsl,spi-cs-sck-delay = <100>;
> >  		fsl,spi-sck-cs-delay = <50>;
> >  	};
> > +
> > +	spidev3@1 {
> > +		compatible = "fsl,vf610-dspi";
> > +		spi-max-frequency = <30000000>;
> > +		reg = <1>;
> > +		fsl,spi-slave-mode;  
> 
> This doesn't look right for how slave mode is described.

You mean that I shall replace fsl,spi-slave-mode; with "spi-slave" ?

Or is there any other issue with this code?

Thanks for your review,

> 
> > +	};
> >  };
> >  
> >  
> > -- 
> > 2.11.0
> >   
> 




Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de
Geert Uytterhoeven Sept. 26, 2018, 3:37 p.m. UTC | #2
Hi Lukasz,

On Wed, Sep 26, 2018 at 4:33 PM Lukasz Majewski <lukma@denx.de> wrote:
> > On Tue, Sep 18, 2018 at 11:34:35AM +0200, Lukasz Majewski wrote:
> > > This commit provides the description of new property:
> > > "fsl,spi-slave-mode" which enables support for DSPI driver working
> > > in slave mode.
> > >
> > > As the new compatible shall be used with SPI bus equipped with
> > > master device a new "spidev" based node has been introduced to
> > > avoid confusion.
> > >
> > > Signed-off-by: Lukasz Majewski <lukma@denx.de>
> > > ---
> > >  Documentation/devicetree/bindings/spi/spi-fsl-dspi.txt | 8 ++++++++
> > >  1 file changed, 8 insertions(+)
> > >
> > > diff --git a/Documentation/devicetree/bindings/spi/spi-fsl-dspi.txt
> > > b/Documentation/devicetree/bindings/spi/spi-fsl-dspi.txt index
> > > 18eeafe359d8..b30af19a2bc5 100644 ---
> > > a/Documentation/devicetree/bindings/spi/spi-fsl-dspi.txt +++
> > > b/Documentation/devicetree/bindings/spi/spi-fsl-dspi.txt @@ -26,6
> > > +26,7 @@ Optional SPI properties for slave nodes:
> > >  - fsl,spi-sck-cs-delay: a delay in nanoseconds between stopping
> > > the clock signal and deactivating chip select, at the end of a
> > > transfer.
> > >  - bus-num : the slave chip chipselect signal number.
> > > +- fsl,spi-slave-mode: if present, controller runs in slave mode.
> >
> > There's a standard property for this.
>
> I've just realised that there is "spi-slave" property in the
> Documentation/devicetree/bindings/spi/spi-bus.txt
>
> I will convert the code to use it.
>
> >
> > >
> > >  Example:
> > >
> > > @@ -56,6 +57,13 @@ dspi0@4002c000 {
> > >             fsl,spi-cs-sck-delay = <100>;
> > >             fsl,spi-sck-cs-delay = <50>;
> > >     };
> > > +
> > > +   spidev3@1 {
> > > +           compatible = "fsl,vf610-dspi";
> > > +           spi-max-frequency = <30000000>;
> > > +           reg = <1>;
> > > +           fsl,spi-slave-mode;
> >
> > This doesn't look right for how slave mode is described.
>
> You mean that I shall replace fsl,spi-slave-mode; with "spi-slave" ?
>
> Or is there any other issue with this code?

According to Documentation/devicetree/bindings/spi/spi-bus.txt:
  1. "spi-slave" should be a property of the controller node, not of the
     slave node,
  2. the slave node should be called "slave", without unit address, and
     without "reg" property.

Gr{oetje,eeting}s,

                        Geert
Lukasz Majewski Sept. 26, 2018, 9:33 p.m. UTC | #3
Hi Geert,

> Hi Lukasz,
> 
> On Wed, Sep 26, 2018 at 4:33 PM Lukasz Majewski <lukma@denx.de> wrote:
> > > On Tue, Sep 18, 2018 at 11:34:35AM +0200, Lukasz Majewski wrote:  
> > > > This commit provides the description of new property:
> > > > "fsl,spi-slave-mode" which enables support for DSPI driver
> > > > working in slave mode.
> > > >
> > > > As the new compatible shall be used with SPI bus equipped with
> > > > master device a new "spidev" based node has been introduced to
> > > > avoid confusion.
> > > >
> > > > Signed-off-by: Lukasz Majewski <lukma@denx.de>
> > > > ---
> > > >  Documentation/devicetree/bindings/spi/spi-fsl-dspi.txt | 8
> > > > ++++++++ 1 file changed, 8 insertions(+)
> > > >
> > > > diff --git
> > > > a/Documentation/devicetree/bindings/spi/spi-fsl-dspi.txt
> > > > b/Documentation/devicetree/bindings/spi/spi-fsl-dspi.txt index
> > > > 18eeafe359d8..b30af19a2bc5 100644 ---
> > > > a/Documentation/devicetree/bindings/spi/spi-fsl-dspi.txt +++
> > > > b/Documentation/devicetree/bindings/spi/spi-fsl-dspi.txt @@
> > > > -26,6 +26,7 @@ Optional SPI properties for slave nodes:
> > > >  - fsl,spi-sck-cs-delay: a delay in nanoseconds between stopping
> > > > the clock signal and deactivating chip select, at the end of a
> > > > transfer.
> > > >  - bus-num : the slave chip chipselect signal number.
> > > > +- fsl,spi-slave-mode: if present, controller runs in slave
> > > > mode.  
> > >
> > > There's a standard property for this.  
> >
> > I've just realised that there is "spi-slave" property in the
> > Documentation/devicetree/bindings/spi/spi-bus.txt
> >
> > I will convert the code to use it.
> >  
> > >  
> > > >
> > > >  Example:
> > > >
> > > > @@ -56,6 +57,13 @@ dspi0@4002c000 {
> > > >             fsl,spi-cs-sck-delay = <100>;
> > > >             fsl,spi-sck-cs-delay = <50>;
> > > >     };
> > > > +
> > > > +   spidev3@1 {
> > > > +           compatible = "fsl,vf610-dspi";
> > > > +           spi-max-frequency = <30000000>;
> > > > +           reg = <1>;
> > > > +           fsl,spi-slave-mode;  
> > >
> > > This doesn't look right for how slave mode is described.  
> >
> > You mean that I shall replace fsl,spi-slave-mode; with "spi-slave" ?
> >
> > Or is there any other issue with this code?  
> 
> According to Documentation/devicetree/bindings/spi/spi-bus.txt:
>   1. "spi-slave" should be a property of the controller node, not of
> the slave node,
>   2. the slave node should be called "slave", without unit address,
> and without "reg" property.

Thanks for clarification.

> 
> Gr{oetje,eeting}s,
> 
>                         Geert
> 




Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/spi/spi-fsl-dspi.txt b/Documentation/devicetree/bindings/spi/spi-fsl-dspi.txt
index 18eeafe359d8..b30af19a2bc5 100644
--- a/Documentation/devicetree/bindings/spi/spi-fsl-dspi.txt
+++ b/Documentation/devicetree/bindings/spi/spi-fsl-dspi.txt
@@ -26,6 +26,7 @@  Optional SPI properties for slave nodes:
 - fsl,spi-sck-cs-delay: a delay in nanoseconds between stopping the clock
   signal and deactivating chip select, at the end of a transfer.
 - bus-num : the slave chip chipselect signal number.
+- fsl,spi-slave-mode: if present, controller runs in slave mode.
 
 Example:
 
@@ -56,6 +57,13 @@  dspi0@4002c000 {
 		fsl,spi-cs-sck-delay = <100>;
 		fsl,spi-sck-cs-delay = <50>;
 	};
+
+	spidev3@1 {
+		compatible = "fsl,vf610-dspi";
+		spi-max-frequency = <30000000>;
+		reg = <1>;
+		fsl,spi-slave-mode;
+	};
 };