From patchwork Tue Oct 3 22:05:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ping Cheng X-Patchwork-Id: 9983579 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 49E84602B8 for ; Tue, 3 Oct 2017 22:06:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 37B23286A1 for ; Tue, 3 Oct 2017 22:06:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 29E1B28889; Tue, 3 Oct 2017 22:06:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 86C64286A1 for ; Tue, 3 Oct 2017 22:06:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751156AbdJCWG3 (ORCPT ); Tue, 3 Oct 2017 18:06:29 -0400 Received: from mail-pg0-f66.google.com ([74.125.83.66]:37940 "EHLO mail-pg0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751148AbdJCWG3 (ORCPT ); Tue, 3 Oct 2017 18:06:29 -0400 Received: by mail-pg0-f66.google.com with SMTP id y192so11234042pgd.5 for ; Tue, 03 Oct 2017 15:06:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=tPdHvn5bQg2uTWUr17xUDxR2XEGssWTuUE4q/9J3swc=; b=hOqDyTte5iJ9k/gRa+imW+/7C3jxGAgpcs/iIuVmqQSiWrtqGixBDPjHmW3489Z8fh FxBPZhWqjaGKyS0/eFGfqpNsct4n+4IqyDP1Z8oH10ZFnSHaHaYyVvvPY0cMu5qk9siU ersrWmoOqt8+XLRkK419PLnHwOX4FNQRIYGuQlKU5AromDqXNQz1WaJs/sPZI61vMMuM um+bogSdows20wo6b5oVM/K1Erhaghnlu6c/dwJNQgyBcYw4abLsyi9zjLrnA0V4RXTN 45WjYIgYbwSvPTxaEm3FUO4KydflBnlMCRjMEjoM31d7O7vBstPtOKMUIEZ4SVFI38Dd cTBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=tPdHvn5bQg2uTWUr17xUDxR2XEGssWTuUE4q/9J3swc=; b=oaqHAmAYNBg68vqGjfj2t5SyxF5DcsVBRI+/Qd2uJNkCicVlPF8Esbkc0Bj1YvlCjw tfnk3mw4o8dKQ4/8PQIeUE/4ZGIAynV59yfKYWGGKg/5xTq9ziCOS/Sypj6LLVYE1YSf eg/FXI82K1EqS6d2pgBRFziWQj/sTLOiLGrSesHJVNQieXArFDBiSPH/k8o6RzB+Om9p HtuR93oJd/H7wCPy00rPB+gilbjW8K/KqmTKznHd038eXYKFjhm8bFbA8CL6St31Iv9V DS6gLFN4+XkLgo3uVFA9YM0Rd/mwXuCQ5nbn46YdKL1/b/nCkGpmfAZtUsWYxs7X+7RG 9aVw== X-Gm-Message-State: AHPjjUjal/9SWJWK61R//W/qa60xrfoIJrW9qUOfVlvfqdi+CDAE8mjY FfIK7EVbppIT4Wr8PNsmZ4o= X-Google-Smtp-Source: AOwi7QBl1mSVTYtRKGbO5gW75YbLkswm7xammsehtZfJA2c0LkElxGFb2lYIJ9xPMWmwmE2UyNnuBA== X-Received: by 10.84.233.66 with SMTP id k2mr18633861plt.134.1507068388908; Tue, 03 Oct 2017 15:06:28 -0700 (PDT) Received: from localhost.localdomain.org ([66.96.79.214]) by smtp.gmail.com with ESMTPSA id e76sm23093989pfd.149.2017.10.03.15.06.28 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 03 Oct 2017 15:06:28 -0700 (PDT) From: Ping Cheng X-Google-Original-From: Ping Cheng To: jikos@kernel.org Cc: linux-input@vger.kernel.org, toshiki.takeuchi@wacom.com, killertofu@gmail.com, Ping Cheng Subject: [PATCH] HID: hid-input: Add eraser usage to hidinput_configure_usage Date: Tue, 3 Oct 2017 15:05:41 -0700 Message-Id: <20171003220541.3333-1-ping.cheng@wacom.com> X-Mailer: git-send-email 2.13.6 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Some tablets report eraser usage to indicate the eraser tool tip is touching the surface. But, hidinput_configure_usage didn't support the usage, which led it falls into default as ABS_MISC. Signed-off-by: Ping Cheng --- drivers/hid/hid-input.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c index 199f6a01fc62..04d01b57d94c 100644 --- a/drivers/hid/hid-input.c +++ b/drivers/hid/hid-input.c @@ -797,6 +797,15 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel map_key_clear(BTN_STYLUS); break; + case 0x45: /* ERASER */ + /* + * This event is reported when eraser tip touches the surface. + * Actual eraser (BTN_TOOL_RUBBER) is set by Invert usage when + * tool gets in proximity. + */ + map_key_clear(BTN_TOUCH); + break; + case 0x46: /* TabletPick */ case 0x5a: /* SecondaryBarrelSwitch */ map_key_clear(BTN_STYLUS2);