Re: [patch 2.6.20-rc1 4/6] PXA GPIO wrappers

2007-01-01 Thread David Brownell
For the list archives: here's the latest version of this. The signed-off-by discussion is offlist right now, so this version has none; see what eventually merges. From: Philipp Zabel <[EMAIL PROTECTED]> Arch-neutral GPIO calls for PXA. Index: pxa/include/asm-arm/arch-pxa/gpio.h

Re: [patch 2.6.20-rc1 4/6] PXA GPIO wrappers

2007-01-01 Thread David Brownell
For the list archives: here's the latest version of this. The signed-off-by discussion is offlist right now, so this version has none; see what eventually merges. From: Philipp Zabel [EMAIL PROTECTED] Arch-neutral GPIO calls for PXA. Index: pxa/include/asm-arm/arch-pxa/gpio.h

Re: [patch 2.6.20-rc1 4/6] PXA GPIO wrappers

2006-12-29 Thread David Brownell
On Friday 29 December 2006 6:15 pm, Nicolas Pitre wrote: > On Thu, 28 Dec 2006, David Brownell wrote: > > > Phillip: is this the final version, then? It's missing > > a signed-off-by line, so I can't do anything appropriate. > > > > Nico, your signoff here would be a Good Thing too if it > >

Re: [patch 2.6.20-rc1 4/6] PXA GPIO wrappers

2006-12-29 Thread Nicolas Pitre
On Thu, 28 Dec 2006, David Brownell wrote: > Phillip: is this the final version, then? It's missing > a signed-off-by line, so I can't do anything appropriate. > > Nico, your signoff here would be a Good Thing too if it > meets your technical review. (My only comment, ISTR, was > that

Re: [patch 2.6.20-rc1 4/6] PXA GPIO wrappers

2006-12-29 Thread David Brownell
Just FYI -- I updated your patch, fixed a compile bug, and switched some code over to use this new API. The patch is appended. I happen to think it's a lot easier to read this way. Maybe to some people it's easy to remember what a GPLR, GPCR, and GPSR register is supposed to do, after a long

Re: [patch 2.6.20-rc1 4/6] PXA GPIO wrappers

2006-12-29 Thread David Brownell
Just FYI -- I updated your patch, fixed a compile bug, and switched some code over to use this new API. The patch is appended. I happen to think it's a lot easier to read this way. Maybe to some people it's easy to remember what a GPLR, GPCR, and GPSR register is supposed to do, after a long

Re: [patch 2.6.20-rc1 4/6] PXA GPIO wrappers

2006-12-29 Thread Nicolas Pitre
On Thu, 28 Dec 2006, David Brownell wrote: Phillip: is this the final version, then? It's missing a signed-off-by line, so I can't do anything appropriate. Nico, your signoff here would be a Good Thing too if it meets your technical review. (My only comment, ISTR, was that

Re: [patch 2.6.20-rc1 4/6] PXA GPIO wrappers

2006-12-29 Thread David Brownell
On Friday 29 December 2006 6:15 pm, Nicolas Pitre wrote: On Thu, 28 Dec 2006, David Brownell wrote: Phillip: is this the final version, then? It's missing a signed-off-by line, so I can't do anything appropriate. Nico, your signoff here would be a Good Thing too if it meets your

Re: [patch 2.6.20-rc1 4/6] PXA GPIO wrappers

2006-12-28 Thread Pavel Machek
On Thu 2006-12-28 21:50:55, Pavel Machek wrote: > Hi! > > > > > From: Philipp Zabel <[EMAIL PROTECTED]> > > > > > > Missing s-o-b? > > > > Yes, still ... > > > > > > +static inline int gpio_direction_input(unsigned gpio) > > > > +{ > > > > + if (gpio > PXA_LAST_GPIO) > > > > +

Re: [patch 2.6.20-rc1 4/6] PXA GPIO wrappers

2006-12-28 Thread Pavel Machek
Hi! > > > From: Philipp Zabel <[EMAIL PROTECTED]> > > > > Missing s-o-b? > > Yes, still ... > > > > +static inline int gpio_direction_input(unsigned gpio) > > > +{ > > > + if (gpio > PXA_LAST_GPIO) > > > + return -EINVAL; > > > + pxa_gpio_mode(gpio | GPIO_IN); > > > +} > > > > Missing

Re: [patch 2.6.20-rc1 4/6] PXA GPIO wrappers

2006-12-28 Thread David Brownell
On Wednesday 27 December 2006 9:53 am, Pavel Machek wrote: > Hi! > > > Arch-neutral GPIO calls for PXA. > > > > From: Philipp Zabel <[EMAIL PROTECTED]> > > Missing s-o-b? Yes, still ... > > +static inline int gpio_direction_input(unsigned gpio) > > +{ > > + if (gpio > PXA_LAST_GPIO) > > +

Re: [patch 2.6.20-rc1 4/6] PXA GPIO wrappers

2006-12-28 Thread David Brownell
Phillip: is this the final version, then? It's missing a signed-off-by line, so I can't do anything appropriate. Nico, your signoff here would be a Good Thing too if it meets your technical review. (My only comment, ISTR, was that gpio_set_value macro should probably test for whether the value

Re: [patch 2.6.20-rc1 4/6] PXA GPIO wrappers

2006-12-28 Thread Pavel Machek
Hi! > Arch-neutral GPIO calls for PXA. > > From: Philipp Zabel <[EMAIL PROTECTED]> Missing s-o-b? > +static inline int gpio_direction_input(unsigned gpio) > +{ > + if (gpio > PXA_LAST_GPIO) > + return -EINVAL; > + pxa_gpio_mode(gpio | GPIO_IN); > +} Missing return 0? >

Re: [patch 2.6.20-rc1 4/6] PXA GPIO wrappers

2006-12-28 Thread Pavel Machek
Hi! Arch-neutral GPIO calls for PXA. From: Philipp Zabel [EMAIL PROTECTED] Missing s-o-b? +static inline int gpio_direction_input(unsigned gpio) +{ + if (gpio PXA_LAST_GPIO) + return -EINVAL; + pxa_gpio_mode(gpio | GPIO_IN); +} Missing return 0? +static inline

Re: [patch 2.6.20-rc1 4/6] PXA GPIO wrappers

2006-12-28 Thread David Brownell
Phillip: is this the final version, then? It's missing a signed-off-by line, so I can't do anything appropriate. Nico, your signoff here would be a Good Thing too if it meets your technical review. (My only comment, ISTR, was that gpio_set_value macro should probably test for whether the value

Re: [patch 2.6.20-rc1 4/6] PXA GPIO wrappers

2006-12-28 Thread David Brownell
On Wednesday 27 December 2006 9:53 am, Pavel Machek wrote: Hi! Arch-neutral GPIO calls for PXA. From: Philipp Zabel [EMAIL PROTECTED] Missing s-o-b? Yes, still ... +static inline int gpio_direction_input(unsigned gpio) +{ + if (gpio PXA_LAST_GPIO) + return

Re: [patch 2.6.20-rc1 4/6] PXA GPIO wrappers

2006-12-28 Thread Pavel Machek
Hi! From: Philipp Zabel [EMAIL PROTECTED] Missing s-o-b? Yes, still ... +static inline int gpio_direction_input(unsigned gpio) +{ + if (gpio PXA_LAST_GPIO) + return -EINVAL; + pxa_gpio_mode(gpio | GPIO_IN); +} Missing return 0? +static inline int

Re: [patch 2.6.20-rc1 4/6] PXA GPIO wrappers

2006-12-28 Thread Pavel Machek
On Thu 2006-12-28 21:50:55, Pavel Machek wrote: Hi! From: Philipp Zabel [EMAIL PROTECTED] Missing s-o-b? Yes, still ... +static inline int gpio_direction_input(unsigned gpio) +{ + if (gpio PXA_LAST_GPIO) + return -EINVAL; +

Re: [patch 2.6.20-rc1 4/6] PXA GPIO wrappers

2006-12-21 Thread pHilipp Zabel
On 12/21/06, Nicolas Pitre <[EMAIL PROTECTED]> wrote: On Thu, 21 Dec 2006, pHilipp Zabel wrote: > > > --- linux-2.6.orig/arch/arm/mach-pxa/generic.c2006-12-16 > > > +++ linux-2.6/arch/arm/mach-pxa/generic.c 2006-12-16 > > > 16:47:45.0 > > > @@ -129,6 +129,29 @@ > > >

Re: [patch 2.6.20-rc1 4/6] PXA GPIO wrappers

2006-12-21 Thread Bill Gatliff
Guys: Probably? What I am wondering is this: can the compiler optimize away the range check that is duplicated in GPSR/GPCR and GPIO_bit for __gpio_set/get_value? Or could we optimize this case by expanding the macros in place (which would mean duplicating code from pxa-regs.h)... Who

Re: [patch 2.6.20-rc1 4/6] PXA GPIO wrappers

2006-12-21 Thread Nicolas Pitre
On Thu, 21 Dec 2006, pHilipp Zabel wrote: > > > --- linux-2.6.orig/arch/arm/mach-pxa/generic.c2006-12-16 > > > +++ linux-2.6/arch/arm/mach-pxa/generic.c 2006-12-16 > > > 16:47:45.0 > > > @@ -129,6 +129,29 @@ > > > EXPORT_SYMBOL(pxa_gpio_mode); > > > > > > /* > > > + * Return

Re: [patch 2.6.20-rc1 4/6] PXA GPIO wrappers

2006-12-21 Thread pHilipp Zabel
On 12/21/06, Nicolas Pitre <[EMAIL PROTECTED]> wrote: On Thu, 21 Dec 2006, pHilipp Zabel wrote: > David suggested to have both inline and non-inline functions depending > on whether gpio is constant. How is this patch? More comments below. > --- /dev/null 1970-01-01 00:00:00.0 + >

Re: [patch 2.6.20-rc1 4/6] PXA GPIO wrappers

2006-12-21 Thread David Brownell
On Thursday 21 December 2006 7:03 am, pHilipp Zabel wrote: > On 12/21/06, Nicolas Pitre <[EMAIL PROTECTED]> wrote: > +static inline void __gpio_set_value(unsigned gpio, int value) > +{ > + if (value) > + GPSR(gpio) = GPIO_bit(gpio); > + else > + GPCR(gpio) =

Re: [patch 2.6.20-rc1 4/6] PXA GPIO wrappers

2006-12-21 Thread Nicolas Pitre
On Thu, 21 Dec 2006, pHilipp Zabel wrote: > David suggested to have both inline and non-inline functions depending > on whether gpio is constant. How is this patch? More comments below. > --- /dev/null 1970-01-01 00:00:00.0 + > +++ linux-2.6/include/asm-arm/arch-pxa/gpio.h

Re: [patch 2.6.20-rc1 4/6] PXA GPIO wrappers

2006-12-21 Thread pHilipp Zabel
On 12/21/06, Nicolas Pitre <[EMAIL PROTECTED]> wrote: On Wed, 20 Dec 2006, David Brownell wrote: > On Wednesday 20 December 2006 10:12 pm, Andrew Morton wrote: > > Why not implement them as inline functions? > > I just collected and forwarded the code from Philip... > the better not to lose

Re: [patch 2.6.20-rc1 4/6] PXA GPIO wrappers

2006-12-21 Thread Nicolas Pitre
On Wed, 20 Dec 2006, David Brownell wrote: > On Wednesday 20 December 2006 10:12 pm, Andrew Morton wrote: > > Why not implement them as inline functions? > > I just collected and forwarded the code from Philip... > the better not to lose such stuff! :) > > > > Or non-inline functions, come

Re: [patch 2.6.20-rc1 4/6] PXA GPIO wrappers

2006-12-21 Thread Nicolas Pitre
On Wed, 20 Dec 2006, David Brownell wrote: On Wednesday 20 December 2006 10:12 pm, Andrew Morton wrote: Why not implement them as inline functions? I just collected and forwarded the code from Philip... the better not to lose such stuff! :) Or non-inline functions, come to that.

Re: [patch 2.6.20-rc1 4/6] PXA GPIO wrappers

2006-12-21 Thread pHilipp Zabel
On 12/21/06, Nicolas Pitre [EMAIL PROTECTED] wrote: On Wed, 20 Dec 2006, David Brownell wrote: On Wednesday 20 December 2006 10:12 pm, Andrew Morton wrote: Why not implement them as inline functions? I just collected and forwarded the code from Philip... the better not to lose such stuff!

Re: [patch 2.6.20-rc1 4/6] PXA GPIO wrappers

2006-12-21 Thread Nicolas Pitre
On Thu, 21 Dec 2006, pHilipp Zabel wrote: David suggested to have both inline and non-inline functions depending on whether gpio is constant. How is this patch? More comments below. --- /dev/null 1970-01-01 00:00:00.0 + +++ linux-2.6/include/asm-arm/arch-pxa/gpio.h 2006-12-21

Re: [patch 2.6.20-rc1 4/6] PXA GPIO wrappers

2006-12-21 Thread David Brownell
On Thursday 21 December 2006 7:03 am, pHilipp Zabel wrote: On 12/21/06, Nicolas Pitre [EMAIL PROTECTED] wrote: +static inline void __gpio_set_value(unsigned gpio, int value) +{ + if (value) + GPSR(gpio) = GPIO_bit(gpio); + else + GPCR(gpio) = GPIO_bit(gpio);

Re: [patch 2.6.20-rc1 4/6] PXA GPIO wrappers

2006-12-21 Thread pHilipp Zabel
On 12/21/06, Nicolas Pitre [EMAIL PROTECTED] wrote: On Thu, 21 Dec 2006, pHilipp Zabel wrote: David suggested to have both inline and non-inline functions depending on whether gpio is constant. How is this patch? More comments below. --- /dev/null 1970-01-01 00:00:00.0 + +++

Re: [patch 2.6.20-rc1 4/6] PXA GPIO wrappers

2006-12-21 Thread Nicolas Pitre
On Thu, 21 Dec 2006, pHilipp Zabel wrote: --- linux-2.6.orig/arch/arm/mach-pxa/generic.c2006-12-16 +++ linux-2.6/arch/arm/mach-pxa/generic.c 2006-12-16 16:47:45.0 @@ -129,6 +129,29 @@ EXPORT_SYMBOL(pxa_gpio_mode); /* + * Return GPIO level, nonzero means

Re: [patch 2.6.20-rc1 4/6] PXA GPIO wrappers

2006-12-21 Thread Bill Gatliff
Guys: Probably? What I am wondering is this: can the compiler optimize away the range check that is duplicated in GPSR/GPCR and GPIO_bit for __gpio_set/get_value? Or could we optimize this case by expanding the macros in place (which would mean duplicating code from pxa-regs.h)... Who

Re: [patch 2.6.20-rc1 4/6] PXA GPIO wrappers

2006-12-21 Thread pHilipp Zabel
On 12/21/06, Nicolas Pitre [EMAIL PROTECTED] wrote: On Thu, 21 Dec 2006, pHilipp Zabel wrote: --- linux-2.6.orig/arch/arm/mach-pxa/generic.c2006-12-16 +++ linux-2.6/arch/arm/mach-pxa/generic.c 2006-12-16 16:47:45.0 @@ -129,6 +129,29 @@

Re: [patch 2.6.20-rc1 4/6] PXA GPIO wrappers

2006-12-20 Thread David Brownell
On Wednesday 20 December 2006 10:12 pm, Andrew Morton wrote: > On Wed, 20 Dec 2006 13:12:35 -0800 > David Brownell <[EMAIL PROTECTED]> wrote: > > > +/* REVISIT these macros are correct, but suffer code explosion > > + * for non-constant parameters. Provide out-line versions too. > > + */ > >

Re: [patch 2.6.20-rc1 4/6] PXA GPIO wrappers

2006-12-20 Thread Andrew Morton
On Wed, 20 Dec 2006 13:12:35 -0800 David Brownell <[EMAIL PROTECTED]> wrote: > +/* REVISIT these macros are correct, but suffer code explosion > + * for non-constant parameters. Provide out-line versions too. > + */ > +#define gpio_get_value(gpio) \ > + (GPLR(gpio) & GPIO_bit(gpio)) > + >

[patch 2.6.20-rc1 4/6] PXA GPIO wrappers

2006-12-20 Thread David Brownell
Arch-neutral GPIO calls for PXA. From: Philipp Zabel <[EMAIL PROTECTED]> Index: at91/include/asm-arm/arch-pxa/gpio.h === --- /dev/null 1970-01-01 00:00:00.0 + +++ at91/include/asm-arm/arch-pxa/gpio.h2006-12-19

[patch 2.6.20-rc1 4/6] PXA GPIO wrappers

2006-12-20 Thread David Brownell
Arch-neutral GPIO calls for PXA. From: Philipp Zabel [EMAIL PROTECTED] Index: at91/include/asm-arm/arch-pxa/gpio.h === --- /dev/null 1970-01-01 00:00:00.0 + +++ at91/include/asm-arm/arch-pxa/gpio.h2006-12-19

Re: [patch 2.6.20-rc1 4/6] PXA GPIO wrappers

2006-12-20 Thread Andrew Morton
On Wed, 20 Dec 2006 13:12:35 -0800 David Brownell [EMAIL PROTECTED] wrote: +/* REVISIT these macros are correct, but suffer code explosion + * for non-constant parameters. Provide out-line versions too. + */ +#define gpio_get_value(gpio) \ + (GPLR(gpio) GPIO_bit(gpio)) + +#define

Re: [patch 2.6.20-rc1 4/6] PXA GPIO wrappers

2006-12-20 Thread David Brownell
On Wednesday 20 December 2006 10:12 pm, Andrew Morton wrote: On Wed, 20 Dec 2006 13:12:35 -0800 David Brownell [EMAIL PROTECTED] wrote: +/* REVISIT these macros are correct, but suffer code explosion + * for non-constant parameters. Provide out-line versions too. + */ +#define