aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/misc
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2011-03-31 01:25:34 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2011-03-31 03:02:39 -0400
commita718d79cc0e0c2f0aa82ba2c54383a18f15b7738 (patch)
tree5a221f370c0492215fed6ede9e1c8cbba7ca9b98 /drivers/input/misc
parent170531bae648c0ef8d56b44dc5bd8d67717b0db9 (diff)
Input: uinput - allow for 0/0 min/max on absolute axes.
Some devices provide absolute axes with min/max of 0/0 (e.g. wacom's ABS_MISC axis). Current uinput restrictions do not allow duplication of these devices and require hacks in userspace to work around this. If the kernel accepts physical devices with a min/max of 0/0, uinput shouldn't disallow the same range. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input/misc')
-rw-r--r--drivers/input/misc/uinput.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/input/misc/uinput.c b/drivers/input/misc/uinput.c
index 364bdf43a381..736056897e50 100644
--- a/drivers/input/misc/uinput.c
+++ b/drivers/input/misc/uinput.c
@@ -302,10 +302,14 @@ static int uinput_validate_absbits(struct input_dev *dev)
302 int retval = 0; 302 int retval = 0;
303 303
304 for (cnt = 0; cnt < ABS_CNT; cnt++) { 304 for (cnt = 0; cnt < ABS_CNT; cnt++) {
305 int min, max;
305 if (!test_bit(cnt, dev->absbit)) 306 if (!test_bit(cnt, dev->absbit))
306 continue; 307 continue;
307 308
308 if (input_abs_get_max(dev, cnt) <= input_abs_get_min(dev, cnt)) { 309 min = input_abs_get_min(dev, cnt);
310 max = input_abs_get_max(dev, cnt);
311
312 if ((min != 0 || max != 0) && max <= min) {
309 printk(KERN_DEBUG 313 printk(KERN_DEBUG
310 "%s: invalid abs[%02x] min:%d max:%d\n", 314 "%s: invalid abs[%02x] min:%d max:%d\n",
311 UINPUT_NAME, cnt, 315 UINPUT_NAME, cnt,