linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* Question about GPIO Lib
@ 2012-01-27  4:31 Bruce_Leonard
  2012-01-27 18:42 ` Bill Gatliff
  0 siblings, 1 reply; 8+ messages in thread
From: Bruce_Leonard @ 2012-01-27  4:31 UTC (permalink / raw)
  To: linuxppc-dev

(This time with a subject line, sorry)

Hi,

I'm using the 3.0.3 kernel on an MPC8308 and have turned on GPIO support 
(CONFIG_GPIOLIB = Y) because the SPI sub-system needed to use it for the 
GPIO pin I'm using as a CS to a NvRAM part.  I also have some jumpers on 
the processor GPIO pins and I thought it would be really slick to use the 
built in GPIO support in the kernel rather than roll my own driver to read 

five pins.  So I've got GPIO sysfs support turned on (CONFIG_GPIO_SYSFS = 
Y) and everything shows up in /sys/class/gpio and works as advertised. 
Really nice.

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?

I tried the following in my device tree without success:

      gpio1: gpio@c00 {
         #gpio-cells = <2>;
         device_type = "gpio";
         compatible = "fsl,mpc8308-gpio", "fsl,mpc8349-gpio";
         reg = <0xc00 0x18>;
         interrupts = <74 0x8>;
         interrupt-parent = <&ipic>;
         gpio-controller;
         gpios = <&gpio1 0 0
                  &gpio1 1 0
                  &gpio1 2 0
                  &gpio1 3 0
                  &gpio1 4 0
                  &gpio1 5 0
                  &gpio1 6 0>;
      };

I also thought maybe a separate child node of the gpio1 node, but I think 
it would require a "compatible" attribute which would mean a driver to 
bind it to, and the whole point is to avoid writing a driver if someone 
else has already got something that will work.

Thanks.

Bruce

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2012-02-01 16:53 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-27  4:31 Question about GPIO Lib Bruce_Leonard
2012-01-27 18:42 ` Bill Gatliff
2012-01-31  0:06   ` Bruce_Leonard
2012-01-31 16:39     ` Bill Gatliff
2012-01-31 17:44       ` Bruce_Leonard
2012-02-01 12:32       ` Mark Brown
2012-02-01 15:56         ` Bill Gatliff
2012-02-01 16:53           ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).