diff options
Diffstat (limited to 'drivers/input/mouse/logips2pp.c')
| -rw-r--r-- | drivers/input/mouse/logips2pp.c | 41 |
1 files changed, 20 insertions, 21 deletions
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); |
