diff options
Diffstat (limited to 'drivers/input/input.c')
-rw-r--r-- | drivers/input/input.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/input/input.c b/drivers/input/input.c index 37708d1d86ec..9ea713f4192b 100644 --- a/drivers/input/input.c +++ b/drivers/input/input.c | |||
@@ -1095,6 +1095,8 @@ static int input_devices_seq_show(struct seq_file *seq, void *v) | |||
1095 | seq_printf(seq, "%s ", handle->name); | 1095 | seq_printf(seq, "%s ", handle->name); |
1096 | seq_putc(seq, '\n'); | 1096 | seq_putc(seq, '\n'); |
1097 | 1097 | ||
1098 | input_seq_print_bitmap(seq, "PROP", dev->propbit, INPUT_PROP_MAX); | ||
1099 | |||
1098 | input_seq_print_bitmap(seq, "EV", dev->evbit, EV_MAX); | 1100 | input_seq_print_bitmap(seq, "EV", dev->evbit, EV_MAX); |
1099 | if (test_bit(EV_KEY, dev->evbit)) | 1101 | if (test_bit(EV_KEY, dev->evbit)) |
1100 | input_seq_print_bitmap(seq, "KEY", dev->keybit, KEY_MAX); | 1102 | input_seq_print_bitmap(seq, "KEY", dev->keybit, KEY_MAX); |
@@ -1318,11 +1320,26 @@ static ssize_t input_dev_show_modalias(struct device *dev, | |||
1318 | } | 1320 | } |
1319 | static DEVICE_ATTR(modalias, S_IRUGO, input_dev_show_modalias, NULL); | 1321 | static DEVICE_ATTR(modalias, S_IRUGO, input_dev_show_modalias, NULL); |
1320 | 1322 | ||
1323 | static int input_print_bitmap(char *buf, int buf_size, unsigned long *bitmap, | ||
1324 | int max, int add_cr); | ||
1325 | |||
1326 | static ssize_t input_dev_show_properties(struct device *dev, | ||
1327 | struct device_attribute *attr, | ||
1328 | char *buf) | ||
1329 | { | ||
1330 | struct input_dev *input_dev = to_input_dev(dev); | ||
1331 | int len = input_print_bitmap(buf, PAGE_SIZE, input_dev->propbit, | ||
1332 | INPUT_PROP_MAX, true); | ||
1333 | return min_t(int, len, PAGE_SIZE); | ||
1334 | } | ||
1335 | static DEVICE_ATTR(properties, S_IRUGO, input_dev_show_properties, NULL); | ||
1336 | |||
1321 | static struct attribute *input_dev_attrs[] = { | 1337 | static struct attribute *input_dev_attrs[] = { |
1322 | &dev_attr_name.attr, | 1338 | &dev_attr_name.attr, |
1323 | &dev_attr_phys.attr, | 1339 | &dev_attr_phys.attr, |
1324 | &dev_attr_uniq.attr, | 1340 | &dev_attr_uniq.attr, |
1325 | &dev_attr_modalias.attr, | 1341 | &dev_attr_modalias.attr, |
1342 | &dev_attr_properties.attr, | ||
1326 | NULL | 1343 | NULL |
1327 | }; | 1344 | }; |
1328 | 1345 | ||
@@ -1522,6 +1539,8 @@ static int input_dev_uevent(struct device *device, struct kobj_uevent_env *env) | |||
1522 | if (dev->uniq) | 1539 | if (dev->uniq) |
1523 | INPUT_ADD_HOTPLUG_VAR("UNIQ=\"%s\"", dev->uniq); | 1540 | INPUT_ADD_HOTPLUG_VAR("UNIQ=\"%s\"", dev->uniq); |
1524 | 1541 | ||
1542 | INPUT_ADD_HOTPLUG_BM_VAR("PROP=", dev->propbit, INPUT_PROP_MAX); | ||
1543 | |||
1525 | INPUT_ADD_HOTPLUG_BM_VAR("EV=", dev->evbit, EV_MAX); | 1544 | INPUT_ADD_HOTPLUG_BM_VAR("EV=", dev->evbit, EV_MAX); |
1526 | if (test_bit(EV_KEY, dev->evbit)) | 1545 | if (test_bit(EV_KEY, dev->evbit)) |
1527 | INPUT_ADD_HOTPLUG_BM_VAR("KEY=", dev->keybit, KEY_MAX); | 1546 | INPUT_ADD_HOTPLUG_BM_VAR("KEY=", dev->keybit, KEY_MAX); |