全志触摸屏调试

gt9xxnew_ts驱动的移植

1.修改配置文件:sys_config.fex
(1)源码路径:lichee/tools/pack/chips/sun8iw11p1/configs/t3-mp1/sys_config.fex

[ctp]
compatible          = "allwinner,sun50i-ctp-para"
ctp_used            = 1
ctp_name            = "gt9xxnew_ts"
ctp_twi_id          = 2
ctp_twi_addr        = 0x14
ctp_screen_max_x    = 1024
ctp_screen_max_y    = 600
ctp_revert_x_flag   = 0
ctp_revert_y_flag   = 0
ctp_exchange_x_y_flag = 0
ctp_power_ldo       = "vcc-ctp"
ctp_power_ldo_vol   = 3300
ctp_int_port        = port:PH21<6><default><default><default>
ctp_wakeup          = port:PB13<1><default><default><1>

[ctp_list]
compatible          = "allwinner,sun50i-ctp-list"
ctp_list_used       = 0
gt82x               = 0
gt9xxnew_ts         = 0

2.添加设备信息:sw_device.c
(1)源码路径: lichee/linux-3.10/drivers/input/sw-device.c

/*ctp info*/
static struct sw_device_info ctps[] = {
        { "ft5x_ts", 0, {      0x38},   0xa3, {0x3,0x0a,0x55,0x06,0x08,0x02,0xa3}, 0},
        {   "gt82x", 0, {      0x5d},  0xf7d, {0x13,0x27,0x28          }, 0},
        { "gslX680", 0, {      0x40},   0x00, {0x00                    }, 1},
        {"gslX680new", 0, {    0x40},   0x00, {0x00                    }, 1},
        {"gt9xx_ts", 0, {0x14, 0x5d}, 0x8140, {0x39                    }, 0},
        {"gt9xxnew_ts", 0, {0x14, 0x5d}, 0x8140, {0x39,0x60,0xe0,0x10,                    }, 0},
        {"gt9xxf_ts", 0, { 0x14,0x5d},   0x00, {0x00                    }, 1},
        {   "tu_ts", 0, {      0x5f},   0x00, {0x00                    }, 1},
        {"gt818_ts", 0, {      0x5d},  0x715, {0xc3                    }, 0},
        { "zet622x", 0, {      0x76},   0x00, {0x00                    }, 0},
        {"aw5306_ts", 0, {     0x38},   0x01, {0xA8                    }, 0},
        {"icn83xx_ts", 0,{     0x40},   0x00, {0x00                    }, 1},
};

3.添加TP的cfg文件:gt9xx.h
(1)源码路径:lichee/linux-3.10/drivers/input/touchscreen/gt9xxnew/gt9xx.h

#define GTP_CUSTOM_CFG        0 //关
#define GTP_DRIVER_SEND_CFG   1 //开
/* TODO: define your config for Sensor_ID == 6 here, if needed*/
#define CTP_CFG_GROUP7 {\
                0x41,0x20,0x03,0xe0,0x01,0x02,0x4d,0x00,\
                0x01,0x08,0x19,0x0a,0x50,0x3c,0x03,0x05,\
                0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\
                0x00,0x00,0x00,0x8a,0x2a,0x0c,0x46,0x44,\
                0x0c,0x08,0x00,0x00,0x00,0xba,0x02,0x1d,\
                0x00,0x01,0x00,0x00,0x00,0x03,0x64,0x32,\
                0x00,0x00,0x00,0x32,0x55,0x8a,0xc5,0x02,\
                0x07,0x00,0x00,0x04,0xa2,0x34,0x00,0x93,\
                0x3a,0x00,0x86,0x41,0x00,0x7b,0x48,0x00,\
                0x71,0x50,0x00,0x71,0x00,0x00,0x00,0x00,\
                0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\
                0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\
                0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\
                0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\
                0x18,0x16,0x14,0x12,0x10,0x0e,0x0c,0x0a,\
                0x08,0x06,0x04,0x02,0xff,0xff,0x00,0x00,\
                0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\
                0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,\
                0x04,0x06,0x08,0x0a,0x0f,0x10,0x12,0x13,\
                0x16,0x18,0x1c,0x1d,0x1e,0x1f,0x20,0x21,\
                0x22,0x24,0xff,0xff,0xff,0xff,0xff,0xff,\
                0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\
                0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\
                0x78,0x01}

(2)源码路径:lichee/linux-3.10/drivers/input/touchscreen/gt9xxnew/gt9xx.c

else if (!strcmp(config_info.name, "gt9xxnew_ts")) {
                        sensor_id = 6;
                        dprintk(DEBUG_INIT,"gt9xx:sensor_id = %d\n",sensor_id);
                } 

虽然触摸屏是第一次玩,耗费的时间有点多。网上搜过很多方法,但真正有用的就是以上几个步骤,完成之后触摸屏就可以正常使用了!

你可能感兴趣的:(全志触摸屏调试)