diff options
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); | |||
| 1599 | * @dev: input device supporting MT events and finger tracking | 1599 | * @dev: input device supporting MT events and finger tracking |
| 1600 | * @num_slots: number of slots used by the device | 1600 | * @num_slots: number of slots used by the device |
| 1601 | * | 1601 | * |
| 1602 | * This function allocates all necessary memory for MT slot handling | 1602 | * This function allocates all necessary memory for MT slot handling in the |
| 1603 | * in the input device, and adds ABS_MT_SLOT to the device capabilities. | 1603 | * input device, and adds ABS_MT_SLOT to the device capabilities. All slots |
| 1604 | * are initially marked as unused iby setting ABS_MT_TRACKING_ID to -1. | ||
| 1604 | */ | 1605 | */ |
| 1605 | int input_mt_create_slots(struct input_dev *dev, unsigned int num_slots) | 1606 | int input_mt_create_slots(struct input_dev *dev, unsigned int num_slots) |
| 1606 | { | 1607 | { |
| 1608 | int i; | ||
| 1609 | |||
| 1607 | if (!num_slots) | 1610 | if (!num_slots) |
| 1608 | return 0; | 1611 | return 0; |
| 1609 | 1612 | ||
| @@ -1614,6 +1617,10 @@ int input_mt_create_slots(struct input_dev *dev, unsigned int num_slots) | |||
| 1614 | dev->mtsize = num_slots; | 1617 | dev->mtsize = num_slots; |
| 1615 | input_set_abs_params(dev, ABS_MT_SLOT, 0, num_slots - 1, 0, 0); | 1618 | input_set_abs_params(dev, ABS_MT_SLOT, 0, num_slots - 1, 0, 0); |
| 1616 | 1619 | ||
| 1620 | /* Mark slots as 'unused' */ | ||
| 1621 | for (i = 0; i < num_slots; i++) | ||
| 1622 | dev->mt[i].abs[ABS_MT_TRACKING_ID - ABS_MT_FIRST] = -1; | ||
| 1623 | |||
| 1617 | return 0; | 1624 | return 0; |
| 1618 | } | 1625 | } |
| 1619 | EXPORT_SYMBOL(input_mt_create_slots); | 1626 | EXPORT_SYMBOL(input_mt_create_slots); |
