diff options
author | Dmitry Torokhov <dtor@insightbb.com> | 2006-09-19 01:56:44 -0400 |
---|---|---|
committer | Dmitry Torokhov <dtor@insightbb.com> | 2006-09-19 01:56:44 -0400 |
commit | 0612ec48762bf8712db1925b2e67246d2237ebab (patch) | |
tree | 01b0d69c9c9915015c0f23ad4263646dd5413e99 /drivers/input/mouse | |
parent | 4263cf0fac28122c8381b6f4f9441a43cd93c81f (diff) | |
parent | 47a5c6fa0e204a2b63309c648bb2fde36836c826 (diff) |
Merge rsync://rsync.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Diffstat (limited to 'drivers/input/mouse')
-rw-r--r-- | drivers/input/mouse/logips2pp.c | 3 | ||||
-rw-r--r-- | drivers/input/mouse/psmouse-base.c | 7 | ||||
-rw-r--r-- | drivers/input/mouse/trackpoint.c | 52 |
3 files changed, 35 insertions, 27 deletions
diff --git a/drivers/input/mouse/logips2pp.c b/drivers/input/mouse/logips2pp.c index eb03f3a3f8a7..7972eecbcfe4 100644 --- a/drivers/input/mouse/logips2pp.c +++ b/drivers/input/mouse/logips2pp.c | |||
@@ -239,8 +239,7 @@ static const struct ps2pp_info *get_model_info(unsigned char model) | |||
239 | { 100, PS2PP_KIND_MX, /* MX510 */ | 239 | { 100, PS2PP_KIND_MX, /* MX510 */ |
240 | PS2PP_WHEEL | PS2PP_SIDE_BTN | PS2PP_TASK_BTN | | 240 | PS2PP_WHEEL | PS2PP_SIDE_BTN | PS2PP_TASK_BTN | |
241 | PS2PP_EXTRA_BTN | PS2PP_NAV_BTN }, | 241 | PS2PP_EXTRA_BTN | PS2PP_NAV_BTN }, |
242 | { 111, PS2PP_KIND_MX, /* MX300 */ | 242 | { 111, PS2PP_KIND_MX, PS2PP_WHEEL | PS2PP_SIDE_BTN }, /* MX300 reports task button as side */ |
243 | PS2PP_WHEEL | PS2PP_EXTRA_BTN | PS2PP_TASK_BTN }, | ||
244 | { 112, PS2PP_KIND_MX, /* MX500 */ | 243 | { 112, PS2PP_KIND_MX, /* MX500 */ |
245 | PS2PP_WHEEL | PS2PP_SIDE_BTN | PS2PP_TASK_BTN | | 244 | PS2PP_WHEEL | PS2PP_SIDE_BTN | PS2PP_TASK_BTN | |
246 | PS2PP_EXTRA_BTN | PS2PP_NAV_BTN }, | 245 | PS2PP_EXTRA_BTN | PS2PP_NAV_BTN }, |
diff --git a/drivers/input/mouse/psmouse-base.c b/drivers/input/mouse/psmouse-base.c index ec0119459bc6..9fb7eb6b0f71 100644 --- a/drivers/input/mouse/psmouse-base.c +++ b/drivers/input/mouse/psmouse-base.c | |||
@@ -485,13 +485,6 @@ static int im_explorer_detect(struct psmouse *psmouse, int set_properties) | |||
485 | param[0] = 40; | 485 | param[0] = 40; |
486 | ps2_command(ps2dev, param, PSMOUSE_CMD_SETRATE); | 486 | ps2_command(ps2dev, param, PSMOUSE_CMD_SETRATE); |
487 | 487 | ||
488 | param[0] = 200; | ||
489 | ps2_command(ps2dev, param, PSMOUSE_CMD_SETRATE); | ||
490 | param[0] = 200; | ||
491 | ps2_command(ps2dev, param, PSMOUSE_CMD_SETRATE); | ||
492 | param[0] = 60; | ||
493 | ps2_command(ps2dev, param, PSMOUSE_CMD_SETRATE); | ||
494 | |||
495 | if (set_properties) { | 488 | if (set_properties) { |
496 | set_bit(BTN_MIDDLE, psmouse->dev->keybit); | 489 | set_bit(BTN_MIDDLE, psmouse->dev->keybit); |
497 | set_bit(REL_WHEEL, psmouse->dev->relbit); | 490 | set_bit(REL_WHEEL, psmouse->dev->relbit); |
diff --git a/drivers/input/mouse/trackpoint.c b/drivers/input/mouse/trackpoint.c index 6d9ec9ab1b90..ae5871a0e060 100644 --- a/drivers/input/mouse/trackpoint.c +++ b/drivers/input/mouse/trackpoint.c | |||
@@ -183,21 +183,26 @@ static struct attribute_group trackpoint_attr_group = { | |||
183 | .attrs = trackpoint_attrs, | 183 | .attrs = trackpoint_attrs, |
184 | }; | 184 | }; |
185 | 185 | ||
186 | static void trackpoint_disconnect(struct psmouse *psmouse) | 186 | static int trackpoint_start_protocol(struct psmouse *psmouse, unsigned char *firmware_id) |
187 | { | 187 | { |
188 | sysfs_remove_group(&psmouse->ps2dev.serio->dev.kobj, &trackpoint_attr_group); | 188 | unsigned char param[2] = { 0 }; |
189 | 189 | ||
190 | kfree(psmouse->private); | 190 | if (ps2_command(&psmouse->ps2dev, param, MAKE_PS2_CMD(0, 2, TP_READ_ID))) |
191 | psmouse->private = NULL; | 191 | return -1; |
192 | |||
193 | if (param[0] != TP_MAGIC_IDENT) | ||
194 | return -1; | ||
195 | |||
196 | if (firmware_id) | ||
197 | *firmware_id = param[1]; | ||
198 | |||
199 | return 0; | ||
192 | } | 200 | } |
193 | 201 | ||
194 | static int trackpoint_sync(struct psmouse *psmouse) | 202 | static int trackpoint_sync(struct psmouse *psmouse) |
195 | { | 203 | { |
196 | unsigned char toggle; | ||
197 | struct trackpoint_data *tp = psmouse->private; | 204 | struct trackpoint_data *tp = psmouse->private; |
198 | 205 | unsigned char toggle; | |
199 | if (!tp) | ||
200 | return -1; | ||
201 | 206 | ||
202 | /* Disable features that may make device unusable with this driver */ | 207 | /* Disable features that may make device unusable with this driver */ |
203 | trackpoint_read(&psmouse->ps2dev, TP_TOGGLE_TWOHAND, &toggle); | 208 | trackpoint_read(&psmouse->ps2dev, TP_TOGGLE_TWOHAND, &toggle); |
@@ -263,27 +268,38 @@ static void trackpoint_defaults(struct trackpoint_data *tp) | |||
263 | tp->ext_dev = TP_DEF_EXT_DEV; | 268 | tp->ext_dev = TP_DEF_EXT_DEV; |
264 | } | 269 | } |
265 | 270 | ||
271 | static void trackpoint_disconnect(struct psmouse *psmouse) | ||
272 | { | ||
273 | sysfs_remove_group(&psmouse->ps2dev.serio->dev.kobj, &trackpoint_attr_group); | ||
274 | |||
275 | kfree(psmouse->private); | ||
276 | psmouse->private = NULL; | ||
277 | } | ||
278 | |||
279 | static int trackpoint_reconnect(struct psmouse *psmouse) | ||
280 | { | ||
281 | if (trackpoint_start_protocol(psmouse, NULL)) | ||
282 | return -1; | ||
283 | |||
284 | if (trackpoint_sync(psmouse)) | ||
285 | return -1; | ||
286 | |||
287 | return 0; | ||
288 | } | ||
289 | |||
266 | int trackpoint_detect(struct psmouse *psmouse, int set_properties) | 290 | int trackpoint_detect(struct psmouse *psmouse, int set_properties) |
267 | { | 291 | { |
268 | struct trackpoint_data *priv; | 292 | struct trackpoint_data *priv; |
269 | struct ps2dev *ps2dev = &psmouse->ps2dev; | 293 | struct ps2dev *ps2dev = &psmouse->ps2dev; |
270 | unsigned char firmware_id; | 294 | unsigned char firmware_id; |
271 | unsigned char button_info; | 295 | unsigned char button_info; |
272 | unsigned char param[2]; | ||
273 | |||
274 | param[0] = param[1] = 0; | ||
275 | 296 | ||
276 | if (ps2_command(ps2dev, param, MAKE_PS2_CMD(0, 2, TP_READ_ID))) | 297 | if (trackpoint_start_protocol(psmouse, &firmware_id)) |
277 | return -1; | ||
278 | |||
279 | if (param[0] != TP_MAGIC_IDENT) | ||
280 | return -1; | 298 | return -1; |
281 | 299 | ||
282 | if (!set_properties) | 300 | if (!set_properties) |
283 | return 0; | 301 | return 0; |
284 | 302 | ||
285 | firmware_id = param[1]; | ||
286 | |||
287 | if (trackpoint_read(&psmouse->ps2dev, TP_EXT_BTN, &button_info)) { | 303 | if (trackpoint_read(&psmouse->ps2dev, TP_EXT_BTN, &button_info)) { |
288 | printk(KERN_WARNING "trackpoint.c: failed to get extended button data\n"); | 304 | printk(KERN_WARNING "trackpoint.c: failed to get extended button data\n"); |
289 | button_info = 0; | 305 | button_info = 0; |
@@ -296,7 +312,7 @@ int trackpoint_detect(struct psmouse *psmouse, int set_properties) | |||
296 | psmouse->vendor = "IBM"; | 312 | psmouse->vendor = "IBM"; |
297 | psmouse->name = "TrackPoint"; | 313 | psmouse->name = "TrackPoint"; |
298 | 314 | ||
299 | psmouse->reconnect = trackpoint_sync; | 315 | psmouse->reconnect = trackpoint_reconnect; |
300 | psmouse->disconnect = trackpoint_disconnect; | 316 | psmouse->disconnect = trackpoint_disconnect; |
301 | 317 | ||
302 | trackpoint_defaults(priv); | 318 | trackpoint_defaults(priv); |