From patchwork Fri Sep 3 12:17:27 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Henrik Rydberg X-Patchwork-Id: 154021 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 o83CIgsb021853 for ; Fri, 3 Sep 2010 12:18:43 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757700Ab0ICMS3 (ORCPT ); Fri, 3 Sep 2010 08:18:29 -0400 Received: from ch-smtp02.sth.basefarm.net ([80.76.149.213]:40681 "EHLO ch-smtp02.sth.basefarm.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757936Ab0ICMSU (ORCPT ); Fri, 3 Sep 2010 08:18:20 -0400 Received: from c83-248-196-134.bredband.comhem.se ([83.248.196.134]:39942 helo=alnilam) by ch-smtp02.sth.basefarm.net with smtp (Exim 4.68) (envelope-from ) id 1OrVDf-0006wF-8q; Fri, 03 Sep 2010 14:18:15 +0200 Received: by alnilam (sSMTP sendmail emulation); Fri, 03 Sep 2010 14:18:09 +0200 From: "Henrik Rydberg" To: Dmitry Torokhov Cc: Ping Cheng , Chris Bagwell , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Henrik Rydberg Subject: [PATCH 5/5] input: wacom: Add a quirk for lowres Bamboo devices Date: Fri, 3 Sep 2010 14:17:27 +0200 Message-Id: <1283516247-11624-6-git-send-email-rydberg@euromail.se> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1283516247-11624-1-git-send-email-rydberg@euromail.se> References: <1283516247-11624-1-git-send-email-rydberg@euromail.se> X-Originating-IP: 83.248.196.134 X-Scan-Result: No virus found in message 1OrVDf-0006wF-8q. X-Scan-Signature: ch-smtp02.sth.basefarm.net 1OrVDf-0006wF-8q ac0adea833dd13a9f110d5e1a3a8299b 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]); Fri, 03 Sep 2010 12:18:43 +0000 (UTC) diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c index 78e5345..fd2d46a 100644 --- a/drivers/input/tablet/wacom_wac.c +++ b/drivers/input/tablet/wacom_wac.c @@ -858,6 +858,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) { static int trkid; + 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; @@ -872,6 +873,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); @@ -1007,6 +1012,16 @@ void wacom_setup_device_quirks(struct wacom_features *features) if (features->type == TABLETPC || features->type == TABLETPC2FG || features->type == BAMBOO_PT) features->quirks |= WACOM_QUIRK_MULTI_INPUT; + + /* quirks for bamboo touch */ + if (features->x_max == 480 && features->y_max == 320) { + features->x_max = 15360; + features->y_max = 10240; + features->x_fuzz = 128; + features->y_fuzz = 128; + features->pressure_fuzz = 16; + features->quirks |= WACOM_QUIRK_BBTOUCH_LOWRES; + } } void wacom_setup_input_capabilities(struct input_dev *input_dev, diff --git a/drivers/input/tablet/wacom_wac.h b/drivers/input/tablet/wacom_wac.h index 1284f33..b9de134 100644 --- a/drivers/input/tablet/wacom_wac.h +++ b/drivers/input/tablet/wacom_wac.h @@ -43,6 +43,7 @@ /* device quirks */ #define WACOM_QUIRK_MULTI_INPUT 0x0001 +#define WACOM_QUIRK_BBTOUCH_LOWRES 0x0002 enum { PENPARTNER = 0,