Re: [RFC] Proposal: common kernel-wide GPIO interface

From: Juergen Beisert
Date: Tue Aug 01 2006 - 03:37:10 EST

Hi Chris,

some ideas:

On Monday 31 July 2006 23:23, Chris Boot wrote:
> Yes I was thinking that a GPIO is a resource a little like an IRQ and
> thinking of a registration and ownership system as well. I'm glad somebody
> came up with that suggestion!
> The access API is, as you say, more difficult. The access methods for slow
> GPIOs is indeed very simple but I can't think of any way to provide
> (near-)direct access for faster accesses in a portable way. Does anyone
> have any suggestions?

Maybe three kind of API. One for fastest access: The driver request the GPIO
itself from the GPIO management and has to share some kind of locking
mechanism with the other API to avoid conflicts when accessing the registers
to manipulate this GPIO. This could be the way an I2C driver works to be as
fast as possible. Buts its achitecture specific.
The second API is slower and supports some functions to manipulate the GPIOs
at higer lever. This API would be architrecture independend but for use in
the kernel only.
The third API I like to have is for some slow GPIO. They should be accessible
from user space in an easy way. For example through some entries in sysfs the
user can access with simple "cat" and "echo" commands.
Alltogether share the GPIO management and the locking mechanism.


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at