Re: best way to handle LEDs

From: Rich Walker
Date: Thu Nov 03 2005 - 10:17:00 EST


Russell King <rmk+lkml@xxxxxxxxxxxxxxxx> writes:

>
> I also have issues with a generic GPIO layer. As I mentioned in the
> past, there's serious locking issues with any generic abstraction of
> GPIOs.
>
> 1. You want to be able to change GPIO state from interrupts. This
> implies you can not sleep in GPIO state changing functions.
>
> 2. Some GPIOs are implemented on I2C devices. This means that to
> change state, you must sleep.
>
> (1) and (2) are incompatible requirements, so you can not offer a
> generic interface for these GPIOs which has a consistent behaviour -
> where users of the interface know whether the function may sleep or
> may be used from interrupt context.
>

So you have a request_gpio API, where you specify usage characteristics
and get back a handle?

cheers, Rich.

--
rich walker | Shadow Robot Company | rw@xxxxxxxxxxxxx
technical director 251 Liverpool Road |
need a Hand? London N1 1LX | +UK 20 7700 2487
www.shadow.org.uk/products/newhand.shtml

-
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/