input: touchscreen: add touch screen of gslx680 for rk3399-firefly-edp
[firefly-linux-kernel-4.4.55.git] / drivers / input / touchscreen / ft5506_wgj.h
1 #ifndef __LINUX_FT5X0X_TS_H__
2 #define __LINUX_FT5X0X_TS_H__
3
4 //#define CONFIG_SUPPORT_FTS_CTP_UPG
5 #define CONFIG_FTS_CUSTOME_ENV
6
7 #define FT5X0X_I2C_SPEED 200*1000
8
9 #define CFG_DBG_DUMMY_INFO_SUPPORT   1     //output touch point information
10 #define CFG_DBG_FUCTION_INFO_SUPPORT 0     //output fouction name
11 #define CFG_DBG_INPUT_EVENT                   1     //debug input event
12
13
14 #define CFG_MAX_POINT_NUM            10    //max touch points supported
15 #define CFG_NUMOFKEYS                    0x00//0x4    //number of touch keys
16
17 #ifdef CONFIG_FTS_CUSTOME_ENV  
18 //µ±ÊÖÖ¸´Ó±ß½ç»®Æðʱ,»á³öÏÖÎÞÏìÓ¦µÄÇé¿ö,Òò´ËÌí¼ÓÒ»¸öºê½«±ß½ç×î´óÖµÏòÍâÀ­Éì
19 #define SCREEN_BOUNDARY_ADJUST_VALUE 10 
20
21 #define SCREEN_MAX_X           1280
22 #define SCREEN_MAX_Y           800//600
23 #else
24 #define SCREEN_MAX_X           1024
25 #define SCREEN_MAX_Y           768
26 #endif
27 #define PRESS_MAX                 255
28
29 #define KEY_PRESS                 0x1
30 #define KEY_RELEASE              0x0
31
32 #define FT5X0X_NAME    "laibao_touch"//"ft5x0x_ts"  
33
34 #define FTS_NULL                    0x0
35 #define FTS_TRUE                    0x1
36 #define FTS_FALSE                   0x0
37 #define I2C_CTPM_ADDRESS    0x70
38
39 typedef unsigned char         FTS_BYTE;    
40 typedef unsigned short        FTS_WORD;   
41 typedef unsigned int          FTS_DWRD;    
42 typedef unsigned char         FTS_BOOL;  
43
44
45
46  typedef struct _REPORT_FINGER_INFO_T
47  {
48      short   ui2_id;               /* ID information, from 0 to  CFG_MAX_POINT_NUM - 1*/
49      short    u2_pressure;    /* ***pressure information, valid from 0 -63 **********/
50      short    i2_x;                /*********** X coordinate, 0 - 2047 ****************/
51      short    i2_y;                /* **********Y coordinate, 0 - 2047 ****************/
52  } REPORT_FINGER_INFO_T;
53
54
55 typedef enum
56 {
57     ERR_OK,
58     ERR_MODE,
59     ERR_READID,
60     ERR_ERASE,
61     ERR_STATUS,
62     ERR_ECC,
63     ERR_DL_ERASE_FAIL,
64     ERR_DL_PROGRAM_FAIL,
65     ERR_DL_VERIFY_FAIL
66 }E_UPGRADE_ERR_TYPE;
67
68
69  struct FTS_TS_EVENT_T {
70     short    x1;
71     short    y1;
72     short    x2;
73     short    y2;
74     short    x3;
75     short    y3;
76     short    x4;
77     short    y4;
78     short    x5;
79     short    y5;
80     short    pressure1;
81     short    pressure2;
82     short    pressure3;
83     short    pressure4;
84     short    pressure5;
85     u8        touch_point;
86 };
87
88
89
90
91 enum ft5x0x_ts_regs {
92     FT5X0X_REG_THRES = 0x80,              /* Thresshold, the threshold be low, the sensitivy will be high */
93     FT5X0X_REG_REPORT_RATE = 0x88,  /* **************report rate, in unit of 10Hz **************/
94     FT5X0X_REG_PMODE    = 0xA5,          /* Power Consume Mode 0 -- active, 1 -- monitor, 3 -- sleep */    
95     FT5X0X_REG_FIRMID   = 0xA6,          /* ***************firmware version **********************/
96     FT5X0X_REG_NOISE_MODE = 0xb2    /* to enable or disable power noise, 1 -- enable, 0 -- disable */
97 };
98
99 #define PMODE_ACTIVE        0x00
100 #define PMODE_MONITOR       0x01
101 #define PMODE_STANDBY       0x02
102 #define PMODE_HIBERNATE     0x03
103
104
105 #ifndef ABS_MT_TOUCH_MAJOR
106 #define ABS_MT_TOUCH_MAJOR    0x30    /* touching ellipse */
107 #define ABS_MT_TOUCH_MINOR    0x31    /* (omit if circular) */
108 #define ABS_MT_WIDTH_MAJOR    0x32    /* approaching ellipse */
109 #define ABS_MT_WIDTH_MINOR    0x33    /* (omit if circular) */
110 #define ABS_MT_ORIENTATION     0x34    /* Ellipse orientation */
111 #define ABS_MT_POSITION_X       0x35    /* Center X ellipse position */
112 #define ABS_MT_POSITION_Y       0x36    /* Center Y ellipse position */
113 #define ABS_MT_TOOL_TYPE        0x37    /* Type of touching device */
114 #define ABS_MT_BLOB_ID             0x38    /* Group set of pkts as blob */
115 #endif 
116
117
118 #endif
119
120