aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/misc
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-08-10 18:08:02 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-08-10 18:08:02 -0400
commit04f2b9765f1e80337314e03c4adde695fe2f0403 (patch)
treebde948d37c22eaf5e200dd9675543ea2b2e059c2 /drivers/input/misc
parent9895850b23886e030cd1e7241d5529a57e969c3d (diff)
parent5fc0d36c00e6a2d0a9f2a0a815cff5b9a13b080d (diff)
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/misc')
-rw-r--r--drivers/input/misc/adxl34x.c1
-rw-r--r--drivers/input/misc/uinput.c29
2 files changed, 17 insertions, 13 deletions
diff --git a/drivers/input/misc/adxl34x.c b/drivers/input/misc/adxl34x.c
index e2ca01708080..de5900d50788 100644
--- a/drivers/input/misc/adxl34x.c
+++ b/drivers/input/misc/adxl34x.c
@@ -724,7 +724,6 @@ struct adxl34x *adxl34x_probe(struct device *dev, int irq,
724 pdata = &ac->pdata; 724 pdata = &ac->pdata;
725 725
726 ac->input = input_dev; 726 ac->input = input_dev;
727 ac->disabled = true;
728 ac->dev = dev; 727 ac->dev = dev;
729 ac->irq = irq; 728 ac->irq = irq;
730 ac->bops = bops; 729 ac->bops = bops;
diff --git a/drivers/input/misc/uinput.c b/drivers/input/misc/uinput.c
index b71eb55f2dbc..bb53fd33cd1c 100644
--- a/drivers/input/misc/uinput.c
+++ b/drivers/input/misc/uinput.c
@@ -304,21 +304,25 @@ static int uinput_validate_absbits(struct input_dev *dev)
304 if (!test_bit(cnt, dev->absbit)) 304 if (!test_bit(cnt, dev->absbit))
305 continue; 305 continue;
306 306
307 if ((dev->absmax[cnt] <= dev->absmin[cnt])) { 307 if (input_abs_get_max(dev, cnt) <= input_abs_get_min(dev, cnt)) {
308 printk(KERN_DEBUG 308 printk(KERN_DEBUG
309 "%s: invalid abs[%02x] min:%d max:%d\n", 309 "%s: invalid abs[%02x] min:%d max:%d\n",
310 UINPUT_NAME, cnt, 310 UINPUT_NAME, cnt,
311 dev->absmin[cnt], dev->absmax[cnt]); 311 input_abs_get_min(dev, cnt),
312 input_abs_get_max(dev, cnt));
312 retval = -EINVAL; 313 retval = -EINVAL;
313 break; 314 break;
314 } 315 }
315 316
316 if (dev->absflat[cnt] > (dev->absmax[cnt] - dev->absmin[cnt])) { 317 if (input_abs_get_flat(dev, cnt) >
318 input_abs_get_max(dev, cnt) - input_abs_get_min(dev, cnt)) {
317 printk(KERN_DEBUG 319 printk(KERN_DEBUG
318 "%s: absflat[%02x] out of range: %d " 320 "%s: abs_flat #%02x out of range: %d "
319 "(min:%d/max:%d)\n", 321 "(min:%d/max:%d)\n",
320 UINPUT_NAME, cnt, dev->absflat[cnt], 322 UINPUT_NAME, cnt,
321 dev->absmin[cnt], dev->absmax[cnt]); 323 input_abs_get_flat(dev, cnt),
324 input_abs_get_min(dev, cnt),
325 input_abs_get_max(dev, cnt));
322 retval = -EINVAL; 326 retval = -EINVAL;
323 break; 327 break;
324 } 328 }
@@ -343,7 +347,7 @@ static int uinput_setup_device(struct uinput_device *udev, const char __user *bu
343 struct uinput_user_dev *user_dev; 347 struct uinput_user_dev *user_dev;
344 struct input_dev *dev; 348 struct input_dev *dev;
345 char *name; 349 char *name;
346 int size; 350 int i, size;
347 int retval; 351 int retval;
348 352
349 if (count != sizeof(struct uinput_user_dev)) 353 if (count != sizeof(struct uinput_user_dev))
@@ -387,11 +391,12 @@ static int uinput_setup_device(struct uinput_device *udev, const char __user *bu
387 dev->id.product = user_dev->id.product; 391 dev->id.product = user_dev->id.product;
388 dev->id.version = user_dev->id.version; 392 dev->id.version = user_dev->id.version;
389 393
390 size = sizeof(int) * ABS_CNT; 394 for (i = 0; i < ABS_CNT; i++) {
391 memcpy(dev->absmax, user_dev->absmax, size); 395 input_abs_set_max(dev, i, user_dev->absmax[i]);
392 memcpy(dev->absmin, user_dev->absmin, size); 396 input_abs_set_min(dev, i, user_dev->absmin[i]);
393 memcpy(dev->absfuzz, user_dev->absfuzz, size); 397 input_abs_set_fuzz(dev, i, user_dev->absfuzz[i]);
394 memcpy(dev->absflat, user_dev->absflat, size); 398 input_abs_set_flat(dev, i, user_dev->absflat[i]);
399 }
395 400
396 /* check if absmin/absmax/absfuzz/absflat are filled as 401 /* check if absmin/absmax/absfuzz/absflat are filled as
397 * told in Documentation/input/input-programming.txt */ 402 * told in Documentation/input/input-programming.txt */