aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid
diff options
context:
space:
mode:
authorHenrik Rydberg <rydberg@euromail.se>2010-11-27 04:50:54 -0500
committerHenrik Rydberg <rydberg@euromail.se>2010-12-16 04:41:12 -0500
commit8cde81001626c4c60b26ef2eb5fc522885ed9fd0 (patch)
tree9e9092cae44615376c5e3de98b8b259d137eb987 /drivers/hid
parent47c78e891323513e9909729b44033e2c6649e2b7 (diff)
input: mt: Collect slots initialization code
The MT slots devices all follow the same initialization pattern of creating slots and hinting about buffer size. Let drivers call an initialization function instead, and make sure it can be called repeatedly without side effects. Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Diffstat (limited to 'drivers/hid')
-rw-r--r--drivers/hid/hid-3m-pct.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/hid/hid-3m-pct.c b/drivers/hid/hid-3m-pct.c
index 18575a4e0d63..ea475964d05a 100644
--- a/drivers/hid/hid-3m-pct.c
+++ b/drivers/hid/hid-3m-pct.c
@@ -29,7 +29,6 @@ MODULE_LICENSE("GPL");
29 29
30#define MAX_SLOTS 60 30#define MAX_SLOTS 60
31#define MAX_TRKID USHRT_MAX 31#define MAX_TRKID USHRT_MAX
32#define MAX_EVENTS 360
33 32
34/* estimated signal-to-noise ratios */ 33/* estimated signal-to-noise ratios */
35#define SN_MOVE 2048 34#define SN_MOVE 2048
@@ -123,9 +122,7 @@ static int mmm_input_mapping(struct hid_device *hdev, struct hid_input *hi,
123 EV_ABS, ABS_MT_TRACKING_ID); 122 EV_ABS, ABS_MT_TRACKING_ID);
124 input_set_abs_params(hi->input, ABS_MT_TRACKING_ID, 123 input_set_abs_params(hi->input, ABS_MT_TRACKING_ID,
125 0, MAX_TRKID, 0, 0); 124 0, MAX_TRKID, 0, 0);
126 if (!hi->input->mt) 125 input_mt_init_slots(hi->input, MAX_SLOTS);
127 input_mt_create_slots(hi->input, MAX_SLOTS);
128 input_set_events_per_packet(hi->input, MAX_EVENTS);
129 return 1; 126 return 1;
130 } 127 }
131 /* let hid-input decide for the others */ 128 /* let hid-input decide for the others */