Skip to content

Commit 5db7b47

Browse files
committed
HID: magicmouse: use struct input_mt_pos for X/Y
Signed-off-by: Janne Grunau <j@jannau.net>
1 parent 9ecde8b commit 5db7b47

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

drivers/hid/hid-magicmouse.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ MODULE_PARM_DESC(report_undeciphered, "Report undeciphered multi-touch state fie
121121
* @ntouches: Number of touches in most recent touch report.
122122
* @scroll_accel: Number of consecutive scroll motions.
123123
* @scroll_jiffies: Time of last scroll motion.
124+
* @pos: multi touch position data of the last report.
124125
* @touches: Most recent data for a touch, indexed by tracking ID.
125126
* @tracking_ids: Mapping of current touch input data to @touches.
126127
* @hdev: Pointer to the underlying HID device.
@@ -135,9 +136,8 @@ struct magicmouse_sc {
135136
int scroll_accel;
136137
unsigned long scroll_jiffies;
137138

139+
struct input_mt_pos pos[MAX_CONTACTS];
138140
struct {
139-
short x;
140-
short y;
141141
short scroll_x;
142142
short scroll_y;
143143
short scroll_x_hr;
@@ -194,7 +194,7 @@ static void magicmouse_emit_buttons(struct magicmouse_sc *msc, int state)
194194
} else if (last_state != 0) {
195195
state = last_state;
196196
} else if ((id = magicmouse_firm_touch(msc)) >= 0) {
197-
int x = msc->touches[id].x;
197+
int x = msc->pos[id].x;
198198
if (x < middle_button_start)
199199
state = 1;
200200
else if (x > middle_button_stop)
@@ -258,8 +258,8 @@ static void magicmouse_emit_touch(struct magicmouse_sc *msc, int raw_id, u8 *tda
258258

259259
/* Store tracking ID and other fields. */
260260
msc->tracking_ids[raw_id] = id;
261-
msc->touches[id].x = x;
262-
msc->touches[id].y = y;
261+
msc->pos[id].x = x;
262+
msc->pos[id].y = y;
263263
msc->touches[id].size = size;
264264

265265
/* If requested, emulate a scroll wheel by detecting small

0 commit comments

Comments
 (0)