From: Chase Douglas Date: Wed, 8 Dec 2010 23:08:04 +0000 (-0800) Subject: HID: magicmouse: Don't report REL_{X,Y} for Magic Trackpad X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=6a66bbd693c12f71697c61207aa18bc5a12da0ab;p=linux-beck.git HID: magicmouse: Don't report REL_{X,Y} for Magic Trackpad With the recent switch to having the hid layer handle standard axis initialization, the Magic Trackpad now reports relative axes. This would be fine in the normal mode, but the driver puts the device in multitouch mode where no relative events are generated. Also, userspace software depends on accurate axis information for device type detection. Thus, ignoring the relative axes from the Magic Trackpad is best. Signed-off-by: Chase Douglas Signed-off-by: Jiri Kosina --- diff --git a/drivers/hid/hid-magicmouse.c b/drivers/hid/hid-magicmouse.c index e6dc15171664..ed732b746c96 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; }