diff options
Diffstat (limited to 'drivers/input/input.c')
-rw-r--r-- | drivers/input/input.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/drivers/input/input.c b/drivers/input/input.c index 3312e20016bf..9408dba2cd31 100644 --- a/drivers/input/input.c +++ b/drivers/input/input.c | |||
@@ -1110,6 +1110,8 @@ static int input_devices_seq_show(struct seq_file *seq, void *v) | |||
1110 | seq_printf(seq, "%s ", handle->name); | 1110 | seq_printf(seq, "%s ", handle->name); |
1111 | seq_putc(seq, '\n'); | 1111 | seq_putc(seq, '\n'); |
1112 | 1112 | ||
1113 | input_seq_print_bitmap(seq, "PROP", dev->propbit, INPUT_PROP_MAX); | ||
1114 | |||
1113 | input_seq_print_bitmap(seq, "EV", dev->evbit, EV_MAX); | 1115 | input_seq_print_bitmap(seq, "EV", dev->evbit, EV_MAX); |
1114 | if (test_bit(EV_KEY, dev->evbit)) | 1116 | if (test_bit(EV_KEY, dev->evbit)) |
1115 | input_seq_print_bitmap(seq, "KEY", dev->keybit, KEY_MAX); | 1117 | input_seq_print_bitmap(seq, "KEY", dev->keybit, KEY_MAX); |
@@ -1333,11 +1335,26 @@ static ssize_t input_dev_show_modalias(struct device *dev, | |||
1333 | } | 1335 | } |
1334 | static DEVICE_ATTR(modalias, S_IRUGO, input_dev_show_modalias, NULL); | 1336 | static DEVICE_ATTR(modalias, S_IRUGO, input_dev_show_modalias, NULL); |
1335 | 1337 | ||
1338 | static int input_print_bitmap(char *buf, int buf_size, unsigned long *bitmap, | ||
1339 | int max, int add_cr); | ||
1340 | |||
1341 | static ssize_t input_dev_show_properties(struct device *dev, | ||
1342 | struct device_attribute *attr, | ||
1343 | char *buf) | ||
1344 | { | ||
1345 | struct input_dev *input_dev = to_input_dev(dev); | ||
1346 | int len = input_print_bitmap(buf, PAGE_SIZE, input_dev->propbit, | ||
1347 | INPUT_PROP_MAX, true); | ||
1348 | return min_t(int, len, PAGE_SIZE); | ||
1349 | } | ||
1350 | static DEVICE_ATTR(properties, S_IRUGO, input_dev_show_properties, NULL); | ||
1351 | |||
1336 | static struct attribute *input_dev_attrs[] = { | 1352 | static struct attribute *input_dev_attrs[] = { |
1337 | &dev_attr_name.attr, | 1353 | &dev_attr_name.attr, |
1338 | &dev_attr_phys.attr, | 1354 | &dev_attr_phys.attr, |
1339 | &dev_attr_uniq.attr, | 1355 | &dev_attr_uniq.attr, |
1340 | &dev_attr_modalias.attr, | 1356 | &dev_attr_modalias.attr, |
1357 | &dev_attr_properties.attr, | ||
1341 | NULL | 1358 | NULL |
1342 | }; | 1359 | }; |
1343 | 1360 | ||
@@ -1471,7 +1488,7 @@ static int input_add_uevent_bm_var(struct kobj_uevent_env *env, | |||
1471 | { | 1488 | { |
1472 | int len; | 1489 | int len; |
1473 | 1490 | ||
1474 | if (add_uevent_var(env, "%s=", name)) | 1491 | if (add_uevent_var(env, "%s", name)) |
1475 | return -ENOMEM; | 1492 | return -ENOMEM; |
1476 | 1493 | ||
1477 | len = input_print_bitmap(&env->buf[env->buflen - 1], | 1494 | len = input_print_bitmap(&env->buf[env->buflen - 1], |
@@ -1537,6 +1554,8 @@ static int input_dev_uevent(struct device *device, struct kobj_uevent_env *env) | |||
1537 | if (dev->uniq) | 1554 | if (dev->uniq) |
1538 | INPUT_ADD_HOTPLUG_VAR("UNIQ=\"%s\"", dev->uniq); | 1555 | INPUT_ADD_HOTPLUG_VAR("UNIQ=\"%s\"", dev->uniq); |
1539 | 1556 | ||
1557 | INPUT_ADD_HOTPLUG_BM_VAR("PROP=", dev->propbit, INPUT_PROP_MAX); | ||
1558 | |||
1540 | INPUT_ADD_HOTPLUG_BM_VAR("EV=", dev->evbit, EV_MAX); | 1559 | INPUT_ADD_HOTPLUG_BM_VAR("EV=", dev->evbit, EV_MAX); |
1541 | if (test_bit(EV_KEY, dev->evbit)) | 1560 | if (test_bit(EV_KEY, dev->evbit)) |
1542 | INPUT_ADD_HOTPLUG_BM_VAR("KEY=", dev->keybit, KEY_MAX); | 1561 | INPUT_ADD_HOTPLUG_BM_VAR("KEY=", dev->keybit, KEY_MAX); |