From patchwork Fri May 24 11:21:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?Sm9zw6kgRXhww7NzaXRv?= X-Patchwork-Id: 13673099 X-Patchwork-Delegate: jikos@jikos.cz Received: from mail-wr1-f44.google.com (mail-wr1-f44.google.com [209.85.221.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 11D7185930; Fri, 24 May 2024 11:26:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716549972; cv=none; b=rEsLx5+ArAztqCob+hj+JMLOsFXnVDxqf2lUasyVm9EqcWm+QWDxw70AGbhQkUkdCgtz7aZCcFy0Dp8fUZubA/URWXU+2Qaz/a0hojCVPzFrs3f6mBlmjUsNHOnWVfldWMxQYBOtTLqrDfg285+RcNdU/K70/vg8akBiu3NTPFE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716549972; c=relaxed/simple; bh=cG6gYW6/lF5NjKoSljLUI3Q9DM/hM0vRcJ+v92dR7+k=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=sni/zIevpv1otE6bcFtLowAoRso6nMyj/BIh5hNsIydDVC1QhTv/Ypy6Oh3MyaJE5GbDDBovKiwcbRrOkkM1LPiqdORKV/9MXhRUQ5T6uHxT9vS/LTTlYcOPjzyz7UYUWttjJrqPCc84WBlFiG9te3PrcZ2GMmASiqamaKXVmYs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Nz/pg54/; arc=none smtp.client-ip=209.85.221.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Nz/pg54/" Received: by mail-wr1-f44.google.com with SMTP id ffacd0b85a97d-35507fc2600so703597f8f.0; Fri, 24 May 2024 04:26:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716549969; x=1717154769; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=/ur1UlHeEjfjcn7igZ5+i6qFXG1IXbKWH273ahEei2E=; b=Nz/pg54/j7MR7HKPm9yfLotiwoE7DzClg/4S2JZ6IxaCai7w5ncfjUnettzAXA4xKe VB+TGbDwBTTAKUFFoav8e/hc53P9vhxd1plPHXSc34zXVPiGHIefP0Aw7mdEalLpzzzC ipT1igA6JTOFrKQaFDk3xVdktuF9wiXdWE6NLSUdOy6EnPf9M75//yVbvHQhqZwdNyUb 9BnoNTS2Bu69VjPRLCFtUbPhkw/trWawuXhszKULgxRduSP3M7xpiJKRYn6QDtvNQFtA F/RNCY4kj4itmZnmootBiCqpCygtn0TYf6rm4n/E90f+UUiMjNvsPl8RZtieJ/uXbI0y /38A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716549969; x=1717154769; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/ur1UlHeEjfjcn7igZ5+i6qFXG1IXbKWH273ahEei2E=; b=Vbb7CD2PLrM/hFdcLpXDano924HzTvLnWDeAGJYBgL69ZgH75NkNOdynP/L9cwCkEk NagbGIKrMPOeVeQiGR18QLE0GVnhFvvmYcqF/pviVc5mZ+Ct1ToWr1YurepntFAX/AMS oLnkXa/u1wDgIUd8vxfpoUb/kwNk67UE3ucuV2vuWJCTYhQTOzH6nfamOuspwtnd1iM1 LHfcjXx3DYIVQqS95+pdZyIxZobMAvTNZKP8EMe2g4sV39C5SGkyx39aPDYBIRzJyz3Z 8sTLoQ592l8JpS+UMG2Zl7obU/AghI9FZH2JKIYuxuclw0UObiQ6bdKrBdXFzaDvYUoA u6PQ== X-Forwarded-Encrypted: i=1; AJvYcCUOsCwFwH/Q75UTgD60XFid2AS5sl2CPtvIB5CUUsPmSavEp3xF9vltziczm2LCNkZU5Lb3ngHiyZZ+k1OjUpMm80mlxO/Lnx6MvbgtSz6Q0qIkVBdzxK5xlVZmuXEuBz9IP0KP8ZCkz1E= X-Gm-Message-State: AOJu0YzbQ6PX/lrwNWCSJevxD+0k/1NDiH/etlHM3RD+1Ga1KhK+1Jh5 wZwC58QfnXW7J4TksDv3LjOeRfrqbTGGOQ1pQiksRpGZzIZyGmIi9V6gxw== X-Google-Smtp-Source: AGHT+IEx0Yb3r2siwh/vlxwUaOWz2q5dnjGuxaX436ZE18SweH1MRl+QUrOn/gNL/NHwlXA1ph/hQg== X-Received: by 2002:adf:fc44:0:b0:34d:b42d:b666 with SMTP id ffacd0b85a97d-3552fdfa4f6mr1236618f8f.56.1716549969275; Fri, 24 May 2024 04:26:09 -0700 (PDT) Received: from fedora.. ([213.94.26.172]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3557a1c936esm1369907f8f.83.2024.05.24.04.26.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 May 2024 04:26:07 -0700 (PDT) From: =?utf-8?b?Sm9zw6kgRXhww7NzaXRv?= To: jikos@kernel.org Cc: benjamin.tissoires@redhat.com, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?b?Sm9zw6kgRXhww7NzaXRv?= Subject: [PATCH 1/2] HID: uclogic: Support HUION devices with up to 20 buttons Date: Fri, 24 May 2024 13:21:35 +0200 Message-ID: <20240524112554.166746-2-jose.exposito89@gmail.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240524112554.166746-1-jose.exposito89@gmail.com> References: <20240524112554.166746-1-jose.exposito89@gmail.com> Precedence: bulk X-Mailing-List: linux-input@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 The HID descriptor for HUION tablets was limited to 13 buttons. However, there are devices with more buttons in their frames. So far, the device with more buttons released by HUION is the Huion Kamvas Pro 24 (GT-240, QHD) [1], with 20 buttons. Tweak the HID descriptor to support it. Link: https://gitlab.freedesktop.org/libinput/libinput/-/issues/989 [1] Signed-off-by: José Expósito --- drivers/hid/hid-uclogic-rdesc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/hid/hid-uclogic-rdesc.c b/drivers/hid/hid-uclogic-rdesc.c index b6dfdf6356a6..7cbd673747a5 100644 --- a/drivers/hid/hid-uclogic-rdesc.c +++ b/drivers/hid/hid-uclogic-rdesc.c @@ -689,10 +689,10 @@ const size_t uclogic_rdesc_v2_pen_template_size = 0xA0, /* Collection (Physical), */ \ 0x05, 0x09, /* Usage Page (Button), */ \ 0x19, 0x01, /* Usage Minimum (01h), */ \ - 0x29, 0x03, /* Usage Maximum (03h), */ \ - 0x95, 0x03, /* Report Count (3), */ \ + 0x29, 0x0A, /* Usage Maximum (0Ah), */ \ + 0x95, 0x0A, /* Report Count (10), */ \ 0x81, 0x02, /* Input (Variable), */ \ - 0x95, ((_size) * 8 - 45), \ + 0x95, ((_size) * 8 - 52), \ /* Report Count (padding), */ \ 0x81, 0x01, /* Input (Constant), */ \ 0xC0, /* End Collection, */ \ From patchwork Fri May 24 11:21:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?Sm9zw6kgRXhww7NzaXRv?= X-Patchwork-Id: 13673100 X-Patchwork-Delegate: jikos@jikos.cz Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BB72886256; Fri, 24 May 2024 11:26:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716549974; cv=none; b=fLjTHACCuD9Dx7fvOpvXzdVGUxJaB35iTHuwMhu2cCZ09mj7e//X5CthWIzdq2WcuSeJXd/dAbHSBYTWPOMFZiMx5pbTkt+4MGjHTmau9EVthRBhIEuh3wtnuopC0tYvqiazi+bZErF114sU5M8Cl/lp67nF2KyNekS7xP/qhQ8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716549974; c=relaxed/simple; bh=rVcJOAuVTTsN0S1Mw/DD2ndJe2PvZtARmsDMYZCX+1U=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=SM8+1q/0f/Rz4j8Z4FUNH3dbxMiY6bz2/khKjIHRzXr4TQSGCvAHoTSk/YHNaoJvBkE6W/o6AEQIPDD00pFv/686reLNT9nDgBocRKrGlqUudphgq3qRD4pTex7Laqka8fw4/5zfV8yA+xqaAcYB33YED7ynPmJJr9Aas49PtyI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=QA5ndkVR; arc=none smtp.client-ip=209.85.221.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="QA5ndkVR" Received: by mail-wr1-f42.google.com with SMTP id ffacd0b85a97d-35507fc2600so703615f8f.0; Fri, 24 May 2024 04:26:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716549971; x=1717154771; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=F71HeAiS0n7OunXO1S9h5SbnNhlmYJtMncX8oz/1y3M=; b=QA5ndkVRqEbVtArzk56OxyF5dpXyqA+pxXu4fCG+PR3hRCU6NFao9kKdZOUFFpdzNJ 5bsT1bfODto/OfLwhIrPb0ZFBD4Kkucz2xI09RdAXtj84UhWh8MpyK5wyxRRfBKiU8PZ ThemqtFuROWcPuvdtDGoQvbM2Mf1Li5WcnSi8O9/I/O+t0tWFT+5YafEy0OI+siKe85H tgrcgA+p4zVwkIWSRKwBBiUsHq7k+YGylbjHj/x7rg2x7Rj3cX5DKAlJs8pkJp5ZDlBi mpwa22xKy1O+iQbjuyIGKnpMDYZcxUxG7k5w7ZlhJ8rHg3kCsaC14oXPTJLLaaExMW4S iD6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716549971; x=1717154771; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=F71HeAiS0n7OunXO1S9h5SbnNhlmYJtMncX8oz/1y3M=; b=pV2tDrQ+bSooXTyOhKFHtAZkrbU6Kp50Lz0FX891DWcjxluGP31EC2r/WWvnlFhsgW pfYlM16AeFedVSpLen39nTlnim3e3qC+LMJm71EcyMooYB3k7q7F5dmkITxkxOgwgbDl wSH5TLTtC8Ybt/aprtcv0leUSJUn+oYhi9nqKxY4gVfQbDQmRKHyELcFC6c1qeSXMhgu y5rIeKnMXteQfZf9oNSSec2DVHXzxJQWFJ0dLSnFjAbRLr1BPO1G3HuCUnQM4bg2NfBd R62wsRR8vFYbib+fY7ZQSiTyT/r4p/MXJTrVn1XayYRrftjYg2FyZHGhPKFNKViuEyBE KqQA== X-Forwarded-Encrypted: i=1; AJvYcCU4thZLV6StoY4OBiA+8X5zM1L7S6QAonLXq8+jq335KCtMri4u+a+n0JtfEBKM5bbgTCsTCUsvvcAMV6YO+A7WqpRJmveE/F7gsqVET21ogPWjt3bgkn8wd9V61qA0QJcI0ES17+l0il4= X-Gm-Message-State: AOJu0YwouLm7/0xVVg8IMcpgUDDnTJwoHFoCcIlOKCRQXXg0D33GviDS 3t6vjr3/Eh2oFV2UOOAa1YJg09iN77iM3A1VlPH5TKUgot9uh6v3 X-Google-Smtp-Source: AGHT+IGqZcitUO5Gi+PO0ih2/A+4NCsX0ZbPD1Aif6JNz34kIb38WvQZqJoFXXgKoCMmwzyL0/2cDA== X-Received: by 2002:a5d:58c4:0:b0:355:2ae:d88d with SMTP id ffacd0b85a97d-3552883172amr1238150f8f.34.1716549971164; Fri, 24 May 2024 04:26:11 -0700 (PDT) Received: from fedora.. ([213.94.26.172]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3557a1c936esm1369907f8f.83.2024.05.24.04.26.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 May 2024 04:26:09 -0700 (PDT) From: =?utf-8?b?Sm9zw6kgRXhww7NzaXRv?= To: jikos@kernel.org Cc: benjamin.tissoires@redhat.com, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?b?Sm9zw6kgRXhww7NzaXRv?= Subject: [PATCH 2/2] HID: uclogic: Use Rx and Ry for touch strips Date: Fri, 24 May 2024 13:21:36 +0200 Message-ID: <20240524112554.166746-3-jose.exposito89@gmail.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240524112554.166746-1-jose.exposito89@gmail.com> References: <20240524112554.166746-1-jose.exposito89@gmail.com> Precedence: bulk X-Mailing-List: linux-input@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Currently, HUION devices use ABS_WHEEL as the usage for touch strips. There are 2 main issues with this approach: The first one is that the descriptor for touch rings (uclogic_rdesc_v2_frame_touch_ring_arr) also uses ABS_WHEEL. From user-space it is impossible to know which device sends the events. The second one is that Wacom uses ABS_RX/ABS_RY to notify events from touch strips and user-space was designed to handle those axes. Change the usage of touch strips to Rx/Ry to fix both issues. Link: https://gitlab.freedesktop.org/libinput/libinput/-/issues/989 Signed-off-by: José Expósito --- drivers/hid/hid-uclogic-rdesc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/hid/hid-uclogic-rdesc.c b/drivers/hid/hid-uclogic-rdesc.c index 7cbd673747a5..dfd74a043b39 100644 --- a/drivers/hid/hid-uclogic-rdesc.c +++ b/drivers/hid/hid-uclogic-rdesc.c @@ -789,7 +789,8 @@ const __u8 uclogic_rdesc_v2_frame_touch_strip_arr[] = { 0x95, 0x01, /* Report Count (1), */ 0x81, 0x02, /* Input (Variable), */ 0x05, 0x01, /* Usage Page (Desktop), */ - 0x09, 0x38, /* Usage (Wheel), */ + 0x09, 0x33, /* Usage (Rx), */ + 0x09, 0x34, /* Usage (Ry), */ 0x95, 0x01, /* Report Count (1), */ 0x15, 0x00, /* Logical Minimum (0), */ 0x25, 0x07, /* Logical Maximum (7), */