Question about GPIO Lib

Bill Gatliff bgat at billgatliff.com
Sat Jan 28 05:42:57 EST 2012


Bruce:

On Fri, Jan 27, 2012 at 5:31 AM,  <Bruce_Leonard at selinc.com> wrote:
>
> The problem is we've got a number of other things hooked up to the GPIO
> pins that it would be very bad if someone from user space played with
> them, like our FPGA configuration pin.  Some one toggles that and our box
> goes stupid.  So what I'm wondering is if there's a way, preferably via
> the device tree, to limit the GPIOs that GPIO Lib exposes to user space?

Sounds like you DON'T want to merely export that GPIO pin to userspace.

If you have anything in kernel space doing a gpio_request() on that
pin, it won't be exportable to userspace anyway.  Regardless, you are
probably better off implement a DEVICE_ATTR that, in its store()
method, treads lightly on said pin.  And then do a gpio_request() in
kernel space so that users can't ever see the pin directly.

Just my $0.02.


b.g.
-- 
Bill Gatliff
bgat at billgatliff.com


More information about the Linuxppc-dev mailing list