Skip to content

Commit 5b59b20

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

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

drivers/hid/hid-magicmouse.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,8 @@ struct magicmouse_sc {
134134
int scroll_accel;
135135
unsigned long scroll_jiffies;
136136

137+
struct input_mt_pos pos[MAX_CONTACTS];
137138
struct {
138-
short x;
139-
short y;
140139
short scroll_x;
141140
short scroll_y;
142141
short scroll_x_hr;
@@ -193,7 +192,7 @@ static void magicmouse_emit_buttons(struct magicmouse_sc *msc, int state)
193192
} else if (last_state != 0) {
194193
state = last_state;
195194
} else if ((id = magicmouse_firm_touch(msc)) >= 0) {
196-
int x = msc->touches[id].x;
195+
int x = msc->pos[id].x;
197196
if (x < middle_button_start)
198197
state = 1;
199198
else if (x > middle_button_stop)
@@ -254,8 +253,8 @@ static void magicmouse_emit_touch(struct magicmouse_sc *msc, int raw_id, u8 *tda
254253

255254
/* Store tracking ID and other fields. */
256255
msc->tracking_ids[raw_id] = id;
257-
msc->touches[id].x = x;
258-
msc->touches[id].y = y;
256+
msc->pos[id].x = x;
257+
msc->pos[id].y = y;
259258
msc->touches[id].size = size;
260259

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

0 commit comments

Comments
 (0)