From patchwork Mon Aug 30 17:15:33 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chase Douglas X-Patchwork-Id: 63095 X-Patchwork-Delegate: leann.ogasawara@canonical.com 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 5FAA9B710D for ; Tue, 31 Aug 2010 03:15:58 +1000 (EST) Received: from localhost ([127.0.0.1] helo=chlorine.canonical.com) by chlorine.canonical.com with esmtp (Exim 4.69) (envelope-from ) id 1Oq7xZ-0002k1-4P; Mon, 30 Aug 2010 18:15:53 +0100 Received: from adelie.canonical.com ([91.189.90.139]) by chlorine.canonical.com with esmtp (Exim 4.69) (envelope-from ) id 1Oq7xU-0002fv-EL for kernel-team@lists.ubuntu.com; Mon, 30 Aug 2010 18:15:48 +0100 Received: from hutte.canonical.com ([91.189.90.181]) by adelie.canonical.com with esmtp (Exim 4.69 #1 (Debian)) id 1Oq7xU-0002gx-Ct for ; Mon, 30 Aug 2010 18:15:48 +0100 Received: from cpe-75-180-27-10.columbus.res.rr.com ([75.180.27.10] 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 1Oq7xU-0004X7-3w for kernel-team@lists.ubuntu.com; Mon, 30 Aug 2010 18:15:48 +0100 From: Chase Douglas To: kernel-team@lists.ubuntu.com Subject: [PATCH 6/6] HID: magicmouse: Adjust major / minor axes to scale Date: Mon, 30 Aug 2010 13:15:33 -0400 Message-Id: <1283188533-4607-7-git-send-email-chase.douglas@canonical.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1283188533-4607-1-git-send-email-chase.douglas@canonical.com> References: <1283188533-4607-1-git-send-email-chase.douglas@canonical.com> X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.9 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 From: Henrik Rydberg By visual inspection, the reported touch_major and touch_minor axes are roughly a factor of four too small. The factor is approximate, since the protocol is not known and the HID report encodes touch size with fewer bits than positions. This patch scales the reported values by a factor of four. Signed-off-by: Henrik Rydberg --- drivers/hid/hid-magicmouse.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/hid/hid-magicmouse.c b/drivers/hid/hid-magicmouse.c index 687dde4..b051f7d 100644 --- a/drivers/hid/hid-magicmouse.c +++ b/drivers/hid/hid-magicmouse.c @@ -253,8 +253,8 @@ static void magicmouse_emit_touch(struct magicmouse_sc *msc, int raw_id, u8 *tda /* Generate the input events for this touch. */ if (report_touches && down) { input_report_abs(input, ABS_MT_TRACKING_ID, id); - input_report_abs(input, ABS_MT_TOUCH_MAJOR, touch_major); - input_report_abs(input, ABS_MT_TOUCH_MINOR, touch_minor); + 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_POSITION_X, x); input_report_abs(input, ABS_MT_POSITION_Y, y);