diff options
Diffstat (limited to 'drivers/input/joystick/sidewinder.c')
-rw-r--r-- | drivers/input/joystick/sidewinder.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/drivers/input/joystick/sidewinder.c b/drivers/input/joystick/sidewinder.c index ca13a6bec33..b8d86115644 100644 --- a/drivers/input/joystick/sidewinder.c +++ b/drivers/input/joystick/sidewinder.c | |||
@@ -761,17 +761,21 @@ static int sw_connect(struct gameport *gameport, struct gameport_driver *drv) | |||
761 | input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS); | 761 | input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS); |
762 | 762 | ||
763 | for (j = 0; (bits = sw_bit[sw->type][j]); j++) { | 763 | for (j = 0; (bits = sw_bit[sw->type][j]); j++) { |
764 | int min, max, fuzz, flat; | ||
765 | |||
764 | code = sw_abs[sw->type][j]; | 766 | code = sw_abs[sw->type][j]; |
765 | set_bit(code, input_dev->absbit); | 767 | min = bits == 1 ? -1 : 0; |
766 | input_dev->absmax[code] = (1 << bits) - 1; | 768 | max = (1 << bits) - 1; |
767 | input_dev->absmin[code] = (bits == 1) ? -1 : 0; | 769 | fuzz = (bits >> 1) >= 2 ? 1 << ((bits >> 1) - 2) : 0; |
768 | input_dev->absfuzz[code] = ((bits >> 1) >= 2) ? (1 << ((bits >> 1) - 2)) : 0; | 770 | flat = code == ABS_THROTTLE || bits < 5 ? |
769 | if (code != ABS_THROTTLE) | 771 | 0 : 1 << (bits - 5); |
770 | input_dev->absflat[code] = (bits >= 5) ? (1 << (bits - 5)) : 0; | 772 | |
773 | input_set_abs_params(input_dev, code, | ||
774 | min, max, fuzz, flat); | ||
771 | } | 775 | } |
772 | 776 | ||
773 | for (j = 0; (code = sw_btn[sw->type][j]); j++) | 777 | for (j = 0; (code = sw_btn[sw->type][j]); j++) |
774 | set_bit(code, input_dev->keybit); | 778 | __set_bit(code, input_dev->keybit); |
775 | 779 | ||
776 | dbg("%s%s [%d-bit id %d data %d]\n", sw->name, comment, m, l, k); | 780 | dbg("%s%s [%d-bit id %d data %d]\n", sw->name, comment, m, l, k); |
777 | 781 | ||