[PATCH 2/9] collie: prepare for gpiolib use

Russell King - ARM Linux linux at arm.linux.org.uk
Wed Oct 7 09:10:03 EDT 2009


On Wed, Oct 07, 2009 at 04:42:52PM +0400, Dmitry Artamonow wrote:
> Perhaps I wasn't exactly clear in explaining my thoughts. Sorry.
> I meant following - currently in mach/h3600_gpio.h we have gpios declared
> like that:
> #define GPIO_H3100_IR_ON                GPIO_GPIO (8)
> which effectively means:
> #define GPIO_H3100_IR_ON                (1 << 8)
> i.e. bit-shifted value. 
> 
> But gpiolibs needs numeric gpio definitions, something like that:
> #define NGPIO_H3100_IR_ON		8
> 
> That's all well, but not all direct operations with GPIO registers on
> SA1100 can be converted to gpiolib.

I tinkered around with this yesterday before your message came through,
and I defined a new set of definitions, eg:

#define H3100_GPIO_IR_ON	8

so avoiding the problem.  See my 'sa1100' branch published in the usual
places.

> Operations with GAFR (GPIO alternate function register), for example
> (PXA have MFD API for that, but StrongArm doesn't)

Maybe long-term replicating something like the MFP API would be a good
idea, rather than sticking with direct manipulation of the GAFR (which
is racy if done from two different contexts).

Currently, it's hard to audit that all GAFR manipulations are done in
a safe way.



More information about the linux-arm-kernel mailing list