4 #include <linux/gpio.h>
\r
5 #ifdef CONFIG_HAS_EARLYSUSPEND
\r
6 #include <linux/earlysuspend.h>
\r
8 #include "../tp_suspend.h"
\r
11 /*vtl touch IC define*/
\r
12 #define CT36X 0x01//(CT36X:ct362,ct363,ct365)
\r
13 #define CT360 0x02//(CT360:ct360)
\r
15 /*xy data protocol*/
\r
16 #define OLD_PROTOCOL 0x01
\r
17 #define NEW_PROTOCOL 0x02
\r
21 /***********************vtl ts driver config ******************************************/
\r
24 #define CHIP_ID CT36X//CT360//
\r
26 #define XY_DATA_PROTOCOL NEW_PROTOCOL//OLD_PROTOCOL//
\r
28 #define TS_I2C_SPEED 400000 //for rockchip
\r
31 #define XY_SWAP_ENABLE 0
\r
33 #define X_REVERSE_ENABLE 0
\r
35 #define Y_REVERSE_ENABLE 1
\r
37 #define CHIP_UPDATE_ENABLE 1
\r
39 #define DEBUG_ENABLE 0
\r
42 /***********************vtl ts driver config end******************************************/
\r
73 /*vtl ts driver name*/
\r
74 #define DRIVER_NAME "vtl_ts"
\r
75 //#define DEBUG_ENABLE 1
\r
77 #define DEBUG() printk("___%s___\n",__func__);
\r
78 //#define XY_DEBUG(id,status,x,y) printk("id = %d,status = %d,X = %d,Y = %d\n",id,status,x,y);
\r
81 //#define XY_DEBUG(id,status,x,y)
\r
84 /*TOUCH_POINT_NUM define*/
\r
85 #if(CHIP_ID == CT360)
\r
86 #define TOUCH_POINT_NUM 5
\r
87 #elif(CHIP_ID == CT36X)
\r
88 #define TOUCH_POINT_NUM 10
\r
91 /*priate define and declare*/
\r
92 #if(CHIP_ID == CT360)
\r
94 #if(XY_DATA_PROTOCOL == OLD_PROTOCOL)
\r
95 unsigned char status : 4; // Action information, 1: Down; 2: Move; 3: Up
\r
96 unsigned char id : 4; // ID information, from 1 to CFG_MAX_POINT_NUM
\r
98 unsigned char xhi; // X coordinate Hi
\r
99 unsigned char yhi; // Y coordinate Hi
\r
100 unsigned char ylo : 4; // Y coordinate Lo
\r
101 unsigned char xlo : 4; // X coordinate Lo
\r
102 #if(XY_DATA_PROTOCOL == NEW_PROTOCOL)
\r
103 unsigned char status : 4; // Action information, 1: Down; 2: Move; 3: Up
\r
104 unsigned char id : 4; // ID information, from 1 to CFG_MAX_POINT_NUM
\r
109 #if(XY_DATA_PROTOCOL == OLD_PROTOCOL)
\r
110 unsigned char status : 3; // Action information, 1: Down; 2: Move; 3: Up
\r
111 unsigned char id : 5; // ID information, from 1 to CFG_MAX_POINT_NUM
\r
113 unsigned char xhi; // X coordinate Hi
\r
114 unsigned char yhi; // Y coordinate Hi
\r
115 unsigned char ylo : 4; // Y coordinate Lo
\r
116 unsigned char xlo : 4; // X coordinate Lo
\r
117 #if(XY_DATA_PROTOCOL == NEW_PROTOCOL)
\r
118 unsigned char status : 3; // Action information, 1: Down; 2: Move; 3: Up
\r
119 unsigned char id : 5; // ID information, from 1 to CFG_MAX_POINT_NUM
\r
121 unsigned char area; // Touch area
\r
122 unsigned char pressure; // Touch Pressure
\r
128 struct xy_data point[TOUCH_POINT_NUM];
\r
129 unsigned char buf[TOUCH_POINT_NUM * sizeof(struct xy_data)];
\r
135 struct i2c_client *client;
\r
137 /* input devices */
\r
138 struct input_dev *input_dev;
\r
140 struct proc_dir_entry *proc_entry;
\r
142 struct task_struct *ts_thread;
\r
144 //#ifdef CONFIG_HAS_EARLYSUSPEND
\r
145 //struct early_suspend early_suspend;
\r
149 struct ts_config_info{
\r
151 unsigned int screen_max_x;
\r
152 unsigned int screen_max_y;
\r
153 unsigned int irq_gpio_number;
\r
154 unsigned int irq_number;
\r
155 unsigned int rst_gpio_number;
\r
156 unsigned char touch_point_number;
\r
157 unsigned char ctp_used;
\r
158 //unsigned char i2c_bus_number;
\r
159 //unsigned char revert_x_flag;
\r
160 //unsigned char revert_y_flag;
\r
161 //unsigned char exchange_x_y_flag;
\r
166 struct ts_driver *driver;
\r
167 struct ts_config_info config_info;
\r
168 union ts_xy_data xy_data;
\r
169 unsigned char debug;
\r
170 struct tp_device tp;
\r
174 //extern struct ts_info *pg_ts;
\r
175 extern struct ts_info * vtl_ts_get_object(void);
\r
176 extern void vtl_ts_hw_reset(void);
\r