linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] powerpc: SPI: specify chip select active high
@ 2008-10-15 13:00 Wolfgang Ocker
  2008-10-15 14:22 ` Grant Likely
  2008-10-20 14:52 ` Kumar Gala
  0 siblings, 2 replies; 4+ messages in thread
From: Wolfgang Ocker @ 2008-10-15 13:00 UTC (permalink / raw)
  To: linuxppc-dev

The patch allows to specify that an SPI device needs an active high chip
select.

Signed-off-by: Wolfgang Ocker <weo@reccoware.de>
---

--- linux-2.6.27-rc7/drivers/of/of_spi.c.of_spi_cshigh	2008-09-22 00:29:55.000000000 +0200
+++ linux-2.6.27-rc7/drivers/of/of_spi.c	2008-09-29 13:43:06.000000000 +0200
@@ -61,6 +61,8 @@
 			spi->mode |= SPI_CPHA;
 		if (of_find_property(nc, "spi-cpol", NULL))
 			spi->mode |= SPI_CPOL;
+		if (of_find_property(nc, "spi-cs-high", NULL))
+			spi->mode |= SPI_CS_HIGH;
 
 		/* Device speed */
 		prop = of_get_property(nc, "spi-max-frequency", &len);
--- linux-2.6.27-rc7/Documentation/powerpc/booting-without-of.txt.of_spi_cshigh	2008-09-29 14:14:08.000000000 +0200
+++ linux-2.6.27-rc7/Documentation/powerpc/booting-without-of.txt	2008-09-29 14:24:26.000000000 +0200
@@ -1917,6 +1917,8 @@
 			inverse clock polarity (CPOL) mode
     - spi-cpha        - (optional) Empty property indicating device requires
 			shifted clock phase (CPHA) mode
+    - spi-cs-high     - (optional) Empty property indicating device requires
+			chip select active high
 
     SPI example for an MPC5200 SPI bus:
 		spi@f00 {

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] powerpc: SPI: specify chip select active high
  2008-10-15 13:00 [PATCH] powerpc: SPI: specify chip select active high Wolfgang Ocker
@ 2008-10-15 14:22 ` Grant Likely
  2008-10-15 15:51   ` Anton Vorontsov
  2008-10-20 14:52 ` Kumar Gala
  1 sibling, 1 reply; 4+ messages in thread
From: Grant Likely @ 2008-10-15 14:22 UTC (permalink / raw)
  To: Wolfgang Ocker; +Cc: linuxppc-dev

On Wed, Oct 15, 2008 at 03:00:47PM +0200, Wolfgang Ocker wrote:
> The patch allows to specify that an SPI device needs an active high chip
> select.

This look reasonable to me.  Anyone else have comments on this binding?

g.

> 
> Signed-off-by: Wolfgang Ocker <weo@reccoware.de>
> ---
> 
> --- linux-2.6.27-rc7/drivers/of/of_spi.c.of_spi_cshigh	2008-09-22 00:29:55.000000000 +0200
> +++ linux-2.6.27-rc7/drivers/of/of_spi.c	2008-09-29 13:43:06.000000000 +0200
> @@ -61,6 +61,8 @@
>  			spi->mode |= SPI_CPHA;
>  		if (of_find_property(nc, "spi-cpol", NULL))
>  			spi->mode |= SPI_CPOL;
> +		if (of_find_property(nc, "spi-cs-high", NULL))
> +			spi->mode |= SPI_CS_HIGH;
>  
>  		/* Device speed */
>  		prop = of_get_property(nc, "spi-max-frequency", &len);
> --- linux-2.6.27-rc7/Documentation/powerpc/booting-without-of.txt.of_spi_cshigh	2008-09-29 14:14:08.000000000 +0200
> +++ linux-2.6.27-rc7/Documentation/powerpc/booting-without-of.txt	2008-09-29 14:24:26.000000000 +0200
> @@ -1917,6 +1917,8 @@
>  			inverse clock polarity (CPOL) mode
>      - spi-cpha        - (optional) Empty property indicating device requires
>  			shifted clock phase (CPHA) mode
> +    - spi-cs-high     - (optional) Empty property indicating device requires
> +			chip select active high
>  
>      SPI example for an MPC5200 SPI bus:
>  		spi@f00 {
> 
> 
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] powerpc: SPI: specify chip select active high
  2008-10-15 14:22 ` Grant Likely
@ 2008-10-15 15:51   ` Anton Vorontsov
  0 siblings, 0 replies; 4+ messages in thread
From: Anton Vorontsov @ 2008-10-15 15:51 UTC (permalink / raw)
  To: Grant Likely; +Cc: linuxppc-dev, Wolfgang Ocker

On Wed, Oct 15, 2008 at 08:22:28AM -0600, Grant Likely wrote:
> On Wed, Oct 15, 2008 at 03:00:47PM +0200, Wolfgang Ocker wrote:
> > The patch allows to specify that an SPI device needs an active high chip
> > select.
> 
> This look reasonable to me.  Anyone else have comments on this binding?

Looks good. I'm assuming that a spi controller has its own chip select
machine, since for GPIO chip-select we can pass active-high/low stuff
via gpios = <> property. But well, we can support both ways even for
GPIO chip-selects, I see no problem.

> g.
> 
> > 
> > Signed-off-by: Wolfgang Ocker <weo@reccoware.de>
> > ---
> > 
> > --- linux-2.6.27-rc7/drivers/of/of_spi.c.of_spi_cshigh	2008-09-22 00:29:55.000000000 +0200
> > +++ linux-2.6.27-rc7/drivers/of/of_spi.c	2008-09-29 13:43:06.000000000 +0200
> > @@ -61,6 +61,8 @@
> >  			spi->mode |= SPI_CPHA;
> >  		if (of_find_property(nc, "spi-cpol", NULL))
> >  			spi->mode |= SPI_CPOL;
> > +		if (of_find_property(nc, "spi-cs-high", NULL))
> > +			spi->mode |= SPI_CS_HIGH;
> >  
> >  		/* Device speed */
> >  		prop = of_get_property(nc, "spi-max-frequency", &len);
> > --- linux-2.6.27-rc7/Documentation/powerpc/booting-without-of.txt.of_spi_cshigh	2008-09-29 14:14:08.000000000 +0200
> > +++ linux-2.6.27-rc7/Documentation/powerpc/booting-without-of.txt	2008-09-29 14:24:26.000000000 +0200
> > @@ -1917,6 +1917,8 @@
> >  			inverse clock polarity (CPOL) mode
> >      - spi-cpha        - (optional) Empty property indicating device requires
> >  			shifted clock phase (CPHA) mode
> > +    - spi-cs-high     - (optional) Empty property indicating device requires
> > +			chip select active high
> >  
> >      SPI example for an MPC5200 SPI bus:
> >  		spi@f00 {
> > 
> > 

-- 
Anton Vorontsov
email: cbouatmailru@gmail.com
irc://irc.freenode.net/bd2

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] powerpc: SPI: specify chip select active high
  2008-10-15 13:00 [PATCH] powerpc: SPI: specify chip select active high Wolfgang Ocker
  2008-10-15 14:22 ` Grant Likely
@ 2008-10-20 14:52 ` Kumar Gala
  1 sibling, 0 replies; 4+ messages in thread
From: Kumar Gala @ 2008-10-20 14:52 UTC (permalink / raw)
  To: Wolfgang Ocker; +Cc: linuxppc-dev


On Oct 15, 2008, at 8:00 AM, Wolfgang Ocker wrote:

> The patch allows to specify that an SPI device needs an active high  
> chip
> select.
>
> Signed-off-by: Wolfgang Ocker <weo@reccoware.de>
> ---

applied

- k

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-10-20 14:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-10-15 13:00 [PATCH] powerpc: SPI: specify chip select active high Wolfgang Ocker
2008-10-15 14:22 ` Grant Likely
2008-10-15 15:51   ` Anton Vorontsov
2008-10-20 14:52 ` Kumar Gala

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).