diff options
Diffstat (limited to 'drivers/input/joystick')
-rw-r--r-- | drivers/input/joystick/a3d.c | 3 | ||||
-rw-r--r-- | drivers/input/joystick/adi.c | 2 | ||||
-rw-r--r-- | drivers/input/joystick/amijoy.c | 4 | ||||
-rw-r--r-- | drivers/input/joystick/gf2k.c | 20 | ||||
-rw-r--r-- | drivers/input/joystick/interact.c | 14 | ||||
-rw-r--r-- | drivers/input/joystick/sidewinder.c | 18 |
6 files changed, 31 insertions, 30 deletions
diff --git a/drivers/input/joystick/a3d.c b/drivers/input/joystick/a3d.c index 6489f4010c4f..d259b41354b8 100644 --- a/drivers/input/joystick/a3d.c +++ b/drivers/input/joystick/a3d.c | |||
@@ -342,7 +342,8 @@ static int a3d_connect(struct gameport *gameport, struct gameport_driver *drv) | |||
342 | 342 | ||
343 | for (i = 0; i < 4; i++) { | 343 | for (i = 0; i < 4; i++) { |
344 | if (i < 2) | 344 | if (i < 2) |
345 | input_set_abs_params(input_dev, axes[i], 48, input_dev->abs[axes[i]] * 2 - 48, 0, 8); | 345 | input_set_abs_params(input_dev, axes[i], |
346 | 48, input_abs_get_val(input_dev, axes[i]) * 2 - 48, 0, 8); | ||
346 | else | 347 | else |
347 | input_set_abs_params(input_dev, axes[i], 2, 253, 0, 0); | 348 | input_set_abs_params(input_dev, axes[i], 2, 253, 0, 0); |
348 | input_set_abs_params(input_dev, ABS_HAT0X + i, -1, 1, 0, 0); | 349 | input_set_abs_params(input_dev, ABS_HAT0X + i, -1, 1, 0, 0); |
diff --git a/drivers/input/joystick/adi.c b/drivers/input/joystick/adi.c index 89c4c084d4ad..b992fbf91f2f 100644 --- a/drivers/input/joystick/adi.c +++ b/drivers/input/joystick/adi.c | |||
@@ -452,7 +452,7 @@ static void adi_init_center(struct adi *adi) | |||
452 | for (i = 0; i < adi->axes10 + adi->axes8 + (adi->hats + (adi->pad != -1)) * 2; i++) { | 452 | for (i = 0; i < adi->axes10 + adi->axes8 + (adi->hats + (adi->pad != -1)) * 2; i++) { |
453 | 453 | ||
454 | t = adi->abs[i]; | 454 | t = adi->abs[i]; |
455 | x = adi->dev->abs[t]; | 455 | x = input_abs_get_val(adi->dev, t); |
456 | 456 | ||
457 | if (t == ABS_THROTTLE || t == ABS_RUDDER || adi->id == ADI_ID_WGPE) | 457 | if (t == ABS_THROTTLE || t == ABS_RUDDER || adi->id == ADI_ID_WGPE) |
458 | x = i < adi->axes10 ? 512 : 128; | 458 | x = i < adi->axes10 ? 512 : 128; |
diff --git a/drivers/input/joystick/amijoy.c b/drivers/input/joystick/amijoy.c index 05022f07ec77..e90694fe0d5c 100644 --- a/drivers/input/joystick/amijoy.c +++ b/drivers/input/joystick/amijoy.c | |||
@@ -139,8 +139,8 @@ static int __init amijoy_init(void) | |||
139 | amijoy_dev[i]->keybit[BIT_WORD(BTN_LEFT)] = BIT_MASK(BTN_LEFT) | | 139 | amijoy_dev[i]->keybit[BIT_WORD(BTN_LEFT)] = BIT_MASK(BTN_LEFT) | |
140 | BIT_MASK(BTN_MIDDLE) | BIT_MASK(BTN_RIGHT); | 140 | BIT_MASK(BTN_MIDDLE) | BIT_MASK(BTN_RIGHT); |
141 | for (j = 0; j < 2; j++) { | 141 | for (j = 0; j < 2; j++) { |
142 | amijoy_dev[i]->absmin[ABS_X + j] = -1; | 142 | XXinput_set_abs_params(amijoy_dev[i], ABS_X + j, |
143 | amijoy_dev[i]->absmax[ABS_X + j] = 1; | 143 | -1, 1, 0, 0); |
144 | } | 144 | } |
145 | 145 | ||
146 | err = input_register_device(amijoy_dev[i]); | 146 | err = input_register_device(amijoy_dev[i]); |
diff --git a/drivers/input/joystick/gf2k.c b/drivers/input/joystick/gf2k.c index 45ac70eae0aa..0536b1b2f018 100644 --- a/drivers/input/joystick/gf2k.c +++ b/drivers/input/joystick/gf2k.c | |||
@@ -318,11 +318,8 @@ static int gf2k_connect(struct gameport *gameport, struct gameport_driver *drv) | |||
318 | for (i = 0; i < gf2k_axes[gf2k->id]; i++) | 318 | for (i = 0; i < gf2k_axes[gf2k->id]; i++) |
319 | set_bit(gf2k_abs[i], input_dev->absbit); | 319 | set_bit(gf2k_abs[i], input_dev->absbit); |
320 | 320 | ||
321 | for (i = 0; i < gf2k_hats[gf2k->id]; i++) { | 321 | for (i = 0; i < gf2k_hats[gf2k->id]; i++) |
322 | set_bit(ABS_HAT0X + i, input_dev->absbit); | 322 | input_set_abs_params(input_dev, ABS_HAT0X + i, -1, 1, 0, 0); |
323 | input_dev->absmin[ABS_HAT0X + i] = -1; | ||
324 | input_dev->absmax[ABS_HAT0X + i] = 1; | ||
325 | } | ||
326 | 323 | ||
327 | for (i = 0; i < gf2k_joys[gf2k->id]; i++) | 324 | for (i = 0; i < gf2k_joys[gf2k->id]; i++) |
328 | set_bit(gf2k_btn_joy[i], input_dev->keybit); | 325 | set_bit(gf2k_btn_joy[i], input_dev->keybit); |
@@ -334,11 +331,14 @@ static int gf2k_connect(struct gameport *gameport, struct gameport_driver *drv) | |||
334 | gf2k_read(gf2k, data); | 331 | gf2k_read(gf2k, data); |
335 | 332 | ||
336 | for (i = 0; i < gf2k_axes[gf2k->id]; i++) { | 333 | for (i = 0; i < gf2k_axes[gf2k->id]; i++) { |
337 | input_dev->absmax[gf2k_abs[i]] = (i < 2) ? input_dev->abs[gf2k_abs[i]] * 2 - 32 : | 334 | int max = i < 2 ? |
338 | input_dev->abs[gf2k_abs[0]] + input_dev->abs[gf2k_abs[1]] - 32; | 335 | input_abs_get_val(input_dev, gf2k_abs[i]) * 2 : |
339 | input_dev->absmin[gf2k_abs[i]] = 32; | 336 | input_abs_get_val(input_dev, gf2k_abs[0]) + |
340 | input_dev->absfuzz[gf2k_abs[i]] = 8; | 337 | input_abs_get_val(input_dev, gf2k_abs[1]); |
341 | input_dev->absflat[gf2k_abs[i]] = (i < 2) ? 24 : 0; | 338 | int flat = i < 2 ? 24 : 0; |
339 | |||
340 | input_set_abs_params(input_dev, gf2k_abs[i], | ||
341 | 32, max - 32, 8, flat); | ||
342 | } | 342 | } |
343 | 343 | ||
344 | err = input_register_device(gf2k->dev); | 344 | err = input_register_device(gf2k->dev); |
diff --git a/drivers/input/joystick/interact.c b/drivers/input/joystick/interact.c index 2478289aeeea..16fb19d1ca25 100644 --- a/drivers/input/joystick/interact.c +++ b/drivers/input/joystick/interact.c | |||
@@ -270,18 +270,14 @@ static int interact_connect(struct gameport *gameport, struct gameport_driver *d | |||
270 | input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS); | 270 | input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS); |
271 | 271 | ||
272 | for (i = 0; (t = interact_type[interact->type].abs[i]) >= 0; i++) { | 272 | for (i = 0; (t = interact_type[interact->type].abs[i]) >= 0; i++) { |
273 | set_bit(t, input_dev->absbit); | 273 | if (i < interact_type[interact->type].b8) |
274 | if (i < interact_type[interact->type].b8) { | 274 | input_set_abs_params(input_dev, t, 0, 255, 0, 0); |
275 | input_dev->absmin[t] = 0; | 275 | else |
276 | input_dev->absmax[t] = 255; | 276 | input_set_abs_params(input_dev, t, -1, 1, 0, 0); |
277 | } else { | ||
278 | input_dev->absmin[t] = -1; | ||
279 | input_dev->absmax[t] = 1; | ||
280 | } | ||
281 | } | 277 | } |
282 | 278 | ||
283 | for (i = 0; (t = interact_type[interact->type].btn[i]) >= 0; i++) | 279 | for (i = 0; (t = interact_type[interact->type].btn[i]) >= 0; i++) |
284 | set_bit(t, input_dev->keybit); | 280 | __set_bit(t, input_dev->keybit); |
285 | 281 | ||
286 | err = input_register_device(interact->dev); | 282 | err = input_register_device(interact->dev); |
287 | if (err) | 283 | if (err) |
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) | |||
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 | ||