aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2012-03-09 13:56:35 -0500
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2012-03-09 13:56:35 -0500
commit05b7b842fa1798c4775997602d42f3d6373e7ef3 (patch)
treea0942796d362b68c893ec1d92c106a6f04010545 /drivers/input
parentb675b3667f6729dcd1036a2a129b35445947f905 (diff)
parent7491f3dffd99fadf1239011c0ab5346925618dae (diff)
Merge branch 'for-next' of github.com:rydberg/linux into next
Diffstat (limited to 'drivers/input')
-rw-r--r--drivers/input/evdev.c27
-rw-r--r--drivers/input/input.c2
-rw-r--r--drivers/input/mouse/bcm5974.c1
3 files changed, 28 insertions, 2 deletions
diff --git a/drivers/input/evdev.c b/drivers/input/evdev.c
index 3626b1ce4609..cfe78597eb68 100644
--- a/drivers/input/evdev.c
+++ b/drivers/input/evdev.c
@@ -20,7 +20,7 @@
20#include <linux/slab.h> 20#include <linux/slab.h>
21#include <linux/module.h> 21#include <linux/module.h>
22#include <linux/init.h> 22#include <linux/init.h>
23#include <linux/input.h> 23#include <linux/input/mt.h>
24#include <linux/major.h> 24#include <linux/major.h>
25#include <linux/device.h> 25#include <linux/device.h>
26#include "input-compat.h" 26#include "input-compat.h"
@@ -632,6 +632,28 @@ static int evdev_handle_set_keycode_v2(struct input_dev *dev, void __user *p)
632 return input_set_keycode(dev, &ke); 632 return input_set_keycode(dev, &ke);
633} 633}
634 634
635static int evdev_handle_mt_request(struct input_dev *dev,
636 unsigned int size,
637 int __user *ip)
638{
639 const struct input_mt_slot *mt = dev->mt;
640 unsigned int code;
641 int max_slots;
642 int i;
643
644 if (get_user(code, &ip[0]))
645 return -EFAULT;
646 if (!input_is_mt_value(code))
647 return -EINVAL;
648
649 max_slots = (size - sizeof(__u32)) / sizeof(__s32);
650 for (i = 0; i < dev->mtsize && i < max_slots; i++)
651 if (put_user(input_mt_get_value(&mt[i], code), &ip[1 + i]))
652 return -EFAULT;
653
654 return 0;
655}
656
635static long evdev_do_ioctl(struct file *file, unsigned int cmd, 657static long evdev_do_ioctl(struct file *file, unsigned int cmd,
636 void __user *p, int compat_mode) 658 void __user *p, int compat_mode)
637{ 659{
@@ -725,6 +747,9 @@ static long evdev_do_ioctl(struct file *file, unsigned int cmd,
725 return bits_to_user(dev->propbit, INPUT_PROP_MAX, 747 return bits_to_user(dev->propbit, INPUT_PROP_MAX,
726 size, p, compat_mode); 748 size, p, compat_mode);
727 749
750 case EVIOCGMTSLOTS(0):
751 return evdev_handle_mt_request(dev, size, ip);
752
728 case EVIOCGKEY(0): 753 case EVIOCGKEY(0):
729 return bits_to_user(dev->key, KEY_MAX, size, p, compat_mode); 754 return bits_to_user(dev->key, KEY_MAX, size, p, compat_mode);
730 755
diff --git a/drivers/input/input.c b/drivers/input/input.c
index 1f78c957a75a..8921c6180c51 100644
--- a/drivers/input/input.c
+++ b/drivers/input/input.c
@@ -180,7 +180,7 @@ static int input_handle_abs_event(struct input_dev *dev,
180 return INPUT_IGNORE_EVENT; 180 return INPUT_IGNORE_EVENT;
181 } 181 }
182 182
183 is_mt_event = code >= ABS_MT_FIRST && code <= ABS_MT_LAST; 183 is_mt_event = input_is_mt_value(code);
184 184
185 if (!is_mt_event) { 185 if (!is_mt_event) {
186 pold = &dev->absinfo[code].value; 186 pold = &dev->absinfo[code].value;
diff --git a/drivers/input/mouse/bcm5974.c b/drivers/input/mouse/bcm5974.c
index 927e479c2649..f9e2758b9f46 100644
--- a/drivers/input/mouse/bcm5974.c
+++ b/drivers/input/mouse/bcm5974.c
@@ -433,6 +433,7 @@ static void setup_events_to_report(struct input_dev *input_dev,
433 __set_bit(BTN_TOOL_QUADTAP, input_dev->keybit); 433 __set_bit(BTN_TOOL_QUADTAP, input_dev->keybit);
434 __set_bit(BTN_LEFT, input_dev->keybit); 434 __set_bit(BTN_LEFT, input_dev->keybit);
435 435
436 __set_bit(INPUT_PROP_POINTER, input_dev->propbit);
436 if (cfg->caps & HAS_INTEGRATED_BUTTON) 437 if (cfg->caps & HAS_INTEGRATED_BUTTON)
437 __set_bit(INPUT_PROP_BUTTONPAD, input_dev->propbit); 438 __set_bit(INPUT_PROP_BUTTONPAD, input_dev->propbit);
438 439