Message ID | 211f8d2101fff1790526f7dff766d0d9efff9280.1390723880.git.baruch@tkos.co.il (mailing list archive) |
---|---|
State | Accepted |
Commit | 20e5ea191524b482e1b4aa12b5ff4684717f44b8 |
Headers | show |
On Sun, Jan 26, 2014 at 10:14:35AM +0200, Baruch Siach wrote: > +Required properties: > +- num-cs: see spi-bus.txt Why is this mandatory, in the code it was optional? One or the other ought to be updated.
Hi Mark, On Mon, Jan 27, 2014 at 07:08:39PM +0000, Mark Brown wrote: > On Sun, Jan 26, 2014 at 10:14:35AM +0200, Baruch Siach wrote: > > > +Required properties: > > > +- num-cs: see spi-bus.txt > > Why is this mandatory, in the code it was optional? One or the other > ought to be updated. The code defaults to 4. I guess that's what the hardware this code was tested on had. But this default doesn't make much sense in the general case. Anyway, for backwards compatibility I'll document this property as optional, note that the default is 4, and recommend to add this property anyway. Does this sound reasonable? baruch
On Mon, Jan 27, 2014 at 09:18:10PM +0200, Baruch Siach wrote: > On Mon, Jan 27, 2014 at 07:08:39PM +0000, Mark Brown wrote: > > On Sun, Jan 26, 2014 at 10:14:35AM +0200, Baruch Siach wrote: > > > +Required properties: > > > +- num-cs: see spi-bus.txt > > Why is this mandatory, in the code it was optional? One or the other > > ought to be updated. > The code defaults to 4. I guess that's what the hardware this code was tested > on had. But this default doesn't make much sense in the general case. Anyway, > for backwards compatibility I'll document this property as optional, note that > the default is 4, and recommend to add this property anyway. Does this sound > reasonable? This is a new binding, why would it have to be backwards compatible with anything?
Hi Mark, On Mon, Jan 27, 2014 at 07:22:51PM +0000, Mark Brown wrote: > On Mon, Jan 27, 2014 at 09:18:10PM +0200, Baruch Siach wrote: > > On Mon, Jan 27, 2014 at 07:08:39PM +0000, Mark Brown wrote: > > > On Sun, Jan 26, 2014 at 10:14:35AM +0200, Baruch Siach wrote: > > > > > +Required properties: > > > > > +- num-cs: see spi-bus.txt > > > > Why is this mandatory, in the code it was optional? One or the other > > > ought to be updated. > > > The code defaults to 4. I guess that's what the hardware this code was tested > > on had. But this default doesn't make much sense in the general case. Anyway, > > for backwards compatibility I'll document this property as optional, note that > > the default is 4, and recommend to add this property anyway. Does this sound > > reasonable? > > This is a new binding, why would it have to be backwards compatible with > anything? I meant driver compatibility. I used to work that way, and should continue doing so in non-DT environment. I suggest to make num-cs mandatory for DT, but keep the existing behaviour for non-DT. I'll update the code then. baruch
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>; +};
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