title: How can I get edge events via GPIO on Linux without a busy-loop?
body: <p>I'm working an a system with embedded Linux (Kernel 2.6.31).</p>
  
  <p>It is a AT91SAM9G20 chip inside, and some of the Pins are forwarded to the outside.</p>
  
  <p>Now I want to use them as GPIO Inputs.</p>
  
  <p>I read the gpio.txt documentation about using the GPIOs via filesystem, and that works very well 'til here. I connected some switches to the gpio-pins and I can see the result in <code>/sys/class/gpio/gpioX/value</code>. But now I'd like to react on a change without busy-waiting in a loop. (i.e echo "Switch1 was pressed").</p>
  
  <p>I guess I need interrupts here, but I couldn't find out how to use them without writing my own kernel driver. I'm relatively new to Linux and C (I normally program in Java), so I'd like to handle the Interrupts via sysfs too. But my problem is, that there is no "edge"-file in my GPIO directory (I guess because this is only since Kernel version 2.6.33+). Is that right? Instead of "edge" I've got a <code>uevent</code> file in there, which is not described in <code>gpio.txt</code>.</p>
  
  <p>In the gpio.txt documentation there was a Standard Kernel Driver mentioned: "gpio_keys". Is it possible to use this for my problem?</p>
  
  <p>I guess it would be better to work with this driver than allowing a userspace program to manipulate kernel tasks.
  I found a lot of codesnippets for writing my own driver, but I wasn't even able to find out which of the 600 <code>gpio.h</code> files to include, and how to refer to the library (cross compiler couldn't find the gpio.h file).</p>
  
  <p>Sorry for newbie questions, I hope you could give me some advices.</p>
  
  <p>Thanks in advance</p>