From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.210.176 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796229903; b=TE6eVAhLHb0MBwEW2uzf9a+jwrrhE4rKvCDkxkTE+Rs8O2yQEr5NsrqROfdMciN24S+j ec8fIiDBUagJsP7+WpAM1ub5HOcHmuhH6X6pAcNIRvnMb3AG1l8SL0NdjEPmV2/U3gfT5 3ys9HA9qff7mFePrrCdXMQtHlbnvxNy2uBXOv3wWtR9TswEe41jDlAwuEvVCJ1ZnGl1Oo B4iFh9oaWOG0exJrAPQmeMRYEEPKp06XdOqdeulbbgD0z5GWoXudt4BaBuk/vQqlQ8LbM n464shdI+jaiYYRVe+xsiPUHYo++HnQ1HHET3/QXUaN9pk9ZmVMGq6sAt1kTne3+KUg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796229903; 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=iaRKPTYGilKGZD8gttp4ZGW0qFOVhmb+ijEwJgqrqjBUBQG2RA1yF6huBrx2lo82NaRX 99NZXsC9h/eZAtkODr56R2oqFIm8LIfySTd/iFFf1zgws+voXSPFcgDSa83K7EKsRAO1B A3DfK8O1fgFB+Li5ilbDFV+4Wq7Tjybs/QNuz4/j01Qm3NpX/RfTK34xT1bRIPbsAmvGz SFDZXfrT7s5WXzbM9clrc+T3q69dOOSgQ/Uwxmt7qlaFuwspDUi6HeR+sh9cDDW8DTrqF gXwEnM/27r1EjHotGk7+jfSMpErHw+jH7Iq3iV4mjuRo0Y4Wtti4r1hZljNRu2Rau8A== 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.176 Received: from mail-pf1-f176.google.com (mail-pf1-f176.google.com [209.85.210.176]) (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 9D9B9606A32D for ; Wed, 2 Dec 2026 16:45:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 9D9B9606A32D 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-f176.google.com with SMTP id d2e1a72fcca58-8b5e5e64494so7165842b3a.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=l/DcGwGiGFTzPhjOJaPvv/LvXZ3609zpaShtz+Z7M+n4GNkZ0R0ck+lNMifj4jSTpt baZzcxGwwPGBDiR7l0+xcH74mK8xAEYYxp4jqhnjGJGTXjuY4xk1vRXnL85vfDTfAlNA 3Wyad5AmmTX5aRnWnPoiTvkVkb4Fc/AsfxqYfdssMEYaYURkVqbNekffUeOIdIRPn3SQ 13dBKvzU00L2eCL6NXnwYnXS1eMPyL/JmHvGCmS3VVOZrq68QCnM1RFAcl49b1SUfq3S U0+RE0YzrXWweTZYNAmjvd0IVkyUuPRuGCffMH9uvyV3lPwJp9TDBy9RV/qxNJ6ioOYp nR8Q== X-Forwarded-Encrypted: i=1; AL+hErFYQYy+5kVFPc4Bp5wxlxx7yflLyzjXek4mknMaQyh1I1bbuxYqOuK1qt2RNzWhezrLMhbrdzHAeLj8@vger.kernel.org X-Gm-Message-State: APuU4Z/who1eiplW8UsjrhKy5J/CgXpoQQgadZ8ACqsgUyscOrE6l31i IfxbUmvdp8r0H70oHKa7PBGPMqtvQbO3E44hBDy8YQDDETP5/7JNmjOW X-Gm-Gg: AZFdTZfB7ouXDeCCDCRynkSCfA8Dkd3CTDtsl0o+/H36NVkp0rTIxUqy3VivW7w60j6 eKaM00mmawOSpvrSKKccv9bhtto6dUmPBCpTppWDClSe+hBeEb6w/NmLcXX2pcJN69FsV4iCgGp eGBgL8w0qGSp1iSYjmlFaIoDrtwaoridAcJESvKjatAtIPciE1Zfs82qIyI8mLaP+cwjg0SlDiI K7dy6DKYQFGMOzcrNSq/dWSr4EulFE1aEK0BI4d5IPkL1c+0JqiucjPVxTewDEnJXNNtdzjKVsN bXHkbsC4lYt1goI+ONw710DGg8yM+2dhCWggfqtQ2qzi5UXffH5LKjHI3VlLEBj9nq/VQmwR3sa CC0K0XDqhGyaCsVQtMeVl1qSRBXvDsagmPltd9GckpzKGE4qWwLwiJzo/HsO9BmgZQKaKDvktnA fTWXBjdaW10pxl4fI5kPTS9odnbVg06XujANPanHiNhMMGwGzXSIy8bUT5ogdYOJ5tHK3RHqyzS C+jh2L77kmluiri/Y94V5lsL+8sxRl9L4e/sY+MGhwS45/8yJ0owg9769CUztU8kDR+rGztb5dX Kr8aqbY= 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: devicetree@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