diff options
-rw-r--r-- | drivers/input/mouse/alps.c | 47 |
1 files changed, 17 insertions, 30 deletions
diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c index f6dad83539e0..7490f1da4a53 100644 --- a/drivers/input/mouse/alps.c +++ b/drivers/input/mouse/alps.c | |||
@@ -120,40 +120,27 @@ static void alps_report_buttons(struct psmouse *psmouse, | |||
120 | struct input_dev *dev1, struct input_dev *dev2, | 120 | struct input_dev *dev1, struct input_dev *dev2, |
121 | int left, int right, int middle) | 121 | int left, int right, int middle) |
122 | { | 122 | { |
123 | struct alps_data *priv = psmouse->private; | 123 | struct input_dev *dev; |
124 | const struct alps_model_info *model = priv->i; | ||
125 | |||
126 | if (model->flags & ALPS_PS2_INTERLEAVED) { | ||
127 | struct input_dev *dev; | ||
128 | 124 | ||
129 | /* | 125 | /* |
130 | * If shared button has already been reported on the | 126 | * If shared button has already been reported on the |
131 | * other device (dev2) then this event should be also | 127 | * other device (dev2) then this event should be also |
132 | * sent through that device. | 128 | * sent through that device. |
133 | */ | 129 | */ |
134 | dev = test_bit(BTN_LEFT, dev2->key) ? dev2 : dev1; | 130 | dev = test_bit(BTN_LEFT, dev2->key) ? dev2 : dev1; |
135 | input_report_key(dev, BTN_LEFT, left); | 131 | input_report_key(dev, BTN_LEFT, left); |
136 | 132 | ||
137 | dev = test_bit(BTN_RIGHT, dev2->key) ? dev2 : dev1; | 133 | dev = test_bit(BTN_RIGHT, dev2->key) ? dev2 : dev1; |
138 | input_report_key(dev, BTN_RIGHT, right); | 134 | input_report_key(dev, BTN_RIGHT, right); |
139 | 135 | ||
140 | dev = test_bit(BTN_MIDDLE, dev2->key) ? dev2 : dev1; | 136 | dev = test_bit(BTN_MIDDLE, dev2->key) ? dev2 : dev1; |
141 | input_report_key(dev, BTN_MIDDLE, middle); | 137 | input_report_key(dev, BTN_MIDDLE, middle); |
142 | 138 | ||
143 | /* | 139 | /* |
144 | * Sync the _other_ device now, we'll do the first | 140 | * Sync the _other_ device now, we'll do the first |
145 | * device later once we report the rest of the events. | 141 | * device later once we report the rest of the events. |
146 | */ | 142 | */ |
147 | input_sync(dev2); | 143 | input_sync(dev2); |
148 | } else { | ||
149 | /* | ||
150 | * For devices with non-interleaved packets we know what | ||
151 | * device buttons belong to so we can simply report them. | ||
152 | */ | ||
153 | input_report_key(dev1, BTN_LEFT, left); | ||
154 | input_report_key(dev1, BTN_RIGHT, right); | ||
155 | input_report_key(dev1, BTN_MIDDLE, middle); | ||
156 | } | ||
157 | } | 144 | } |
158 | 145 | ||
159 | static void alps_process_packet(struct psmouse *psmouse) | 146 | static void alps_process_packet(struct psmouse *psmouse) |