From patchwork Fri Aug 21 11:01:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Mastykin X-Patchwork-Id: 11729143 X-Patchwork-Delegate: jikos@jikos.cz Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C3832913 for ; Fri, 21 Aug 2020 11:01:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id ABCD220738 for ; Fri, 21 Aug 2020 11:01:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727791AbgHULBm (ORCPT ); Fri, 21 Aug 2020 07:01:42 -0400 Received: from mail.astralinux.ru ([217.74.38.120]:52947 "EHLO astralinux.ru" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727770AbgHULBm (ORCPT ); Fri, 21 Aug 2020 07:01:42 -0400 Received: from [46.148.196.138] (account dmastykin@astralinux.ru HELO [192.168.32.67]) by astralinux.ru (CommuniGate Pro SMTP 6.2.7) with ESMTPSA id 2215213 for linux-input@vger.kernel.org; Fri, 21 Aug 2020 13:58:03 +0300 Subject: Upd: hid-multitouch: is pen hovering ever possible? References: <0322c725-9eea-2947-bcf1-89958d91db92@astralinux.ru> To: linux-input@vger.kernel.org From: Dmitry Mastykin X-Forwarded-Message-Id: <0322c725-9eea-2947-bcf1-89958d91db92@astralinux.ru> Message-ID: Date: Fri, 21 Aug 2020 14:01:40 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <0322c725-9eea-2947-bcf1-89958d91db92@astralinux.ru> Content-Language: en-US Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Hello guys, here is a 3-lines patch that made the pen working with hid-multitouch. It just delegates pen to hid-input. Hope it helps someone. Kind regards, Dmitry Mastykin -------- Forwarded Message -------- Subject: hid-multitouch: is pen hovering ever possible? Date: Fri, 21 Aug 2020 13:24:40 +0300 From: Dmitry Mastykin To: linux-input@vger.kernel.org Hello guys, thanks to all of you for your great work! Please, answer, is pen hovering ever possible using hid-multitouch driver? If I remove hid-multitouch - hovering works well with hid-generic. I can't unbind from hid-multitouch and bind to hid-generic: bind fails with "No such device". I tried to modify hid-multitouch, but was not able to get hovering work using multitouch reports. Then I noticed, that wacom uses non-multitouch reports for their pen devices, and added a quirk to hid-multitouch that changes pen's behavior to non-multitouch (patch attached). It works, but the way must be wrong( How should one proceed in right way? Thank you very much! Dmitry Mastykin From ae8672dc7020ed93a7dfbb6d797aea85466f236b Mon Sep 17 00:00:00 2001 From: Dmitry Mastykin Date: Fri, 21 Aug 2020 13:51:46 +0300 Subject: hid-multitouch: delegate pen to hid-input diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c index 362805ddf377..41d809947a0a 100644 --- a/drivers/hid/hid-multitouch.c +++ b/drivers/hid/hid-multitouch.c @@ -1334,6 +1334,11 @@ static int mt_input_mapping(struct hid_device *hdev, struct hid_input *hi, return 1; } + if (field->application == HID_DG_PEN) { + rdata->is_mt_collection = false; + return 0; + } + if (rdata->is_mt_collection) return mt_touch_input_mapping(hdev, hi, field, usage, bit, max, application);