summaryrefslogtreecommitdiff
path: root/drivers/input/input.c
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2009-11-12 23:19:05 -0800
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2009-11-12 23:20:35 -0800
commit3cc96351799d3d82c3809aa6970ef537bc1af553 (patch)
treeec2f833bfa9d112025b53e5d66b8ac95dec3d64d /drivers/input/input.c
parentbf3204cbff7d2606e758afb0994e8da6ae1c6c26 (diff)
downloadlinux-3.10-3cc96351799d3d82c3809aa6970ef537bc1af553.tar.gz
linux-3.10-3cc96351799d3d82c3809aa6970ef537bc1af553.tar.bz2
linux-3.10-3cc96351799d3d82c3809aa6970ef537bc1af553.zip
Input: force LED reset on resume
We should be sending EV_LED event down to drivers upon resume even in cases when in-kernel state of the LED is off since device could come up with some leds turned on. Reported-and-tested-by: Mikko Vinni <mmvinni@yahoo.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input/input.c')
-rw-r--r--drivers/input/input.c29
1 files changed, 18 insertions, 11 deletions
diff --git a/drivers/input/input.c b/drivers/input/input.c
index cc763c96fad..2266ecbfbc0 100644
--- a/drivers/input/input.c
+++ b/drivers/input/input.c
@@ -1292,17 +1292,24 @@ static int input_dev_uevent(struct device *device, struct kobj_uevent_env *env)
return 0;
}
-#define INPUT_DO_TOGGLE(dev, type, bits, on) \
- do { \
- int i; \
- if (!test_bit(EV_##type, dev->evbit)) \
- break; \
- for (i = 0; i < type##_MAX; i++) { \
- if (!test_bit(i, dev->bits##bit) || \
- !test_bit(i, dev->bits)) \
- continue; \
- dev->event(dev, EV_##type, i, on); \
- } \
+#define INPUT_DO_TOGGLE(dev, type, bits, on) \
+ do { \
+ int i; \
+ bool active; \
+ \
+ if (!test_bit(EV_##type, dev->evbit)) \
+ break; \
+ \
+ for (i = 0; i < type##_MAX; i++) { \
+ if (!test_bit(i, dev->bits##bit)) \
+ continue; \
+ \
+ active = test_bit(i, dev->bits); \
+ if (!active && !on) \
+ continue; \
+ \
+ dev->event(dev, EV_##type, i, on ? active : 0); \
+ } \
} while (0)
#ifdef CONFIG_PM