On Fri, Oct 24, 2008 at 3:10 PM, Anton Vorontsov <[EMAIL PROTECTED]> wrote: > On Fri, Oct 24, 2008 at 10:08:59PM +0200, Wolfgang Ocker wrote: >> SPI slave devices require the specification of a chip select address. >> This patch allows that specification using the gpios property. The reg >> property remains supported. >> >> Signed-off-by: Wolfgang Ocker <[EMAIL PROTECTED]> >> --- >> >> --- linux-2.6.27.3/drivers/of/of_spi.c.of_spi_gpio 2008-10-22 >> 23:38:01.000000000 +0200 >> +++ linux-2.6.27.3/drivers/of/of_spi.c.of_spi_cshigh 2008-10-24 >> 21:36:39.000000000 +0200 > [...] >> --- linux-2.6.27.3/Documentation/powerpc/booting-without-of.txt.of_spi_gpio >> 2008-10-22 23:38:01.000000000 +0200 >> +++ >> linux-2.6.27.3/Documentation/powerpc/booting-without-of.txt.of_spi_cshigh >> 2008-10-24 21:57:16.000000000 +0200 >> @@ -1936,7 +1938,7 @@ platforms are moved over to use the flat >> [EMAIL PROTECTED] { >> compatible = "ti,tlv320aic26"; >> spi-max-frequency = <100000>; >> - reg = <1>; >> + gpios = <&GPIO1 3>; >> }; >> }; > > Close, but no cigar. Sorry. ;-) The bindings are fine as is, you don't > need to change them. > > The scheme should look like this: > > spi-controller { > #address-cells = <1>; > #size-cells = <0>; > > /* two GPIOs, representing two chip selects: 0 and 1 */ > gpios = <&pio 5 0 &pio 16 0>; > > [EMAIL PROTECTED] { > reg = <0>; > }; > > [EMAIL PROTECTED] { > reg = <1>; > }; > } > > Notice that "gpios" is spi-controller's property, not spi devices'. > It is truly as hardware works, SPI controllers consists of two units: > I/O, and chip-select machine. Most spi controllers don't have > dedicated chip-select machines, so they use GPIOs.
FWIW, I 100% agree. g. -- Grant Likely, B.Sc., P.Eng. Secret Lab Technologies Ltd. _______________________________________________ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev