diff mbox

HID: magicmouse: Don't report REL_{X,Y} for Magic Trackpad

Message ID 1291849685-2623-1-git-send-email-chase.douglas@canonical.com (mailing list archive)
State New, archived
Delegated to: Jiri Kosina
Headers show

Commit Message

Chase Douglas Dec. 8, 2010, 11:08 p.m. UTC
None
diff mbox

Patch

diff --git a/drivers/hid/hid-magicmouse.c b/drivers/hid/hid-magicmouse.c
index e6dc151..ed732b7 100644
--- a/drivers/hid/hid-magicmouse.c
+++ b/drivers/hid/hid-magicmouse.c
@@ -433,6 +433,11 @@  static int magicmouse_input_mapping(struct hid_device *hdev,
 	if (!msc->input)
 		msc->input = hi->input;
 
+	/* Magic Trackpad does not give relative data after switching to MT */
+	if (hi->input->id.product == USB_DEVICE_ID_APPLE_MAGICTRACKPAD &&
+	    field->flags & HID_MAIN_ITEM_RELATIVE)
+		return -1;
+
 	return 0;
 }