From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.210.175 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796229902; b=uFLvhxTSAf/vZg5QG65+UQqTAnljBaFc8TR/853z2nIoPXLVW+R7tFGFSWEr6MUNhZy0 nk+99QNiIV7KlgfQvRRf0P3hP2yUh9+V1BmOpxrbvo7SCe2conYGBOLfsiDbDB8EhF0dO 2aatkMqeUY6clBDm5lJdbv6rf3vxPnCkr2Pxnwtf49TEYj0+D4KIb6QTy1+dmsfLXWWrU lrZvfH2EgDN+Obe5r3SvporIZLRBBzSfzdgj4ot5XwipLYIq+N+UNATNsSkdFnAVPkbCr 8xP2qY+xtdQUOhOC/hVId5H6khCtQHfoWY5C8j/NO5OkHIPwHv7D6mltJtyJlbSl1SQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796229902; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:To:Cc:Subject:Date:Message-ID:X-Mailer:MIME-Version: Content-Transfer-Encoding; bh=lYK73AXEt3CHivmpYpIFlVuMNsuPhI1h/CreKWFHq34=; b=G0LtZ351/nJVnUor0XU9HP4Q4EdiXWZzqE4rKqug2+VgqxYSok560ZvuTgtIxhl01kCC eEpFOCmkrq6ww4K3191Czf0rBBpHu3pCvKlZLW2eG0RsKXnzxhFBMAxMAySzdqvmM/vEx BM8fzHGDg/7ksM+GLVrpJWnCwdxB92SZk5jxP/ompFBGO8w6hBhanYpYh90dvUqNckMO4 WWx4BBM3rt8kkqs/PQiNLKA+lUs9jBDdjw4XJ4JcR+CegGTJlcINKlQ5p4C3kzB925Qah dg9NicsQUXmadqrKvCtnHNc/GvloxeKGK7Vlk7TISRfkgUpDvzrJ5vWltlOLIvIwNMQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b="MZX5d/px"; arc=none smtp.remote-ip=209.85.210.175 Received: from mail-pf1-f175.google.com (mail-pf1-f175.google.com [209.85.210.175]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9627C606A32C for ; Wed, 2 Dec 2026 16:45:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 9627C606A32C 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.a=rsa-sha256 header.s=20260707 header.b=MZX5d/px Received: by mail-pf1-f175.google.com with SMTP id d2e1a72fcca58-8b5e5e64494so7165843b3a.1 for ; Wed, 02 Dec 2026 08:45:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796229902; x=1796834702; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=lYK73AXEt3CHivmpYpIFlVuMNsuPhI1h/CreKWFHq34=; b=MZX5d/pxMsbXTfVsP9JJJD/9VXXCSfVGe1ODNNDP/S6MeSCSCPv2fDwMxdVSIBoUdv FFezdEEVC6gqKIHOr8BwVZF9vhSYSjHG0rM67+uNaQbZUTfhv3w4NyjHTyN/kizIBY9j 3nGEy9Deihq0BOEEZrRZDzcGpQI/HOzGau94r71W3/lpO+SiBV8r3zOtxS5YjmPxPurJ pJfrNwGFKwCNb/LZ6lHstvdrgs54W/qFwC0WJflXM2IxIbZzuA40rZUdLQnHKr9JdDvq dXdUA8aiEM2N/Cenb8L51qxSCSqAdGr2vBt7ezr+rdxqEw8NIXFNIwxl0EV5nrjXUojc mlzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796229902; x=1796834702; h=content-transfer-encoding:mime-version: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=lYK73AXEt3CHivmpYpIFlVuMNsuPhI1h/CreKWFHq34=; b=HMhjSH3Se+z+YBw2bs+gtybi6Vq9S/UifFJsYMzdSN/PiXhoiqzKEFN/iDYtoqgzF1 nb5MRCqd3XzF6//ILOeFCR5JtgY1IOaANJrwWovdwYhMC5YOqa5Ijhp9aY+iQC0sqPIL gL1HH/yUtmCgGn/2GjUq+mB9MMQfxKLOS2yHh7T+Th+zzVcH0nZbsUDyFY4qUAf97Gtb SyENDhpIOPdQ7haxu1bO4okVB2ctlFuPr/DagnHrP7Z/QbOyTSm7AWg59HgpfKaYphw1 Dpf9+OqIfI+dZzgMHv8iUpEKpTdyS2VZKLV3WuU2E/3cqR20C1o8M7ZS/PD77ebSfX8R SzDw== X-Forwarded-Encrypted: i=1; AL+hErGkugTQPZ0mAfPjT4+nmeSng4zK3xFYGqEDNcFP+mSj+X3awSKRI7b4t/EI+8kRruxYHydsEECd+j40mg==@vger.kernel.org X-Gm-Message-State: APuU4Z/bS0IrlRYCf7ng9PuHZIQe1NzfDubVr6cKKDFJ6yO4Pi2kkXyb d0uiljAy9C+laHm6rmpEn8NXxSfw/MbpD76ou2+wVrpE8fFIJzDKoe5o X-Gm-Gg: AZFdTZfUdIQN/iJelfttdLz0SLqPaEE5ZH2g28VHT3mA0BVaNuildltDaVbH439iMiR MR9sXWHAIWwgNy/q+eLJ1cj5k/ZaxzObj+UhTXiBhLDYNtS/h+NcjI5pjKTq4GiuJ5D1eu8b7vJ yFRr1WptryL+3DibQ6K4GtKeUfqZPkbpCyu4uPw2oPiVsn1XpP1MgPpCtN7wZq4IpXPKLBjoSqh pBaAgsXKrDHkXhjtHgGulXKQdaTHrf9pKfeLtqt0HceHsJP/WvKa86+POdVph568/jPR+vRlbIh GHB0y4CaixyeBqZ6GJyBJiJ5s24qCKP72361MycVVP2LPxTg9hOeaBcm+P6WJIkgf7PNl0ZnVnf lGfoNZVL8zA3yEC/uREtOLyQscyQoLoyVp+MQLraZpBcht3hX5xZVF9BnSTh0IVl5iMSdiwPN33 tXNBLYF8tRHRc74uHl/FS0o1P+ypekHFNjCiT/3qmXPMeZvskU1XVxP0ZRQeCkgDQXjH4DHFjfX CHoN+N9ao4UBdkXeuJSDP+U1Yypjc3JZOsmMIT0/HAEGZ4GfsK6L5XJt51azYV9tm263Xy1shWd nux1DUM= X-Received: by 2002:a05:6a00:3d16:b0:899:394d:2976 with SMTP id d2e1a72fcca58-8c87ca50249mr45473351b3a.39.1796229901627; Wed, 02 Dec 2026 08:45:01 -0800 (PST) Received: from wyb-ms7e59 ([2001:df1:7880:4::50a]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-8c87285c14fsm22196082b3a.15.2026.12.02.08.44.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Dec 2026 08:45:01 -0800 (PST) From: wyibo6109@gmail.com To: Dmitry Torokhov , linux-input@vger.kernel.org Cc: Krzysztof Kozlowski , Rob Herring , Conor Dooley , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Yibo Wang Subject: [PATCH v8 0/2] Input: add support for OnePlus/OPPO Pad pogo-pin keyboards Date: Wed, 2 Dec 2026 10:44:55 -0600 Message-ID: <20261202164457.1577424-1-wyibo6109@gmail.com> X-Mailer: git-send-email 2.53.0 X-Mailing-List: linux-input@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Yibo Wang This series adds support for the magnetic pogo-pin smart keyboards of the OnePlus Pad 3 Pro / Pad 4 and the OPPO Pad 5 Pro. The keyboard is built around a Tinno MCU attached to a tablet UART. Both sides share a single data wire, so the host gates its transmission onto the bus with a PMIC GPIO for the duration of a frame, and every host frame is echoed back on RX. The MCU speaks a framed "one wire bus" protocol over the half-duplex 921600 8N1 UART: 8x 0x55 preamble, 0xF1, src/dst addresses, command, length, payload, CRC16-IBM (poly 0x8005, init 0xC596), 0xFE and 4x 0xAA. The protocol was reverse engineered from the vendor kernel driver; this is a clean-room serdev reimplementation that replaces the downstream platform driver, which depends on a private msm_geni_serial callback and a user-space held tty fd. The core protocol (framing, keys, touchpad, sync/heartbeat) has been carried unchanged across four SoC generations of these keyboards, from the sm8550 era to the sm8850 ones covered here; only the 0x3A general sub-commands grew over time. Patch 1 adds the DT binding, patch 2 the driver. Changes in v8, addressing Dmitry Torokhov's and Krzysztof Kozlowski's comments: - the power handling now covers both vendor models: an optional vdd-supply regulator and an optional enable-gpios pin, powered up in that order and down in reverse, with either or both allowed to be absent; - renamed power-gpios to enable-gpios to say what the pin does; - reworded the compatible description so it needs no block scalar (Rob's comment on v7). Changes in v7, addressing Krzysztof Kozlowski's comments: - dropped the touchscreen size/mm properties from the binding as agreed: the touchpad geometry is per-project driver data and neither the binding documents it nor the driver parses it from DT; - moved the MAINTAINERS entry to its alphabetical place, after ONENAND; Changes in v5, addressing Rob Herring's comments on the binding: - dropped the block scalar from the top-level description; - rewrapped the descriptions to stay within 75 columns; - restored the serial parent node in the example. Changes in v4, after Krzysztof Kozlowski's comment that the binding describes the keyboard rather than the MCU (wording only, no functional change): - the binding description and the commit messages now describe the keyboard (built around the Tinno MCU) instead of the MCU itself, and spell out that a keyboard is a fixed physical device, so the touchpad geometry and the product names are per-compatible constants in the driver. Changes in v3: - the compatible names the tablet project the pogo port belongs to (oneplus,caihong- / erhai- / iceland-pogo-keyboard, the codenames used by the vendor trees), and the driver carries a per-project description in the OF match data: feature flags gate each 0x3A general sub-command (caihong, sm8650 era, has no wake notification and no backlight; erhai, sm8750 era, adds the wake notification; iceland, sm8850 era, adds the keyboard backlight), while the touchpad geometry and the per-brand product names are per-project constants - the wake notification is skipped and the backlight LED only registered where supported; - the touchpad geometry and product names are no longer DT properties: they are fixed per project and live in the driver; the common touchscreen properties (touchscreen-size-x/y, touchscreen-x-mm/y-mm) remain as an optional override, parsed with touchscreen_parse_properties(), for the unlikely case of a variant. Changes in v2: - dropped the redundant "binding" from the dt-bindings subject; - replaced the custom oneplus,touchpad-xy-max/-resolution properties with the common touchscreen properties; - dropped the serial wrapper node from the binding example; - the MAINTAINERS entry added with the binding references only the binding file; the driver F: line is added together with the driver patch. Tested on the OnePlus Pad 4 (iceland) running Linux 7.2.0-sm8850 (v7.2-based iceland tree). Yibo Wang (2): dt-bindings: input: add OnePlus pogo-pin keyboard Input: add OnePlus/OPPO Pad pogo-pin keyboard serdev driver .../bindings/input/oneplus,pogo-keyboard.yaml | 78 ++ MAINTAINERS | 7 + drivers/input/keyboard/Kconfig | 13 + drivers/input/keyboard/Makefile | 1 + drivers/input/keyboard/oneplus-pogo-kbd.c | 1272 ++++++++++++++++++++ 5 files changed, 1371 insertions(+) create mode 100644 Documentation/devicetree/bindings/input/oneplus,pogo-keyboard.yaml create mode 100644 drivers/input/keyboard/oneplus-pogo-kbd.c -- 2.53.0