aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/input/mouse/logips2pp.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/drivers/input/mouse/logips2pp.c b/drivers/input/mouse/logips2pp.c
index 2f0d28840810..eb03f3a3f8a7 100644
--- a/drivers/input/mouse/logips2pp.c
+++ b/drivers/input/mouse/logips2pp.c
@@ -30,9 +30,9 @@
30#define PS2PP_NAV_BTN 0x20 30#define PS2PP_NAV_BTN 0x20
31 31
32struct ps2pp_info { 32struct ps2pp_info {
33 const int model; 33 u8 model;
34 unsigned const int kind; 34 u8 kind;
35 unsigned const int features; 35 u16 features;
36}; 36};
37 37
38/* 38/*
@@ -199,9 +199,9 @@ static void ps2pp_disconnect(struct psmouse *psmouse)
199 device_remove_file(&psmouse->ps2dev.serio->dev, &psmouse_attr_smartscroll.dattr); 199 device_remove_file(&psmouse->ps2dev.serio->dev, &psmouse_attr_smartscroll.dattr);
200} 200}
201 201
202static struct ps2pp_info *get_model_info(unsigned char model) 202static const struct ps2pp_info *get_model_info(unsigned char model)
203{ 203{
204 static struct ps2pp_info ps2pp_list[] = { 204 static const struct ps2pp_info ps2pp_list[] = {
205 { 12, 0, PS2PP_SIDE_BTN}, 205 { 12, 0, PS2PP_SIDE_BTN},
206 { 13, 0, 0 }, 206 { 13, 0, 0 },
207 { 15, PS2PP_KIND_MX, /* MX1000 */ 207 { 15, PS2PP_KIND_MX, /* MX1000 */
@@ -215,6 +215,7 @@ static struct ps2pp_info *get_model_info(unsigned char model)
215 { 51, 0, 0 }, 215 { 51, 0, 0 },
216 { 52, PS2PP_KIND_WHEEL, PS2PP_SIDE_BTN | PS2PP_WHEEL }, 216 { 52, PS2PP_KIND_WHEEL, PS2PP_SIDE_BTN | PS2PP_WHEEL },
217 { 53, PS2PP_KIND_WHEEL, PS2PP_WHEEL }, 217 { 53, PS2PP_KIND_WHEEL, PS2PP_WHEEL },
218 { 56, PS2PP_KIND_WHEEL, PS2PP_SIDE_BTN | PS2PP_WHEEL }, /* Cordless MouseMan Wheel */
218 { 61, PS2PP_KIND_MX, /* MX700 */ 219 { 61, PS2PP_KIND_MX, /* MX700 */
219 PS2PP_WHEEL | PS2PP_SIDE_BTN | PS2PP_TASK_BTN | 220 PS2PP_WHEEL | PS2PP_SIDE_BTN | PS2PP_TASK_BTN |
220 PS2PP_EXTRA_BTN | PS2PP_NAV_BTN }, 221 PS2PP_EXTRA_BTN | PS2PP_NAV_BTN },
@@ -245,12 +246,11 @@ static struct ps2pp_info *get_model_info(unsigned char model)
245 PS2PP_EXTRA_BTN | PS2PP_NAV_BTN }, 246 PS2PP_EXTRA_BTN | PS2PP_NAV_BTN },
246 { 114, PS2PP_KIND_MX, /* MX310 */ 247 { 114, PS2PP_KIND_MX, /* MX310 */
247 PS2PP_WHEEL | PS2PP_SIDE_BTN | 248 PS2PP_WHEEL | PS2PP_SIDE_BTN |
248 PS2PP_TASK_BTN | PS2PP_EXTRA_BTN }, 249 PS2PP_TASK_BTN | PS2PP_EXTRA_BTN }
249 { }
250 }; 250 };
251 int i; 251 int i;
252 252
253 for (i = 0; ps2pp_list[i].model; i++) 253 for (i = 0; i < ARRAY_SIZE(ps2pp_list); i++)
254 if (model == ps2pp_list[i].model) 254 if (model == ps2pp_list[i].model)
255 return &ps2pp_list[i]; 255 return &ps2pp_list[i];
256 256
@@ -262,7 +262,8 @@ static struct ps2pp_info *get_model_info(unsigned char model)
262 * Set up input device's properties based on the detected mouse model. 262 * Set up input device's properties based on the detected mouse model.
263 */ 263 */
264 264
265static void ps2pp_set_model_properties(struct psmouse *psmouse, struct ps2pp_info *model_info, 265static void ps2pp_set_model_properties(struct psmouse *psmouse,
266 const struct ps2pp_info *model_info,
266 int using_ps2pp) 267 int using_ps2pp)
267{ 268{
268 struct input_dev *input_dev = psmouse->dev; 269 struct input_dev *input_dev = psmouse->dev;
@@ -328,7 +329,7 @@ int ps2pp_init(struct psmouse *psmouse, int set_properties)
328 struct ps2dev *ps2dev = &psmouse->ps2dev; 329 struct ps2dev *ps2dev = &psmouse->ps2dev;
329 unsigned char param[4]; 330 unsigned char param[4];
330 unsigned char model, buttons; 331 unsigned char model, buttons;
331 struct ps2pp_info *model_info; 332 const struct ps2pp_info *model_info;
332 int use_ps2pp = 0; 333 int use_ps2pp = 0;
333 334
334 param[0] = 0; 335 param[0] = 0;
@@ -350,7 +351,7 @@ int ps2pp_init(struct psmouse *psmouse, int set_properties)
350/* 351/*
351 * Do Logitech PS2++ / PS2T++ magic init. 352 * Do Logitech PS2++ / PS2T++ magic init.
352 */ 353 */
353 if (model == 97) { /* Touch Pad 3 */ 354 if (model_info->kind == PS2PP_KIND_TP3) { /* Touch Pad 3 */
354 355
355 /* Unprotect RAM */ 356 /* Unprotect RAM */
356 param[0] = 0x11; param[1] = 0x04; param[2] = 0x68; 357 param[0] = 0x11; param[1] = 0x04; param[2] = 0x68;