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
20 /***********************vtl ts driver config ******************************************/
\r
23 #define CHIP_ID CT36X//CT360//
\r
25 #define XY_DATA_PROTOCOL NEW_PROTOCOL//OLD_PROTOCOL//
\r
27 #define TS_I2C_SPEED 400000 //for rockchip
\r
30 #define XY_SWAP_ENABLE 1
\r
32 #define XY_SWAP_ENABLE 0
\r
35 #define X_REVERSE_ENABLE 0
\r
38 #define Y_REVERSE_ENABLE 0
\r
40 #define Y_REVERSE_ENABLE 1
\r
44 #define CHIP_UPDATE_ENABLE 1
\r
46 #define DEBUG_ENABLE 0
\r
49 /***********************vtl ts driver config end******************************************/
\r
80 /*vtl ts driver name*/
\r
81 #define DRIVER_NAME "vtl_ts"
\r
82 //#define DEBUG_ENABLE 1
\r
84 #define DEBUG() printk("___%s___\n",__func__);
\r
85 //#define XY_DEBUG(id,status,x,y) printk("id = %d,status = %d,X = %d,Y = %d\n",id,status,x,y);
\r
88 //#define XY_DEBUG(id,status,x,y)
\r
91 /*TOUCH_POINT_NUM define*/
\r
92 #if(CHIP_ID == CT360)
\r
93 #define TOUCH_POINT_NUM 5
\r
94 #elif(CHIP_ID == CT36X)
\r
95 #define TOUCH_POINT_NUM 10
\r
98 /*priate define and declare*/
\r
99 #if(CHIP_ID == CT360)
\r
101 #if(XY_DATA_PROTOCOL == OLD_PROTOCOL)
\r
102 unsigned char status : 4; // Action information, 1: Down; 2: Move; 3: Up
\r
103 unsigned char id : 4; // ID information, from 1 to CFG_MAX_POINT_NUM
\r
105 unsigned char xhi; // X coordinate Hi
\r
106 unsigned char yhi; // Y coordinate Hi
\r
107 unsigned char ylo : 4; // Y coordinate Lo
\r
108 unsigned char xlo : 4; // X coordinate Lo
\r
109 #if(XY_DATA_PROTOCOL == NEW_PROTOCOL)
\r
110 unsigned char status : 4; // Action information, 1: Down; 2: Move; 3: Up
\r
111 unsigned char id : 4; // ID information, from 1 to CFG_MAX_POINT_NUM
\r
116 #if(XY_DATA_PROTOCOL == OLD_PROTOCOL)
\r
117 unsigned char status : 3; // Action information, 1: Down; 2: Move; 3: Up
\r
118 unsigned char id : 5; // ID information, from 1 to CFG_MAX_POINT_NUM
\r
120 unsigned char xhi; // X coordinate Hi
\r
121 unsigned char yhi; // Y coordinate Hi
\r
122 unsigned char ylo : 4; // Y coordinate Lo
\r
123 unsigned char xlo : 4; // X coordinate Lo
\r
124 #if(XY_DATA_PROTOCOL == NEW_PROTOCOL)
\r
125 unsigned char status : 3; // Action information, 1: Down; 2: Move; 3: Up
\r
126 unsigned char id : 5; // ID information, from 1 to CFG_MAX_POINT_NUM
\r
128 unsigned char area; // Touch area
\r
129 unsigned char pressure; // Touch Pressure
\r
135 struct xy_data point[TOUCH_POINT_NUM];
\r
136 unsigned char buf[TOUCH_POINT_NUM * sizeof(struct xy_data)];
\r
142 struct i2c_client *client;
\r
144 /* input devices */
\r
145 struct input_dev *input_dev;
\r
147 struct proc_dir_entry *proc_entry;
\r
149 struct task_struct *ts_thread;
\r
151 //#ifdef CONFIG_HAS_EARLYSUSPEND
\r
152 //struct early_suspend early_suspend;
\r
156 struct ts_config_info{
\r
158 unsigned int screen_max_x;
\r
159 unsigned int screen_max_y;
\r
160 unsigned int xy_swap;
\r
161 unsigned int x_reverse;
\r
162 unsigned int y_reverse;
\r
163 unsigned int x_mul;
\r
164 unsigned int y_mul;
\r
165 unsigned int bin_ver;
\r
166 unsigned int irq_gpio_number;
\r
167 unsigned int irq_number;
\r
168 unsigned int rst_gpio_number;
\r
169 unsigned char touch_point_number;
\r
170 unsigned char ctp_used;
\r
171 //unsigned char i2c_bus_number;
\r
172 //unsigned char revert_x_flag;
\r
173 //unsigned char revert_y_flag;
\r
174 //unsigned char exchange_x_y_flag;
\r
179 struct ts_driver *driver;
\r
180 struct ts_config_info config_info;
\r
181 union ts_xy_data xy_data;
\r
182 unsigned char debug;
\r
183 struct tp_device tp;
\r
187 //extern struct ts_info *pg_ts;
\r
188 extern struct ts_info * vtl_ts_get_object(void);
\r
189 extern void vtl_ts_hw_reset(void);
\r