Skip to content

Commit 921990b

Browse files
rydbergJiri Kosina
authored andcommitted
HID: magicmouse: Adjust major / minor axes to scale
By visual inspection, the reported touch_major and touch_minor axes are roughly a factor of four too small. The factor is approximate, since the protocol is not known and the HID report encodes touch size with fewer bits than positions. This patch scales the reported values by a factor of four. Signed-off-by: Henrik Rydberg <rydberg@euromail.se> Signed-off-by: Chase Douglas <chase.douglas@canonical.com> Acked-by: Michael Poole <mdpoole@troilus.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
1 parent 64eb105 commit 921990b

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎drivers/hid/hid-magicmouse.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,8 +254,8 @@ static void magicmouse_emit_touch(struct magicmouse_sc *msc, int raw_id, u8 *tda
254254
/* Generate the input events for this touch. */
255255
if (report_touches && down) {
256256
input_report_abs(input, ABS_MT_TRACKING_ID, id);
257-
input_report_abs(input, ABS_MT_TOUCH_MAJOR, touch_major);
258-
input_report_abs(input, ABS_MT_TOUCH_MINOR, touch_minor);
257+
input_report_abs(input, ABS_MT_TOUCH_MAJOR, touch_major << 2);
258+
input_report_abs(input, ABS_MT_TOUCH_MINOR, touch_minor << 2);
259259
input_report_abs(input, ABS_MT_ORIENTATION, orientation);
260260
input_report_abs(input, ABS_MT_POSITION_X, x);
261261
input_report_abs(input, ABS_MT_POSITION_Y, y);

0 commit comments

Comments
 (0)