Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3cc96351 authored by Dmitry Torokhov's avatar Dmitry Torokhov
Browse files

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: default avatarMikko Vinni <mmvinni@yahoo.com>
Signed-off-by: default avatarDmitry Torokhov <dtor@mail.ru>
parent bf3204cb
Loading
Loading
Loading
Loading
+18 −11
Original line number Diff line number Diff line
@@ -1295,13 +1295,20 @@ static int input_dev_uevent(struct device *device, struct kobj_uevent_env *env)
#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) ||	\
			    !test_bit(i, dev->bits))		\
			if (!test_bit(i, dev->bits##bit))		\
				continue;				\
			dev->event(dev, EV_##type, i, on);	\
									\
			active = test_bit(i, dev->bits);		\
			if (!active && !on)				\
				continue;				\
									\
			dev->event(dev, EV_##type, i, on ? active : 0);	\
		}							\
	} while (0)