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>
This commit is contained in:
@@ -1292,17 +1292,24 @@ static int input_dev_uevent(struct device *device, struct kobj_uevent_env *env)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define INPUT_DO_TOGGLE(dev, type, bits, on) \
|
#define INPUT_DO_TOGGLE(dev, type, bits, on) \
|
||||||
do { \
|
do { \
|
||||||
int i; \
|
int i; \
|
||||||
if (!test_bit(EV_##type, dev->evbit)) \
|
bool active; \
|
||||||
break; \
|
\
|
||||||
for (i = 0; i < type##_MAX; i++) { \
|
if (!test_bit(EV_##type, dev->evbit)) \
|
||||||
if (!test_bit(i, dev->bits##bit) || \
|
break; \
|
||||||
!test_bit(i, dev->bits)) \
|
\
|
||||||
continue; \
|
for (i = 0; i < type##_MAX; i++) { \
|
||||||
dev->event(dev, EV_##type, i, on); \
|
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)
|
} while (0)
|
||||||
|
|
||||||
#ifdef CONFIG_PM
|
#ifdef CONFIG_PM
|
||||||
|
Reference in New Issue
Block a user