首页 > 代码库 > FL2440移植LINUX-3.4.2 -- 内核自带的触摸屏驱动移植
FL2440移植LINUX-3.4.2 -- 内核自带的触摸屏驱动移植
修改两个文件/arch/arm/mach-s3c2440/mach-smdk2440.c
和
linux-3.0-s3c2440/drivers/input/touchscreen/s3c2410_ts.c
1 /arch/arm/mach-s3c2440/mach-smdk2440.c 2 3 +#include <plat/ts.h> /*Add by guowenxue to support Touch screen, 2011.09.06*/ 4 5 +/*Touch Screen driver info add by guowenxue 2011.09.04 */ 6 +static struct s3c2410_ts_mach_info smdk2440_ts_cfg __initdata = http://www.mamicode.com/{"color: #008080;">11 +12 13 14 static struct platform_device *smdk2440_devices[] __initdata =http://www.mamicode.com/ {15 @@ -155,19 +295,48 @@16 &s3c_device_wdt,17 &s3c_device_i2c0,18 &s3c_device_iis,26 + &s3c_device_adc, /* Add Touch Screen driver by guowenxue, 2011.09.06*/27 + &s3c_device_ts, /* Add Touch Screen driver by guowenxue, 2011.09.06*/30 +#endif31 };32 33 34 35 static void __init smdk2440_machine_init(void)36 {37 s3c24xx_fb_set_platdata(&smdk2440_fb_info);38 + s3c24xx_ts_set_platdata(&smdk2440_ts_cfg); /*Add Touch Screen info by guowenxue, 2011.09.06*/39 s3c_i2c0_set_platdata(NULL);40 + i2c_register_board_info(0, smdk2440_i2c_devs, ARRAY_SIZE(smdk2440_i2c_devs));41 42 platform_add_devices(smdk2440_devices, ARRAY_SIZE(smdk2440_devices));43 smdk_machine_init();44 45 46 47 /drivers/input/touchscreen/s3c2410_ts.c48 +++ linux-3.0-s3c2440/drivers/input/touchscreen/s3c2410_ts.c 2013-07-28 11:44:58.555435668 +080049 @@ -126,6 +126,7 @@50 input_report_abs(ts.input, ABS_Y, ts.yp);51 52 input_report_key(ts.input, BTN_TOUCH, 1);53 + input_report_abs(ts.input, ABS_PRESSURE, 1); /* Add by guowenxue, 2012.03.30 */54 input_sync(ts.input);55 56 ts.xp = 0;57 @@ -140,6 +141,7 @@58 ts.count = 0;59 60 input_report_key(ts.input, BTN_TOUCH, 0);61 + input_report_abs(ts.input, ABS_PRESSURE, 0); /* Add by guowenxue, 2012.03.30 */62 input_sync(ts.input);63 64 writel(WAIT4INT | INT_DOWN, ts.io + S3C2410_ADCTSC);65 @@ -314,10 +316,11 @@66 }67 68 ts.input = input_dev;69 - ts.input->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS);70 + ts.input->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS) | BIT(EV_SYN); /* Modify by guowenxue, 2012.03.30 */71 ts.input->keybit[BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH);72 input_set_abs_params(ts.input, ABS_X, 0, 0x3FF, 0, 0);73 input_set_abs_params(ts.input, ABS_Y, 0, 0x3FF, 0, 0);74 + input_set_abs_params(ts.input, ABS_PRESSURE, 0, 1, 0, 0); /* Add by guowenxue, 2012.03.30 */75 76 ts.input->name = "S3C24XX TouchScreen";77 ts.input->id.bustype = BUS_HOST;
FL2440移植LINUX-3.4.2 -- 内核自带的触摸屏驱动移植
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。