[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <200805011440.18347.david-b@pacbell.net>
Date: Thu, 1 May 2008 14:40:17 -0700
From: David Brownell <david-b@...bell.net>
To: Ben Nizette <bn@...sdigital.com>
Cc: lkml <linux-kernel@...r.kernel.org>,
Trent Piepho <tpiepho@...escale.com>,
hartleys <hartleys@...ionengravers.com>,
Mike Frysinger <vapier.adi@...il.com>,
Bryan Wu <cooloney@...nel.org>
Subject: Re: [patch/rfc 2.6.25-git v2] gpio: sysfs interface
On Wednesday 30 April 2008, Ben Nizette wrote:
>
> On Wed, 2008-04-30 at 14:34 -0700, David Brownell wrote:
> > Simple sysfs interface for GPIOs.
> >
> > /sys/class/gpio
> > /control ... to request a GPIO be imported or returned
> > /gpioN ... for each exported GPIO #N
> > /value ... always readable, writes fail for input GPIOs
> > /direction ... r/w as: in, out (default low); write high, low
> > /gpiochipN ... for each gpiochip; #N is its first GPIO
> > /base ... (r/o) same as N
> > /label ... (r/o) descriptive, not necessarily unique
> > /ngpio ... (r/o) number of GPIOs; numbered N .. N+(ngpio - 1)
>
> You dropped the 'device' symlink? Sure it won't always be available but
> I did quite like the idea of being able to walk back through sysfs and
> discover, for example, the SPI chip select to which it's attached.
Just didn't describe it in that summary ... like several other
standard attributes, like "uevent" and "subsystem". The only
thing different about "device" is that when the gpio_chip doesn't
say what device it uses, that will (necessarily) be missing.
And again, that's just like all other class device nodes.
> > +/*
> > + * /sys/class/gpio/control ... write-only
> > + * integer N: non-negative == export; negative == unexport
> > + */
> > +static ssize_t control_store(struct class *class, const char *buf, size_t len)
>
> Unexport gpio 0?
Yeah, gotta fix that. Unfortunately "-0" == "0" ... I'll have to
handle any leading "-" by hand. Trivial fix, in all.
- Dave
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists