From: Gabriel M. Beddingfield <[email protected]>

In 2.6.38 input_mt_init_slots was renamed to input_mt_create_slots.
(commit 8cde81001626c4c60b26ef2eb5fc522885ed9fd0.

This commit sets the name back for 2.6.37.

Signed-off-by: Gabriel M. Beddingfield <[email protected]>
---
 drivers/hid/hid-multitouch.c |    3 +--
 drivers/input/input.c        |    4 ++++
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c
index 07d3183..f922e3d 100644
--- a/drivers/hid/hid-multitouch.c
+++ b/drivers/hid/hid-multitouch.c
@@ -19,7 +19,6 @@
 #include <linux/module.h>
 #include <linux/slab.h>
 #include <linux/usb.h>
-#include <linux/input/mt.h>
 #include "usbhid/usbhid.h"
 
 
@@ -185,7 +184,7 @@ static int mt_input_mapping(struct hid_device *hdev, struct 
hid_input *hi,
                        td->last_slot_field = usage->hid;
                        return 1;
                case HID_DG_CONTACTID:
-                       input_mt_init_slots(hi->input,
+                       input_mt_create_slots(hi->input,
                                        td->mtclass->maxcontacts);
                        td->last_slot_field = usage->hid;
                        return 1;
diff --git a/drivers/input/input.c b/drivers/input/input.c
index e8a8802..968f5a3 100644
--- a/drivers/input/input.c
+++ b/drivers/input/input.c
@@ -1724,6 +1724,8 @@ int input_mt_create_slots(struct input_dev *dev, unsigned 
int num_slots)
 
        if (!num_slots)
                return 0;
+       if (dev->mt)
+               return dev->mtsize != num_slots ? -EINVAL : 0;
 
        dev->mt = kcalloc(num_slots, sizeof(struct input_mt_slot), GFP_KERNEL);
        if (!dev->mt)
@@ -1731,6 +1733,7 @@ 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);
+       input_set_events_per_packet(dev, 6 * num_slots);
 
        /* Mark slots as 'unused' */
        for (i = 0; i < num_slots; i++)
@@ -1752,6 +1755,7 @@ void input_mt_destroy_slots(struct input_dev *dev)
        kfree(dev->mt);
        dev->mt = NULL;
        dev->mtsize = 0;
+       dev->slot = 0;
 }
 EXPORT_SYMBOL(input_mt_destroy_slots);
 
-- 
1.7.0.4

_______________________________________________
MeeGo-kernel mailing list
[email protected]
http://lists.meego.com/listinfo/meego-kernel

Reply via email to