免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1244 | 回复: 0
打印 上一主题 下一主题

加入友善的触摸屏驱动 for mini2440 & Linux2.6.30.4 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-11-12 22:53 |只看该作者 |倒序浏览

                                                                                                                                1.
# gedit drivers/input/touchscreen/Makefile
在最后加入下面一句:
obj-$(CONFIG_TOUCHSCREEN_S3C2410) += s3c2410_ts.o
2.
# gedit drivers/input/touchscreen/Kconfig
在12行找到:
if INPUT_TOUCHSCREEN
在其后加入以下:
config TOUCHSCREEN_S3C2410
     tristate "Samsung S3C2410 touchscreen input driver"
     help
          Say Y here if you have the s3c2410 touchscreen.
          If unsure, say N.
          To compile this driver as a module, choose M here: the
          module will be called s3c2410_ts.
3.
# gedit drivers/char/Makefile
找到:
obj-$(CONFIG_JS_RTC)   += js-rtc.o
js-rtc-y = rtc.o
在其后加入下面一句:
obj-$(CONFIG_MINI2440_ADC)    += mini2440_adc.o
# gedit drivers/char/Kconfig
找到:
config DEVKMEM
     bool "/dev/kmem virtual device support"
     default y
     help
         Say Y here if you want to support the /dev/kmem device. The
         /dev/kmem device is rarely used, but can be used for certain
         kind of kernel debugging operations.
         When in doubt, say "N".
在其后加入以下:
config MINI2440_ADC
   bool "ADC driver for FriendlyARM Mini2440/QQ2440 development boards"
   default y if MACH_FRIENDLY_ARM_MINI2440
   help
       this is ADC driver for FriendlyARM Mini2440/QQ2440 development boards
       Notes: the touch-screen-driver required this option
4.
在 drivers/char 放入友善之臂公司的 s3c24xx-adc.h mini2440_adc.c在 drivers/input/touchscreen/ 放入友善之臂公司的 s3c2410_ts.c
修改s3c2410_ts.c文件:
在184行:
               
               
               
                    /* Get irqs */
    if (request_irq(IRQ_ADC, stylus_action, IRQF_SAMPLE_RANDOM,
        "s3c2410_action", dev)) {
        printk(KERN_ERR "s3c2410_ts.c: Could not allocate ts IRQ_ADC !\n");
        iounmap(base_addr);
        return -EIO;
    }
改为使用共享中断方式:
    /* Get irqs */
    if (request_irq(IRQ_ADC, stylus_action, IRQF_SHARED,
        "s3c2410_action", dev)) {
        printk(KERN_ERR "s3c2410_ts.c: Could not allocate ts IRQ_ADC !\n");
        iounmap(base_addr);
        return -EIO;
    }
5.
配置:
# make menuconfig
修改:
Device drivers -> Input device support ->(320)   Horizontal screen resolution
                                         (240)   Vertical screen resolution
      
选中:
Device drivers -> Input device support -> Touchscreen -> Samsung S3C2410 touchscreen input driver
Device drivers -> character devices -> ADC driver for FriendlyARM Mini2440/QQ2440 development boards
6.
# make zImage
发现触摸屏已经可以用,但Qtopia毫无反应!
开发板上操作:
# cat /etc/init.d/rcS
...
...
/bin/qtopia &
可以看到在最后,正是通过"/bin/qtopia &"这句来启动Qtopia,/bin/qtopia是一个脚本:
# cat /bin/qtopia
#!/bin/sh
export TSLIB_TSDEVICE=/dev/input/event0
export TSLIB_CONFFILE=/usr/local/etc/ts.conf
export TSLIB_PLUGINDIR=/usr/local/lib/ts
export TSLIB_CALIBFILE=/etc/pointercal
export QTDIR=/opt/qtopia
export QPEDIR=/opt/qtopia
export PATH=$QTDIR/bin:$PATH
export LD_LIBRARY_PATH=$QTDIR/lib:/usr/local/lib:$LD_LIBRARY_PATH
export QWS_DISPLAY="linuxFB:mmWidth35:mmHeight45:0"
TS_INFO_FILE=/sys/devices/virtual/input/input0/uevent   
               
if [ -e $TS_INFO_FILE -a "/bin/grep -q TouchScreen  ]; then   
        export QWS_MOUSE_PROTO="TPanel:/dev/input/event0 USB:/dev/input/mice"
        if [ -e /etc/pointercal -a ! -s /etc/pointercal ] ; then              
                rm /etc/pointercal                                            
        fi                                                                    
else                                                                          
        export QWS_MOUSE_PROTO="USB:/dev/input/mice"                          
        >/etc/pointercal                                                      
fi                                                                           
unset TS_INFO_FILE                                                            
                                                                              
export QWS_KEYBOARD=TTY:/dev/tty1                                             
export KDEDIR=/opt/kde                                                        
                                                                              
export HOME=/root                                                            
                                                                              
exec $QPEDIR/bin/qpe 1>/dev/null 2>/dev/null   
# cd /sys# find -name uevent
未能找到/sys/devices/virtual/input/input0/uevent但找到了/sys/class/input/input0/uevent  修改 TS_INFO_FILE=/sys/class/input/input0/uevent
OK!
               
               
               
               
               
               
               
               
               
               
               
               

本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u3/104564/showart_2093068.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP