Merge remote-tracking branch 'remotes/aosp/android-3.0' into develop-3.0
[firefly-linux-kernel-4.4.55.git] / drivers / input / touchscreen / ft5x0x_i2c_ts.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 CFG_DBG_DUMMY_INFO_SUPPORT   1     //output touch point information
8 #define CFG_DBG_FUCTION_INFO_SUPPORT 0     //output fouction name
9 #define CFG_DBG_INPUT_EVENT                   0     //debug input event
10
11
12 #define CFG_MAX_POINT_NUM            0x5    //max touch points supported
13 #define CFG_NUMOFKEYS                    0x4    //number of touch keys
14
15 #ifdef CONFIG_FTS_CUSTOME_ENV  
16 #define SCREEN_MAX_X           1044//1024
17 #define SCREEN_MAX_Y           620//600
18 #else
19 #define SCREEN_MAX_X           800
20 #define SCREEN_MAX_Y           480
21 #endif
22 #define PRESS_MAX                 255
23
24 #define KEY_PRESS                 0x1
25 #define KEY_RELEASE              0x0
26
27 #define FT5X0X_NAME    "laibao_touch"//"ft5x0x_ts"  
28
29 #define FTS_NULL                    0x0
30 #define FTS_TRUE                    0x1
31 #define FTS_FALSE                   0x0
32 #define I2C_CTPM_ADDRESS    0x70
33
34 typedef unsigned char         FTS_BYTE;    
35 typedef unsigned short        FTS_WORD;   
36 typedef unsigned int          FTS_DWRD;    
37 typedef unsigned char         FTS_BOOL;  
38
39
40
41  typedef struct _REPORT_FINGER_INFO_T
42  {
43      short   ui2_id;               /* ID information, from 0 to  CFG_MAX_POINT_NUM - 1*/
44      short    u2_pressure;    /* ***pressure information, valid from 0 -63 **********/
45      short    i2_x;                /*********** X coordinate, 0 - 2047 ****************/
46      short    i2_y;                /* **********Y coordinate, 0 - 2047 ****************/
47  } REPORT_FINGER_INFO_T;
48
49
50 typedef enum
51 {
52     ERR_OK,
53     ERR_MODE,
54     ERR_READID,
55     ERR_ERASE,
56     ERR_STATUS,
57     ERR_ECC,
58     ERR_DL_ERASE_FAIL,
59     ERR_DL_PROGRAM_FAIL,
60     ERR_DL_VERIFY_FAIL
61 }E_UPGRADE_ERR_TYPE;
62
63
64  struct FTS_TS_EVENT_T {
65     short    x1;
66     short    y1;
67     short    x2;
68     short    y2;
69     short    x3;
70     short    y3;
71     short    x4;
72     short    y4;
73     short    x5;
74     short    y5;
75     short    pressure1;
76     short    pressure2;
77     short    pressure3;
78     short    pressure4;
79     short    pressure5;
80     u8        touch_point;
81 };
82
83
84
85
86 enum ft5x0x_ts_regs {
87     FT5X0X_REG_THRES = 0x80,              /* Thresshold, the threshold be low, the sensitivy will be high */
88     FT5X0X_REG_REPORT_RATE = 0x88,  /* **************report rate, in unit of 10Hz **************/
89     FT5X0X_REG_PMODE    = 0xA5,          /* Power Consume Mode 0 -- active, 1 -- monitor, 3 -- sleep */    
90     FT5X0X_REG_FIRMID   = 0xA6,          /* ***************firmware version **********************/
91     FT5X0X_REG_NOISE_MODE = 0xb2    /* to enable or disable power noise, 1 -- enable, 0 -- disable */
92 };
93
94 #define PMODE_ACTIVE        0x00
95 #define PMODE_MONITOR       0x01
96 #define PMODE_STANDBY       0x02
97 #define PMODE_HIBERNATE     0x03
98
99
100 #ifndef ABS_MT_TOUCH_MAJOR
101 #define ABS_MT_TOUCH_MAJOR    0x30    /* touching ellipse */
102 #define ABS_MT_TOUCH_MINOR    0x31    /* (omit if circular) */
103 #define ABS_MT_WIDTH_MAJOR    0x32    /* approaching ellipse */
104 #define ABS_MT_WIDTH_MINOR    0x33    /* (omit if circular) */
105 #define ABS_MT_ORIENTATION     0x34    /* Ellipse orientation */
106 #define ABS_MT_POSITION_X       0x35    /* Center X ellipse position */
107 #define ABS_MT_POSITION_Y       0x36    /* Center Y ellipse position */
108 #define ABS_MT_TOOL_TYPE        0x37    /* Type of touching device */
109 #define ABS_MT_BLOB_ID             0x38    /* Group set of pkts as blob */
110 #endif 
111
112
113 #endif
114
115