Re: [PATCH RFC 1/2] gpio: Add a block GPIO API to gpiolib

From: Linus Walleij
Date: Fri Sep 28 2012 - 07:34:13 EST


On Fri, Sep 28, 2012 at 11:52 AM, Roland Stigge <stigge@xxxxxxxxx> wrote:

> It's hard to do the one-value-per-file right for a several-gpios-at-once
> goal. :-)

That's true. This is one of the reasons I think GPIO chips should
be /dev/gpioN device nodes and this business be handled by
ioctl():s instead, it is harder from an ABI point of view but can
do several things at once.

> I originally had a one-value solution: A bit map, continuously
> hex coded, like in the original kernel API idea (e.g. 0x000F0A0010).
> Wasn't sure because it encodes GPIO numbers in a weird way.

Yeah, well that is not so nice either.

> Strictly formally: Isn't a comma-separated list of a GPIO block (e.g.
> "80,81,85") a singe value in a sense? :-)

I think it's called an array ...

> Or other possibilities? Maybe
> some node in /proc?

Heaven's no.

> Or some kind of new character device node?

Yes, I don't know if we should create /dev/gpioN or /dev/pinctrlN for
this, and add GPIO functions to pinctrl (while wrapping it in the
gpiolib to aid migration) the latter would encourage users of the
new ABI to switch to writing pinctrl drivers.

> Otherwise, I need to think about leaving out the sysfs for this purpose.

Do you really need it?

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/