leds: add support to leds with readable status
commitabd7a12d3967d15fe14f8822d2092cc36a3fbf67
authorHenrique de Moraes Holschuh <hmh@hmh.eng.br>
Mon, 17 Mar 2008 07:30:20 +0000 (17 04:30 -0300)
committerHenrique de Moraes Holschuh <hmh@hmh.eng.br>
Fri, 21 Mar 2008 23:47:43 +0000 (21 20:47 -0300)
treeee8b8fa0af7bf30296d901d5b799edf17b251bf3
parent49b6a0946c2a25774190c27d9656b752f54ba90b
leds: add support to leds with readable status

Some led hardware allows drivers to query the led state, and this patch
adds a hook to let the led class take advantage of that information when
available.

Without this functionality, when access to the led hardware is not
exclusive (i.e. firmware or hardware might change its state behind the
kernel's back), reality goes out of sync with the led class' idea of what
the led is doing, which is annoying at best.

Behaviour for drivers that do not or cannot read the led status is
unchanged.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Cc: Richard Purdie <rpurdie@rpsys.net>
drivers/leds/led-class.c
include/linux/leds.h