diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2009-09-09 22:13:20 -0400 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2009-09-11 01:11:38 -0400 |
commit | b7802c5c1ea9563f3746bea09c214ccedc8600f4 (patch) | |
tree | 8feca41ff76258d05b8d4cc893b1a08e04a712f8 /drivers | |
parent | f81134163fc785622f58af27363079ba1de7c7aa (diff) |
Input: psmouse - use boolean type
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/input/mouse/alps.c | 20 | ||||
-rw-r--r-- | drivers/input/mouse/alps.h | 4 | ||||
-rw-r--r-- | drivers/input/mouse/elantech.c | 2 | ||||
-rw-r--r-- | drivers/input/mouse/elantech.h | 4 | ||||
-rw-r--r-- | drivers/input/mouse/hgpk.c | 8 | ||||
-rw-r--r-- | drivers/input/mouse/hgpk.h | 6 | ||||
-rw-r--r-- | drivers/input/mouse/lifebook.c | 8 | ||||
-rw-r--r-- | drivers/input/mouse/lifebook.h | 4 | ||||
-rw-r--r-- | drivers/input/mouse/logips2pp.c | 41 | ||||
-rw-r--r-- | drivers/input/mouse/logips2pp.h | 4 | ||||
-rw-r--r-- | drivers/input/mouse/psmouse-base.c | 87 | ||||
-rw-r--r-- | drivers/input/mouse/psmouse.h | 14 | ||||
-rw-r--r-- | drivers/input/mouse/sentelic.c | 2 | ||||
-rw-r--r-- | drivers/input/mouse/sentelic.h | 4 | ||||
-rw-r--r-- | drivers/input/mouse/synaptics.c | 34 | ||||
-rw-r--r-- | drivers/input/mouse/synaptics.h | 2 | ||||
-rw-r--r-- | drivers/input/mouse/touchkit_ps2.c | 4 | ||||
-rw-r--r-- | drivers/input/mouse/touchkit_ps2.h | 4 | ||||
-rw-r--r-- | drivers/input/mouse/trackpoint.c | 2 | ||||
-rw-r--r-- | drivers/input/mouse/trackpoint.h | 4 |
20 files changed, 133 insertions, 125 deletions
diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c index 5547e2429fbe..f36110689aae 100644 --- a/drivers/input/mouse/alps.c +++ b/drivers/input/mouse/alps.c | |||
@@ -279,7 +279,7 @@ static const struct alps_model_info *alps_get_model(struct psmouse *psmouse, int | |||
279 | * subsequent commands. It looks like glidepad is behind stickpointer, | 279 | * subsequent commands. It looks like glidepad is behind stickpointer, |
280 | * I'd thought it would be other way around... | 280 | * I'd thought it would be other way around... |
281 | */ | 281 | */ |
282 | static int alps_passthrough_mode(struct psmouse *psmouse, int enable) | 282 | static int alps_passthrough_mode(struct psmouse *psmouse, bool enable) |
283 | { | 283 | { |
284 | struct ps2dev *ps2dev = &psmouse->ps2dev; | 284 | struct ps2dev *ps2dev = &psmouse->ps2dev; |
285 | int cmd = enable ? PSMOUSE_CMD_SETSCALE21 : PSMOUSE_CMD_SETSCALE11; | 285 | int cmd = enable ? PSMOUSE_CMD_SETSCALE21 : PSMOUSE_CMD_SETSCALE11; |
@@ -367,16 +367,16 @@ static int alps_poll(struct psmouse *psmouse) | |||
367 | { | 367 | { |
368 | struct alps_data *priv = psmouse->private; | 368 | struct alps_data *priv = psmouse->private; |
369 | unsigned char buf[6]; | 369 | unsigned char buf[6]; |
370 | int poll_failed; | 370 | bool poll_failed; |
371 | 371 | ||
372 | if (priv->i->flags & ALPS_PASS) | 372 | if (priv->i->flags & ALPS_PASS) |
373 | alps_passthrough_mode(psmouse, 1); | 373 | alps_passthrough_mode(psmouse, true); |
374 | 374 | ||
375 | poll_failed = ps2_command(&psmouse->ps2dev, buf, | 375 | poll_failed = ps2_command(&psmouse->ps2dev, buf, |
376 | PSMOUSE_CMD_POLL | (psmouse->pktsize << 8)) < 0; | 376 | PSMOUSE_CMD_POLL | (psmouse->pktsize << 8)) < 0; |
377 | 377 | ||
378 | if (priv->i->flags & ALPS_PASS) | 378 | if (priv->i->flags & ALPS_PASS) |
379 | alps_passthrough_mode(psmouse, 0); | 379 | alps_passthrough_mode(psmouse, false); |
380 | 380 | ||
381 | if (poll_failed || (buf[0] & priv->i->mask0) != priv->i->byte0) | 381 | if (poll_failed || (buf[0] & priv->i->mask0) != priv->i->byte0) |
382 | return -1; | 382 | return -1; |
@@ -401,10 +401,12 @@ static int alps_hw_init(struct psmouse *psmouse, int *version) | |||
401 | if (!priv->i) | 401 | if (!priv->i) |
402 | return -1; | 402 | return -1; |
403 | 403 | ||
404 | if ((priv->i->flags & ALPS_PASS) && alps_passthrough_mode(psmouse, 1)) | 404 | if ((priv->i->flags & ALPS_PASS) && |
405 | alps_passthrough_mode(psmouse, true)) { | ||
405 | return -1; | 406 | return -1; |
407 | } | ||
406 | 408 | ||
407 | if (alps_tap_mode(psmouse, 1)) { | 409 | if (alps_tap_mode(psmouse, true)) { |
408 | printk(KERN_WARNING "alps.c: Failed to enable hardware tapping\n"); | 410 | printk(KERN_WARNING "alps.c: Failed to enable hardware tapping\n"); |
409 | return -1; | 411 | return -1; |
410 | } | 412 | } |
@@ -414,8 +416,10 @@ static int alps_hw_init(struct psmouse *psmouse, int *version) | |||
414 | return -1; | 416 | return -1; |
415 | } | 417 | } |
416 | 418 | ||
417 | if ((priv->i->flags & ALPS_PASS) && alps_passthrough_mode(psmouse, 0)) | 419 | if ((priv->i->flags & ALPS_PASS) && |
420 | alps_passthrough_mode(psmouse, false)) { | ||
418 | return -1; | 421 | return -1; |
422 | } | ||
419 | 423 | ||
420 | /* ALPS needs stream mode, otherwise it won't report any data */ | 424 | /* ALPS needs stream mode, otherwise it won't report any data */ |
421 | if (ps2_command(&psmouse->ps2dev, NULL, PSMOUSE_CMD_SETSTREAM)) { | 425 | if (ps2_command(&psmouse->ps2dev, NULL, PSMOUSE_CMD_SETSTREAM)) { |
@@ -519,7 +523,7 @@ init_fail: | |||
519 | return -1; | 523 | return -1; |
520 | } | 524 | } |
521 | 525 | ||
522 | int alps_detect(struct psmouse *psmouse, int set_properties) | 526 | int alps_detect(struct psmouse *psmouse, bool set_properties) |
523 | { | 527 | { |
524 | int version; | 528 | int version; |
525 | const struct alps_model_info *model; | 529 | const struct alps_model_info *model; |
diff --git a/drivers/input/mouse/alps.h b/drivers/input/mouse/alps.h index 4bbddc99962b..bc87936fee1a 100644 --- a/drivers/input/mouse/alps.h +++ b/drivers/input/mouse/alps.h | |||
@@ -26,10 +26,10 @@ struct alps_data { | |||
26 | }; | 26 | }; |
27 | 27 | ||
28 | #ifdef CONFIG_MOUSE_PS2_ALPS | 28 | #ifdef CONFIG_MOUSE_PS2_ALPS |
29 | int alps_detect(struct psmouse *psmouse, int set_properties); | 29 | int alps_detect(struct psmouse *psmouse, bool set_properties); |
30 | int alps_init(struct psmouse *psmouse); | 30 | int alps_init(struct psmouse *psmouse); |
31 | #else | 31 | #else |
32 | inline int alps_detect(struct psmouse *psmouse, int set_properties) | 32 | inline int alps_detect(struct psmouse *psmouse, bool set_properties) |
33 | { | 33 | { |
34 | return -ENOSYS; | 34 | return -ENOSYS; |
35 | } | 35 | } |
diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c index 4bc78892ba91..fda35e615abf 100644 --- a/drivers/input/mouse/elantech.c +++ b/drivers/input/mouse/elantech.c | |||
@@ -553,7 +553,7 @@ static struct attribute_group elantech_attr_group = { | |||
553 | /* | 553 | /* |
554 | * Use magic knock to detect Elantech touchpad | 554 | * Use magic knock to detect Elantech touchpad |
555 | */ | 555 | */ |
556 | int elantech_detect(struct psmouse *psmouse, int set_properties) | 556 | int elantech_detect(struct psmouse *psmouse, bool set_properties) |
557 | { | 557 | { |
558 | struct ps2dev *ps2dev = &psmouse->ps2dev; | 558 | struct ps2dev *ps2dev = &psmouse->ps2dev; |
559 | unsigned char param[3]; | 559 | unsigned char param[3]; |
diff --git a/drivers/input/mouse/elantech.h b/drivers/input/mouse/elantech.h index ed848cc80814..feac5f7af966 100644 --- a/drivers/input/mouse/elantech.h +++ b/drivers/input/mouse/elantech.h | |||
@@ -109,10 +109,10 @@ struct elantech_data { | |||
109 | }; | 109 | }; |
110 | 110 | ||
111 | #ifdef CONFIG_MOUSE_PS2_ELANTECH | 111 | #ifdef CONFIG_MOUSE_PS2_ELANTECH |
112 | int elantech_detect(struct psmouse *psmouse, int set_properties); | 112 | int elantech_detect(struct psmouse *psmouse, bool set_properties); |
113 | int elantech_init(struct psmouse *psmouse); | 113 | int elantech_init(struct psmouse *psmouse); |
114 | #else | 114 | #else |
115 | static inline int elantech_detect(struct psmouse *psmouse, int set_properties) | 115 | static inline int elantech_detect(struct psmouse *psmouse, bool set_properties) |
116 | { | 116 | { |
117 | return -ENOSYS; | 117 | return -ENOSYS; |
118 | } | 118 | } |
diff --git a/drivers/input/mouse/hgpk.c b/drivers/input/mouse/hgpk.c index f5aa035774d9..de1e553028b7 100644 --- a/drivers/input/mouse/hgpk.c +++ b/drivers/input/mouse/hgpk.c | |||
@@ -367,7 +367,7 @@ static ssize_t hgpk_set_powered(struct psmouse *psmouse, void *data, | |||
367 | } | 367 | } |
368 | 368 | ||
369 | __PSMOUSE_DEFINE_ATTR(powered, S_IWUSR | S_IRUGO, NULL, | 369 | __PSMOUSE_DEFINE_ATTR(powered, S_IWUSR | S_IRUGO, NULL, |
370 | hgpk_show_powered, hgpk_set_powered, 0); | 370 | hgpk_show_powered, hgpk_set_powered, false); |
371 | 371 | ||
372 | static ssize_t hgpk_trigger_recal_show(struct psmouse *psmouse, | 372 | static ssize_t hgpk_trigger_recal_show(struct psmouse *psmouse, |
373 | void *data, char *buf) | 373 | void *data, char *buf) |
@@ -396,7 +396,7 @@ static ssize_t hgpk_trigger_recal(struct psmouse *psmouse, void *data, | |||
396 | } | 396 | } |
397 | 397 | ||
398 | __PSMOUSE_DEFINE_ATTR(recalibrate, S_IWUSR | S_IRUGO, NULL, | 398 | __PSMOUSE_DEFINE_ATTR(recalibrate, S_IWUSR | S_IRUGO, NULL, |
399 | hgpk_trigger_recal_show, hgpk_trigger_recal, 0); | 399 | hgpk_trigger_recal_show, hgpk_trigger_recal, false); |
400 | 400 | ||
401 | static void hgpk_disconnect(struct psmouse *psmouse) | 401 | static void hgpk_disconnect(struct psmouse *psmouse) |
402 | { | 402 | { |
@@ -489,7 +489,7 @@ int hgpk_init(struct psmouse *psmouse) | |||
489 | 489 | ||
490 | psmouse->private = priv; | 490 | psmouse->private = priv; |
491 | priv->psmouse = psmouse; | 491 | priv->psmouse = psmouse; |
492 | priv->powered = 1; | 492 | priv->powered = true; |
493 | INIT_DELAYED_WORK(&priv->recalib_wq, hgpk_recalib_work); | 493 | INIT_DELAYED_WORK(&priv->recalib_wq, hgpk_recalib_work); |
494 | 494 | ||
495 | err = psmouse_reset(psmouse); | 495 | err = psmouse_reset(psmouse); |
@@ -532,7 +532,7 @@ static enum hgpk_model_t hgpk_get_model(struct psmouse *psmouse) | |||
532 | return param[2]; | 532 | return param[2]; |
533 | } | 533 | } |
534 | 534 | ||
535 | int hgpk_detect(struct psmouse *psmouse, int set_properties) | 535 | int hgpk_detect(struct psmouse *psmouse, bool set_properties) |
536 | { | 536 | { |
537 | int version; | 537 | int version; |
538 | 538 | ||
diff --git a/drivers/input/mouse/hgpk.h b/drivers/input/mouse/hgpk.h index a4b2a96f5f54..d61cfd3ee9cb 100644 --- a/drivers/input/mouse/hgpk.h +++ b/drivers/input/mouse/hgpk.h | |||
@@ -15,7 +15,7 @@ enum hgpk_model_t { | |||
15 | 15 | ||
16 | struct hgpk_data { | 16 | struct hgpk_data { |
17 | struct psmouse *psmouse; | 17 | struct psmouse *psmouse; |
18 | int powered; | 18 | bool powered; |
19 | int count, x_tally, y_tally; /* hardware workaround stuff */ | 19 | int count, x_tally, y_tally; /* hardware workaround stuff */ |
20 | unsigned long recalib_window; | 20 | unsigned long recalib_window; |
21 | struct delayed_work recalib_wq; | 21 | struct delayed_work recalib_wq; |
@@ -33,10 +33,10 @@ struct hgpk_data { | |||
33 | dev_notice(&(psmouse)->ps2dev.serio->dev, format, ## arg) | 33 | dev_notice(&(psmouse)->ps2dev.serio->dev, format, ## arg) |
34 | 34 | ||
35 | #ifdef CONFIG_MOUSE_PS2_OLPC | 35 | #ifdef CONFIG_MOUSE_PS2_OLPC |
36 | int hgpk_detect(struct psmouse *psmouse, int set_properties); | 36 | int hgpk_detect(struct psmouse *psmouse, bool set_properties); |
37 | int hgpk_init(struct psmouse *psmouse); | 37 | int hgpk_init(struct psmouse *psmouse); |
38 | #else | 38 | #else |
39 | static inline int hgpk_detect(struct psmouse *psmouse, int set_properties) | 39 | static inline int hgpk_detect(struct psmouse *psmouse, bool set_properties) |
40 | { | 40 | { |
41 | return -ENODEV; | 41 | return -ENODEV; |
42 | } | 42 | } |
diff --git a/drivers/input/mouse/lifebook.c b/drivers/input/mouse/lifebook.c index dcd4236af1e3..5e6308694408 100644 --- a/drivers/input/mouse/lifebook.c +++ b/drivers/input/mouse/lifebook.c | |||
@@ -33,11 +33,11 @@ static int lifebook_set_serio_phys(const struct dmi_system_id *d) | |||
33 | return 0; | 33 | return 0; |
34 | } | 34 | } |
35 | 35 | ||
36 | static unsigned char lifebook_use_6byte_proto; | 36 | static bool lifebook_use_6byte_proto; |
37 | 37 | ||
38 | static int lifebook_set_6byte_proto(const struct dmi_system_id *d) | 38 | static int lifebook_set_6byte_proto(const struct dmi_system_id *d) |
39 | { | 39 | { |
40 | lifebook_use_6byte_proto = 1; | 40 | lifebook_use_6byte_proto = true; |
41 | return 0; | 41 | return 0; |
42 | } | 42 | } |
43 | 43 | ||
@@ -125,7 +125,7 @@ static psmouse_ret_t lifebook_process_byte(struct psmouse *psmouse) | |||
125 | struct input_dev *dev1 = psmouse->dev; | 125 | struct input_dev *dev1 = psmouse->dev; |
126 | struct input_dev *dev2 = priv ? priv->dev2 : NULL; | 126 | struct input_dev *dev2 = priv ? priv->dev2 : NULL; |
127 | unsigned char *packet = psmouse->packet; | 127 | unsigned char *packet = psmouse->packet; |
128 | int relative_packet = packet[0] & 0x08; | 128 | bool relative_packet = packet[0] & 0x08; |
129 | 129 | ||
130 | if (relative_packet || !lifebook_use_6byte_proto) { | 130 | if (relative_packet || !lifebook_use_6byte_proto) { |
131 | if (psmouse->pktcnt != 3) | 131 | if (psmouse->pktcnt != 3) |
@@ -242,7 +242,7 @@ static void lifebook_disconnect(struct psmouse *psmouse) | |||
242 | psmouse->private = NULL; | 242 | psmouse->private = NULL; |
243 | } | 243 | } |
244 | 244 | ||
245 | int lifebook_detect(struct psmouse *psmouse, int set_properties) | 245 | int lifebook_detect(struct psmouse *psmouse, bool set_properties) |
246 | { | 246 | { |
247 | if (!dmi_check_system(lifebook_dmi_table)) | 247 | if (!dmi_check_system(lifebook_dmi_table)) |
248 | return -1; | 248 | return -1; |
diff --git a/drivers/input/mouse/lifebook.h b/drivers/input/mouse/lifebook.h index c1647cf036c2..407cb226bc0a 100644 --- a/drivers/input/mouse/lifebook.h +++ b/drivers/input/mouse/lifebook.h | |||
@@ -12,10 +12,10 @@ | |||
12 | #define _LIFEBOOK_H | 12 | #define _LIFEBOOK_H |
13 | 13 | ||
14 | #ifdef CONFIG_MOUSE_PS2_LIFEBOOK | 14 | #ifdef CONFIG_MOUSE_PS2_LIFEBOOK |
15 | int lifebook_detect(struct psmouse *psmouse, int set_properties); | 15 | int lifebook_detect(struct psmouse *psmouse, bool set_properties); |
16 | int lifebook_init(struct psmouse *psmouse); | 16 | int lifebook_init(struct psmouse *psmouse); |
17 | #else | 17 | #else |
18 | inline int lifebook_detect(struct psmouse *psmouse, int set_properties) | 18 | inline int lifebook_detect(struct psmouse *psmouse, bool set_properties) |
19 | { | 19 | { |
20 | return -ENOSYS; | 20 | return -ENOSYS; |
21 | } | 21 | } |
diff --git a/drivers/input/mouse/logips2pp.c b/drivers/input/mouse/logips2pp.c index 390f1dbb98a4..de745d751162 100644 --- a/drivers/input/mouse/logips2pp.c +++ b/drivers/input/mouse/logips2pp.c | |||
@@ -130,14 +130,11 @@ static int ps2pp_cmd(struct psmouse *psmouse, unsigned char *param, unsigned cha | |||
130 | * 0 - disabled | 130 | * 0 - disabled |
131 | */ | 131 | */ |
132 | 132 | ||
133 | static void ps2pp_set_smartscroll(struct psmouse *psmouse, unsigned int smartscroll) | 133 | static void ps2pp_set_smartscroll(struct psmouse *psmouse, bool smartscroll) |
134 | { | 134 | { |
135 | struct ps2dev *ps2dev = &psmouse->ps2dev; | 135 | struct ps2dev *ps2dev = &psmouse->ps2dev; |
136 | unsigned char param[4]; | 136 | unsigned char param[4]; |
137 | 137 | ||
138 | if (smartscroll > 1) | ||
139 | smartscroll = 1; | ||
140 | |||
141 | ps2pp_cmd(psmouse, param, 0x32); | 138 | ps2pp_cmd(psmouse, param, 0x32); |
142 | 139 | ||
143 | param[0] = 0; | 140 | param[0] = 0; |
@@ -149,12 +146,14 @@ static void ps2pp_set_smartscroll(struct psmouse *psmouse, unsigned int smartscr | |||
149 | ps2_command(ps2dev, param, PSMOUSE_CMD_SETRES); | 146 | ps2_command(ps2dev, param, PSMOUSE_CMD_SETRES); |
150 | } | 147 | } |
151 | 148 | ||
152 | static ssize_t ps2pp_attr_show_smartscroll(struct psmouse *psmouse, void *data, char *buf) | 149 | static ssize_t ps2pp_attr_show_smartscroll(struct psmouse *psmouse, |
150 | void *data, char *buf) | ||
153 | { | 151 | { |
154 | return sprintf(buf, "%d\n", psmouse->smartscroll ? 1 : 0); | 152 | return sprintf(buf, "%d\n", psmouse->smartscroll); |
155 | } | 153 | } |
156 | 154 | ||
157 | static ssize_t ps2pp_attr_set_smartscroll(struct psmouse *psmouse, void *data, const char *buf, size_t count) | 155 | static ssize_t ps2pp_attr_set_smartscroll(struct psmouse *psmouse, void *data, |
156 | const char *buf, size_t count) | ||
158 | { | 157 | { |
159 | unsigned long value; | 158 | unsigned long value; |
160 | 159 | ||
@@ -261,29 +260,29 @@ static const struct ps2pp_info *get_model_info(unsigned char model) | |||
261 | 260 | ||
262 | static void ps2pp_set_model_properties(struct psmouse *psmouse, | 261 | static void ps2pp_set_model_properties(struct psmouse *psmouse, |
263 | const struct ps2pp_info *model_info, | 262 | const struct ps2pp_info *model_info, |
264 | int using_ps2pp) | 263 | bool using_ps2pp) |
265 | { | 264 | { |
266 | struct input_dev *input_dev = psmouse->dev; | 265 | struct input_dev *input_dev = psmouse->dev; |
267 | 266 | ||
268 | if (model_info->features & PS2PP_SIDE_BTN) | 267 | if (model_info->features & PS2PP_SIDE_BTN) |
269 | set_bit(BTN_SIDE, input_dev->keybit); | 268 | __set_bit(BTN_SIDE, input_dev->keybit); |
270 | 269 | ||
271 | if (model_info->features & PS2PP_EXTRA_BTN) | 270 | if (model_info->features & PS2PP_EXTRA_BTN) |
272 | set_bit(BTN_EXTRA, input_dev->keybit); | 271 | __set_bit(BTN_EXTRA, input_dev->keybit); |
273 | 272 | ||
274 | if (model_info->features & PS2PP_TASK_BTN) | 273 | if (model_info->features & PS2PP_TASK_BTN) |
275 | set_bit(BTN_TASK, input_dev->keybit); | 274 | __set_bit(BTN_TASK, input_dev->keybit); |
276 | 275 | ||
277 | if (model_info->features & PS2PP_NAV_BTN) { | 276 | if (model_info->features & PS2PP_NAV_BTN) { |
278 | set_bit(BTN_FORWARD, input_dev->keybit); | 277 | __set_bit(BTN_FORWARD, input_dev->keybit); |
279 | set_bit(BTN_BACK, input_dev->keybit); | 278 | __set_bit(BTN_BACK, input_dev->keybit); |
280 | } | 279 | } |
281 | 280 | ||
282 | if (model_info->features & PS2PP_WHEEL) | 281 | if (model_info->features & PS2PP_WHEEL) |
283 | set_bit(REL_WHEEL, input_dev->relbit); | 282 | __set_bit(REL_WHEEL, input_dev->relbit); |
284 | 283 | ||
285 | if (model_info->features & PS2PP_HWHEEL) | 284 | if (model_info->features & PS2PP_HWHEEL) |
286 | set_bit(REL_HWHEEL, input_dev->relbit); | 285 | __set_bit(REL_HWHEEL, input_dev->relbit); |
287 | 286 | ||
288 | switch (model_info->kind) { | 287 | switch (model_info->kind) { |
289 | case PS2PP_KIND_WHEEL: | 288 | case PS2PP_KIND_WHEEL: |
@@ -321,13 +320,13 @@ static void ps2pp_set_model_properties(struct psmouse *psmouse, | |||
321 | * that support it. | 320 | * that support it. |
322 | */ | 321 | */ |
323 | 322 | ||
324 | int ps2pp_init(struct psmouse *psmouse, int set_properties) | 323 | int ps2pp_init(struct psmouse *psmouse, bool set_properties) |
325 | { | 324 | { |
326 | struct ps2dev *ps2dev = &psmouse->ps2dev; | 325 | struct ps2dev *ps2dev = &psmouse->ps2dev; |
327 | unsigned char param[4]; | 326 | unsigned char param[4]; |
328 | unsigned char model, buttons; | 327 | unsigned char model, buttons; |
329 | const struct ps2pp_info *model_info; | 328 | const struct ps2pp_info *model_info; |
330 | int use_ps2pp = 0; | 329 | bool use_ps2pp = false; |
331 | int error; | 330 | int error; |
332 | 331 | ||
333 | param[0] = 0; | 332 | param[0] = 0; |
@@ -364,7 +363,7 @@ int ps2pp_init(struct psmouse *psmouse, int set_properties) | |||
364 | param[0] = 0; | 363 | param[0] = 0; |
365 | if (!ps2_command(ps2dev, param, 0x13d1) && | 364 | if (!ps2_command(ps2dev, param, 0x13d1) && |
366 | param[0] == 0x06 && param[1] == 0x00 && param[2] == 0x14) { | 365 | param[0] == 0x06 && param[1] == 0x00 && param[2] == 0x14) { |
367 | use_ps2pp = 1; | 366 | use_ps2pp = true; |
368 | } | 367 | } |
369 | 368 | ||
370 | } else { | 369 | } else { |
@@ -376,8 +375,8 @@ int ps2pp_init(struct psmouse *psmouse, int set_properties) | |||
376 | if ((param[0] & 0x78) == 0x48 && | 375 | if ((param[0] & 0x78) == 0x48 && |
377 | (param[1] & 0xf3) == 0xc2 && | 376 | (param[1] & 0xf3) == 0xc2 && |
378 | (param[2] & 0x03) == ((param[1] >> 2) & 3)) { | 377 | (param[2] & 0x03) == ((param[1] >> 2) & 3)) { |
379 | ps2pp_set_smartscroll(psmouse, psmouse->smartscroll); | 378 | ps2pp_set_smartscroll(psmouse, false); |
380 | use_ps2pp = 1; | 379 | use_ps2pp = true; |
381 | } | 380 | } |
382 | } | 381 | } |
383 | } | 382 | } |
@@ -406,7 +405,7 @@ int ps2pp_init(struct psmouse *psmouse, int set_properties) | |||
406 | } | 405 | } |
407 | 406 | ||
408 | if (buttons < 3) | 407 | if (buttons < 3) |
409 | clear_bit(BTN_MIDDLE, psmouse->dev->keybit); | 408 | __clear_bit(BTN_MIDDLE, psmouse->dev->keybit); |
410 | 409 | ||
411 | if (model_info) | 410 | if (model_info) |
412 | ps2pp_set_model_properties(psmouse, model_info, use_ps2pp); | 411 | ps2pp_set_model_properties(psmouse, model_info, use_ps2pp); |
diff --git a/drivers/input/mouse/logips2pp.h b/drivers/input/mouse/logips2pp.h index 6e5712525fd6..0c186f0282d9 100644 --- a/drivers/input/mouse/logips2pp.h +++ b/drivers/input/mouse/logips2pp.h | |||
@@ -12,9 +12,9 @@ | |||
12 | #define _LOGIPS2PP_H | 12 | #define _LOGIPS2PP_H |
13 | 13 | ||
14 | #ifdef CONFIG_MOUSE_PS2_LOGIPS2PP | 14 | #ifdef CONFIG_MOUSE_PS2_LOGIPS2PP |
15 | int ps2pp_init(struct psmouse *psmouse, int set_properties); | 15 | int ps2pp_init(struct psmouse *psmouse, bool set_properties); |
16 | #else | 16 | #else |
17 | inline int ps2pp_init(struct psmouse *psmouse, int set_properties) | 17 | inline int ps2pp_init(struct psmouse *psmouse, bool set_properties) |
18 | { | 18 | { |
19 | return -ENOSYS; | 19 | return -ENOSYS; |
20 | } | 20 | } |
diff --git a/drivers/input/mouse/psmouse-base.c b/drivers/input/mouse/psmouse-base.c index df318887ca09..690aed905436 100644 --- a/drivers/input/mouse/psmouse-base.c +++ b/drivers/input/mouse/psmouse-base.c | |||
@@ -109,10 +109,10 @@ static struct workqueue_struct *kpsmoused_wq; | |||
109 | 109 | ||
110 | struct psmouse_protocol { | 110 | struct psmouse_protocol { |
111 | enum psmouse_type type; | 111 | enum psmouse_type type; |
112 | bool maxproto; | ||
112 | const char *name; | 113 | const char *name; |
113 | const char *alias; | 114 | const char *alias; |
114 | int maxproto; | 115 | int (*detect)(struct psmouse *, bool); |
115 | int (*detect)(struct psmouse *, int); | ||
116 | int (*init)(struct psmouse *); | 116 | int (*init)(struct psmouse *); |
117 | }; | 117 | }; |
118 | 118 | ||
@@ -217,7 +217,7 @@ void psmouse_queue_work(struct psmouse *psmouse, struct delayed_work *work, | |||
217 | static inline void __psmouse_set_state(struct psmouse *psmouse, enum psmouse_state new_state) | 217 | static inline void __psmouse_set_state(struct psmouse *psmouse, enum psmouse_state new_state) |
218 | { | 218 | { |
219 | psmouse->state = new_state; | 219 | psmouse->state = new_state; |
220 | psmouse->pktcnt = psmouse->out_of_sync = 0; | 220 | psmouse->pktcnt = psmouse->out_of_sync_cnt = 0; |
221 | psmouse->ps2dev.flags = 0; | 221 | psmouse->ps2dev.flags = 0; |
222 | psmouse->last = jiffies; | 222 | psmouse->last = jiffies; |
223 | } | 223 | } |
@@ -250,7 +250,7 @@ static int psmouse_handle_byte(struct psmouse *psmouse) | |||
250 | if (psmouse->state == PSMOUSE_ACTIVATED) { | 250 | if (psmouse->state == PSMOUSE_ACTIVATED) { |
251 | printk(KERN_WARNING "psmouse.c: %s at %s lost sync at byte %d\n", | 251 | printk(KERN_WARNING "psmouse.c: %s at %s lost sync at byte %d\n", |
252 | psmouse->name, psmouse->phys, psmouse->pktcnt); | 252 | psmouse->name, psmouse->phys, psmouse->pktcnt); |
253 | if (++psmouse->out_of_sync == psmouse->resetafter) { | 253 | if (++psmouse->out_of_sync_cnt == psmouse->resetafter) { |
254 | __psmouse_set_state(psmouse, PSMOUSE_IGNORE); | 254 | __psmouse_set_state(psmouse, PSMOUSE_IGNORE); |
255 | printk(KERN_NOTICE "psmouse.c: issuing reconnect request\n"); | 255 | printk(KERN_NOTICE "psmouse.c: issuing reconnect request\n"); |
256 | serio_reconnect(psmouse->ps2dev.serio); | 256 | serio_reconnect(psmouse->ps2dev.serio); |
@@ -262,8 +262,8 @@ static int psmouse_handle_byte(struct psmouse *psmouse) | |||
262 | 262 | ||
263 | case PSMOUSE_FULL_PACKET: | 263 | case PSMOUSE_FULL_PACKET: |
264 | psmouse->pktcnt = 0; | 264 | psmouse->pktcnt = 0; |
265 | if (psmouse->out_of_sync) { | 265 | if (psmouse->out_of_sync_cnt) { |
266 | psmouse->out_of_sync = 0; | 266 | psmouse->out_of_sync_cnt = 0; |
267 | printk(KERN_NOTICE "psmouse.c: %s at %s - driver resynched.\n", | 267 | printk(KERN_NOTICE "psmouse.c: %s at %s - driver resynched.\n", |
268 | psmouse->name, psmouse->phys); | 268 | psmouse->name, psmouse->phys); |
269 | } | 269 | } |
@@ -409,7 +409,7 @@ int psmouse_reset(struct psmouse *psmouse) | |||
409 | /* | 409 | /* |
410 | * Genius NetMouse magic init. | 410 | * Genius NetMouse magic init. |
411 | */ | 411 | */ |
412 | static int genius_detect(struct psmouse *psmouse, int set_properties) | 412 | static int genius_detect(struct psmouse *psmouse, bool set_properties) |
413 | { | 413 | { |
414 | struct ps2dev *ps2dev = &psmouse->ps2dev; | 414 | struct ps2dev *ps2dev = &psmouse->ps2dev; |
415 | unsigned char param[4]; | 415 | unsigned char param[4]; |
@@ -425,9 +425,9 @@ static int genius_detect(struct psmouse *psmouse, int set_properties) | |||
425 | return -1; | 425 | return -1; |
426 | 426 | ||
427 | if (set_properties) { | 427 | if (set_properties) { |
428 | set_bit(BTN_EXTRA, psmouse->dev->keybit); | 428 | __set_bit(BTN_EXTRA, psmouse->dev->keybit); |
429 | set_bit(BTN_SIDE, psmouse->dev->keybit); | 429 | __set_bit(BTN_SIDE, psmouse->dev->keybit); |
430 | set_bit(REL_WHEEL, psmouse->dev->relbit); | 430 | __set_bit(REL_WHEEL, psmouse->dev->relbit); |
431 | 431 | ||
432 | psmouse->vendor = "Genius"; | 432 | psmouse->vendor = "Genius"; |
433 | psmouse->name = "Mouse"; | 433 | psmouse->name = "Mouse"; |
@@ -440,7 +440,7 @@ static int genius_detect(struct psmouse *psmouse, int set_properties) | |||
440 | /* | 440 | /* |
441 | * IntelliMouse magic init. | 441 | * IntelliMouse magic init. |
442 | */ | 442 | */ |
443 | static int intellimouse_detect(struct psmouse *psmouse, int set_properties) | 443 | static int intellimouse_detect(struct psmouse *psmouse, bool set_properties) |
444 | { | 444 | { |
445 | struct ps2dev *ps2dev = &psmouse->ps2dev; | 445 | struct ps2dev *ps2dev = &psmouse->ps2dev; |
446 | unsigned char param[2]; | 446 | unsigned char param[2]; |
@@ -457,8 +457,8 @@ static int intellimouse_detect(struct psmouse *psmouse, int set_properties) | |||
457 | return -1; | 457 | return -1; |
458 | 458 | ||
459 | if (set_properties) { | 459 | if (set_properties) { |
460 | set_bit(BTN_MIDDLE, psmouse->dev->keybit); | 460 | __set_bit(BTN_MIDDLE, psmouse->dev->keybit); |
461 | set_bit(REL_WHEEL, psmouse->dev->relbit); | 461 | __set_bit(REL_WHEEL, psmouse->dev->relbit); |
462 | 462 | ||
463 | if (!psmouse->vendor) psmouse->vendor = "Generic"; | 463 | if (!psmouse->vendor) psmouse->vendor = "Generic"; |
464 | if (!psmouse->name) psmouse->name = "Wheel Mouse"; | 464 | if (!psmouse->name) psmouse->name = "Wheel Mouse"; |
@@ -471,7 +471,7 @@ static int intellimouse_detect(struct psmouse *psmouse, int set_properties) | |||
471 | /* | 471 | /* |
472 | * Try IntelliMouse/Explorer magic init. | 472 | * Try IntelliMouse/Explorer magic init. |
473 | */ | 473 | */ |
474 | static int im_explorer_detect(struct psmouse *psmouse, int set_properties) | 474 | static int im_explorer_detect(struct psmouse *psmouse, bool set_properties) |
475 | { | 475 | { |
476 | struct ps2dev *ps2dev = &psmouse->ps2dev; | 476 | struct ps2dev *ps2dev = &psmouse->ps2dev; |
477 | unsigned char param[2]; | 477 | unsigned char param[2]; |
@@ -498,11 +498,11 @@ static int im_explorer_detect(struct psmouse *psmouse, int set_properties) | |||
498 | ps2_command(ps2dev, param, PSMOUSE_CMD_SETRATE); | 498 | ps2_command(ps2dev, param, PSMOUSE_CMD_SETRATE); |
499 | 499 | ||
500 | if (set_properties) { | 500 | if (set_properties) { |
501 | set_bit(BTN_MIDDLE, psmouse->dev->keybit); | 501 | __set_bit(BTN_MIDDLE, psmouse->dev->keybit); |
502 | set_bit(REL_WHEEL, psmouse->dev->relbit); | 502 | __set_bit(REL_WHEEL, psmouse->dev->relbit); |
503 | set_bit(REL_HWHEEL, psmouse->dev->relbit); | 503 | __set_bit(REL_HWHEEL, psmouse->dev->relbit); |
504 | set_bit(BTN_SIDE, psmouse->dev->keybit); | 504 | __set_bit(BTN_SIDE, psmouse->dev->keybit); |
505 | set_bit(BTN_EXTRA, psmouse->dev->keybit); | 505 | __set_bit(BTN_EXTRA, psmouse->dev->keybit); |
506 | 506 | ||
507 | if (!psmouse->vendor) psmouse->vendor = "Generic"; | 507 | if (!psmouse->vendor) psmouse->vendor = "Generic"; |
508 | if (!psmouse->name) psmouse->name = "Explorer Mouse"; | 508 | if (!psmouse->name) psmouse->name = "Explorer Mouse"; |
@@ -515,7 +515,7 @@ static int im_explorer_detect(struct psmouse *psmouse, int set_properties) | |||
515 | /* | 515 | /* |
516 | * Kensington ThinkingMouse / ExpertMouse magic init. | 516 | * Kensington ThinkingMouse / ExpertMouse magic init. |
517 | */ | 517 | */ |
518 | static int thinking_detect(struct psmouse *psmouse, int set_properties) | 518 | static int thinking_detect(struct psmouse *psmouse, bool set_properties) |
519 | { | 519 | { |
520 | struct ps2dev *ps2dev = &psmouse->ps2dev; | 520 | struct ps2dev *ps2dev = &psmouse->ps2dev; |
521 | unsigned char param[2]; | 521 | unsigned char param[2]; |
@@ -536,7 +536,7 @@ static int thinking_detect(struct psmouse *psmouse, int set_properties) | |||
536 | return -1; | 536 | return -1; |
537 | 537 | ||
538 | if (set_properties) { | 538 | if (set_properties) { |
539 | set_bit(BTN_EXTRA, psmouse->dev->keybit); | 539 | __set_bit(BTN_EXTRA, psmouse->dev->keybit); |
540 | 540 | ||
541 | psmouse->vendor = "Kensington"; | 541 | psmouse->vendor = "Kensington"; |
542 | psmouse->name = "ThinkingMouse"; | 542 | psmouse->name = "ThinkingMouse"; |
@@ -548,7 +548,7 @@ static int thinking_detect(struct psmouse *psmouse, int set_properties) | |||
548 | /* | 548 | /* |
549 | * Bare PS/2 protocol "detection". Always succeeds. | 549 | * Bare PS/2 protocol "detection". Always succeeds. |
550 | */ | 550 | */ |
551 | static int ps2bare_detect(struct psmouse *psmouse, int set_properties) | 551 | static int ps2bare_detect(struct psmouse *psmouse, bool set_properties) |
552 | { | 552 | { |
553 | if (set_properties) { | 553 | if (set_properties) { |
554 | if (!psmouse->vendor) psmouse->vendor = "Generic"; | 554 | if (!psmouse->vendor) psmouse->vendor = "Generic"; |
@@ -562,12 +562,12 @@ static int ps2bare_detect(struct psmouse *psmouse, int set_properties) | |||
562 | * Cortron PS/2 protocol detection. There's no special way to detect it, so it | 562 | * Cortron PS/2 protocol detection. There's no special way to detect it, so it |
563 | * must be forced by sysfs protocol writing. | 563 | * must be forced by sysfs protocol writing. |
564 | */ | 564 | */ |
565 | static int cortron_detect(struct psmouse *psmouse, int set_properties) | 565 | static int cortron_detect(struct psmouse *psmouse, bool set_properties) |
566 | { | 566 | { |
567 | if (set_properties) { | 567 | if (set_properties) { |
568 | psmouse->vendor = "Cortron"; | 568 | psmouse->vendor = "Cortron"; |
569 | psmouse->name = "PS/2 Trackball"; | 569 | psmouse->name = "PS/2 Trackball"; |
570 | set_bit(BTN_SIDE, psmouse->dev->keybit); | 570 | __set_bit(BTN_SIDE, psmouse->dev->keybit); |
571 | } | 571 | } |
572 | 572 | ||
573 | return 0; | 573 | return 0; |
@@ -579,9 +579,9 @@ static int cortron_detect(struct psmouse *psmouse, int set_properties) | |||
579 | */ | 579 | */ |
580 | 580 | ||
581 | static int psmouse_extensions(struct psmouse *psmouse, | 581 | static int psmouse_extensions(struct psmouse *psmouse, |
582 | unsigned int max_proto, int set_properties) | 582 | unsigned int max_proto, bool set_properties) |
583 | { | 583 | { |
584 | int synaptics_hardware = 0; | 584 | bool synaptics_hardware = true; |
585 | 585 | ||
586 | /* | 586 | /* |
587 | * We always check for lifebook because it does not disturb mouse | 587 | * We always check for lifebook because it does not disturb mouse |
@@ -608,7 +608,7 @@ static int psmouse_extensions(struct psmouse *psmouse, | |||
608 | * can reset it properly after probing for intellimouse. | 608 | * can reset it properly after probing for intellimouse. |
609 | */ | 609 | */ |
610 | if (max_proto > PSMOUSE_PS2 && synaptics_detect(psmouse, set_properties) == 0) { | 610 | if (max_proto > PSMOUSE_PS2 && synaptics_detect(psmouse, set_properties) == 0) { |
611 | synaptics_hardware = 1; | 611 | synaptics_hardware = true; |
612 | 612 | ||
613 | if (max_proto > PSMOUSE_IMEX) { | 613 | if (max_proto > PSMOUSE_IMEX) { |
614 | if (!set_properties || synaptics_init(psmouse) == 0) | 614 | if (!set_properties || synaptics_init(psmouse) == 0) |
@@ -733,7 +733,7 @@ static const struct psmouse_protocol psmouse_protocols[] = { | |||
733 | .type = PSMOUSE_PS2, | 733 | .type = PSMOUSE_PS2, |
734 | .name = "PS/2", | 734 | .name = "PS/2", |
735 | .alias = "bare", | 735 | .alias = "bare", |
736 | .maxproto = 1, | 736 | .maxproto = true, |
737 | .detect = ps2bare_detect, | 737 | .detect = ps2bare_detect, |
738 | }, | 738 | }, |
739 | #ifdef CONFIG_MOUSE_PS2_LOGIPS2PP | 739 | #ifdef CONFIG_MOUSE_PS2_LOGIPS2PP |
@@ -760,14 +760,14 @@ static const struct psmouse_protocol psmouse_protocols[] = { | |||
760 | .type = PSMOUSE_IMPS, | 760 | .type = PSMOUSE_IMPS, |
761 | .name = "ImPS/2", | 761 | .name = "ImPS/2", |
762 | .alias = "imps", | 762 | .alias = "imps", |
763 | .maxproto = 1, | 763 | .maxproto = true, |
764 | .detect = intellimouse_detect, | 764 | .detect = intellimouse_detect, |
765 | }, | 765 | }, |
766 | { | 766 | { |
767 | .type = PSMOUSE_IMEX, | 767 | .type = PSMOUSE_IMEX, |
768 | .name = "ImExPS/2", | 768 | .name = "ImExPS/2", |
769 | .alias = "exps", | 769 | .alias = "exps", |
770 | .maxproto = 1, | 770 | .maxproto = true, |
771 | .detect = im_explorer_detect, | 771 | .detect = im_explorer_detect, |
772 | }, | 772 | }, |
773 | #ifdef CONFIG_MOUSE_PS2_SYNAPTICS | 773 | #ifdef CONFIG_MOUSE_PS2_SYNAPTICS |
@@ -848,7 +848,7 @@ static const struct psmouse_protocol psmouse_protocols[] = { | |||
848 | .type = PSMOUSE_AUTO, | 848 | .type = PSMOUSE_AUTO, |
849 | .name = "auto", | 849 | .name = "auto", |
850 | .alias = "any", | 850 | .alias = "any", |
851 | .maxproto = 1, | 851 | .maxproto = true, |
852 | }, | 852 | }, |
853 | }; | 853 | }; |
854 | 854 | ||
@@ -1014,7 +1014,7 @@ static void psmouse_resync(struct work_struct *work) | |||
1014 | container_of(work, struct psmouse, resync_work.work); | 1014 | container_of(work, struct psmouse, resync_work.work); |
1015 | struct serio *serio = psmouse->ps2dev.serio; | 1015 | struct serio *serio = psmouse->ps2dev.serio; |
1016 | psmouse_ret_t rc = PSMOUSE_GOOD_DATA; | 1016 | psmouse_ret_t rc = PSMOUSE_GOOD_DATA; |
1017 | int failed = 0, enabled = 0; | 1017 | bool failed = false, enabled = false; |
1018 | int i; | 1018 | int i; |
1019 | 1019 | ||
1020 | mutex_lock(&psmouse_mutex); | 1020 | mutex_lock(&psmouse_mutex); |
@@ -1041,9 +1041,9 @@ static void psmouse_resync(struct work_struct *work) | |||
1041 | 1041 | ||
1042 | if (ps2_sendbyte(&psmouse->ps2dev, PSMOUSE_CMD_DISABLE, 20)) { | 1042 | if (ps2_sendbyte(&psmouse->ps2dev, PSMOUSE_CMD_DISABLE, 20)) { |
1043 | if (psmouse->num_resyncs < 3 || psmouse->acks_disable_command) | 1043 | if (psmouse->num_resyncs < 3 || psmouse->acks_disable_command) |
1044 | failed = 1; | 1044 | failed = true; |
1045 | } else | 1045 | } else |
1046 | psmouse->acks_disable_command = 1; | 1046 | psmouse->acks_disable_command = true; |
1047 | 1047 | ||
1048 | /* | 1048 | /* |
1049 | * Poll the mouse. If it was reset the packet will be shorter than | 1049 | * Poll the mouse. If it was reset the packet will be shorter than |
@@ -1054,7 +1054,7 @@ static void psmouse_resync(struct work_struct *work) | |||
1054 | */ | 1054 | */ |
1055 | if (!failed) { | 1055 | if (!failed) { |
1056 | if (psmouse->poll(psmouse)) | 1056 | if (psmouse->poll(psmouse)) |
1057 | failed = 1; | 1057 | failed = true; |
1058 | else { | 1058 | else { |
1059 | psmouse_set_state(psmouse, PSMOUSE_CMD_MODE); | 1059 | psmouse_set_state(psmouse, PSMOUSE_CMD_MODE); |
1060 | for (i = 0; i < psmouse->pktsize; i++) { | 1060 | for (i = 0; i < psmouse->pktsize; i++) { |
@@ -1064,7 +1064,7 @@ static void psmouse_resync(struct work_struct *work) | |||
1064 | break; | 1064 | break; |
1065 | } | 1065 | } |
1066 | if (rc != PSMOUSE_FULL_PACKET) | 1066 | if (rc != PSMOUSE_FULL_PACKET) |
1067 | failed = 1; | 1067 | failed = true; |
1068 | psmouse_set_state(psmouse, PSMOUSE_RESYNCING); | 1068 | psmouse_set_state(psmouse, PSMOUSE_RESYNCING); |
1069 | } | 1069 | } |
1070 | } | 1070 | } |
@@ -1075,7 +1075,7 @@ static void psmouse_resync(struct work_struct *work) | |||
1075 | */ | 1075 | */ |
1076 | for (i = 0; i < 5; i++) { | 1076 | for (i = 0; i < 5; i++) { |
1077 | if (!ps2_command(&psmouse->ps2dev, NULL, PSMOUSE_CMD_ENABLE)) { | 1077 | if (!ps2_command(&psmouse->ps2dev, NULL, PSMOUSE_CMD_ENABLE)) { |
1078 | enabled = 1; | 1078 | enabled = true; |
1079 | break; | 1079 | break; |
1080 | } | 1080 | } |
1081 | msleep(200); | 1081 | msleep(200); |
@@ -1084,7 +1084,7 @@ static void psmouse_resync(struct work_struct *work) | |||
1084 | if (!enabled) { | 1084 | if (!enabled) { |
1085 | printk(KERN_WARNING "psmouse.c: failed to re-enable mouse on %s\n", | 1085 | printk(KERN_WARNING "psmouse.c: failed to re-enable mouse on %s\n", |
1086 | psmouse->ps2dev.serio->phys); | 1086 | psmouse->ps2dev.serio->phys); |
1087 | failed = 1; | 1087 | failed = true; |
1088 | } | 1088 | } |
1089 | 1089 | ||
1090 | if (failed) { | 1090 | if (failed) { |
@@ -1211,7 +1211,8 @@ static int psmouse_switch_protocol(struct psmouse *psmouse, const struct psmouse | |||
1211 | psmouse->type = proto->type; | 1211 | psmouse->type = proto->type; |
1212 | } | 1212 | } |
1213 | else | 1213 | else |
1214 | psmouse->type = psmouse_extensions(psmouse, psmouse_max_proto, 1); | 1214 | psmouse->type = psmouse_extensions(psmouse, |
1215 | psmouse_max_proto, true); | ||
1215 | 1216 | ||
1216 | /* | 1217 | /* |
1217 | * If mouse's packet size is 3 there is no point in polling the | 1218 | * If mouse's packet size is 3 there is no point in polling the |
@@ -1366,8 +1367,10 @@ static int psmouse_reconnect(struct serio *serio) | |||
1366 | if (psmouse->reconnect(psmouse)) | 1367 | if (psmouse->reconnect(psmouse)) |
1367 | goto out; | 1368 | goto out; |
1368 | } else if (psmouse_probe(psmouse) < 0 || | 1369 | } else if (psmouse_probe(psmouse) < 0 || |
1369 | psmouse->type != psmouse_extensions(psmouse, psmouse_max_proto, 0)) | 1370 | psmouse->type != psmouse_extensions(psmouse, |
1371 | psmouse_max_proto, false)) { | ||
1370 | goto out; | 1372 | goto out; |
1373 | } | ||
1371 | 1374 | ||
1372 | /* ok, the device type (and capabilities) match the old one, | 1375 | /* ok, the device type (and capabilities) match the old one, |
1373 | * we can continue using it, complete intialization | 1376 | * we can continue using it, complete intialization |
@@ -1552,7 +1555,9 @@ static ssize_t psmouse_attr_set_protocol(struct psmouse *psmouse, void *data, co | |||
1552 | 1555 | ||
1553 | while (serio->child) { | 1556 | while (serio->child) { |
1554 | if (++retry > 3) { | 1557 | if (++retry > 3) { |
1555 | printk(KERN_WARNING "psmouse: failed to destroy child port, protocol change aborted.\n"); | 1558 | printk(KERN_WARNING |
1559 | "psmouse: failed to destroy child port, " | ||
1560 | "protocol change aborted.\n"); | ||
1556 | input_free_device(new_dev); | 1561 | input_free_device(new_dev); |
1557 | return -EIO; | 1562 | return -EIO; |
1558 | } | 1563 | } |
diff --git a/drivers/input/mouse/psmouse.h b/drivers/input/mouse/psmouse.h index cca1744c2a08..e053bdd137ff 100644 --- a/drivers/input/mouse/psmouse.h +++ b/drivers/input/mouse/psmouse.h | |||
@@ -47,10 +47,10 @@ struct psmouse { | |||
47 | unsigned char pktcnt; | 47 | unsigned char pktcnt; |
48 | unsigned char pktsize; | 48 | unsigned char pktsize; |
49 | unsigned char type; | 49 | unsigned char type; |
50 | unsigned char acks_disable_command; | 50 | bool acks_disable_command; |
51 | unsigned int model; | 51 | unsigned int model; |
52 | unsigned long last; | 52 | unsigned long last; |
53 | unsigned long out_of_sync; | 53 | unsigned long out_of_sync_cnt; |
54 | unsigned long num_resyncs; | 54 | unsigned long num_resyncs; |
55 | enum psmouse_state state; | 55 | enum psmouse_state state; |
56 | char devname[64]; | 56 | char devname[64]; |
@@ -60,7 +60,7 @@ struct psmouse { | |||
60 | unsigned int resolution; | 60 | unsigned int resolution; |
61 | unsigned int resetafter; | 61 | unsigned int resetafter; |
62 | unsigned int resync_time; | 62 | unsigned int resync_time; |
63 | unsigned int smartscroll; /* Logitech only */ | 63 | bool smartscroll; /* Logitech only */ |
64 | 64 | ||
65 | psmouse_ret_t (*protocol_handler)(struct psmouse *psmouse); | 65 | psmouse_ret_t (*protocol_handler)(struct psmouse *psmouse); |
66 | void (*set_rate)(struct psmouse *psmouse, unsigned int rate); | 66 | void (*set_rate)(struct psmouse *psmouse, unsigned int rate); |
@@ -108,7 +108,7 @@ struct psmouse_attribute { | |||
108 | ssize_t (*show)(struct psmouse *psmouse, void *data, char *buf); | 108 | ssize_t (*show)(struct psmouse *psmouse, void *data, char *buf); |
109 | ssize_t (*set)(struct psmouse *psmouse, void *data, | 109 | ssize_t (*set)(struct psmouse *psmouse, void *data, |
110 | const char *buf, size_t count); | 110 | const char *buf, size_t count); |
111 | int protect; | 111 | bool protect; |
112 | }; | 112 | }; |
113 | #define to_psmouse_attr(a) container_of((a), struct psmouse_attribute, dattr) | 113 | #define to_psmouse_attr(a) container_of((a), struct psmouse_attribute, dattr) |
114 | 114 | ||
@@ -139,14 +139,14 @@ static struct psmouse_attribute psmouse_attr_##_name = { \ | |||
139 | __PSMOUSE_DEFINE_ATTR_VAR(_name, _mode, _data, _show, _set, _protect) | 139 | __PSMOUSE_DEFINE_ATTR_VAR(_name, _mode, _data, _show, _set, _protect) |
140 | 140 | ||
141 | #define PSMOUSE_DEFINE_ATTR(_name, _mode, _data, _show, _set) \ | 141 | #define PSMOUSE_DEFINE_ATTR(_name, _mode, _data, _show, _set) \ |
142 | __PSMOUSE_DEFINE_ATTR(_name, _mode, _data, _show, _set, 1) | 142 | __PSMOUSE_DEFINE_ATTR(_name, _mode, _data, _show, _set, true) |
143 | 143 | ||
144 | #define PSMOUSE_DEFINE_RO_ATTR(_name, _mode, _data, _show) \ | 144 | #define PSMOUSE_DEFINE_RO_ATTR(_name, _mode, _data, _show) \ |
145 | static ssize_t _show(struct psmouse *, void *, char *); \ | 145 | static ssize_t _show(struct psmouse *, void *, char *); \ |
146 | __PSMOUSE_DEFINE_ATTR_VAR(_name, _mode, _data, _show, NULL, 1) | 146 | __PSMOUSE_DEFINE_ATTR_VAR(_name, _mode, _data, _show, NULL, true) |
147 | 147 | ||
148 | #define PSMOUSE_DEFINE_WO_ATTR(_name, _mode, _data, _set) \ | 148 | #define PSMOUSE_DEFINE_WO_ATTR(_name, _mode, _data, _set) \ |
149 | static ssize_t _set(struct psmouse *, void *, const char *, size_t); \ | 149 | static ssize_t _set(struct psmouse *, void *, const char *, size_t); \ |
150 | __PSMOUSE_DEFINE_ATTR_VAR(_name, _mode, _data, NULL, _set, 1) | 150 | __PSMOUSE_DEFINE_ATTR_VAR(_name, _mode, _data, NULL, _set, true) |
151 | 151 | ||
152 | #endif /* _PSMOUSE_H */ | 152 | #endif /* _PSMOUSE_H */ |
diff --git a/drivers/input/mouse/sentelic.c b/drivers/input/mouse/sentelic.c index 97b1e72855a0..84e2fc04d11b 100644 --- a/drivers/input/mouse/sentelic.c +++ b/drivers/input/mouse/sentelic.c | |||
@@ -756,7 +756,7 @@ static int fsp_activate_protocol(struct psmouse *psmouse) | |||
756 | return 0; | 756 | return 0; |
757 | } | 757 | } |
758 | 758 | ||
759 | int fsp_detect(struct psmouse *psmouse, int set_properties) | 759 | int fsp_detect(struct psmouse *psmouse, bool set_properties) |
760 | { | 760 | { |
761 | int id; | 761 | int id; |
762 | 762 | ||
diff --git a/drivers/input/mouse/sentelic.h b/drivers/input/mouse/sentelic.h index 083559c7282b..ed1395ac7b8b 100644 --- a/drivers/input/mouse/sentelic.h +++ b/drivers/input/mouse/sentelic.h | |||
@@ -80,10 +80,10 @@ struct fsp_data { | |||
80 | }; | 80 | }; |
81 | 81 | ||
82 | #ifdef CONFIG_MOUSE_PS2_SENTELIC | 82 | #ifdef CONFIG_MOUSE_PS2_SENTELIC |
83 | extern int fsp_detect(struct psmouse *psmouse, int set_properties); | 83 | extern int fsp_detect(struct psmouse *psmouse, bool set_properties); |
84 | extern int fsp_init(struct psmouse *psmouse); | 84 | extern int fsp_init(struct psmouse *psmouse); |
85 | #else | 85 | #else |
86 | inline int fsp_detect(struct psmouse *psmouse, int set_properties) | 86 | inline int fsp_detect(struct psmouse *psmouse, bool set_properties) |
87 | { | 87 | { |
88 | return -ENOSYS; | 88 | return -ENOSYS; |
89 | } | 89 | } |
diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c index 19984bf06cad..b66ff1ac7dea 100644 --- a/drivers/input/mouse/synaptics.c +++ b/drivers/input/mouse/synaptics.c | |||
@@ -60,7 +60,7 @@ static int synaptics_mode_cmd(struct psmouse *psmouse, unsigned char mode) | |||
60 | return 0; | 60 | return 0; |
61 | } | 61 | } |
62 | 62 | ||
63 | int synaptics_detect(struct psmouse *psmouse, int set_properties) | 63 | int synaptics_detect(struct psmouse *psmouse, bool set_properties) |
64 | { | 64 | { |
65 | struct ps2dev *ps2dev = &psmouse->ps2dev; | 65 | struct ps2dev *ps2dev = &psmouse->ps2dev; |
66 | unsigned char param[4]; | 66 | unsigned char param[4]; |
@@ -556,38 +556,38 @@ static void set_input_params(struct input_dev *dev, struct synaptics_data *priv) | |||
556 | { | 556 | { |
557 | int i; | 557 | int i; |
558 | 558 | ||
559 | set_bit(EV_ABS, dev->evbit); | 559 | __set_bit(EV_ABS, dev->evbit); |
560 | input_set_abs_params(dev, ABS_X, XMIN_NOMINAL, XMAX_NOMINAL, 0, 0); | 560 | input_set_abs_params(dev, ABS_X, XMIN_NOMINAL, XMAX_NOMINAL, 0, 0); |
561 | input_set_abs_params(dev, ABS_Y, YMIN_NOMINAL, YMAX_NOMINAL, 0, 0); | 561 | input_set_abs_params(dev, ABS_Y, YMIN_NOMINAL, YMAX_NOMINAL, 0, 0); |
562 | input_set_abs_params(dev, ABS_PRESSURE, 0, 255, 0, 0); | 562 | input_set_abs_params(dev, ABS_PRESSURE, 0, 255, 0, 0); |
563 | set_bit(ABS_TOOL_WIDTH, dev->absbit); | 563 | __set_bit(ABS_TOOL_WIDTH, dev->absbit); |
564 | 564 | ||
565 | set_bit(EV_KEY, dev->evbit); | 565 | __set_bit(EV_KEY, dev->evbit); |
566 | set_bit(BTN_TOUCH, dev->keybit); | 566 | __set_bit(BTN_TOUCH, dev->keybit); |
567 | set_bit(BTN_TOOL_FINGER, dev->keybit); | 567 | __set_bit(BTN_TOOL_FINGER, dev->keybit); |
568 | set_bit(BTN_LEFT, dev->keybit); | 568 | __set_bit(BTN_LEFT, dev->keybit); |
569 | set_bit(BTN_RIGHT, dev->keybit); | 569 | __set_bit(BTN_RIGHT, dev->keybit); |
570 | 570 | ||
571 | if (SYN_CAP_MULTIFINGER(priv->capabilities)) { | 571 | if (SYN_CAP_MULTIFINGER(priv->capabilities)) { |
572 | set_bit(BTN_TOOL_DOUBLETAP, dev->keybit); | 572 | __set_bit(BTN_TOOL_DOUBLETAP, dev->keybit); |
573 | set_bit(BTN_TOOL_TRIPLETAP, dev->keybit); | 573 | __set_bit(BTN_TOOL_TRIPLETAP, dev->keybit); |
574 | } | 574 | } |
575 | 575 | ||
576 | if (SYN_CAP_MIDDLE_BUTTON(priv->capabilities)) | 576 | if (SYN_CAP_MIDDLE_BUTTON(priv->capabilities)) |
577 | set_bit(BTN_MIDDLE, dev->keybit); | 577 | __set_bit(BTN_MIDDLE, dev->keybit); |
578 | 578 | ||
579 | if (SYN_CAP_FOUR_BUTTON(priv->capabilities) || | 579 | if (SYN_CAP_FOUR_BUTTON(priv->capabilities) || |
580 | SYN_CAP_MIDDLE_BUTTON(priv->capabilities)) { | 580 | SYN_CAP_MIDDLE_BUTTON(priv->capabilities)) { |
581 | set_bit(BTN_FORWARD, dev->keybit); | 581 | __set_bit(BTN_FORWARD, dev->keybit); |
582 | set_bit(BTN_BACK, dev->keybit); | 582 | __set_bit(BTN_BACK, dev->keybit); |
583 | } | 583 | } |
584 | 584 | ||
585 | for (i = 0; i < SYN_CAP_MULTI_BUTTON_NO(priv->ext_cap); i++) | 585 | for (i = 0; i < SYN_CAP_MULTI_BUTTON_NO(priv->ext_cap); i++) |
586 | set_bit(BTN_0 + i, dev->keybit); | 586 | __set_bit(BTN_0 + i, dev->keybit); |
587 | 587 | ||
588 | clear_bit(EV_REL, dev->evbit); | 588 | __clear_bit(EV_REL, dev->evbit); |
589 | clear_bit(REL_X, dev->relbit); | 589 | __clear_bit(REL_X, dev->relbit); |
590 | clear_bit(REL_Y, dev->relbit); | 590 | __clear_bit(REL_Y, dev->relbit); |
591 | 591 | ||
592 | dev->absres[ABS_X] = priv->x_res; | 592 | dev->absres[ABS_X] = priv->x_res; |
593 | dev->absres[ABS_Y] = priv->y_res; | 593 | dev->absres[ABS_Y] = priv->y_res; |
diff --git a/drivers/input/mouse/synaptics.h b/drivers/input/mouse/synaptics.h index 302382151752..871f6fe377f9 100644 --- a/drivers/input/mouse/synaptics.h +++ b/drivers/input/mouse/synaptics.h | |||
@@ -105,7 +105,7 @@ struct synaptics_data { | |||
105 | int scroll; | 105 | int scroll; |
106 | }; | 106 | }; |
107 | 107 | ||
108 | int synaptics_detect(struct psmouse *psmouse, int set_properties); | 108 | int synaptics_detect(struct psmouse *psmouse, bool set_properties); |
109 | int synaptics_init(struct psmouse *psmouse); | 109 | int synaptics_init(struct psmouse *psmouse); |
110 | void synaptics_reset(struct psmouse *psmouse); | 110 | void synaptics_reset(struct psmouse *psmouse); |
111 | 111 | ||
diff --git a/drivers/input/mouse/touchkit_ps2.c b/drivers/input/mouse/touchkit_ps2.c index 3fadb2accac0..0308a0faa94d 100644 --- a/drivers/input/mouse/touchkit_ps2.c +++ b/drivers/input/mouse/touchkit_ps2.c | |||
@@ -67,7 +67,7 @@ static psmouse_ret_t touchkit_ps2_process_byte(struct psmouse *psmouse) | |||
67 | return PSMOUSE_FULL_PACKET; | 67 | return PSMOUSE_FULL_PACKET; |
68 | } | 68 | } |
69 | 69 | ||
70 | int touchkit_ps2_detect(struct psmouse *psmouse, int set_properties) | 70 | int touchkit_ps2_detect(struct psmouse *psmouse, bool set_properties) |
71 | { | 71 | { |
72 | struct input_dev *dev = psmouse->dev; | 72 | struct input_dev *dev = psmouse->dev; |
73 | unsigned char param[3]; | 73 | unsigned char param[3]; |
@@ -86,7 +86,7 @@ int touchkit_ps2_detect(struct psmouse *psmouse, int set_properties) | |||
86 | 86 | ||
87 | if (set_properties) { | 87 | if (set_properties) { |
88 | dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS); | 88 | dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS); |
89 | set_bit(BTN_TOUCH, dev->keybit); | 89 | __set_bit(BTN_TOUCH, dev->keybit); |
90 | input_set_abs_params(dev, ABS_X, 0, TOUCHKIT_MAX_XC, 0, 0); | 90 | input_set_abs_params(dev, ABS_X, 0, TOUCHKIT_MAX_XC, 0, 0); |
91 | input_set_abs_params(dev, ABS_Y, 0, TOUCHKIT_MAX_YC, 0, 0); | 91 | input_set_abs_params(dev, ABS_Y, 0, TOUCHKIT_MAX_YC, 0, 0); |
92 | 92 | ||
diff --git a/drivers/input/mouse/touchkit_ps2.h b/drivers/input/mouse/touchkit_ps2.h index 8a0dd3574aef..2efe9ea29d0c 100644 --- a/drivers/input/mouse/touchkit_ps2.h +++ b/drivers/input/mouse/touchkit_ps2.h | |||
@@ -13,10 +13,10 @@ | |||
13 | #define _TOUCHKIT_PS2_H | 13 | #define _TOUCHKIT_PS2_H |
14 | 14 | ||
15 | #ifdef CONFIG_MOUSE_PS2_TOUCHKIT | 15 | #ifdef CONFIG_MOUSE_PS2_TOUCHKIT |
16 | int touchkit_ps2_detect(struct psmouse *psmouse, int set_properties); | 16 | int touchkit_ps2_detect(struct psmouse *psmouse, bool set_properties); |
17 | #else | 17 | #else |
18 | static inline int touchkit_ps2_detect(struct psmouse *psmouse, | 18 | static inline int touchkit_ps2_detect(struct psmouse *psmouse, |
19 | int set_properties) | 19 | bool set_properties) |
20 | { | 20 | { |
21 | return -ENOSYS; | 21 | return -ENOSYS; |
22 | } | 22 | } |
diff --git a/drivers/input/mouse/trackpoint.c b/drivers/input/mouse/trackpoint.c index e68c814c4361..e354362f2971 100644 --- a/drivers/input/mouse/trackpoint.c +++ b/drivers/input/mouse/trackpoint.c | |||
@@ -282,7 +282,7 @@ static int trackpoint_reconnect(struct psmouse *psmouse) | |||
282 | return 0; | 282 | return 0; |
283 | } | 283 | } |
284 | 284 | ||
285 | int trackpoint_detect(struct psmouse *psmouse, int set_properties) | 285 | int trackpoint_detect(struct psmouse *psmouse, bool set_properties) |
286 | { | 286 | { |
287 | struct trackpoint_data *priv; | 287 | struct trackpoint_data *priv; |
288 | struct ps2dev *ps2dev = &psmouse->ps2dev; | 288 | struct ps2dev *ps2dev = &psmouse->ps2dev; |
diff --git a/drivers/input/mouse/trackpoint.h b/drivers/input/mouse/trackpoint.h index c10a6e7d0101..e558a7096618 100644 --- a/drivers/input/mouse/trackpoint.h +++ b/drivers/input/mouse/trackpoint.h | |||
@@ -143,9 +143,9 @@ struct trackpoint_data | |||
143 | }; | 143 | }; |
144 | 144 | ||
145 | #ifdef CONFIG_MOUSE_PS2_TRACKPOINT | 145 | #ifdef CONFIG_MOUSE_PS2_TRACKPOINT |
146 | int trackpoint_detect(struct psmouse *psmouse, int set_properties); | 146 | int trackpoint_detect(struct psmouse *psmouse, bool set_properties); |
147 | #else | 147 | #else |
148 | inline int trackpoint_detect(struct psmouse *psmouse, int set_properties) | 148 | inline int trackpoint_detect(struct psmouse *psmouse, bool set_properties) |
149 | { | 149 | { |
150 | return -ENOSYS; | 150 | return -ENOSYS; |
151 | } | 151 | } |