diff options
| author | Dave Airlie <airlied@redhat.com> | 2010-09-24 15:37:33 +1000 |
|---|---|---|
| committer | Dave Airlie <airlied@redhat.com> | 2010-09-24 15:37:33 +1000 |
| commit | 4a445f291ac3faa08f56eaeb6e44856b6b72b74c (patch) | |
| tree | b66cc93311dc4c623113a87aa9b40730a21ac18e /drivers/input/input.c | |
| parent | cbc60ca04b342a4e1f2a1086a7277c077f07dbed (diff) | |
| parent | a850ea30374ebed32a0724742601861853fde869 (diff) | |
Merge remote branch 'origin/master' of /home/airlied/kernel//linux-2.6 into drm-core-next
Diffstat (limited to 'drivers/input/input.c')
| -rw-r--r-- | drivers/input/input.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/input/input.c b/drivers/input/input.c index a9b025f4147a..ab6982056518 100644 --- a/drivers/input/input.c +++ b/drivers/input/input.c @@ -1599,11 +1599,14 @@ EXPORT_SYMBOL(input_free_device); * @dev: input device supporting MT events and finger tracking * @num_slots: number of slots used by the device * - * This function allocates all necessary memory for MT slot handling - * in the input device, and adds ABS_MT_SLOT to the device capabilities. + * This function allocates all necessary memory for MT slot handling in the + * input device, and adds ABS_MT_SLOT to the device capabilities. All slots + * are initially marked as unused iby setting ABS_MT_TRACKING_ID to -1. */ int input_mt_create_slots(struct input_dev *dev, unsigned int num_slots) { + int i; + if (!num_slots) return 0; @@ -1614,6 +1617,10 @@ int input_mt_create_slots(struct input_dev *dev, unsigned int num_slots) dev->mtsize = num_slots; input_set_abs_params(dev, ABS_MT_SLOT, 0, num_slots - 1, 0, 0); + /* Mark slots as 'unused' */ + for (i = 0; i < num_slots; i++) + dev->mt[i].abs[ABS_MT_TRACKING_ID - ABS_MT_FIRST] = -1; + return 0; } EXPORT_SYMBOL(input_mt_create_slots); |
