触摸屏校准值,如何在Android /内核中完成?

我正在将 Android Gingerbread移植到我的定制主板(使用三星S5PV210处理器).我有一个带ESC7000芯片的触摸屏.我在/kernel/drivers/input/touchscreen/usbtouchscreen.c中找到了一个驱动程序.它几乎可以工作,但USB数据包中的位范围,顺序和字节顺序并不好.我修改代码以获得正确的RAW位置(在控制台上使用printk来查看它),现在它几乎可以工作了.我的数据范围从xmin,ymin到xmax,ymax是420,430到3650,3650,而理论上它应该是0,0到4095,4095.这并不奇怪,因为电容式触摸需要校准.这是一个简单的校准,例如每个轴的y = mx b(简单的线性校准).我在驱动程序中四处查看,无法确定校准的处理位置.它必须是可编程的,因为它取决于单位,并且在系统生产中要为每个单元进行一次校准.我想像其他Android设备一样干净.有谁知道校准信息存储在Android系统中的哪个位置?代码在哪里进行补偿计算.任何网络搜索都会提供有关想要重新校准手机的人的信息.所以对我来说没用.

解决方法

看看以下主题https://groups.google.com/forum/#!msg/rowboat/jlbwnmCIDg0/makHFil31pQJ

On EVMs we pass the calibrated values(or let us say hardcoded values
for Xmin/max,Ymin/max and XY resolution) from the driver to the user
space.

Raw events are handled here frameworks/base/libs/ui/InputReader.cpp

SingletouchInputMapper::process(const RawEvent* rawEvent) will process
raw events for a Single touch device. ABS_X and ABS_Y are the values
passed from driver and these are the absolute coordinates in our
case as I told you in my earlier mail.

Correct me if I’m wrong,afaik Android phones have no mechanism to do
calibration from user space. It is a sort of standard in Android
phones to send the calibrated values from driver itself.

What I suggest is,use tslib to calibrate and let it store values in /etc/pointercal. In SingletouchInputMapper::sync(nsecs_t when) calculate the absolute coordinates by parsing the values from /etc/pointercal file.

相关文章

Android性能优化——之控件的优化 前面讲了图像的优化,接下...
前言 上一篇已经讲了如何实现textView中粗字体效果,里面主要...
最近项目重构,涉及到了数据库和文件下载,发现GreenDao这个...
WebView加载页面的两种方式 一、加载网络页面 加载网络页面,...
给APP全局设置字体主要分为两个方面来介绍 一、给原生界面设...
前言 最近UI大牛出了一版新的效果图,按照IOS的效果做的,页...