diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-08-10 15:08:02 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-08-10 15:08:02 -0700 |
commit | 04f2b9765f1e80337314e03c4adde695fe2f0403 (patch) | |
tree | bde948d37c22eaf5e200dd9675543ea2b2e059c2 /drivers/input/joystick/sidewinder.c | |
parent | 9895850b23886e030cd1e7241d5529a57e969c3d (diff) | |
parent | 5fc0d36c00e6a2d0a9f2a0a815cff5b9a13b080d (diff) | |
download | kernel_samsung_smdk4412-04f2b9765f1e80337314e03c4adde695fe2f0403.zip kernel_samsung_smdk4412-04f2b9765f1e80337314e03c4adde695fe2f0403.tar.gz kernel_samsung_smdk4412-04f2b9765f1e80337314e03c4adde695fe2f0403.tar.bz2 |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
Input: xpad - add USB-ID for PL-3601 Xbox 360 pad
Input: cy8ctmg100_ts - signedness bug
Input: elantech - report position also with 3 fingers
Input: elantech - discard the first 2 positions on some firmwares
Input: adxl34x - do not mark device as disabled on startup
Input: gpio_keys - add hooks to enable/disable device
Input: evdev - rearrange ioctl handling
Input: dynamically allocate ABS information
Input: switch to input_abs_*() access functions
Input: add static inline accessors for ABS properties
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 ca13a6b..b8d8611 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); |