Input: ads7846 - pluggable filtering logic
[linux-2.6/openmoko-kernel.git] / include / linux / spi / ads7846.h
blob1663f940ca115d3a5a2455203fe1df0d200229a9
1 /* linux/spi/ads7846.h */
3 /* Touchscreen characteristics vary between boards and models. The
4 * platform_data for the device's "struct device" holds this information.
6 * It's OK if the min/max values are zero.
7 */
8 enum ads7846_filter {
9 ADS7846_FILTER_OK,
10 ADS7846_FILTER_REPEAT,
11 ADS7846_FILTER_IGNORE,
14 struct ads7846_platform_data {
15 u16 model; /* 7843, 7845, 7846. */
16 u16 vref_delay_usecs; /* 0 for external vref; etc */
17 u16 x_plate_ohms;
18 u16 y_plate_ohms;
20 u16 x_min, x_max;
21 u16 y_min, y_max;
22 u16 pressure_min, pressure_max;
24 u16 debounce_max; /* max number of additional readings
25 * per sample */
26 u16 debounce_tol; /* tolerance used for filtering */
27 u16 debounce_rep; /* additional consecutive good readings
28 * required after the first two */
29 int (*get_pendown_state)(void);
30 int (*filter_init) (struct ads7846_platform_data *pdata,
31 void **filter_data);
32 int (*filter) (void *filter_data, int data_idx, int *val);
33 void (*filter_cleanup)(void *filter_data);