您的位置:首页 > 运维架构 > Linux

FL2440移植LINUX-3.4.2 -- 按键驱动和触摸屏驱动移植

2014-10-12 14:58 381 查看
(一)先移植按键输入子系统驱动:

拿过去编译,改错,然后insmod;

(二)触摸屏驱动拿过去编译,改错,然后insmod;

触摸屏驱动的使用:

编译:
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

安装:
cd tmp
cp * -rf /nfsroot

修改 /etc/ts.conf第1行(去掉#号和第一个空格):
# module_raw input
改为:
module_raw input

使用:

1.启动系统,先安装驱动buttons.ko , s3c_ts.ko

2. 设置环境变量:
export TSLIB_TSDEVICE=/dev/event1
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

ts_test

安装tslib中遇到的错误:./autogen.sh: 4: autoreconf: not found

修改方法:

./autogen.sh: 4: autoreconf: not found

是在不同版本的 tslib 下执行 autogen.sh 产生。它们产生的原因一样,是

因为没有安装

automake 工具, (ubuntu 8.04)用下面的命令安装好就可以了。

sudo apt-get install autoconf automake libtool

测试屏幕校准ts_calibrate 出错:selected device is not a touchscreen I understand

修改方法:

tslib:
/usr/local/arm/4.3.2/arm-none-linux-gnueabi/libc/usr/include/linux/input.h
#define EV_VERSION 0x010000
改为
#define EV_VERSION 0x010001

然后重新编译:
cd tslib
make clean
make
make install

重新安装:
cd tmp
cp * -rf /home/chris/nfs_work

修改 /etc/ts.conf第1行(去掉#号和第一个空格):
# module_raw input
改为:
module_raw input

再来测试:
export TSLIB_TSDEVICE=/dev/event1
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

ts_test

0x00076617 0x00000003 0x00000018 0
0x00076617 0x00000003 0x00000018 0
0x00076617 0x00000003 0x00000018 0
0x00076617 0x00000003 0x00000018 0
0x00076617 0x00000003 0x00000018 0
0x0007661b 0x00000003 0x00000018 0
0x0007661b 0x00000003 0x00000018 0
0x0007661b 0x00000003 0x00000018 0
0x0007661b 0x00000003 0x00000018 0
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: