Skip to content

Commit a707089

Browse files
jannaumarcan
authored andcommitted
HID: magicmouse: use struct input_mt_pos for X/Y
Signed-off-by: Janne Grunau <[email protected]>
1 parent b55bf21 commit a707089

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
@@ -131,9 +131,8 @@ struct magicmouse_sc {
131131
int scroll_accel;
132132
unsigned long scroll_jiffies;
133133

134+
struct input_mt_pos pos[MAX_CONTACTS];
134135
struct {
135-
short x;
136-
short y;
137136
short scroll_x;
138137
short scroll_y;
139138
short scroll_x_hr;
@@ -190,7 +189,7 @@ static void magicmouse_emit_buttons(struct magicmouse_sc *msc, int state)
190189
} else if (last_state != 0) {
191190
state = last_state;
192191
} else if ((id = magicmouse_firm_touch(msc)) >= 0) {
193-
int x = msc->touches[id].x;
192+
int x = msc->pos[id].x;
194193
if (x < middle_button_start)
195194
state = 1;
196195
else if (x > middle_button_stop)
@@ -251,8 +250,8 @@ static void magicmouse_emit_touch(struct magicmouse_sc *msc, int raw_id, u8 *tda
251250

252251
/* Store tracking ID and other fields. */
253252
msc->tracking_ids[raw_id] = id;
254-
msc->touches[id].x = x;
255-
msc->touches[id].y = y;
253+
msc->pos[id].x = x;
254+
msc->pos[id].y = y;
256255
msc->touches[id].size = size;
257256

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

0 commit comments

Comments
 (0)