Messages in this thread | | | Date | Fri, 2 May 2008 22:36:38 +0200 | From | Pavel Machek <> | Subject | Re: [patch/rfc 2.6.25-git] gpio: sysfs interface |
| |
Hi!
> > Simple sysfs interface for GPIOs. > > > > /sys/class/gpio > > /gpio-N ... for each exported GPIO #N > > /value ... always readable, writes fail except for output GPIOs > > /direction ... writable as: in, out (default low), high, low > > /control ... to request a GPIO be exported or unexported > > > > GPIOs may be exported by kernel code using gpio_export(), which should > > be most useful for driver debugging. Userspace may also ask that they > > be exported by writing to the sysfs control file, helping to cope with > > incomplete board support: > > > > echo "export 23" > /sys/class/gpio/control > > ... will gpio_request(23, "sysfs") and gpio_export(23); use > > /sys/class/gpio/gpio-23/direction to configure it. > > echo "unexport 23" > /sys/class/gpio/control > > ... will gpio_free(23) > > hm, does ths sysfs one-value-per-file rule apply to writes?
Having seen ibm acpi interface... yes, that rule should be aplied for writes, too.
What about mkdir gpio-N to export it?
-- (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
| |