From patchwork Wed Mar 18 22:26:35 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Charlie Mooney X-Patchwork-Id: 6044491 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.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id C9BC2BF90F for ; Wed, 18 Mar 2015 22:27:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B4180204C9 for ; Wed, 18 Mar 2015 22:27:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9924320497 for ; Wed, 18 Mar 2015 22:27:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752081AbbCRW13 (ORCPT ); Wed, 18 Mar 2015 18:27:29 -0400 Received: from mail-ig0-f169.google.com ([209.85.213.169]:33513 "EHLO mail-ig0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751808AbbCRW11 (ORCPT ); Wed, 18 Mar 2015 18:27:27 -0400 Received: by ignm3 with SMTP id m3so82174116ign.0 for ; Wed, 18 Mar 2015 15:27:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=sender:from:to:cc:subject:date:message-id; bh=ZouTumrJPE5RFKM4DBYl1jqkDDMPCIjH/bH97A1mXEM=; b=CH0uFJVaLoYOL6OGPEFW0dOp9jh3EeS7ICHZXrPttDYe66WK954myTrs/FIfbAUGSl 4QsPDRpglRGaN95/6MMTBswxd3P+57wHTIEWrUTM9s/j6UqrIlr/59uTguSwDiMbmOaf PjuMMnQbAHc11XB0tOqUFAT09qAIo4o2HriVATKSyDFWX5mEUE3MZYo+xVqE/dgDHWc1 AzbzeoqepXxiS6VKIFU8t/fjzHXdZJg3vHmLTgZ818ydMQ5LFlZnN5PYenYNphumQpVw RTxqD/ugp3KX8gVoMjPAXzWai07vUUBEd0LWHk5ZqEkZJJtuUYUbCxs825OeJzYYoL8g gmQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=ZouTumrJPE5RFKM4DBYl1jqkDDMPCIjH/bH97A1mXEM=; b=LmuG2vz35ACFPTxfY7946IFl3rDaSGvH9p7/YkzlvvBZDj2CwWFU2mEhyce+DFJngK gJVZZGB7Pzdzw8dW63gpCq50JtozSab371JLXTeolQR+bpOWqnUUgcWcWNBmIPcDEzks y7v5vyXUupeJf5D4kNdCuT3bHMI1+fPaiJ8hl97dZJTXwcA8DYAP7CEb4NsSl0n6hs6C cQFOYAoVGQMQvp3fN+ASONsz0djXmy4S7PLwIjHKM3iPdSqY6anJGTDiJam5hB6sH9D7 1mPwziwAzxZFHYODoSotd2Nu8sefoRDk1G7VgfMX8Y4aegWF9KY4B5brC1A8hk1LLlf+ UVXQ== X-Gm-Message-State: ALoCoQn4osJJp+C/3YSxGkz4OXo/XfljcV2X57Ok9ifK3uk7ibsWJi/3v83lLi8Q63Y7spUzMcas X-Received: by 10.42.86.12 with SMTP id s12mr85902580icl.47.1426717647064; Wed, 18 Mar 2015 15:27:27 -0700 (PDT) Received: from cmooney.mtv.corp.google.com ([172.22.64.44]) by mx.google.com with ESMTPSA id x2sm2684452igg.9.2015.03.18.15.27.25 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Mar 2015 15:27:26 -0700 (PDT) From: Charlie Mooney To: linux-input@vger.kernel.org Cc: Benjamin Tissoires , Hans de Goede , Peter Hutterer , Andrew De Los Reyes , Henrik Rydberg , Jonathan Corbet , Dmitry Torokhov , Charlie Mooney , Masanari Iida , Jiri Kosina , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-api@vger.kernel.org Subject: [PATCH] Input: Add MT_TOOL_PALM Date: Wed, 18 Mar 2015 15:26:35 -0700 Message-Id: <1426717595-1610-1-git-send-email-charliemooney@chromium.org> X-Mailer: git-send-email 2.1.2 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_RP_MATCHES_RCVD,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 Currently there are only two "tools" that can be specified by a multi-touch driver: MT_TOOL_FINGER and MT_TOOL_PEN. In working with Elan (The touch vendor) and discussing their next-gen devices it seems that it will be useful to have more tools so that their devices can give the upper layers of the stack hints as to what is touching the sensor. In particular they have new experimental firmware that can better differentiate between palms vs fingertips and would like to plumb a patch so that we can use their hints in higher-level gesture soft- ware. The firmware on the device can reasonably do a better job of palm detection because it has access to all of the raw sensor readings as opposed to just the width/pressure/etc that are exposed by the driver. As such, the firmware can characterize what a palm looks like in much finer-grained detail and this change would allow such a device to share its findings with the kernel. Signed-off-by: Charlie Mooney Acked-by: Peter Hutterer --- Documentation/input/multi-touch-protocol.txt | 9 ++++++--- include/uapi/linux/input.h | 3 ++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Documentation/input/multi-touch-protocol.txt b/Documentation/input/multi-touch-protocol.txt index 7b4f59c..b85d000 100644 --- a/Documentation/input/multi-touch-protocol.txt +++ b/Documentation/input/multi-touch-protocol.txt @@ -312,9 +312,12 @@ ABS_MT_TOOL_TYPE The type of approaching tool. A lot of kernel drivers cannot distinguish between different tool types, such as a finger or a pen. In such cases, the -event should be omitted. The protocol currently supports MT_TOOL_FINGER and -MT_TOOL_PEN [2]. For type B devices, this event is handled by input core; -drivers should instead use input_mt_report_slot_state(). +event should be omitted. The protocol currently supports MT_TOOL_FINGER, +MT_TOOL_PEN, and MT_TOOL_PALM [2]. For type B devices, this event is handled +by input core; drivers should instead use input_mt_report_slot_state(). +A contact's ABS_MT_TOOL_TYPE may change over time while still touching the +device, because the firmware may not be able to determine which tool is being +used when it first appears. ABS_MT_BLOB_ID diff --git a/include/uapi/linux/input.h b/include/uapi/linux/input.h index b0a8130..2f62ab2 100644 --- a/include/uapi/linux/input.h +++ b/include/uapi/linux/input.h @@ -973,7 +973,8 @@ struct input_keymap_entry { */ #define MT_TOOL_FINGER 0 #define MT_TOOL_PEN 1 -#define MT_TOOL_MAX 1 +#define MT_TOOL_PALM 2 +#define MT_TOOL_MAX 2 /* * Values describing the status of a force-feedback effect