正点原子Mini Linux 4.3寸800x480触摸屏gt115x驱动

测试内核:NXP官方imx6ull,Linux version 4.1.15

1、设备树

复制代码
&i2c2 {
	clock_frequency = <100000>;
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_i2c2>;
	status = "okay";

	goodix_ts@14 {
        compatible = "goodix,gt115x";
		reg = <0x14>;
		status = "okay";
		interrupt-parent = <&gpio1>;
		interrupts = <9 IRQ_TYPE_EDGE_RISING>; 
		
		reset-gpios = <&gpio5 9 GPIO_ACTIVE_LOW>;
		irq-gpios = <&gpio1 9 GPIO_ACTIVE_LOW>;
		
		// 手动指定分辨率(覆盖默认值)
		touchscreen-size-x = <800>;
		touchscreen-size-y = <480>;
	};

2、驱动文件

复制代码
drivers/input/touchscreen/goodix.c

static const struct of_device_id goodix_of_match[] = {
	{ .compatible = "goodix,gt911" },
	{ .compatible = "goodix,gt9110" },
	{ .compatible = "goodix,gt912" },
	{ .compatible = "goodix,gt927" },
	{ .compatible = "goodix,gt9271" },
	{ .compatible = "goodix,gt928" },
	{ .compatible = "goodix,gt967" },
	{ .compatible = "goodix,gt115x" },  // <-- 添加这一行
	{ }
};

3、menuconfig配置

复制代码
Device Drivers --->
  Input device support --->
    [*] Touchscreens --->
      <*> Goodix I2C touchscreen   # 选中为 <*> (编译进内核)

4、测试

root@ATK-IMX6U:~# hexdump /dev/input/event1

0000000 6b4f 685f 3511 0008 0003 0039 0000 0000

0000010 6b4f 685f 3511 0008 0003 0035 01fb 0000

0000020 6b4f 685f 3511 0008 0003 0036 0086 0000

0000030 6b4f 685f 3511 0008 0003 0030 0040 0000

相关推荐
zlwool5 小时前
图纸管理选型避坑指南
数据库·erp·设备erp·非标机械
新时代牛马5 小时前
Linux 内核入门地图:架构、源码目录与五大子系统
linux·运维·架构
Julien20045 小时前
控制 SELinux 文件上下文
linux·运维·服务器
sulikey5 小时前
Linux Core Dump 完全指南:从原理到实战的崩溃调试手册。什么是core dump?程序报错core dumped怎么办?
linux·服务器·操作系统·调试·coredump
Lifangyun_WD6 小时前
第一次租 GPU 服务器怎么开始?镜像、SSH、数据存储和停机前要做什么
服务器·云计算·gpu算力·gpu算力租赁
小灰灰搞电子6 小时前
完全驾驭 Qt 与数据库:C++ ORM 框架 QxOrm 原理与实践指南
数据库·c++·qt
DevLoom_7 小时前
SD卡插电脑提示:驱动器中的磁盘未被格式化?恢复数据正确处理步骤
运维·服务器·电脑
软件聚导航8 小时前
「聚小软 AI 助手」技术升级:从数据库检索到 RAG 知识库问答
前端·数据库·mysql·微信小程序·小程序·ai编程·rag
学习星球8 小时前
单调栈——从“找下一个更大的“到柱状图中的最大矩形
数据库·c++·算法·leetcode·xcode
MayZork8 小时前
Windows 与 Linux 下 vcpkg 的安装部署指南
linux·运维·windows