Re: [patch/rfc 2.6.25-git] gpio: sysfs interface

From: Ben Nizette
Date: Mon Apr 28 2008 - 20:48:14 EST



On Mon, 2008-04-28 at 16:09 -0700, Trent Piepho wrote:
> On Mon, 28 Apr 2008, David Brownell wrote:
> > Simple sysfs interface for GPIOs.
> >
> > /sys/class/gpio
> > /gpio-N ... for each exported GPIO #N
>
> I liked it better they way I had it, "label:N".
>
> When you have multiple GPIO sources, it's a lot easier to see where they are
> comming from if they use the chip label. Especially if support for dynamic
> allocation of gpio numbers is written.
>
>
> > /value ... always readable, writes fail except for output GPIOs
> > /direction ... writable as: in, out (default low), high, low
>
> You took away the code for the label field? That was one of the features of
> my code that Ben Nizette mentioned as an advantage over a char-device
> interface.

If all gpios are exported read only by default then keeping the label
either in the folder naming or as a file is certainly useful to identify
what you actually want to talk to. If you're debugging a driver or
you've already manually exported a gpio then I'd assume you already know
pretty much all you need to know about that pin.

--Ben.

--
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/