Skip to content

Commit

Permalink
HID: hid-magicmouse: Correct touch orientation direction
Browse files Browse the repository at this point in the history
The magic trackpad and mouse both report touch orientation in opposite
direction to the bcm5974 driver and what is written in
Documents/input/multi-touch-protocol.txt. This patch reverts the
direction, so that all in-kernel devices with this feature behave the
same way.

Since no known application has been utilizing this information yet, it
seems appropriate also for stable.

Cc: [email protected]
Cc: Michael Poole <[email protected]>
Signed-off-by: Henrik Rydberg <[email protected]>
Acked-by: Chase Douglas <[email protected]>
Signed-off-by: Jiri Kosina <[email protected]>
  • Loading branch information
rydberg authored and Jiri Kosina committed Mar 9, 2011
1 parent d923630 commit 2d9ca4e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/hid/hid-magicmouse.c
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ static void magicmouse_emit_touch(struct magicmouse_sc *msc, int raw_id, u8 *tda
input_report_abs(input, ABS_MT_TRACKING_ID, id);
input_report_abs(input, ABS_MT_TOUCH_MAJOR, touch_major << 2);
input_report_abs(input, ABS_MT_TOUCH_MINOR, touch_minor << 2);
input_report_abs(input, ABS_MT_ORIENTATION, orientation);
input_report_abs(input, ABS_MT_ORIENTATION, -orientation);
input_report_abs(input, ABS_MT_POSITION_X, x);
input_report_abs(input, ABS_MT_POSITION_Y, y);

Expand Down Expand Up @@ -397,7 +397,7 @@ static void magicmouse_setup_input(struct input_dev *input, struct hid_device *h
input_set_abs_params(input, ABS_MT_TRACKING_ID, 0, 15, 0, 0);
input_set_abs_params(input, ABS_MT_TOUCH_MAJOR, 0, 255, 4, 0);
input_set_abs_params(input, ABS_MT_TOUCH_MINOR, 0, 255, 4, 0);
input_set_abs_params(input, ABS_MT_ORIENTATION, -32, 31, 1, 0);
input_set_abs_params(input, ABS_MT_ORIENTATION, -31, 32, 1, 0);

/* Note: Touch Y position from the device is inverted relative
* to how pointer motion is reported (and relative to how USB
Expand Down

0 comments on commit 2d9ca4e

Please sign in to comment.