diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-10-21 19:27:12 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-10-21 19:27:12 -0400 |
| commit | be8db0b843d4eef193e996c3e31aabf15b2d7004 (patch) | |
| tree | 5f07fdca273f11e280fd5c4dff1078c7c0b372a0 | |
| parent | 422b42fa79fa2825dc7b272ee8d52aa4bac37113 (diff) | |
| parent | 3776989d2339c58ff8d8421e754603f186d7439b (diff) | |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
Input: hp_sdc_rtc - fix test in hp_sdc_rtc_read_rt()
Input: atkbd - consolidate force release quirks for volume keys
Input: logips2pp - model 73 is actually TrackMan FX
Input: i8042 - add Sony Vaio VGN-FZ240E to the nomux list
Input: fix locking issue in /proc/bus/input/ handlers
Input: atkbd - postpone restoring LED/repeat rate at resume
Input: atkbd - restore resetting LED state at startup
Input: i8042 - make pnp_data_busted variable boolean instead of int
Input: synaptics - add another Protege M300 to rate blacklist
| -rw-r--r-- | drivers/input/input.c | 65 | ||||
| -rw-r--r-- | drivers/input/keyboard/atkbd.c | 96 | ||||
| -rw-r--r-- | drivers/input/misc/hp_sdc_rtc.c | 2 | ||||
| -rw-r--r-- | drivers/input/mouse/logips2pp.c | 2 | ||||
| -rw-r--r-- | drivers/input/mouse/synaptics.c | 10 | ||||
| -rw-r--r-- | drivers/input/serio/i8042-x86ia64io.h | 13 |
6 files changed, 127 insertions, 61 deletions
diff --git a/drivers/input/input.c b/drivers/input/input.c index c6f88ebb40c7..cc763c96fada 100644 --- a/drivers/input/input.c +++ b/drivers/input/input.c | |||
| @@ -782,10 +782,29 @@ static unsigned int input_proc_devices_poll(struct file *file, poll_table *wait) | |||
| 782 | return 0; | 782 | return 0; |
| 783 | } | 783 | } |
| 784 | 784 | ||
| 785 | union input_seq_state { | ||
| 786 | struct { | ||
| 787 | unsigned short pos; | ||
| 788 | bool mutex_acquired; | ||
| 789 | }; | ||
| 790 | void *p; | ||
| 791 | }; | ||
| 792 | |||
| 785 | static void *input_devices_seq_start(struct seq_file *seq, loff_t *pos) | 793 | static void *input_devices_seq_start(struct seq_file *seq, loff_t *pos) |
| 786 | { | 794 | { |
| 787 | if (mutex_lock_interruptible(&input_mutex)) | 795 | union input_seq_state *state = (union input_seq_state *)&seq->private; |
| 788 | return NULL; | 796 | int error; |
| 797 | |||
| 798 | /* We need to fit into seq->private pointer */ | ||
| 799 | BUILD_BUG_ON(sizeof(union input_seq_state) != sizeof(seq->private)); | ||
| 800 | |||
| 801 | error = mutex_lock_interruptible(&input_mutex); | ||
| 802 | if (error) { | ||
| 803 | state->mutex_acquired = false; | ||
| 804 | return ERR_PTR(error); | ||
| 805 | } | ||
| 806 | |||
| 807 | state->mutex_acquired = true; | ||
| 789 | 808 | ||
| 790 | return seq_list_start(&input_dev_list, *pos); | 809 | return seq_list_start(&input_dev_list, *pos); |
| 791 | } | 810 | } |
| @@ -795,9 +814,12 @@ static void *input_devices_seq_next(struct seq_file *seq, void *v, loff_t *pos) | |||
| 795 | return seq_list_next(v, &input_dev_list, pos); | 814 | return seq_list_next(v, &input_dev_list, pos); |
| 796 | } | 815 | } |
| 797 | 816 | ||
| 798 | static void input_devices_seq_stop(struct seq_file *seq, void *v) | 817 | static void input_seq_stop(struct seq_file *seq, void *v) |
| 799 | { | 818 | { |
| 800 | mutex_unlock(&input_mutex); | 819 | union input_seq_state *state = (union input_seq_state *)&seq->private; |
| 820 | |||
| 821 | if (state->mutex_acquired) | ||
| 822 | mutex_unlock(&input_mutex); | ||
| 801 | } | 823 | } |
| 802 | 824 | ||
| 803 | static void input_seq_print_bitmap(struct seq_file *seq, const char *name, | 825 | static void input_seq_print_bitmap(struct seq_file *seq, const char *name, |
| @@ -861,7 +883,7 @@ static int input_devices_seq_show(struct seq_file *seq, void *v) | |||
| 861 | static const struct seq_operations input_devices_seq_ops = { | 883 | static const struct seq_operations input_devices_seq_ops = { |
| 862 | .start = input_devices_seq_start, | 884 | .start = input_devices_seq_start, |
| 863 | .next = input_devices_seq_next, | 885 | .next = input_devices_seq_next, |
| 864 | .stop = input_devices_seq_stop, | 886 | .stop = input_seq_stop, |
| 865 | .show = input_devices_seq_show, | 887 | .show = input_devices_seq_show, |
| 866 | }; | 888 | }; |
| 867 | 889 | ||
| @@ -881,40 +903,49 @@ static const struct file_operations input_devices_fileops = { | |||
| 881 | 903 | ||
| 882 | static void *input_handlers_seq_start(struct seq_file *seq, loff_t *pos) | 904 | static void *input_handlers_seq_start(struct seq_file *seq, loff_t *pos) |
| 883 | { | 905 | { |
| 884 | if (mutex_lock_interruptible(&input_mutex)) | 906 | union input_seq_state *state = (union input_seq_state *)&seq->private; |
| 885 | return NULL; | 907 | int error; |
| 908 | |||
| 909 | /* We need to fit into seq->private pointer */ | ||
| 910 | BUILD_BUG_ON(sizeof(union input_seq_state) != sizeof(seq->private)); | ||
| 911 | |||
| 912 | error = mutex_lock_interruptible(&input_mutex); | ||
| 913 | if (error) { | ||
| 914 | state->mutex_acquired = false; | ||
| 915 | return ERR_PTR(error); | ||
| 916 | } | ||
| 917 | |||
| 918 | state->mutex_acquired = true; | ||
| 919 | state->pos = *pos; | ||
| 886 | 920 | ||
| 887 | seq->private = (void *)(unsigned long)*pos; | ||
| 888 | return seq_list_start(&input_handler_list, *pos); | 921 | return seq_list_start(&input_handler_list, *pos); |
| 889 | } | 922 | } |
| 890 | 923 | ||
| 891 | static void *input_handlers_seq_next(struct seq_file *seq, void *v, loff_t *pos) | 924 | static void *input_handlers_seq_next(struct seq_file *seq, void *v, loff_t *pos) |
| 892 | { | 925 | { |
| 893 | seq->private = (void *)(unsigned long)(*pos + 1); | 926 | union input_seq_state *state = (union input_seq_state *)&seq->private; |
| 894 | return seq_list_next(v, &input_handler_list, pos); | ||
| 895 | } | ||
| 896 | 927 | ||
| 897 | static void input_handlers_seq_stop(struct seq_file *seq, void *v) | 928 | state->pos = *pos + 1; |
| 898 | { | 929 | return seq_list_next(v, &input_handler_list, pos); |
| 899 | mutex_unlock(&input_mutex); | ||
| 900 | } | 930 | } |
| 901 | 931 | ||
| 902 | static int input_handlers_seq_show(struct seq_file *seq, void *v) | 932 | static int input_handlers_seq_show(struct seq_file *seq, void *v) |
| 903 | { | 933 | { |
| 904 | struct input_handler *handler = container_of(v, struct input_handler, node); | 934 | struct input_handler *handler = container_of(v, struct input_handler, node); |
| 935 | union input_seq_state *state = (union input_seq_state *)&seq->private; | ||
| 905 | 936 | ||
| 906 | seq_printf(seq, "N: Number=%ld Name=%s", | 937 | seq_printf(seq, "N: Number=%u Name=%s", state->pos, handler->name); |
| 907 | (unsigned long)seq->private, handler->name); | ||
| 908 | if (handler->fops) | 938 | if (handler->fops) |
| 909 | seq_printf(seq, " Minor=%d", handler->minor); | 939 | seq_printf(seq, " Minor=%d", handler->minor); |
| 910 | seq_putc(seq, '\n'); | 940 | seq_putc(seq, '\n'); |
| 911 | 941 | ||
| 912 | return 0; | 942 | return 0; |
| 913 | } | 943 | } |
| 944 | |||
| 914 | static const struct seq_operations input_handlers_seq_ops = { | 945 | static const struct seq_operations input_handlers_seq_ops = { |
| 915 | .start = input_handlers_seq_start, | 946 | .start = input_handlers_seq_start, |
| 916 | .next = input_handlers_seq_next, | 947 | .next = input_handlers_seq_next, |
| 917 | .stop = input_handlers_seq_stop, | 948 | .stop = input_seq_stop, |
| 918 | .show = input_handlers_seq_show, | 949 | .show = input_handlers_seq_show, |
| 919 | }; | 950 | }; |
| 920 | 951 | ||
diff --git a/drivers/input/keyboard/atkbd.c b/drivers/input/keyboard/atkbd.c index 4709e15af607..a6512372c7a3 100644 --- a/drivers/input/keyboard/atkbd.c +++ b/drivers/input/keyboard/atkbd.c | |||
| @@ -574,11 +574,22 @@ static void atkbd_event_work(struct work_struct *work) | |||
| 574 | 574 | ||
| 575 | mutex_lock(&atkbd->event_mutex); | 575 | mutex_lock(&atkbd->event_mutex); |
| 576 | 576 | ||
| 577 | if (test_and_clear_bit(ATKBD_LED_EVENT_BIT, &atkbd->event_mask)) | 577 | if (!atkbd->enabled) { |
| 578 | atkbd_set_leds(atkbd); | 578 | /* |
| 579 | * Serio ports are resumed asynchronously so while driver core | ||
| 580 | * thinks that device is already fully operational in reality | ||
| 581 | * it may not be ready yet. In this case we need to keep | ||
| 582 | * rescheduling till reconnect completes. | ||
| 583 | */ | ||
| 584 | schedule_delayed_work(&atkbd->event_work, | ||
| 585 | msecs_to_jiffies(100)); | ||
| 586 | } else { | ||
| 587 | if (test_and_clear_bit(ATKBD_LED_EVENT_BIT, &atkbd->event_mask)) | ||
| 588 | atkbd_set_leds(atkbd); | ||
| 579 | 589 | ||
| 580 | if (test_and_clear_bit(ATKBD_REP_EVENT_BIT, &atkbd->event_mask)) | 590 | if (test_and_clear_bit(ATKBD_REP_EVENT_BIT, &atkbd->event_mask)) |
| 581 | atkbd_set_repeat_rate(atkbd); | 591 | atkbd_set_repeat_rate(atkbd); |
| 592 | } | ||
| 582 | 593 | ||
| 583 | mutex_unlock(&atkbd->event_mutex); | 594 | mutex_unlock(&atkbd->event_mutex); |
| 584 | } | 595 | } |
| @@ -770,6 +781,30 @@ static int atkbd_select_set(struct atkbd *atkbd, int target_set, int allow_extra | |||
| 770 | return 3; | 781 | return 3; |
| 771 | } | 782 | } |
| 772 | 783 | ||
| 784 | static int atkbd_reset_state(struct atkbd *atkbd) | ||
| 785 | { | ||
| 786 | struct ps2dev *ps2dev = &atkbd->ps2dev; | ||
| 787 | unsigned char param[1]; | ||
| 788 | |||
| 789 | /* | ||
| 790 | * Set the LEDs to a predefined state (all off). | ||
| 791 | */ | ||
| 792 | |||
| 793 | param[0] = 0; | ||
| 794 | if (ps2_command(ps2dev, param, ATKBD_CMD_SETLEDS)) | ||
| 795 | return -1; | ||
| 796 | |||
