aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/input.c
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2009-11-13 02:19:05 -0500
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2009-11-13 02:20:35 -0500
commit3cc96351799d3d82c3809aa6970ef537bc1af553 (patch)
treeec2f833bfa9d112025b53e5d66b8ac95dec3d64d /drivers/input/input.c
parentbf3204cbff7d2606e758afb0994e8da6ae1c6c26 (diff)
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 cc763c96fada..2266ecbfbc01 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)
1292 return 0; 1292 return 0;
1293} 1293}
1294 1294
1295#define INPUT_DO_TOGGLE(dev, type, bits, on) \ 1295#define INPUT_DO_TOGGLE(dev, type, bits, on) \
1296 do { \ 1296 do { \
1297 int i; \ 1297 int i; \
1298 if (!test_bit(EV_##type, dev->evbit)) \ 1298 bool active; \
1299 break; \ 1299 \
1300 for (i = 0; i < type##_MAX; i++) { \ 1300 if (!test_bit(EV_##type, dev->evbit)) \
1301 if (!test_bit(i, dev->bits##bit) || \ 1301 break; \
1302 !test_bit(i, dev->bits)) \ 1302 \
1303 continue; \ 1303 for (i = 0; i < type##_MAX; i++) { \
1304 dev->event(dev, EV_##type, i, on); \ 1304 if (!test_bit(i, dev->bits##bit)) \
1305 } \ 1305 continue; \
1306 \
1307 active = test_bit(i, dev->bits); \
1308 if (!active && !on) \
1309 continue; \
1310 \
1311 dev->event(dev, EV_##type, i, on ? active : 0); \
1312 } \
1306 } while (0) 1313 } while (0)
1307 1314
1308#ifdef CONFIG_PM 1315#ifdef CONFIG_PM