diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2013-10-08 11:43:00 -0400 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2013-10-08 11:43:00 -0400 |
commit | e3c55d406bd8df1a878546002c93db90c42be10c (patch) | |
tree | efb0ba2707c95fd7166cf1b76887c43c977e37dd /drivers/input | |
parent | 4d6e482675f13e33599fc3d18fc723959be0a9b6 (diff) | |
parent | d0e639c9e06d44e713170031fe05fb60ebe680af (diff) |
Merge tag 'v3.12-rc4' into next
Merge with mainline to bring in changes to input subsystem that were
committed through other trees.
Diffstat (limited to 'drivers/input')
-rw-r--r-- | drivers/input/evdev.c | 37 | ||||
-rw-r--r-- | drivers/input/gameport/gameport.c | 12 | ||||
-rw-r--r-- | drivers/input/keyboard/Kconfig | 4 | ||||
-rw-r--r-- | drivers/input/mouse/bcm5974.c | 6 | ||||
-rw-r--r-- | drivers/input/serio/Kconfig | 1 | ||||
-rw-r--r-- | drivers/input/serio/altera_ps2.c | 1 | ||||
-rw-r--r-- | drivers/input/serio/serio.c | 21 | ||||
-rw-r--r-- | drivers/input/touchscreen/Kconfig | 4 |
8 files changed, 57 insertions, 29 deletions
diff --git a/drivers/input/evdev.c b/drivers/input/evdev.c index d2b34fbbc42e..b6ded17b3be3 100644 --- a/drivers/input/evdev.c +++ b/drivers/input/evdev.c | |||
@@ -48,6 +48,7 @@ struct evdev_client { | |||
48 | struct evdev *evdev; | 48 | struct evdev *evdev; |
49 | struct list_head node; | 49 | struct list_head node; |
50 | int clkid; | 50 | int clkid; |
51 | bool revoked; | ||
51 | unsigned int bufsize; | 52 | unsigned int bufsize; |
52 | struct input_event buffer[]; | 53 | struct input_event buffer[]; |
53 | }; | 54 | }; |
@@ -164,6 +165,9 @@ static void evdev_pass_values(struct evdev_client *client, | |||
164 | struct input_event event; | 165 | struct input_event event; |
165 | bool wakeup = false; | 166 | bool wakeup = false; |
166 | 167 | ||
168 | if (client->revoked) | ||
169 | return; | ||
170 | |||
167 | event.time = ktime_to_timeval(client->clkid == CLOCK_MONOTONIC ? | 171 | event.time = ktime_to_timeval(client->clkid == CLOCK_MONOTONIC ? |
168 | mono : real); | 172 | mono : real); |
169 | 173 | ||
@@ -240,7 +244,7 @@ static int evdev_flush(struct file *file, fl_owner_t id) | |||
240 | if (retval) | 244 | if (retval) |
241 | return retval; | 245 | return retval; |
242 | 246 | ||
243 | if (!evdev->exist) | 247 | if (!evdev->exist || client->revoked) |
244 | retval = -ENODEV; | 248 | retval = -ENODEV; |
245 | else | 249 | else |
246 | retval = input_flush_device(&evdev->handle, file); | 250 | retval = input_flush_device(&evdev->handle, file); |
@@ -429,7 +433,7 @@ static ssize_t evdev_write(struct file *file, const char __user *buffer, | |||
429 | if (retval) | 433 | if (retval) |
430 | return retval; | 434 | return retval; |
431 | 435 | ||
432 | if (!evdev->exist) { | 436 | if (!evdev->exist || client->revoked) { |
433 | retval = -ENODEV; | 437 | retval = -ENODEV; |
434 | goto out; | 438 | goto out; |
435 | } | 439 | } |
@@ -482,7 +486,7 @@ static ssize_t evdev_read(struct file *file, char __user *buffer, | |||
482 | return -EINVAL; | 486 | return -EINVAL; |
483 | 487 | ||
484 | for (;;) { | 488 | for (;;) { |
485 | if (!evdev->exist) | 489 | if (!evdev->exist || client->revoked) |
486 | return -ENODEV; | 490 | return -ENODEV; |
487 | 491 | ||
488 | if (client->packet_head == client->tail && | 492 | if (client->packet_head == client->tail && |
@@ -511,7 +515,7 @@ static ssize_t evdev_read(struct file *file, char __user *buffer, | |||
511 | if (!(file->f_flags & O_NONBLOCK)) { | 515 | if (!(file->f_flags & O_NONBLOCK)) { |
512 | error = wait_event_interruptible(evdev->wait, | 516 | error = wait_event_interruptible(evdev->wait, |
513 | client->packet_head != client->tail || | 517 | client->packet_head != client->tail || |
514 | !evdev->exist); | 518 | !evdev->exist || client->revoked); |
515 | if (error) | 519 | if (error) |
516 | return error; | 520 | return error; |
517 | } | 521 | } |
@@ -529,7 +533,11 @@ static unsigned int evdev_poll(struct file *file, poll_table *wait) | |||
529 | 533 | ||
530 | poll_wait(file, &evdev->wait, wait); | 534 | poll_wait(file, &evdev->wait, wait); |
531 | 535 | ||
532 | mask = evdev->exist ? POLLOUT | POLLWRNORM : POLLHUP | POLLERR; | 536 | if (evdev->exist && !client->revoked) |
537 | mask = POLLOUT | POLLWRNORM; | ||
538 | else | ||
539 | mask = POLLHUP | POLLERR; | ||
540 | |||
533 | if (client->packet_head != client->tail) | 541 | if (client->packet_head != client->tail) |
534 | mask |= POLLIN | POLLRDNORM; | 542 | mask |= POLLIN | POLLRDNORM; |
535 | 543 | ||
@@ -795,6 +803,17 @@ static int evdev_handle_mt_request(struct input_dev *dev, | |||
795 | return 0; | 803 | return 0; |
796 | } | 804 | } |
797 | 805 | ||
806 | static int evdev_revoke(struct evdev *evdev, struct evdev_client *client, | ||
807 | struct file *file) | ||
808 | { | ||
809 | client->revoked = true; | ||
810 | evdev_ungrab(evdev, client); | ||
811 | input_flush_device(&evdev->handle, file); | ||
812 | wake_up_interruptible(&evdev->wait); | ||
813 | |||
814 | return 0; | ||
815 | } | ||
816 | |||
798 | static long evdev_do_ioctl(struct file *file, unsigned int cmd, | 817 | static long evdev_do_ioctl(struct file *file, unsigned int cmd, |
799 | void __user *p, int compat_mode) | 818 | void __user *p, int compat_mode) |
800 | { | 819 | { |
@@ -857,6 +876,12 @@ static long evdev_do_ioctl(struct file *file, unsigned int cmd, | |||
857 | else | 876 | else |
858 | return evdev_ungrab(evdev, client); | 877 | return evdev_ungrab(evdev, client); |
859 | 878 | ||
879 | case EVIOCREVOKE: | ||
880 | if (p) | ||
881 | return -EINVAL; | ||
882 | else | ||
883 | return evdev_revoke(evdev, client, file); | ||
884 | |||
860 | case EVIOCSCLOCKID: | 885 | case EVIOCSCLOCKID: |
861 | if (copy_from_user(&i, p, sizeof(unsigned int))) | 886 | if (copy_from_user(&i, p, sizeof(unsigned int))) |
862 | return -EFAULT; | 887 | return -EFAULT; |
@@ -1002,7 +1027,7 @@ static long evdev_ioctl_handler(struct file *file, unsigned int cmd, | |||
1002 | if (retval) | 1027 | if (retval) |
1003 | return retval; | 1028 | return retval; |
1004 | 1029 | ||
1005 | if (!evdev->exist) { | 1030 | if (!evdev->exist || client->revoked) { |
1006 | retval = -ENODEV; | 1031 | retval = -ENODEV; |
1007 | goto out; | 1032 | goto out; |
1008 | } | 1033 | } |
diff --git a/drivers/input/gameport/gameport.c b/drivers/input/gameport/gameport.c index da739d9d1905..922a7fea2ce6 100644 --- a/drivers/input/gameport/gameport.c +++ b/drivers/input/gameport/gameport.c | |||
@@ -639,16 +639,18 @@ EXPORT_SYMBOL(gameport_unregister_port); | |||
639 | * Gameport driver operations | 639 | * Gameport driver operations |
640 | */ | 640 | */ |
641 | 641 | ||
642 | static ssize_t gameport_driver_show_description(struct device_driver *drv, char *buf) | 642 | static ssize_t description_show(struct device_driver *drv, char *buf) |
643 | { | 643 | { |
644 | struct gameport_driver *driver = to_gameport_driver(drv); | 644 | struct gameport_driver *driver = to_gameport_driver(drv); |
645 | return sprintf(buf, "%s\n", driver->description ? driver->description : "(none)"); | 645 | return sprintf(buf, "%s\n", driver->description ? driver->description : "(none)"); |
646 | } | 646 | } |
647 | static DRIVER_ATTR_RO(description); | ||
647 | 648 | ||
648 | static struct driver_attribute gameport_driver_attrs[] = { | 649 | static struct attribute *gameport_driver_attrs[] = { |
649 | __ATTR(description, S_IRUGO, gameport_driver_show_description, NULL), | 650 | &driver_attr_description.attr, |
650 | __ATTR_NULL | 651 | NULL |
651 | }; | 652 | }; |
653 | ATTRIBUTE_GROUPS(gameport_driver); | ||
652 | 654 | ||
653 | static int gameport_driver_probe(struct device *dev) | 655 | static int gameport_driver_probe(struct device *dev) |
654 | { | 656 | { |
@@ -749,7 +751,7 @@ static int gameport_bus_match(struct device *dev, struct device_driver *drv) | |||
749 | static struct bus_type gameport_bus = { | 751 | static struct bus_type gameport_bus = { |
750 | .name = "gameport", | 752 | .name = "gameport", |
751 | .dev_attrs = gameport_device_attrs, | 753 | .dev_attrs = gameport_device_attrs, |
752 | .drv_attrs = gameport_driver_attrs, | 754 | .drv_groups = gameport_driver_groups, |
753 | .match = gameport_bus_match, | 755 | .match = gameport_bus_match, |
754 | .probe = gameport_driver_probe, | 756 | .probe = gameport_driver_probe, |
755 | .remove = gameport_driver_remove, | 757 | .remove = gameport_driver_remove, |
diff --git a/drivers/input/keyboard/Kconfig b/drivers/input/keyboard/Kconfig index 269d4c3658cb..c1edd39bc5ba 100644 --- a/drivers/input/keyboard/Kconfig +++ b/drivers/input/keyboard/Kconfig | |||
@@ -224,7 +224,7 @@ config KEYBOARD_TCA6416 | |||
224 | 224 | ||
225 | config KEYBOARD_TCA8418 | 225 | config KEYBOARD_TCA8418 |
226 | tristate "TCA8418 Keypad Support" | 226 | tristate "TCA8418 Keypad Support" |
227 | depends on I2C && GENERIC_HARDIRQS | 227 | depends on I2C |
228 | select INPUT_MATRIXKMAP | 228 | select INPUT_MATRIXKMAP |
229 | help | 229 | help |
230 | This driver implements basic keypad functionality | 230 | This driver implements basic keypad functionality |
@@ -303,7 +303,7 @@ config KEYBOARD_HP7XX | |||
303 | 303 | ||
304 | config KEYBOARD_LM8323 | 304 | config KEYBOARD_LM8323 |
305 | tristate "LM8323 keypad chip" | 305 | tristate "LM8323 keypad chip" |
306 | depends on I2C && GENERIC_HARDIRQS | 306 | depends on I2C |
307 | depends on LEDS_CLASS | 307 | depends on LEDS_CLASS |
308 | help | 308 | help |
309 | If you say yes here you get support for the National Semiconductor | 309 | If you say yes here you get support for the National Semiconductor |
diff --git a/drivers/input/mouse/bcm5974.c b/drivers/input/mouse/bcm5974.c index 4ef4d5e198ae..a73f9618b0ad 100644 --- a/drivers/input/mouse/bcm5974.c +++ b/drivers/input/mouse/bcm5974.c | |||
@@ -89,9 +89,9 @@ | |||
89 | #define USB_DEVICE_ID_APPLE_WELLSPRING7A_ISO 0x025a | 89 | #define USB_DEVICE_ID_APPLE_WELLSPRING7A_ISO 0x025a |
90 | #define USB_DEVICE_ID_APPLE_WELLSPRING7A_JIS 0x025b | 90 | #define USB_DEVICE_ID_APPLE_WELLSPRING7A_JIS 0x025b |
91 | /* MacbookAir6,2 (unibody, June 2013) */ | 91 | /* MacbookAir6,2 (unibody, June 2013) */ |
92 | #define USB_DEVICE_ID_APPLE_WELLSPRING8_ANSI 0x0291 | 92 | #define USB_DEVICE_ID_APPLE_WELLSPRING8_ANSI 0x0290 |
93 | #define USB_DEVICE_ID_APPLE_WELLSPRING8_ISO 0x0292 | 93 | #define USB_DEVICE_ID_APPLE_WELLSPRING8_ISO 0x0291 |
94 | #define USB_DEVICE_ID_APPLE_WELLSPRING8_JIS 0x0293 | 94 | #define USB_DEVICE_ID_APPLE_WELLSPRING8_JIS 0x0292 |
95 | 95 | ||
96 | #define BCM5974_DEVICE(prod) { \ | 96 | #define BCM5974_DEVICE(prod) { \ |
97 | .match_flags = (USB_DEVICE_ID_MATCH_DEVICE | \ | 97 | .match_flags = (USB_DEVICE_ID_MATCH_DEVICE | \ |
diff --git a/drivers/input/serio/Kconfig b/drivers/input/serio/Kconfig index a5f342e7ea91..296cb88d7008 100644 --- a/drivers/input/serio/Kconfig +++ b/drivers/input/serio/Kconfig | |||
@@ -239,7 +239,6 @@ config SERIO_PS2MULT | |||
239 | 239 | ||
240 | config SERIO_ARC_PS2 | 240 | config SERIO_ARC_PS2 |
241 | tristate "ARC PS/2 support" | 241 | tristate "ARC PS/2 support" |
242 | depends on GENERIC_HARDIRQS | ||
243 | help | 242 | help |
244 | Say Y here if you have an ARC FPGA platform with a PS/2 | 243 | Say Y here if you have an ARC FPGA platform with a PS/2 |
245 | controller in it. | 244 | controller in it. |
diff --git a/drivers/input/serio/altera_ps2.c b/drivers/input/serio/altera_ps2.c index a0a2657e31ff..4777a73cd390 100644 --- a/drivers/input/serio/altera_ps2.c +++ b/drivers/input/serio/altera_ps2.c | |||
@@ -176,6 +176,7 @@ static int altera_ps2_remove(struct platform_device *pdev) | |||
176 | #ifdef CONFIG_OF | 176 | #ifdef CONFIG_OF |
177 | static const struct of_device_id altera_ps2_match[] = { | 177 | static const struct of_device_id altera_ps2_match[] = { |
178 | { .compatible = "ALTR,ps2-1.0", }, | 178 | { .compatible = "ALTR,ps2-1.0", }, |
179 | { .compatible = "altr,ps2-1.0", }, | ||
179 | {}, | 180 | {}, |
180 | }; | 181 | }; |
181 | MODULE_DEVICE_TABLE(of, altera_ps2_match); | 182 | MODULE_DEVICE_TABLE(of, altera_ps2_match); |
diff --git a/drivers/input/serio/serio.c b/drivers/input/serio/serio.c index 25fc5971f426..2b56855c2c77 100644 --- a/drivers/input/serio/serio.c +++ b/drivers/input/serio/serio.c | |||
@@ -732,19 +732,20 @@ EXPORT_SYMBOL(serio_unregister_child_port); | |||
732 | * Serio driver operations | 732 | * Serio driver operations |
733 | */ | 733 | */ |
734 | 734 | ||
735 | static ssize_t serio_driver_show_description(struct device_driver *drv, char *buf) | 735 | static ssize_t description_show(struct device_driver *drv, char *buf) |
736 | { | 736 | { |
737 | struct serio_driver *driver = to_serio_driver(drv); | 737 | struct serio_driver *driver = to_serio_driver(drv); |
738 | return sprintf(buf, "%s\n", driver->description ? driver->description : "(none)"); | 738 | return sprintf(buf, "%s\n", driver->description ? driver->description : "(none)"); |
739 | } | 739 | } |
740 | static DRIVER_ATTR_RO(description); | ||
740 | 741 | ||
741 | static ssize_t serio_driver_show_bind_mode(struct device_driver *drv, char *buf) | 742 | static ssize_t bind_mode_show(struct device_driver *drv, char *buf) |
742 | { | 743 | { |
743 | struct serio_driver *serio_drv = to_serio_driver(drv); | 744 | struct serio_driver *serio_drv = to_serio_driver(drv); |
744 | return sprintf(buf, "%s\n", serio_drv->manual_bind ? "manual" : "auto"); | 745 | return sprintf(buf, "%s\n", serio_drv->manual_bind ? "manual" : "auto"); |
745 | } | 746 | } |
746 | 747 | ||
747 | static ssize_t serio_driver_set_bind_mode(struct device_driver *drv, const char *buf, size_t count) | 748 | static ssize_t bind_mode_store(struct device_driver *drv, const char *buf, size_t count) |
748 | { | 749 | { |
749 | struct serio_driver *serio_drv = to_serio_driver(drv); | 750 | struct serio_driver *serio_drv = to_serio_driver(drv); |
750 | int retval; | 751 | int retval; |
@@ -760,14 +761,14 @@ static ssize_t serio_driver_set_bind_mode(struct device_driver *drv, const char | |||
760 | 761 | ||
761 | return retval; | 762 | return retval; |
762 | } | 763 | } |
764 | static DRIVER_ATTR_RW(bind_mode); | ||
763 | 765 | ||
764 | 766 | static struct attribute *serio_driver_attrs[] = { | |
765 | static struct driver_attribute serio_driver_attrs[] = { | 767 | &driver_attr_description.attr, |
766 | __ATTR(description, S_IRUGO, serio_driver_show_description, NULL), | 768 | &driver_attr_bind_mode.attr, |
767 | __ATTR(bind_mode, S_IWUSR | S_IRUGO, | 769 | NULL, |
768 | serio_driver_show_bind_mode, serio_driver_set_bind_mode), | ||
769 | __ATTR_NULL | ||
770 | }; | 770 | }; |
771 | ATTRIBUTE_GROUPS(serio_driver); | ||
771 | 772 | ||
772 | static int serio_driver_probe(struct device *dev) | 773 | static int serio_driver_probe(struct device *dev) |
773 | { | 774 | { |
@@ -996,7 +997,7 @@ EXPORT_SYMBOL(serio_interrupt); | |||
996 | static struct bus_type serio_bus = { | 997 | static struct bus_type serio_bus = { |
997 | .name = "serio", | 998 | .name = "serio", |
998 | .dev_attrs = serio_device_attrs, | 999 | .dev_attrs = serio_device_attrs, |
999 | .drv_attrs = serio_driver_attrs, | 1000 | .drv_groups = serio_driver_groups, |
1000 | .match = serio_bus_match, | 1001 | .match = serio_bus_match, |
1001 | .uevent = serio_uevent, | 1002 | .uevent = serio_uevent, |
1002 | .probe = serio_driver_probe, | 1003 | .probe = serio_driver_probe, |
diff --git a/drivers/input/touchscreen/Kconfig b/drivers/input/touchscreen/Kconfig index 3b9758b5f4d7..e09ec67957a3 100644 --- a/drivers/input/touchscreen/Kconfig +++ b/drivers/input/touchscreen/Kconfig | |||
@@ -389,7 +389,7 @@ config TOUCHSCREEN_MCS5000 | |||
389 | 389 | ||
390 | config TOUCHSCREEN_MMS114 | 390 | config TOUCHSCREEN_MMS114 |
391 | tristate "MELFAS MMS114 touchscreen" | 391 | tristate "MELFAS MMS114 touchscreen" |
392 | depends on I2C && GENERIC_HARDIRQS | 392 | depends on I2C |
393 | help | 393 | help |
394 | Say Y here if you have the MELFAS MMS114 touchscreen controller | 394 | Say Y here if you have the MELFAS MMS114 touchscreen controller |
395 | chip in your system. | 395 | chip in your system. |
@@ -845,7 +845,7 @@ config TOUCHSCREEN_TSC_SERIO | |||
845 | 845 | ||
846 | config TOUCHSCREEN_TSC2005 | 846 | config TOUCHSCREEN_TSC2005 |
847 | tristate "TSC2005 based touchscreens" | 847 | tristate "TSC2005 based touchscreens" |
848 | depends on SPI_MASTER && GENERIC_HARDIRQS | 848 | depends on SPI_MASTER |
849 | help | 849 | help |
850 | Say Y here if you have a TSC2005 based touchscreen. | 850 | Say Y here if you have a TSC2005 based touchscreen. |
851 | 851 | ||