lkml.org 
[lkml]   [2007]   [Feb]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] input: extend EV_LED

Extend EV_LED handling code so that it can handle not
only two states (on/off) but also others. For example
a LED can blink using hardware acceleration. The code
changed so that it is similar to the code at EV_SND.

Signed-off-by: Márton Németh <nm127@freemail.hu>

---
diff -uprN linux-2.6.20.orig/drivers/input/input.c
linux/drivers/input/input.c
--- linux-2.6.20.orig/drivers/input/input.c 2007-02-04
19:44:54.000000000 +0100
+++ linux/drivers/input/input.c 2007-02-10 15:20:28.000000000 +0100
@@ -141,10 +141,11 @@ void input_event(struct input_dev *dev,

case EV_LED:

- if (code > LED_MAX || !test_bit(code, dev->ledbit) ||
!!test_bit(code, dev->led) == value)
+ if (code > LED_MAX || !test_bit(code, dev->ledbit))
return;

- change_bit(code, dev->led);
+ if (!!test_bit(code, dev->led) != !!value)
+ change_bit(code, dev->led);

if (dev->event)
dev->event(dev, type, code, value);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2007-02-11 11:21    [from the cache]
©2003-2014 Jasper Spaans. Advertise on this site