Re: [PATCH v2] gpiolib: allow poll(2) on gpio value

From: Jani Nikula
Date: Thu Jul 02 2009 - 07:15:40 EST


On Thu, Jul 2, 2009 at 2:05 AM, David Brownell<david-b@xxxxxxxxxxx> wrote:
> On Wednesday 10 June 2009, Daniel GlÃckner wrote:
>> Many gpio chips allow to generate interrupts when the value of a pin
>> changes. This patch gives usermode application the opportunity to make
>> use of this feature by calling poll(2) on the /sys/class/gpio/gpioN/value
>> sysfs file. The edge to trigger can be set in the edge file in the same
>> directory. Possible values are "none", "rising", "falling", and "both".
>
> Looks pretty clean. ÂComments from anyone else?

I'd appreciate a kernel side interface to gpio_setup_irq functionality
as well; now gpio_export from kernel won't setup support for poll(2)
nor is there any possibility to do so. Having said that, it can be
done in another patch, another day, I don't want that to be holding
this patch back.

And I guess it might also be argued that anyone wanting to poll(2) can
setup edge triggering from user space when needed. Other thoughts on
that?


BR,
Jani.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/