From patchwork Wed Dec 8 23:08:04 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chase Douglas X-Patchwork-Id: 392402 X-Patchwork-Delegate: jikos@jikos.cz Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oB8N8kXi031875 for ; Wed, 8 Dec 2010 23:08:47 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756724Ab0LHXIM (ORCPT ); Wed, 8 Dec 2010 18:08:12 -0500 Received: from adelie.canonical.com ([91.189.90.139]:59925 "EHLO adelie.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756661Ab0LHXIL (ORCPT ); Wed, 8 Dec 2010 18:08:11 -0500 Received: from hutte.canonical.com ([91.189.90.181]) by adelie.canonical.com with esmtp (Exim 4.69 #1 (Debian)) id 1PQT7I-0003Qh-A2; Wed, 08 Dec 2010 23:08:08 +0000 Received: from [67.139.104.67] (helo=canonical.com) by hutte.canonical.com with esmtpsa (TLS-1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.69) (envelope-from ) id 1PQT7H-0004Sq-P5; Wed, 08 Dec 2010 23:08:08 +0000 From: Chase Douglas To: Jiri Kosina Cc: Michael Poole , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] HID: magicmouse: Don't report REL_{X,Y} for Magic Trackpad Date: Wed, 8 Dec 2010 15:08:04 -0800 Message-Id: <1291849685-2623-1-git-send-email-chase.douglas@canonical.com> X-Mailer: git-send-email 1.7.1 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Wed, 08 Dec 2010 23:08:47 +0000 (UTC) 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; }