login
Header Space

 
 

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

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: David Brownell <david-b@...>
Cc: Ben Nizette <bn@...>, lkml <linux-kernel@...>, hartleys <hartleys@...>, Mike Frysinger <vapier.adi@...>, Bryan Wu <cooloney@...>, Andrew Morton <akpm@...>
Date: Tuesday, April 29, 2008 - 2:17 am

On Mon, 28 Apr 2008, David Brownell wrote:

If you want use cases, how about mine?  I didn't write the code originally for
fun, I wrote it for a real product.

We have a flash chip with a hardware write protected boot block controlled by
a gpio.  If we want to flash this block, we need a way to change the gpio. 
patching the mtd driver to do this automatically would require maintaining an
out-of-tree patch, I like to avoid those.  We'd also rather mtd didn't
automatically un-write-protect the boot block; kinda defeats the purpose.

The device may have a daughtercard installed in it.  There is a gpio used as a
presence detect.  We want to be able, from userspace (any maybe kernel too),
to print out "card installed" or "no card installed".  There is also certain
stuff that should run if the card is present when the machine boots.

We have some PCA9557 I2C gpio expanders that encode a device version number. 
We want to print this number out in userspace (e.g.  show it in the web
interface, various other application specific interfaces, etc.).  Maybe the
kernel will need to know too, we'll see what happens when there is a version
two.  The daughter card also has a PCA9557 expander, but of course it might
not be connected, the pca9557 driver can probe the bus for this.


Suppose I want line 5 from the mpuio gpios?  I'd make it so this was: 
/sys/class/gpio/mpuio:5

How would you get the sysfs location, with an automatic shell script running
on a lightweight embedded system (no perl!)?


Why not have an irq file for that?
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[patch/rfc 2.6.25-git] gpio: sysfs interface, David Brownell, (Mon Apr 28, 3:39 pm)
Re: [patch/rfc 2.6.25-git] gpio: sysfs interface, Trent Piepho, (Mon Apr 28, 7:09 pm)
Re: [patch/rfc 2.6.25-git] gpio: sysfs interface, Ben Nizette, (Mon Apr 28, 8:47 pm)
Re: [patch/rfc 2.6.25-git] gpio: sysfs interface, David Brownell, (Mon Apr 28, 8:45 pm)
Re: [patch/rfc 2.6.25-git] gpio: sysfs interface, Trent Piepho, (Tue Apr 29, 1:48 am)
Re: [patch/rfc 2.6.25-git] gpio: sysfs interface, Ben Nizette, (Tue Apr 29, 8:35 am)
Re: [patch/rfc 2.6.25-git] gpio: sysfs interface, David Brownell, (Tue Apr 29, 5:55 pm)
Re: [patch/rfc 2.6.25-git] gpio: sysfs interface, Ben Nizette, (Tue Apr 29, 7:29 pm)
Re: [patch/rfc 2.6.25-git] gpio: sysfs interface, David Brownell, (Tue Apr 29, 9:04 pm)
Re: [patch/rfc 2.6.25-git] gpio: sysfs interface, Ben Nizette, (Tue Apr 29, 10:08 pm)
Re: [patch/rfc 2.6.25-git] gpio: sysfs interface, David Brownell, (Wed Apr 30, 1:42 pm)
[patch/rfc 2.6.25-git v2] gpio: sysfs interface, David Brownell, (Wed Apr 30, 5:34 pm)
Re: [patch/rfc 2.6.25-git v2] gpio: sysfs interface, Ben Nizette, (Wed Apr 30, 7:28 pm)
Re: [patch/rfc 2.6.25-git v2] gpio: sysfs interface, David Brownell, (Thu May 1, 5:40 pm)
Re: [patch/rfc 2.6.25-git v2] gpio: sysfs interface, Trent Piepho, (Wed Apr 30, 6:47 pm)
Re: [patch/rfc 2.6.25-git v2] gpio: sysfs interface, David Brownell, (Wed Apr 30, 10:08 pm)
Re: [patch/rfc 2.6.25-git v2] gpio: sysfs interface, Trent Piepho, (Wed Apr 30, 11:41 pm)
Re: [patch/rfc 2.6.25-git v2] gpio: sysfs interface, David Brownell, (Thu May 1, 12:35 am)
Re: [patch/rfc 2.6.25-git v2] gpio: sysfs interface, Trent Piepho, (Thu May 1, 5:16 pm)
Re: [patch/rfc 2.6.25-git v2] gpio: sysfs interface, David Brownell, (Fri May 2, 10:58 pm)
Re: [patch/rfc 2.6.25-git v2] gpio: sysfs interface, David Brownell, (Fri May 2, 11:05 pm)
Re: [patch/rfc 2.6.25-git v2] gpio: sysfs interface, Ben Nizette, (Wed Apr 30, 7:14 pm)
Re: [patch/rfc 2.6.25-git v2] gpio: sysfs interface, David Brownell, (Wed Apr 30, 10:12 pm)
Re: [patch/rfc 2.6.25-git] gpio: sysfs interface, Trent Piepho, (Tue Apr 29, 11:13 pm)
Re: [patch/rfc 2.6.25-git] gpio: sysfs interface, Ben Nizette, (Wed Apr 30, 6:33 am)
Re: [patch/rfc 2.6.25-git] gpio: sysfs interface, Trent Piepho, (Tue Apr 29, 2:15 pm)
Re: [patch/rfc 2.6.25-git] gpio: sysfs interface, David Brownell, (Tue Apr 29, 5:56 pm)
Re: [patch/rfc 2.6.25-git] gpio: sysfs interface, Trent Piepho, (Tue Apr 29, 8:49 pm)
Re: [patch/rfc 2.6.25-git] gpio: sysfs interface, David Brownell, (Wed Apr 30, 1:49 pm)
Re: [patch/rfc 2.6.25-git] gpio: sysfs interface, Ben Nizette, (Mon Apr 28, 7:01 pm)
Re: [patch/rfc 2.6.25-git] gpio: sysfs interface, David Brownell, (Mon Apr 28, 8:44 pm)
Re: [patch/rfc 2.6.25-git] gpio: sysfs interface, Ben Nizette, (Mon Apr 28, 9:58 pm)
Re: [patch/rfc 2.6.25-git] gpio: sysfs interface, David Brownell, (Mon Apr 28, 11:44 pm)
Re: [patch/rfc 2.6.25-git] gpio: sysfs interface, Trent Piepho, (Tue Apr 29, 2:17 am)
Re: [patch/rfc 2.6.25-git] gpio: sysfs interface, David Brownell, (Tue Apr 29, 6:39 pm)
Re: [patch/rfc 2.6.25-git] gpio: sysfs interface, Ben Nizette, (Tue Apr 29, 12:47 am)
Re: [patch/rfc 2.6.25-git] gpio: sysfs interface, David Brownell, (Tue Apr 29, 5:28 pm)
Re: [patch/rfc 2.6.25-git] gpio: sysfs interface, Andrew Morton, (Mon Apr 28, 4:46 pm)
Re: [patch/rfc 2.6.25-git] gpio: sysfs interface, Pavel Machek, (Fri May 2, 4:36 pm)
Re: [patch/rfc 2.6.25-git] gpio: sysfs interface, David Brownell, (Sat May 17, 6:14 pm)
Re: [patch/rfc 2.6.25-git] gpio: sysfs interface, Pavel Machek, (Mon May 19, 6:39 pm)
Re: [patch/rfc 2.6.25-git] gpio: sysfs interface, David Brownell, (Mon May 19, 9:26 pm)
Re: [patch/rfc 2.6.25-git] gpio: sysfs interface, Pavel Machek, (Tue May 20, 4:02 am)
Re: [patch/rfc 2.6.25-git] gpio: sysfs interface, Ben Nizette, (Sun May 18, 12:55 am)
[patch 2.6.26-rc2-git] gpio: sysfs interface, David Brownell, (Sat May 17, 8:36 pm)
Re: [patch 2.6.26-rc2-git] gpio: sysfs interface, Andrew Morton, (Tue May 20, 3:17 am)
Re: [patch/rfc 2.6.25-git] gpio: sysfs interface, David Brownell, (Mon Apr 28, 7:28 pm)
Re: [patch/rfc 2.6.25-git] gpio: sysfs interface, Andrew Morton, (Mon Apr 28, 10:54 pm)
Re: [patch/rfc 2.6.25-git] gpio: sysfs interface, Greg KH, (Mon Apr 28, 11:42 pm)
Re: [patch/rfc 2.6.25-git] gpio: sysfs interface, David Brownell, (Tue Apr 29, 2:45 pm)
Re: [patch/rfc 2.6.25-git] gpio: sysfs interface, Andrew Morton, (Tue Apr 29, 3:09 pm)
speck-geostationary