lkml.org 
[lkml]   [2008]   [Apr]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [patch/rfc 2.6.25-git] gpio: sysfs interface
Date
On Tuesday 29 April 2008, Ben Nizette wrote:
>
> On Tue, 2008-04-29 at 18:04 -0700, David Brownell wrote:
> > On Tuesday 29 April 2008, Ben Nizette wrote:
> > > I guess one last option (which is made hard by chip label non-uniqueness
> > > but I'll throw out anyway) would be
> > >
> > > /sys/class/gpio
> > > /chipa
> > > /gpio-n
> > > /value
> > > /direction
> > > /control
> > > /chipb
> > > :
> > > :
> > >
> >
> > Or maybe:
> >
> > /sys/class/gpio
> > /gpiochip-X <-- range X..(X+ngpio)

Make that range X to X + ngpio - 1, of course. :)

> > /device <-- symlink, if it's known
> > /ngpio
> > /label
> > /start <-- maybe; start == X
> >
> > with the gpio-N links probably going where you showed. That'd be
> > best in terms of Purity Of Essence.
>
> So you're suggesting that the gpio-N links and control file live inside
> the gpiochip-X folder along with info about the chip to which they're
> attached? I don't mind this, sounds good. Certainly feels most
> sysfsish.

What I have working right now is like the original patch,
but with "gpiochipN" (and "gpioN") nodes. The "*-N" style
doesn't match other sysfs usage.

So the "control" and "gpioN" files aren't nesting like that.

It could be argued which feels more natural. For external
gpiochips it might feel more natural to nest the gpioN nodes.
On some SOCs, that also true of the integrated GPIOs (docs
refer to "PB29" highlighting port B bit 29). But on many
others (OMAP and PXA for starters), they're referenced in
docs by a number 0..hundreds, ignoring details like which
register bank holds the relevant control bits.

That's why I decided not to use nesting. Either choice can
seem a bit odd on some platform; this way is easier and takes
less kernel code.

- Dave


\
 
 \ /
  Last update: 2008-04-30 20:01    [W:1.071 / U:3.092 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site