aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/mouse/logips2pp.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/input/mouse/logips2pp.c')
-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 54b696cfe1e3..7972eecbcfe4 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 },
@@ -244,12 +245,11 @@ static struct ps2pp_info *get_model_info(unsigned char model)
244 PS2PP_EXTRA_BTN | PS2PP_NAV_BTN }, 245 PS2PP_EXTRA_BTN | PS2PP_NAV_BTN },
245 { 114, PS2PP_KIND_MX, /* MX310 */ 246 { 114, PS2PP_KIND_MX, /* MX310 */
246 PS2PP_WHEEL | PS2PP_SIDE_BTN | 247 PS2PP_WHEEL | PS2PP_SIDE_BTN |
247 PS2PP_TASK_BTN | PS2PP_EXTRA_BTN }, 248 PS2PP_TASK_BTN | PS2PP_EXTRA_BTN }
248 { }
249 }; 249 };
250 int i; 250 int i;
251 251
252 for (i = 0; ps2pp_list[i].model; i++) 252 for (i = 0; i < ARRAY_SIZE(ps2pp_list); i++)
253 if (model == ps2pp_list[i].model) 253 if (model == ps2pp_list[i].model)
254 return &ps2pp_list[i]; 254 return &ps2pp_list[i];
255 255
@@ -261,7 +261,8 @@ static struct ps2pp_info *get_model_info(unsigned char model)
261 * Set up input device's properties based on the detected mouse model. 261 * Set up input device's properties based on the detected mouse model.
262 */ 262 */
263 263
264static void ps2pp_set_model_properties(struct psmouse *psmouse, struct ps2pp_info *model_info, 264static void ps2pp_set_model_properties(struct psmouse *psmouse,
265 const struct ps2pp_info *model_info,
265 int using_ps2pp) 266 int using_ps2pp)
266{ 267{
267 struct input_dev *input_dev = psmouse->dev; 268 struct input_dev *input_dev = psmouse->dev;
@@ -327,7 +328,7 @@ int ps2pp_init(struct psmouse *psmouse, int set_properties)
327 struct ps2dev *ps2dev = &psmouse->ps2dev; 328 struct ps2dev *ps2dev = &psmouse->ps2dev;
328 unsigned char param[4]; 329 unsigned char param[4];
329 unsigned char model, buttons; 330 unsigned char model, buttons;
330 struct ps2pp_info *model_info; 331 const struct ps2pp_info *model_info;
331 int use_ps2pp = 0; 332 int use_ps2pp = 0;
332 333
333 param[0] = 0; 334 param[0] = 0;
@@ -349,7 +350,7 @@ int ps2pp_init(struct psmouse *psmouse, int set_properties)
349/* 350/*
350 * Do Logitech PS2++ / PS2T++ magic init. 351 * Do Logitech PS2++ / PS2T++ magic init.
351 */ 352 */
352 if (model == 97) { /* Touch Pad 3 */ 353 if (model_info->kind == PS2PP_KIND_TP3) { /* Touch Pad 3 */
353 354
354 /* Unprotect RAM */ 355 /* Unprotect RAM */
355 param[0] = 0x11; param[1] = 0x04; param[2] = 0x68; 356 param[0] = 0x11; param[1] = 0x04; param[2] = 0x68;