[PATCH] input: extend EV_LED

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




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 <[email protected]>

---
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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux