Repository navigation
Conversation
同一台机器(gaokun3 / CSOT ppc357db1-4 + HX83121A 级联从片)在 Ubuntu 26.04 上的 笔方案。与本项目走两条不同的路 —— 本项目走主片 / BT-MCU,这边只读从片 spi20 的原始 帧 —— 但共用同一套硬件约定(raw_out_sel=0xF6、rawdata_addr=0x5AA5、ICID=0x83121a00), 所以可以互相印证。 文档要点: - 硬件拓扑:spi6 主片 / spi20 从片 / GPIO39 中断 / 引脚 87-90 / 从片无复位线 - 协议差异:从片用 F5/F4,且必须写两个寄存器,否则稳定回全零帧 - 五个定案结论,其中「从片初始化必须晚于主片 FW reload」与平台无关: 早于主片时 TX1 锚点有效率只有 12~28%,表现为悬停光标满屏乱跳、点击不灵敏; 在 probe 里等 2.5 s 后,slave init 移到 FW reload 之后 2 s,开机不再出现 "watchdog: no frame for 1 s",悬停帧间位移 p90 6~21 px - 用户态:为什么必须报 BUS_USB(libwacom 只认 bus:vid:pid)、为什么需要 cursor 镜像补 BTN_LEFT(Mutter 50 起 tablet tip 不再转 pointer click) - 压力/倾角不走从片:键盘套 MCU 12d1:10b8 接口 0、ReportID 0x55 代码(Tools/LinuxPenSlave/)为纯 Python 参考实现,无第三方依赖,不参与 CMake 构建 (顶层 CMakeLists 未 add_subdirectory(Tools/...)),按 MIT 提供。其中 gk3pen_solver.py 的算法源自 Android 侧 gk3pend/solver.h(SPDX: GPL-2.0 AND MIT), 双许可允许以 MIT 分发,原始声明保留在模块 docstring 中。 内核侧代码不随本 PR 提交(GPL-2.0),文档中给出外链。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
这是什么
同一台机器(gaokun3 / MateBook E Go,CSOT
ppc357db1-4+ HX83121A 级联从片)在Linux 侧的笔实现:文档 + 纯 Python 参考代码。
和本项目走的是两条不同的路:
spi20的原始帧但两边用的是同一对 IC、同一套硬件约定(
raw_out_sel=0xF6、rawdata_addr=0x5AA5、ICID=0x83121a00、MCU 事件0x08/0x09/0x71、压感 ReportID0x55),所以下面的数字可以和贵项目的抓包结论直接对表。
为什么可能对你有用
README 里写着 Active Stylus / BT-MCU integration is temporarily disconnected in this
branch。这份文档补的正是"笔"这块的另一条独立实现,而且有几条与平台无关的坑:
与语言无关;
F5/F4操作码 + 两个必须写的寄存器),不写第二个会稳定回全零帧;gk3pend的写法相反(左右倾改列、前后倾改行);best140–360 vs 400–580 重叠),我们在主片上试了 16 个内核补丁后整体退役 —— 这条可以作为"别在主片上做笔"的结论。
那条时序结论(最值得参考的部分)
现象:开机后能画,但悬停光标满屏乱跳、点击不灵敏;重载一次驱动即恢复。
根因:从片 probe(~3.5 s)早于主片 pin reset + FW reload(~4.2 s)。在那之前写
raw_out_sel = 0xF6,级联 TX1 锚点通路还没就绪。同一 boot 内 A/B:看门狗重写同一个寄存器救不回来(问题在写入时机,不在值);只有整模块重载能恢复。
修法是 probe 里等 2.5 s(
msleep),之后slave init落在FW reload done之后 2 s:内容
docs/linux-pen-slave.md—— 拓扑、协议、五条定案、用户态踩坑(为什么必须报BUS_USB、Mutter 50 为什么需要 cursor 镜像补BTN_LEFT)、复现步骤、未解决项Tools/LinuxPenSlave/—— 两个纯 Python 文件(无第三方依赖):gk3pend.py:从片帧 + MCU 压感 → uinput 笔(含镜像设备)gk3pen_solver.py:帧 → 坐标 / 倾斜解算不参与 CMake 构建:顶层
CMakeLists.txt没有add_subdirectory(Tools/...),Tools/下各项本来就是独立的,这两个文件只是参考实现。如果你更希望它只作为文档附录,我可以把它们移到
docs/LinuxPenSlave/并重开 PR。许可
gk3pen_solver.py的算法移植自 Android 侧gk3pend/solver.h(SPDX:GPL-2.0 AND MIT),其 HPP3 步骤的更早来源即本项目的
EGoTouchRev-rebuild⇒ 双许可允许以 MIT 分发,原始声明保留在模块 docstring 里。
MODULE_LICENSE("GPL")= GPL-2.0,与 MIT 不兼容),文档中给出外链:
mashen11/MateBookEgo-linux-kernel→patches/common/linux-gaokun/0083…0110。未解决(如实列出)
ID_PATH,libinput 的 touch arbitration 用不上;