Commit | Line | Data |
---|---|---|
ffa458c1 DB |
1 | /* linux/spi/ads7846.h */ |
2 | ||
3 | /* Touchscreen characteristics vary between boards and models. The | |
2e5a7bd9 | 4 | * platform_data for the device's "struct device" holds this information. |
ffa458c1 DB |
5 | * |
6 | * It's OK if the min/max values are zero. | |
7 | */ | |
da970e69 ID |
8 | enum ads7846_filter { |
9 | ADS7846_FILTER_OK, | |
10 | ADS7846_FILTER_REPEAT, | |
11 | ADS7846_FILTER_IGNORE, | |
12 | }; | |
13 | ||
ffa458c1 DB |
14 | struct ads7846_platform_data { |
15 | u16 model; /* 7843, 7845, 7846. */ | |
16 | u16 vref_delay_usecs; /* 0 for external vref; etc */ | |
7c6d0ee1 DB |
17 | u16 vref_mv; /* external vref value, milliVolts */ |
18 | bool keep_vref_on; /* set to keep vref on for differential | |
de2defd9 | 19 | * measurements as well */ |
86579a4c | 20 | bool swap_xy; /* swap x and y axes */ |
e4f48861 SH |
21 | |
22 | /* Settling time of the analog signals; a function of Vcc and the | |
23 | * capacitance on the X/Y drivers. If set to non-zero, two samples | |
24 | * are taken with settle_delay us apart, and the second one is used. | |
25 | * ~150 uSec with 0.01uF caps. | |
26 | */ | |
27 | u16 settle_delay_usecs; | |
28 | ||
1d25891f SH |
29 | /* If set to non-zero, after samples are taken this delay is applied |
30 | * and penirq is rechecked, to help avoid false events. This value | |
31 | * is affected by the material used to build the touch layer. | |
32 | */ | |
33 | u16 penirq_recheck_delay_usecs; | |
34 | ||
ffa458c1 DB |
35 | u16 x_plate_ohms; |
36 | u16 y_plate_ohms; | |
37 | ||
38 | u16 x_min, x_max; | |
39 | u16 y_min, y_max; | |
40 | u16 pressure_min, pressure_max; | |
0b7018aa | 41 | |
d5b415c9 ID |
42 | u16 debounce_max; /* max number of additional readings |
43 | * per sample */ | |
0b7018aa | 44 | u16 debounce_tol; /* tolerance used for filtering */ |
d5b415c9 ID |
45 | u16 debounce_rep; /* additional consecutive good readings |
46 | * required after the first two */ | |
6ae19b04 EM |
47 | int gpio_pendown; /* the GPIO used to decide the pendown |
48 | * state if get_pendown_state == NULL | |
49 | */ | |
c9e617a5 | 50 | int (*get_pendown_state)(void); |
da970e69 ID |
51 | int (*filter_init) (struct ads7846_platform_data *pdata, |
52 | void **filter_data); | |
53 | int (*filter) (void *filter_data, int data_idx, int *val); | |
54 | void (*filter_cleanup)(void *filter_data); | |
fd746d54 | 55 | void (*wait_for_sync)(void); |
ffa458c1 DB |
56 | }; |
57 |