From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ej1-f54.google.com (mail-ej1-f54.google.com [209.85.218.54]) (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 9018645D18E for ; Thu, 23 Jul 2026 15:23:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.54 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784820210; cv=none; b=B6wlt/BVeFK49pRdofU1+AFoz3AJyXejIDbSKLv2Ie20nnTSHggtjk2jg/A3XSns9TD2KuRhZCRvXLcb4FoYoUt6XkjPoPuz4+emgLzFVaHTv1zfDu1jBqfYS3KruSXx9RDPdrNVqz7fW9AMlau4XLdezEbnnsE5J/3Qkvt06Ks= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784820210; c=relaxed/simple; bh=Cj7/0hUPeXgZVqg8KWSZTNJ8vTFAgPSshjlYFrf0LIw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=qajMCrdQBf67YPsTYbYU/++w9mQpOxZOv7yzlSX0hB7F17T2V/pUcBbC4baZ8Y5t9C8bd8pv0eQ34+DiQ4XTvl0PWibLCJT9hbjPvkIxmQz9j48fBcSL3x0Uzy3+jogd2rFD7mwlql7WWfiC09WHqt3/oPbWFgxzeV2WcOk3AII= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=mide.dk; spf=none smtp.mailfrom=mide.dk; dkim=pass (2048-bit key) header.d=mide-dk.20251104.gappssmtp.com header.i=@mide-dk.20251104.gappssmtp.com header.b=SMexMpPl; arc=none smtp.client-ip=209.85.218.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=mide.dk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=mide.dk Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=mide-dk.20251104.gappssmtp.com header.i=@mide-dk.20251104.gappssmtp.com header.b="SMexMpPl" Received: by mail-ej1-f54.google.com with SMTP id a640c23a62f3a-c1740c36c5cso110125966b.2 for ; Thu, 23 Jul 2026 08:23:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mide-dk.20251104.gappssmtp.com; s=20251104; t=1784820203; x=1785425003; 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:content-type; bh=CuP0OeJhTGW30HNXb6Y1WIZT6ga8TxkRxs5cbmmgrFo=; b=SMexMpPlDeGtfU0hF7w5CSLGOHogSCgE/P+egylArJA7+WVcbNUn+ZaVRN8sv8RpKp 4FwQlyoGbnOcJG0MD9Vx95RNsQVisBw34ahA8dzYoKVdj4vMYTzOcZTNy3/tXruFmxCQ xNvjFhUoY91LkxLObZM6ZiqG9oKSDsD0qr05I9I6qzykDnLDG4CI3IJYU66AMSTYvMtx sbRA2YJXJrMTE8wKIX0VR1VlGeHm7e/Yu9IIRPMGcfg1gMo5MSiYvcVF7lY1ZJofPc9h qjNnA64lVxBL3lrejJt4ziqvmmYiP0UPjxyEZ4g8gQsQ+CSOajIO1tJRcFylhH7Bcw06 WwpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784820203; x=1785425003; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=CuP0OeJhTGW30HNXb6Y1WIZT6ga8TxkRxs5cbmmgrFo=; b=oIVtgxAZADVKOflck7BF534RW1rnlQj8deX64asmoFCeflbblJMyB4PrBSIFa8vmCL V1gXTy2JCZY+X29tmYByOXlE7QG80oM/jLsdnWBchyJYHhmEhrbz1cDIWwmp0VJhvU7S 6f+RXmEJk6ZBqoPf0xU2VpxKn+3IkKq+Z5BLq6/69Ti+WUQ1NtCCQ794UjMmtq0INnQO COVVp+NkWmTULjIf8gmfnW5WSC8tspBIdyE29cxS/n+gUcgPqDx4pD8GssuN80j9IA/W 2n54jj/HcImb1N1BFsY8vH7pDOefDvNqg9j92P8P6IhqvGTxgMb4WXEP3L9jV/OBEHBf YNsA== X-Forwarded-Encrypted: i=1; AHgh+RrncU19uTIlozIjt3kJphcDvoiUWbhvrGixPEzI2OnWnLbvgPn4fGZXvXRyCbe2SGdO+MTp02gZGKFteKY=@vger.kernel.org X-Gm-Message-State: AOJu0Yw6yqeKAOfaHxpDSpaO5VrJ9gr/W6XnRpvgqBasg4LDtqhc1P8n 8y41xyUvCd6wFtIc3jmA5mA69BXkY70B8csQkkDGLm0Ms5xMrRkscbRwXXOLqxRW546bDKfK9re YzkY7fw== X-Gm-Gg: AR+sD12aYYfEp7kTPi34bV4LwUFnwmadU8PpvvohXD0UK608w4BITraZus2PJuj4aUp CVXPpVcSxDw9nflK6+M0BhZVi9oXmekPj5fOambpLsonknYNoStQiO+67aYIyFNomZxmZy/uE16 wAvgL9bBgmuJma6w8SRBfUdO6uPhOxnu5cVdcIdSMMT1kxi5Z1HRqqjFgQG/ztokefHrYfCqHKX cu5KrlZRIggWJWqDstUVwhmci8BbXAFLSvZTvovUq7/dF+Q/MrgiZ/AjFGeweMju++jHqOes9Hg upbL9vTf6vNkAsZl4ShEx2Bg3U5bcmDS8XbUu+bgypDqEIWYK3XTBZqLtzfdpHs8OLwTlhyDhqI JRH+RUyvgYDnzgii8n23v1Kwa9hXjwEMOIWR5yIaJwKOXBeo0Lpg9ayYxLEOkEamCdvqf4UGUOP XXXEibcnGh6/whIoolvHyfe5SbMX4tTt+idJ7DvoHOACdd2pVrnNSxJkHR7NCfmwZwkjcLB2LTN s4eETRiYn/h6BTureR7DziD8Y9uDc7uWuY1+sBaiQ== X-Received: by 2002:a17:907:9451:b0:c16:2e4f:a372 with SMTP id a640c23a62f3a-c1c5074a65emr161638966b.13.1784820202713; Thu, 23 Jul 2026 08:23:22 -0700 (PDT) Received: from localhost.localdomain (2a06.4004.215b.0000.2aa0.6bff.feb3.5b8c.static6.kviknet.net. [2a06:4004:215b:0:2aa0:6bff:feb3:5b8c]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-c1c32ebb385sm250749666b.52.2026.07.23.08.23.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Jul 2026 08:23:22 -0700 (PDT) From: Kristian Mide To: dmitry.torokhov@gmail.com Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Kristian Mide Subject: [PATCH v3 0/3] Input: ilitek_ts: add stylus support for 0x0c reports Date: Thu, 23 Jul 2026 17:22:41 +0200 Message-ID: <20260723152244.11252-1-kristian@mide.dk> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260709182602.7308-1-kristian@mide.dk> References: <20260709182602.7308-1-kristian@mide.dk> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Hi, I bought a CHUWI Hi10 Max and was annoyed to find that the built-in stylus was not usable with the upstream ilitek_ts driver. This series adds support for the pen report format emitted by the device, exposing the stylus as a separate input device with hover, pressure, and side-button support. The pen device is created lazily on first pen report so touchscreen-only hardware does not advertise stylus capabilities up front. The packet format was reverse engineered on this device. In particular, report ID 0x0c appears to carry pen events, pressure comes from buf[6..7] shifted right by one, and the side buttons map to two bits in buf[1]. Changes in v3: - return success after ratelimited unexpected-report logging so the IRQ handler does not emit a second unratelimited error - use input_set_capability() for pen key capabilities Changes in v2: - manage the lazy pen device lifetime explicitly and tear down the IRQ before unregistering the pen device - sync pen axis limits with the DT-adjusted touch axis limits - reject short I2C transfers in ilitek_i2c_write_and_read() - split the short-transfer fix from the ratelimited logging change On the tested CHUWI Hi10 Max this makes the pen usable in GNOME/Krita, including pressure and side buttons. Thanks, Kristian Kristian Mide (3): Input: ilitek_ts: add stylus input support Input: ilitek_ts: handle short I2C transfers Input: ilitek_ts: ratelimit unexpected report logging drivers/input/touchscreen/ilitek_ts_i2c.c | 149 +++++++++++++++++++++- 1 file changed, 144 insertions(+), 5 deletions(-) -- 2.54.0