[PATCH 11/13] ARM: gpio: consolidate trivial gpiolib implementations

Russell King - ARM Linux linux at arm.linux.org.uk
Thu Aug 11 11:07:18 EDT 2011


On Thu, Aug 11, 2011 at 05:15:31PM +0300, Felipe Balbi wrote:
> On Tue, Aug 09, 2011 at 09:08:01AM +0100, Russell King - ARM Linux wrote:
> > diff --git a/arch/arm/include/asm/gpio.h b/arch/arm/include/asm/gpio.h
> > index 166a7a3..15e8970 100644
> > --- a/arch/arm/include/asm/gpio.h
> > +++ b/arch/arm/include/asm/gpio.h
> > @@ -4,4 +4,14 @@
> >  /* not all ARM platforms necessarily support this API ... */
> >  #include <mach/gpio.h>
> >  
> > +#ifdef __ARM_GPIOLIB_TRIVIAL
> > +/* Note: this may rely upon the value of ARCH_NR_GPIOS set in mach/gpio.h */
> > +#include <asm-generic/gpio.h>
> > +
> > +/* The trivial gpiolib dispatchers */
> > +#define gpio_get_value  __gpio_get_value
> > +#define gpio_set_value  __gpio_set_value
> > +#define gpio_cansleep   __gpio_cansleep
> > +#endif
> 
> could that be a selectable symbol ? Something like:
> 
> CONFIG_HAS_ARM_TRIVIAL_GPIO
> 
> then on Kconfig you just:
> 
> select HAS_ARM_TIVIAL_GPIO or something ?

That makes things more complicated, because that involves digging through
a lot of platform code in a couple of places to work out exactly when we
need this - and it crosses the boundary to arch/sh too.

So I'd prefer to keep this simple.

The long-term goal is to remove that symbol entirely, but in order to do
that we need to kill of the "optimized" on-board SoC stuff in those (few)
gpio.h which don't have the symbol selected.  This is rather necessary to
progress towards the consolidated kernel.  (Re-inventing gpiolib by moving
them out of line isn't a good idea...)



More information about the linux-arm-kernel mailing list