aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/mouse/alps.c
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2009-09-09 22:13:20 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2009-09-11 01:11:38 -0400
commitb7802c5c1ea9563f3746bea09c214ccedc8600f4 (patch)
tree8feca41ff76258d05b8d4cc893b1a08e04a712f8 /drivers/input/mouse/alps.c
parentf81134163fc785622f58af27363079ba1de7c7aa (diff)
Input: psmouse - use boolean type
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input/mouse/alps.c')
-rw-r--r--drivers/input/mouse/alps.c20
1 files changed, 12 insertions, 8 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 */
282static int alps_passthrough_mode(struct psmouse *psmouse, int enable) 282static 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
522int alps_detect(struct psmouse *psmouse, int set_properties) 526int 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;