Chinaunix首页 | 论坛 | 博客
  • 博客访问: 160377
  • 博文数量: 21
  • 博客积分: 2227
  • 博客等级: 大尉
  • 技术积分: 215
  • 用 户 组: 普通用户
  • 注册时间: 2009-10-07 19:51
文章分类
文章存档

2012年(1)

2011年(1)

2009年(19)

分类: LINUX

2009-11-12 22:53:45

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 < $TS_INFO_FILE" ]; 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!
阅读(2632) | 评论(0) | 转发(1) |
给主人留下些什么吧!~~