日期:2014-05-16  浏览次数:21061 次

idea6410 linux-3.6.6 ts触摸屏移植

//--------------------------------------------------------

// 作者:longtian635241(longtian_huang@urbetter.com)

// 论坛ID:idea6410

// 版权:idea6410

// 平台:友坚idea6410开发板

// 发布日期:2012-11-19

// 最后修改:2012-11-19

//http://www.urbetter.com/main.asp

//----------------------------------------------------------

将友坚android2.3内核linux-2.6.36中的dev-ts.c  ts 板载初始化和platform 资源初始化文件。

1、arch/arm/mach-s3c64xx/mach-smdk6410.c

注销掉头文件  #include<plat/ts.h>
添加头文件    #include<mach/ts.h>
copy arch/arm/mach-s3c64xx/include/mach/ts.h 到目标内核目录并添加:

#include <linux/sizes.h>
#include <linux/gfp.h>

arch/arm/mach-s3c64xx/dev-ts.c:27: error: 'SZ_256' undeclared here (not in a function)
arch/arm/mach-s3c64xx/dev-ts.c: In function 's3c_ts_set_platdata':
arch/arm/mach-s3c64xx/dev-ts.c:58: error: 'GFP_KERNEL' undeclared (first use in this function)
arch/arm/mach-s3c64xx/dev-ts.c:58: error: (Each undeclared identifier is reported only once
arch/arm/mach-s3c64xx/dev-ts.c:58: error: for each function it appears in.)
arch/arm/mach-s3c64xx/dev-ts.c:58: warning: passing argument 3 of 'kmemdup' makes integer from pointer without a cast
arch/arm/mach-s3c64xx/dev-ts.c: At top level:
arch/arm/mach-s3c64xx/dev-ts.c:64: warning: data definition has no type or storage class
arch/arm/mach-s3c64xx/dev-ts.c:64: warning: type defaults to 'int' in declaration of 'EXPORT_SYMBOL'
arch/arm/mach-s3c64xx/dev-ts.c:64: warning: parameter names (without types) in function declaration
make[1]: *** [arch/arm/mach-s3c64xx/dev-ts.o] 错误 1
make: *** [arch/arm/mach-s3c64xx] 错误 2

在include/linux/interrupt中添加

#define IRQF_SAMPLE_RANDOM 0x00000040

drivers/input/touchscreen/s3c-ts.c: In function 's3c_ts_probe':
drivers/input/touchscreen/s3c-ts.c:494: error: 'IRQF_SAMPLE_RANDOM' undeclared (first use in this function)
drivers/input/touchscreen/s3c-ts.c:494: error: (Each undeclared identifier is reported only once
drivers/input/touchscreen/s3c-ts.c:494: error: for each function it appears in.)


copy arch/arm/mach-s3c64xx/dev-ts.c 到目标内核目录在 arch/arm/mach-s3c64xx/Makefile 中添加 
   obj-$(CONFIG_TOUCHSCREEN_S3C)   += dev-ts.o                  

2、  添加 ts  设备初始化 ,在smdk6410_machine_init ()  结构体中

   

 //s3c24xx_ts_set_platdata(NULL);  

s3c_ts_set_platdata(&s3c_ts_platform);

 

    添加结构体s3c_ts_platform

static struct s3c_ts_mach_info s3c_ts_platform __initdata = {

    .delay            = 10000,

    .presc            = 49,

    .oversampling_shift    = 2,

    .resol_bit        = 12,        

    .s3c_adc_con        = ADC_TYPE_2,    

 

};

3、把友坚恒天官方的s3c-tc.c拷贝到drivers/input/touchsc