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

Sergei Shtylyov sshtylyov at ru.mvista.com
Wed Oct 7 08:10:32 EDT 2009


Hello.

Lothar Waßmann wrote:

>>>>prefix gpio definitions for direct register access with '_' so we
>>>>can use the other names for gpio_request & co

>>>Familiar problem - numeric vs bit-shifted gpio defines.
>>>I'm facing it here too while converting h3[16]00 to gpiolib,
>>>and I'm thinking about dropping bit-shifted defines completely
>>>and using GPIO_GPIO(SOME_NUMERIC_GPIO) instead.

>>What we did with PXA was to decide not to use definitions for the built-in
>>GPIOs - what's the point of:

>>#define GPIO0	0
>>#define GPIO1	1
>>#define GPIO2	2
>>...

> A point could be that 'grep GPIO0 ...' would find any usage of that
> GPIO in the kernel source while 'grep 0 ...' would be quite
> pointless.

    That's why some people have GPIO(n) macro. :-)

#define GPIO(n)	(n)

> Lothar Waßmann

WBR, Sergei



More information about the linux-arm-kernel mailing list