From patchwork Thu Jan 30 18:48:48 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Gerecke, Jason" X-Patchwork-Id: 3558881 Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 03331C02DC for ; Thu, 30 Jan 2014 18:48:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3BC1A200E8 for ; Thu, 30 Jan 2014 18:48:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 657DD201C0 for ; Thu, 30 Jan 2014 18:48:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753022AbaA3Ssr (ORCPT ); Thu, 30 Jan 2014 13:48:47 -0500 Received: from mail-pd0-f181.google.com ([209.85.192.181]:39363 "EHLO mail-pd0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752636AbaA3Ssr (ORCPT ); Thu, 30 Jan 2014 13:48:47 -0500 Received: by mail-pd0-f181.google.com with SMTP id y10so3334673pdj.40 for ; Thu, 30 Jan 2014 10:48:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=J3+31Gh1K8BcOiEX73phe61I82RXUa0UyXNB2A/BRNg=; b=plKTndAhkOJCK9omBUz3gJEDKT1HVL3b7ymg9IkTcr3stEp5zcNDa0KVkHAEaIzTZY V3ej8w9gnPyFvVm7SkrzzHvGs5YU9UWA0llxf6SEb5xuOgRFL6QBdWrPnZTIhzq0PKca owPqge8L6tJBrZNb44evlBwr4LRKwyNPFRVMZrzQVNE+kwWkCBy6dNzKuGTENPTxCF66 g+za60p8YaMJ5XXdOtJwQUNfYvcafzqeswny2tgsbu4/7k4Xv9aHuMDiswjIzCI+AVmc wozLzcak92CxFeeRF6ZGlzK7DsFElpPBzLk0TrC9VbQ+N1PNMTRrpILf8gf+DDhuBECd sLCg== X-Received: by 10.66.145.199 with SMTP id sw7mr15825045pab.143.1391107726968; Thu, 30 Jan 2014 10:48:46 -0800 (PST) Received: from wacom-arch2.wacom.com ([67.51.163.2]) by mx.google.com with ESMTPSA id pp5sm5229737pbb.33.2014.01.30.10.48.45 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 30 Jan 2014 10:48:45 -0800 (PST) From: Jason Gerecke To: linux-input@vger.kernel.org, linuxwacom-devel@lists.sourceforge.net, pinglinux@gmail.com, skomra@gmail.com, dmitry.torokhov@gmail.com Cc: Jason Gerecke Subject: [PATCH 4/4] Input: wacom: Handle 1024 pressure levels in wacom_tpc_pen Date: Thu, 30 Jan 2014 10:48:48 -0800 Message-Id: <1391107728-1306-4-git-send-email-killertofu@gmail.com> X-Mailer: git-send-email 1.8.5.3 In-Reply-To: <1391107728-1306-1-git-send-email-killertofu@gmail.com> References: <1391107728-1306-1-git-send-email-killertofu@gmail.com> Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Some tablet PC sensors (e.g. the 0xEC found in the Thinkpad Yoga) report more than 256 pressure levels and will experience wraparound unless the full range is read. Signed-off-by: Jason Gerecke Tested-by: Aaron Skomra --- drivers/input/tablet/wacom_wac.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c index 9ff5613..ae1437b 100644 --- a/drivers/input/tablet/wacom_wac.c +++ b/drivers/input/tablet/wacom_wac.c @@ -1087,7 +1087,7 @@ static int wacom_tpc_pen(struct wacom_wac *wacom) input_report_key(input, BTN_STYLUS2, data[1] & 0x10); input_report_abs(input, ABS_X, le16_to_cpup((__le16 *)&data[2])); input_report_abs(input, ABS_Y, le16_to_cpup((__le16 *)&data[4])); - input_report_abs(input, ABS_PRESSURE, ((data[7] & 0x01) << 8) | data[6]); + input_report_abs(input, ABS_PRESSURE, ((data[7] & 0x03) << 8) | data[6]); input_report_key(input, BTN_TOUCH, data[1] & 0x05); input_report_key(input, wacom->tool[0], prox); return 1;