diff options
Diffstat (limited to 'drivers/input/input.c')
| -rw-r--r-- | drivers/input/input.c | 29 |
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 |
