From patchwork Tue May 7 18:53:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Gerecke, Jason" X-Patchwork-Id: 10933609 X-Patchwork-Delegate: jikos@jikos.cz Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9CBED14DB for ; Tue, 7 May 2019 18:53:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8C2B7205D1 for ; Tue, 7 May 2019 18:53:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7FFE22891A; Tue, 7 May 2019 18:53:28 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 2C5C0205D1 for ; Tue, 7 May 2019 18:53:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726855AbfEGSx1 (ORCPT ); Tue, 7 May 2019 14:53:27 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:43809 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726464AbfEGSx1 (ORCPT ); Tue, 7 May 2019 14:53:27 -0400 Received: by mail-pg1-f196.google.com with SMTP id t22so8742693pgi.10; Tue, 07 May 2019 11:53:27 -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:mime-version :content-transfer-encoding; bh=jUaBkZMmmgzmMzkoqnX0MUxDUlbVz2UyMtd0YFW6+18=; b=UuhxinJeldM2AmFH7ttf7DKC6TMUIiS2KSfnaOJeydjXmrxgYRRqU6AIP94CM0sJkx 3qcyrzQbDLhDn8J75ZMNr2n8OHehBAX/EtzXA7/XmIh4AYm/7zdSe+yHNG4RnBJt3XXI /9wz67WCLkPlepJ6O4Q7RNDfe4v5hK/is2gz8r+VFkmT+6WHkhxZxH8rxtzEPjk9qsqZ JsDLIe6QwqVfCeYXOGgaaxwBxMRGULnU6M1DS/3yK792BwgkZ1jGZ5abmPVDaBY1ZUjx u8Zw67R0T1f9WiSSwpwyKvLEQkKeoHVeKtLr8CBwYw2Ykf7/I2mCxVFwmh0PcixuZO0T iiOg== 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:mime-version :content-transfer-encoding; bh=jUaBkZMmmgzmMzkoqnX0MUxDUlbVz2UyMtd0YFW6+18=; b=rwuIf0a1Q2SnGPaXTrwvGCG+VHUd01d3aQ9rBm2i1RVxcKPuEDxnHXYilp1MXgm2tD oV6UhzvE3GTOvxZIb8X4i/2x0ucZlGKNnXSyX8N1yNjUX3GPSKhwdPJ/yIrnodVxvpUE TaO0YRv+jCE7Gq2ONJlOaGj4U3cFmvLN6fpbWiBxFPKD3eDSCAkSGmTAkMILJMwoumyC 5P7X6Yk2Q8CtWfd1gWpCqRTDrdNG3miPLULfRhde9S1nD267TrR/2eOD2dg+axjvpp+V uU+vWTMYO4pz98Wt5z/0130sMpPCCBnx4f6LaA5l0NROj79+92KX8nTp2isVM6UsIXDY hgOw== X-Gm-Message-State: APjAAAWNohuCTGG02b7gm6HDy0yyhyeJCE2ZUhckMGBi00aoZh5DZX/D qQiucVbsPCThI8zMTgZQlFCsrpFz X-Google-Smtp-Source: APXvYqwVJ3LKvrvvPRf6CLCjA5OphFg28CtI0o+nKR65H+uuWq7w8G3y34eNGkDZxDPPrNnt/fOv5A== X-Received: by 2002:aa7:8a53:: with SMTP id n19mr42287003pfa.11.1557255206197; Tue, 07 May 2019 11:53:26 -0700 (PDT) Received: from US-191-ENG0002.corp.onewacom.com ([50.225.60.4]) by smtp.gmail.com with ESMTPSA id w189sm20085506pfw.147.2019.05.07.11.53.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 May 2019 11:53:25 -0700 (PDT) From: "Gerecke, Jason" X-Google-Original-From: "Gerecke, Jason" To: linux-input@vger.kernel.org, Benjamin Tissoires Cc: Ping Cheng , Aaron Armstrong Skomra , Jason Gerecke , stable@vger.kernel.org, Aaron Skomra Subject: [PATCH 1/3] HID: wacom: Send BTN_TOUCH in response to INTUOSP2_BT eraser contact Date: Tue, 7 May 2019 11:53:20 -0700 Message-Id: <20190507185322.7168-1-jason.gerecke@wacom.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 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 Bluetooth reports from the 2nd-gen Intuos Pro have separate bits for indicating if the tip or eraser is in contact with the tablet. At the moment, only the tip contact bit controls the state of the BTN_TOUCH event. This prevents the eraser from working as expected. This commit changes the driver to send BTN_TOUCH whenever either the tip or eraser contact bit is set. Fixes: 4922cd26f0 ("HID: wacom: Support 2nd-gen Intuos Pro's Bluetooth classic interface") Cc: # 4.11+ Signed-off-by: Jason Gerecke Reviewed-by: Aaron Skomra --- 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 613342bb9d6b..af62a630fee9 100644 --- a/drivers/hid/wacom_wac.c +++ b/drivers/hid/wacom_wac.c @@ -1301,7 +1301,7 @@ static void wacom_intuos_pro2_bt_pen(struct wacom_wac *wacom) range ? frame[7] : wacom->features.distance_max); } - input_report_key(pen_input, BTN_TOUCH, frame[0] & 0x01); + input_report_key(pen_input, BTN_TOUCH, frame[0] & 0x09); input_report_key(pen_input, BTN_STYLUS, frame[0] & 0x02); input_report_key(pen_input, BTN_STYLUS2, frame[0] & 0x04); From patchwork Tue May 7 18:53:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Gerecke, Jason" X-Patchwork-Id: 10933611 X-Patchwork-Delegate: jikos@jikos.cz Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 507D414DB for ; Tue, 7 May 2019 18:53:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3F050205D1 for ; Tue, 7 May 2019 18:53:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 335572891A; Tue, 7 May 2019 18:53:30 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 C8388205D1 for ; Tue, 7 May 2019 18:53:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727425AbfEGSx3 (ORCPT ); Tue, 7 May 2019 14:53:29 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:41719 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726464AbfEGSx3 (ORCPT ); Tue, 7 May 2019 14:53:29 -0400 Received: by mail-pg1-f193.google.com with SMTP id z3so5051724pgp.8; Tue, 07 May 2019 11:53:28 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=fXrjZyI3zkrddTH2jXfU6DTNpkL2FJKBOlWlMqHcmC8=; b=GBuj+tgmXa5/s1NYjDwoz5pAxoVfUfFh9XEMdgaGneb26j7IoLtJwEqWNbizUMEhDc sRC6cGzA/aScrE62z/8c9inskY95BXcPRG/2L8Yenj/euk4h/74dbivWxEcbC5uArAd1 8cYLu8WFmR5KpwwYZ3btj3KbIU8J14dr/Wttu426GpKsToW9CwV4L4kkCo3N9rMS5Pnq PxC6PEuRZD4CA1IFsjAacsNPI5evPX7KSBh3pB1KU5tmpzBU/JvVp/QgRzGRJ2Vu3xf1 RMYaoRpqZ9Cd0s7ACNwGlR+ydK4oIb+r7W9G3S/1tpHjqFp5IjU1tmk56PCTZy8zeS/2 M7vQ== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=fXrjZyI3zkrddTH2jXfU6DTNpkL2FJKBOlWlMqHcmC8=; b=ooBEH9KLiDs0Uw4SFJA/Av1pz9mzV16zNyqPvk7TZd1u80KjasnEmIRN9UU4FDnefR o9Bak7Rg15FJDqskDwnhB+ergsAnDqQVfPSbJ+9C6gtmvx2dvhLfVhkrzMjfviYyMatw YyGUJr+J/wQ0+i904cg6QFclcRWy8vc2lXljCdyPOuyex7tf4mh1phgs61NhMZD9zZES xwcZlNxJOqmPRHmdmaBxefUDwUQryucCBdodUu64pG4j1DXicCqvLGNQXWb5CXdWJ0fQ TNmfsApISik4mwx7U7WAx+i/bVmaHp4iQZwDq+Zrnb9kBbriZJs4fJjlR1fSUPYpTop9 sZCQ== X-Gm-Message-State: APjAAAVuuJ3NfJAXdLmiiczNL2TE6L0ydkXmiqJdabslK894bb2L3N2H dU/qaw1wQMauHt+GPiov9ToZWam/ X-Google-Smtp-Source: APXvYqxFaczlhP4zjYw0VoWBQEdUx7il02UF2a56ByVu6lbe5B4V3NrvOsUw4tA6yjD1eEtu40yAuw== X-Received: by 2002:a63:f843:: with SMTP id v3mr41254597pgj.69.1557255207917; Tue, 07 May 2019 11:53:27 -0700 (PDT) Received: from US-191-ENG0002.corp.onewacom.com ([50.225.60.4]) by smtp.gmail.com with ESMTPSA id w189sm20085506pfw.147.2019.05.07.11.53.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 May 2019 11:53:26 -0700 (PDT) From: "Gerecke, Jason" X-Google-Original-From: "Gerecke, Jason" To: linux-input@vger.kernel.org, Benjamin Tissoires Cc: Ping Cheng , Aaron Armstrong Skomra , Jason Gerecke , stable@vger.kernel.org, Aaron Skomra Subject: [PATCH 2/3] HID: wacom: Correct button numbering 2nd-gen Intuos Pro over Bluetooth Date: Tue, 7 May 2019 11:53:21 -0700 Message-Id: <20190507185322.7168-2-jason.gerecke@wacom.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190507185322.7168-1-jason.gerecke@wacom.com> References: <20190507185322.7168-1-jason.gerecke@wacom.com> MIME-Version: 1.0 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 button numbering of the 2nd-gen Intuos Pro is not consistent between the USB and Bluetooth interfaces. Over USB, the HID_GENERIC codepath enumerates the eight ExpressKeys first (BTN_0 - BTN_7) followed by the center modeswitch button (BTN_8). The Bluetooth codepath, however, has the center modeswitch button as BTN_0 and the the eight ExpressKeys as BTN_1 - BTN_8. To ensure userspace button mappings do not change depending on how the tablet is connected, modify the Bluetooth codepath to report buttons in the same order as USB. To ensure the mode switch LED continues to toggle in response to the mode switch button, the `wacom_is_led_toggled` function also requires a small update. Link: https://github.com/linuxwacom/input-wacom/pull/79 Fixes: 4922cd26f0 ("HID: wacom: Support 2nd-gen Intuos Pro's Bluetooth classic interface") Cc: # 4.11+ Signed-off-by: Jason Gerecke Reviewed-by: Aaron Skomra --- drivers/hid/wacom_wac.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/hid/wacom_wac.c b/drivers/hid/wacom_wac.c index af62a630fee9..e848445236d8 100644 --- a/drivers/hid/wacom_wac.c +++ b/drivers/hid/wacom_wac.c @@ -1383,7 +1383,7 @@ static void wacom_intuos_pro2_bt_pad(struct wacom_wac *wacom) struct input_dev *pad_input = wacom->pad_input; unsigned char *data = wacom->data; - int buttons = (data[282] << 1) | ((data[281] >> 6) & 0x01); + int buttons = data[282] | ((data[281] & 0x40) << 2); int ring = data[285] & 0x7F; bool ringstatus = data[285] & 0x80; bool prox = buttons || ringstatus; @@ -3832,7 +3832,7 @@ static void wacom_24hd_update_leds(struct wacom *wacom, int mask, int group) static bool wacom_is_led_toggled(struct wacom *wacom, int button_count, int mask, int group) { - int button_per_group; + int group_button; /* * 21UX2 has LED group 1 to the left and LED group 0 @@ -3842,9 +3842,12 @@ static bool wacom_is_led_toggled(struct wacom *wacom, int button_count, if (wacom->wacom_wac.features.type == WACOM_21UX2) group = 1 - group; - button_per_group = button_count/wacom->led.count; + group_button = group * (button_count/wacom->led.count); - return mask & (1 << (group * button_per_group)); + if (wacom->wacom_wac.features.type == INTUOSP2_BT) + group_button = 8; + + return mask & (1 << group_button); } static void wacom_update_led(struct wacom *wacom, int button_count, int mask, From patchwork Tue May 7 18:53:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Gerecke, Jason" X-Patchwork-Id: 10933613 X-Patchwork-Delegate: jikos@jikos.cz Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 468F613AD for ; Tue, 7 May 2019 18:53:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 35F952891A for ; Tue, 7 May 2019 18:53:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 29D8628927; Tue, 7 May 2019 18:53:33 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 4E131205D1 for ; Tue, 7 May 2019 18:53:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727438AbfEGSxa (ORCPT ); Tue, 7 May 2019 14:53:30 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:42529 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726464AbfEGSxa (ORCPT ); Tue, 7 May 2019 14:53:30 -0400 Received: by mail-pf1-f196.google.com with SMTP id 13so8808314pfw.9; Tue, 07 May 2019 11:53:30 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=KRHKxRuysYGgXbbpO6rIqlLn4waiOgs8Pmx2aAZVU0c=; b=pc75Btdxymf408ZedJHdUp37dGFrkRgw8TkbRkyyn8UoVtXDi2pdzijYyJPK+3ziLc 6ogOXccq+keIL6YyTb1Alk8hM6wc0uaaZ7ujkP3Rw7F58GLRcZRR7Vka/pACebpLITLb ZcjDfdQJiH7LgRsrLE4jplchGTnfHZhQwIbT7prYY3UB03V3803fBwnfXkk5WzET6T// JkuPdriYToR1dHzP7QBAA3sYFj4UX4QXhsxYKrlLyzO3/OyXoXm+ZMsEVpurTyJkfmnD YCkUeRzDSomTfmR3S59CBksA6+ujDSYdYWh5qG2sccugYlWwHnFVCwW8PBWl0m9K3sxG WTqQ== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=KRHKxRuysYGgXbbpO6rIqlLn4waiOgs8Pmx2aAZVU0c=; b=rlau2MRBvII87q7wum+dsCsjFYy+fpTFwwfbyswZ23xBoDyqQsvFxfMVl5S/RqQ93F Z+sThyA2YKtYgod8j9HsJV/Dq0oFNdCpuVuJ7Zox9PhC/WZzP2mMasOd1TDQnSTEPFGa hscryhTQFdyeWMrv34l8hE3WSo2AhmlFC4fFSWChMIUuJugZN/q0LL3lcpnxYfPDqHO0 Pdlph8oC+8zVKijvd1pVYsUPa1VG0KfPi/4BwcfzAqJMwq1uxT92qnzgENm8ZzpiLU8W 61pjFpyVh39D75oZSArjGtO4dM/9czf6sC1ZwQmttK82fOOHw3rs0TR35HOdvHQtut54 ELbw== X-Gm-Message-State: APjAAAUlIYFs660Te47Jh3oaga3zvq9b4GZFBKKIsJ9VDk1VNd/7ueUv /UXE2iJTNCe6j+XzcDV/IrZwvFpV X-Google-Smtp-Source: APXvYqyi+fWAto7XDdqYbv7JImcBdCxW466JgklIplZkE8iDrqLTtzFV/ZwsdudpHkP0SMa10pYk4Q== X-Received: by 2002:a62:164f:: with SMTP id 76mr43451592pfw.172.1557255209363; Tue, 07 May 2019 11:53:29 -0700 (PDT) Received: from US-191-ENG0002.corp.onewacom.com ([50.225.60.4]) by smtp.gmail.com with ESMTPSA id w189sm20085506pfw.147.2019.05.07.11.53.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 May 2019 11:53:28 -0700 (PDT) From: "Gerecke, Jason" X-Google-Original-From: "Gerecke, Jason" To: linux-input@vger.kernel.org, Benjamin Tissoires Cc: Ping Cheng , Aaron Armstrong Skomra , Jason Gerecke , stable@vger.kernel.org Subject: [PATCH 3/3] HID: wacom: Sync INTUOSP2_BT touch state after each frame if necessary Date: Tue, 7 May 2019 11:53:22 -0700 Message-Id: <20190507185322.7168-3-jason.gerecke@wacom.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190507185322.7168-1-jason.gerecke@wacom.com> References: <20190507185322.7168-1-jason.gerecke@wacom.com> MIME-Version: 1.0 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 Bluetooth interface of the 2nd-gen Intuos Pro batches together four independent "frames" of finger data into a single report. Each frame is essentially equivalent to a single USB report, with the up-to-10 fingers worth of information being spread across two frames. At the moment the driver only calls `input_sync` after processing all four frames have been processed, which can result in the driver sending multiple updates for a single slot within the same SYN_REPORT. This can confuse userspace, so modify the driver to sync more often if necessary (i.e., after reporting the state of all fingers). Fixes: 4922cd26f0 ("HID: wacom: Support 2nd-gen Intuos Pro's Bluetooth classic interface") Cc: # 4.11+ Signed-off-by: Jason Gerecke --- drivers/hid/wacom_wac.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/hid/wacom_wac.c b/drivers/hid/wacom_wac.c index e848445236d8..09b8e4aac82f 100644 --- a/drivers/hid/wacom_wac.c +++ b/drivers/hid/wacom_wac.c @@ -1371,11 +1371,17 @@ static void wacom_intuos_pro2_bt_touch(struct wacom_wac *wacom) if (wacom->num_contacts_left <= 0) { wacom->num_contacts_left = 0; wacom->shared->touch_down = wacom_wac_finger_count_touches(wacom); + input_sync(touch_input); } } - input_report_switch(touch_input, SW_MUTE_DEVICE, !(data[281] >> 7)); - input_sync(touch_input); + if (wacom->num_contacts_left == 0) { + // Be careful that we don't accidentally call input_sync with + // only a partial set of fingers of processed + input_report_switch(touch_input, SW_MUTE_DEVICE, !(data[281] >> 7)); + input_sync(touch_input); + } + } static void wacom_intuos_pro2_bt_pad(struct wacom_wac *wacom)