From patchwork Fri Sep 8 00:47:38 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ping Cheng X-Patchwork-Id: 9943023 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 C245F600CB for ; Fri, 8 Sep 2017 00:48:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AFDCA27F86 for ; Fri, 8 Sep 2017 00:48:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A515427F94; Fri, 8 Sep 2017 00:48:09 +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 25AAE27F8C for ; Fri, 8 Sep 2017 00:48:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752665AbdIHArz (ORCPT ); Thu, 7 Sep 2017 20:47:55 -0400 Received: from mail-pg0-f68.google.com ([74.125.83.68]:32980 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752658AbdIHAry (ORCPT ); Thu, 7 Sep 2017 20:47:54 -0400 Received: by mail-pg0-f68.google.com with SMTP id m9so607423pgd.0; Thu, 07 Sep 2017 17:47:54 -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=Gu9TrT9RoxOX8SLUxzyp+rZLjdAFwPtXgUYNoY0357M=; b=hWlU69igbI+sG6Lzchwad7YBwqbr2J41bBEKASooeTQjaUHgr19XFkff5LXus7cm8b MPEco27o4aWIoN5oki4BznT+w0Ha9DnDr/ycmiR71lFyhCqb0VFXwxb87XeBDpJDbuq6 ddnQmtaSAQ01kPF3a+unl/7MuFFe/z3vRzmB2ejzkqtlwwYsQSqTiJ/+OZQiXopUFWZr 6+4u0K6JuWXLcKu0tu3lnsfEGDLavH8wGPanhB9Yl1qQsxDtPf9ufBiTycA0XBF9DKKk PZ0YJmuKyCstbLJnD+UNwiW8uRzqQ0dusSgRypOYBYCFlpnLOTFiLdjS1TYr1+YqTX6k EHyg== 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=Gu9TrT9RoxOX8SLUxzyp+rZLjdAFwPtXgUYNoY0357M=; b=mIRujoxOYqcddHwbPY9f4eZ/notGMaz3EklQ3216fKnS8qi+YI+bDjcPV5Cbqx24pX qixucFoJwMU/tuprsEhccFdhA2A8wDrsFMYEW/EQ9xkswVMEF9Ui1+faGjLntwq8Dz2z 1mPBczleShKjTxnUWE0GMIXhR/pv8y5/mnNet4zs2fUgFH0woLHqock/O/ZhRZ3J4JkQ 7Y9DZPZobY/qzQl/6Td0lIKxtp/cZmpUmKiymsJLKKSXBsJInBTjk43N0gpcgeNIpT03 opCaTqbsvCDkCfInTNcLaE8LOfUG5+eUGPl/RsVBpKiiRCRNGqaNf4WP8fpEzuWuWFzi Zzmg== X-Gm-Message-State: AHPjjUhdwus6dyKU1WufnN3lazCe6mlWD5bugAyuccczOj0G4qepb9u+ bVayziWGGysqdA== X-Google-Smtp-Source: ADKCNb6xWUMt1TD6sGvnEZ1Ca9B1q1TqzlsNJvmtO+c9no8vIPT+1NJ+egLCDDx2saN4ow/8t2IpNw== X-Received: by 10.84.211.100 with SMTP id b91mr1421532pli.126.1504831673640; Thu, 07 Sep 2017 17:47:53 -0700 (PDT) Received: from localhost.localdomain (mobile-166-176-185-67.mycingular.net. [166.176.185.67]) by smtp.gmail.com with ESMTPSA id h82sm959526pfd.148.2017.09.07.17.47.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 Sep 2017 17:47:53 -0700 (PDT) From: Ping Cheng X-Google-Original-From: Ping Cheng To: jikos@kernel.org Cc: linux-input@vger.kernel.org, Jason Gerecke , "stable # v4 . 10" , Ping Cheng , Jason Gerecke Subject: [PATCH 2/6] HID: wacom: generic: Clear ABS_MISC when tool leaves proximity Date: Thu, 7 Sep 2017 17:47:38 -0700 Message-Id: <20170908004738.2893-1-ping.cheng@wacom.com> X-Mailer: git-send-email 2.9.5 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 From: Jason Gerecke The tool ID information sent in ABS_MISC is expected to be reset to 0 when a tool leaves proximity. Not doing this can cause problems if a tool is removed and then re-introduced. Kernel event filtering will prevent the (identical) ABS_MISC event from being sent when the tool re-enters proxmity. This can cause userspace to not properly set the tool ID. Fixes: f85c9dc678 ("HID: wacom: generic: Support tool ID and additional tool types") Cc: stable # v4.10 Signed-off-by: Ping Cheng Signed-off-by: Jason Gerecke --- drivers/hid/wacom_wac.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hid/wacom_wac.c b/drivers/hid/wacom_wac.c index e2ba36d..aa692e2 100644 --- a/drivers/hid/wacom_wac.c +++ b/drivers/hid/wacom_wac.c @@ -2272,7 +2272,7 @@ static void wacom_wac_pen_report(struct hid_device *hdev, input_report_key(input, wacom_wac->tool[0], prox); if (wacom_wac->serial[0]) { input_event(input, EV_MSC, MSC_SERIAL, wacom_wac->serial[0]); - input_report_abs(input, ABS_MISC, id); + input_report_abs(input, ABS_MISC, prox ? id : 0); } wacom_wac->hid_data.tipswitch = false;