From patchwork Fri Sep 10 17:14:12 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Henrik Rydberg X-Patchwork-Id: 64435 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 0A384B70FB for ; Sat, 11 Sep 2010 03:15:44 +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 1Ou7CN-0003vI-FA; Fri, 10 Sep 2010 18:15:39 +0100 Received: from ch-smtp01.sth.basefarm.net ([80.76.149.212]) by chlorine.canonical.com with esmtp (Exim 4.69) (envelope-from ) id 1Ou7CL-0003uy-SS for kernel-team@lists.ubuntu.com; Fri, 10 Sep 2010 18:15:37 +0100 Received: from c83-248-196-134.bredband.comhem.se ([83.248.196.134]:54293 helo=alnilam) by ch-smtp01.sth.basefarm.net with smtp (Exim 4.71) (envelope-from ) id 1Ou7BX-000225-6M for kernel-team@lists.ubuntu.com; Fri, 10 Sep 2010 19:14:51 +0200 Received: by alnilam (sSMTP sendmail emulation); Fri, 10 Sep 2010 19:14:47 +0200 From: "Henrik Rydberg" To: kernel-team@lists.ubuntu.com Subject: [PATCH 06/13] Input: wacom - add a quirk for low resolution Bamboo devices Date: Fri, 10 Sep 2010 19:14:12 +0200 Message-Id: <1284138859-32673-7-git-send-email-rydberg@euromail.se> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1284138859-32673-1-git-send-email-rydberg@euromail.se> References: <1284138859-32673-1-git-send-email-rydberg@euromail.se> X-Originating-IP: 83.248.196.134 X-Scan-Result: No virus found in message 1Ou7BX-000225-6M. X-Scan-Signature: ch-smtp01.sth.basefarm.net 1Ou7BX-000225-6M 222556265623ee54827c2fb37fdb0724 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 The Bamboo Touch reports a sub-screen resolution of 480x320. The signal-to-noise ratio is only about 100, so filtering is needed in order to reduce the jitter to a usable level. However, the low resolution leads to round-off errors in the EWMA filter, resulting in extremely jerky pointer motion. This patch explicitly sets a higher resolution for those devices, and tells this to the completion handler via a low-resolution quirk. Signed-off-by: Henrik Rydberg Acked-by: Ping Cheng Signed-off-by: Dmitry Torokhov --- drivers/input/tablet/wacom_wac.c | 10 ++++++++++ drivers/input/tablet/wacom_wac.h | 1 + 2 files changed, 11 insertions(+), 0 deletions(-) diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c index 56238d9..619abf5 100644 --- a/drivers/input/tablet/wacom_wac.c +++ b/drivers/input/tablet/wacom_wac.c @@ -824,6 +824,7 @@ static int wacom_tpc_irq(struct wacom_wac *wacom, size_t len) static int wacom_bpt_irq(struct wacom_wac *wacom, size_t len) { + struct wacom_features *features = &wacom->features; struct input_dev *input = wacom->input; unsigned char *data = wacom->data; int sp = 0, sx = 0, sy = 0, count = 0; @@ -838,6 +839,10 @@ static int wacom_bpt_irq(struct wacom_wac *wacom, size_t len) if (p) { int x = get_unaligned_be16(&data[9 * i + 3]) & 0x7ff; int y = get_unaligned_be16(&data[9 * i + 5]) & 0x7ff; + if (features->quirks & WACOM_QUIRK_BBTOUCH_LOWRES) { + x <<= 5; + y <<= 5; + } input_report_abs(input, ABS_MT_PRESSURE, p); input_report_abs(input, ABS_MT_POSITION_X, x); input_report_abs(input, ABS_MT_POSITION_Y, y); @@ -973,8 +978,13 @@ void wacom_setup_device_quirks(struct wacom_features *features) /* quirks for bamboo touch */ if (features->type == BAMBOO_PT && features->device_type == BTN_TOOL_TRIPLETAP) { + features->x_max <<= 5; + features->y_max <<= 5; + features->x_fuzz <<= 5; + features->y_fuzz <<= 5; features->pressure_max = 256; features->pressure_fuzz = 16; + features->quirks |= WACOM_QUIRK_BBTOUCH_LOWRES; } } diff --git a/drivers/input/tablet/wacom_wac.h b/drivers/input/tablet/wacom_wac.h index c90fb7c..1ee0988 100644 --- a/drivers/input/tablet/wacom_wac.h +++ b/drivers/input/tablet/wacom_wac.h @@ -40,6 +40,7 @@ /* device quirks */ #define WACOM_QUIRK_MULTI_INPUT 0x0001 +#define WACOM_QUIRK_BBTOUCH_LOWRES 0x0002 /* largest reported tracking id */ #define MAX_TRACKING_ID 0xfff