本帖最后由 qiyei2009 于 2015-9-9 23:28 编辑
买了一块5.5寸屏,本人自己折腾了一段时间,现在显示已经可以正常的在ubuntu系统下显示文字,图片等(自己编写的应用程序)
现在想移植tslib库来支持触摸,根据下面这个网站移植的 http://blog.csdn.net/shui1025701856/article/details/7849669
由于修改了pad板的内核让其支持触摸屏,运行 hexdump /dev/input/event1 会有一下数据输出
运行其他的hexdump /dev/input/其他的event就没有输出,因此可以确定。,触摸节点就是、、/dev/input/event1
按照http://blog.csdn.net/shui1025701856/article/details/7849669这个网址交叉编译tslib后, 把tslib下的文件复制到rootfs/usr/local下,并且修改rootfs/etc/profile如下: export TSLIB_DIR=/usr/local/tslib export TSLIB_TSDEVICE=/dev/input/event1 exportTSLIB_CALIBFILE=$TSLIB_DIR/etc/pointercal exportTSLIB_CONFFILE=$TSLIB_DIR/etc/ts.conf export TSLIB_PLUGINDIR=$TSLIB_DIR/lib/ts export TSLIB_CONSOLEDEVICE=none export TSLIB_FBDEVICE=/dev/fb0 export LD_LIBRARY_PATH=$TSLIB_DIR/lib
运行tslib/bin/目录下的任何测试程序,均会出现 tslib: Selected device is not a touchscreen(must support ABS_X and ABS_Y events)
首先根据错误信息考,发现错误发生在tslib中的plugins目录下input-raw.c文件中的check_fd函数内 static int check_fd(struct tslib_input *i) { structtsdev *ts = i->module.dev; intversion; longevbit[BITS_TO_LONGS(EV_CNT)]; longabsbit[BITS_TO_LONGS(ABS_CNT)]; longkeybit[BITS_TO_LONGS(KEY_CNT)];
if(ioctl(ts->fd, EVIOCGVERSION, &version) < 0) { fprintf(stderr,"tslib: Selected device is not a Linux input event device\n"); return-1; }
if(version < EV_VERSION) { fprintf(stderr,"tslib: Selected device uses a different version of the event protocolthan tslib was compiled for\n"); return-1; }
if( (ioctl(ts->fd, EVIOCGBIT(0, sizeof(evbit)), evbit) < 0) || !(evbit[BIT_WORD(EV_ABS)]& BIT_MASK(EV_ABS)) || !(evbit[BIT_WORD(EV_KEY)]& BIT_MASK(EV_KEY)) ) { fprintf(stderr,"tslib: Selected device is not a touchscreen (must support ABS and KEYevent types)\n"); return-1; } if ((ioctl(ts->fd, EVIOCGBIT(EV_ABS,sizeof(absbit)), absbit)) < 0 || !(absbit[BIT_WORD(ABS_X)]& BIT_MASK(ABS_X)) || !(absbit[BIT_WORD(ABS_Y)]& BIT_MASK(ABS_Y))) { fprintf(stderr,"tslib: Selected device is not a touchscreen (must support ABS_X and ABS_Yevents)\n"); return-1; }
估计是触摸屏上报事件时,没有上报ABS_X 和ABS_Y,应该需要在驱动中修改吧,本人对触摸屏驱动位置还不熟悉,请问版主和各位大神们,是在那个文件那个地方修改啊?我看触摸屏驱动都在这个目录下啊 drivers\input\touchscreen\synaptics_dsx
还请版主和大神们解答!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|