input: touchscreen: add touch screen of gslx680 for rk3399-firefly-edp
[firefly-linux-kernel-4.4.55.git] / drivers / input / touchscreen / ts_lib / tslib.h
1 #ifndef _TSLIB_H_
2 #define _TSLIB_H_
3 /*
4  *  tslib/tslib.h
5  *
6  *  Copyright (C) 2001 Russell King.
7  *
8  * This file is placed under the LGPL.
9  *
10  *
11  * Touch screen library interface definitions.
12  */
13
14 #define NR_SAMPHISTLEN  4
15
16 #define VARIANCE_DELTA   10
17 #define DEJITTER_DELTA   100
18
19 struct ts_sample {
20         int             x;
21         int             y;
22         unsigned int    pressure;
23 };
24
25 struct tslib_variance {
26         int delta;
27     struct ts_sample last;
28     struct ts_sample noise;
29         unsigned int flags;
30 };
31
32 struct ts_hist {
33         int x;
34         int y;
35         unsigned int p;
36 };
37
38 struct tslib_dejitter {
39         int delta;
40         int x;
41         int y;
42         int down;
43         int nr;
44         int head;
45         struct ts_hist hist[NR_SAMPHISTLEN];
46 };
47
48 struct tslib_info {
49         int (*raw_read)(struct tslib_info *info, struct ts_sample *samp, int nr);
50         struct tslib_variance *var;
51         struct tslib_dejitter *djt;
52 };
53
54 int sqr(int x);
55
56 int tslib_init(struct tslib_info *info, void *raw_read);
57 void variance_clear(struct tslib_info *info);
58 int variance_read(struct tslib_info *info, struct ts_sample *samp, int nr);
59 int dejitter_read(struct tslib_info *info, struct ts_sample *samp, int nr);
60
61
62 #endif /* _TSLIB_H_ */