tslib移植与测试

移植tslib到arm上 linux-3.4.2:

一、首先编译东山老师之前在linux-2.6.22.6写的s3c_ts.c及其Makefile,以便测试tslib:
修改Makefile:
把: KERN_DIR = /work/system/linux-2.6.22.6
改为:KERN_DIR = /work/system/linux-3.4.2

make,出现下面错误:
/work/drivers_and_test/11th_ts/8th/s3c_ts.c:14:33: error: asm/plat-s3c24xx/ts.h: No such file or directory
/work/drivers_and_test/11th_ts/8th/s3c_ts.c:16:31: error: asm/arch/regs-adc.h: No such file or directory
/work/drivers_and_test/11th_ts/8th/s3c_ts.c:17:32: error: asm/arch/regs-gpio.h: No such file or directory

修改s3c_ts.c,去掉下面几行
 14 //#include <asm/plat-s3c24xx/ts.h>
 15 
 16 //#include <asm/arch/regs-adc.h>
 17 //#include <asm/arch/regs-gpio.h>

再make,即可。
把s3c_ts.ko拷贝到开发板文件系统下。

二、编译安装tslib:
tar xzf tslib-1.4.tar.gz
cd tslib
./autogen.sh 

mkdir tmp
echo "ac_cv_func_malloc_0_nonnull=yes" >arm-linux.cache
./configure --host=arm-linux --cache-file=arm-linux.cache --prefix=$(pwd)/tmp
make
make install

安装:
cp tmp/* -rfd /work/nfs_root/fs_mini_mdev_new

测试:
insmod s3c_ts.ko
ts_calibrate
ts_open: No such file or directory
需重新exprot 一下这些东东:
export TSLIB_TSDEVICE=/dev/event0
export TSLIB_CALIBFILE=/etc/pointercal
export TSLIB_CONFFILE=/etc/ts.conf
export TSLIB_PLUGINDIR=/lib/ts
export TSLIB_CONSOLEDEVICE=none
export TSLIB_FBDEVICE=/dev/fb0

ts_calibrate
Segmentationfault //或No raw modules loaded.
vi /etc/ts.conf, 增加:

module_raw input //要顶格,否则会Segmentationfault

ts_calibrate
selected device is not a touchscreen I understand
查看下面两个input.h文件的EV_VERSION
/usr/local/arm/4.3.2/arm-none-linux-gnueabi/libc/usr/include/linux/input.h
#define EV_VERSION              0x010000
  
linux-3.4.2/include/linux/input.h
#define EV_VERSION              0x010001

修改其中一个EV_VERSION,使之与另一个一样。

rm tmp/* -rf

重新编译tslib

执行ts_calibrate,OK。

执行ts_test,效果:


猜你喜欢

转载自blog.csdn.net/qq_22863733/article/details/80290322