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 ca13a6bec33e..b8d86115644b 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) input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS); for (j = 0; (bits = sw_bit[sw->type][j]); j++) { + int min, max, fuzz, flat; + code = sw_abs[sw->type][j]; - set_bit(code, input_dev->absbit); - input_dev->absmax[code] = (1 << bits) - 1; - input_dev->absmin[code] = (bits == 1) ? -1 : 0; - input_dev->absfuzz[code] = ((bits >> 1) >= 2) ? (1 << ((bits >> 1) - 2)) : 0; - if (code != ABS_THROTTLE) - input_dev->absflat[code] = (bits >= 5) ? (1 << (bits - 5)) : 0; + min = bits == 1 ? -1 : 0; + max = (1 << bits) - 1; + fuzz = (bits >> 1) >= 2 ? 1 << ((bits >> 1) - 2) : 0; + flat = code == ABS_THROTTLE || bits < 5 ? + 0 : 1 << (bits - 5); + + input_set_abs_params(input_dev, code, + min, max, fuzz, flat); } for (j = 0; (code = sw_btn[sw->type][j]); j++) - set_bit(code, input_dev->keybit); + __set_bit(code, input_dev->keybit); dbg("%s%s [%d-bit id %d data %d]\n", sw->name, comment, m, l, k); |