From patchwork Tue Jan 4 14:28:00 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chase Douglas X-Patchwork-Id: 77475 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from chlorine.canonical.com (chlorine.canonical.com [91.189.94.204]) by ozlabs.org (Postfix) with ESMTP id 5595DB7063 for ; Wed, 5 Jan 2011 01:28:15 +1100 (EST) Received: from localhost ([127.0.0.1] helo=chlorine.canonical.com) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1Pa7rp-0005gC-4B; Tue, 04 Jan 2011 14:28:05 +0000 Received: from adelie.canonical.com ([91.189.90.139]) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1Pa7rn-0005g7-0r for kernel-team@lists.ubuntu.com; Tue, 04 Jan 2011 14:28:03 +0000 Received: from hutte.canonical.com ([91.189.90.181]) by adelie.canonical.com with esmtp (Exim 4.71 #1 (Debian)) id 1Pa7rm-00086Y-V5 for ; Tue, 04 Jan 2011 14:28:02 +0000 Received: from cpe-75-180-27-10.columbus.res.rr.com ([75.180.27.10] helo=canonical.com) by hutte.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1Pa7rm-0001LQ-Lj for kernel-team@lists.ubuntu.com; Tue, 04 Jan 2011 14:28:02 +0000 From: Chase Douglas To: kernel-team@lists.ubuntu.com Subject: [NATTY][PATCH] HID: magicmouse: Don't report REL_{X, Y} for Magic Trackpad Date: Tue, 4 Jan 2011 09:28:00 -0500 Message-Id: <1294151280-5329-1-git-send-email-chase.douglas@canonical.com> X-Mailer: git-send-email 1.7.1 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.13 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: kernel-team-bounces@lists.ubuntu.com Errors-To: kernel-team-bounces@lists.ubuntu.com 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 --- This got stuck near the end of the .37 development cycle and didn't make it in time. Since the next release with this will probably be .38-rc1 in a few weeks, please include the patch in the Natty kernel in the meantime as it is causing issues for our own development efforts. Thanks! drivers/hid/hid-magicmouse.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) 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; }