diff options
Diffstat (limited to 'drivers/input/touchscreen/ts_filter_median.h')
-rw-r--r-- | drivers/input/touchscreen/ts_filter_median.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/drivers/input/touchscreen/ts_filter_median.h b/drivers/input/touchscreen/ts_filter_median.h new file mode 100644 index 00000000000..8f25e27b2aa --- /dev/null +++ b/drivers/input/touchscreen/ts_filter_median.h @@ -0,0 +1,36 @@ +#ifndef __TS_FILTER_MEDIAN_H__ +#define __TS_FILTER_MEDIAN_H__ + +#include "ts_filter.h" + +/* + * Touchscreen filter. + * + * median + * + * (c) 2008 Andy Green <andy@openmoko.com> + */ + +struct ts_filter_median_configuration { + int extent; + int midpoint; + int decimation_threshold; + int decimation_above; + int decimation_below; +}; + +struct ts_filter_median { + struct ts_filter tsf; + struct ts_filter_median_configuration *config; + + int decimation_count; + int last_issued[MAX_TS_FILTER_COORDS]; + int valid; /* how many samples in the sort buffer are valid */ + int *sort[MAX_TS_FILTER_COORDS]; /* samples taken for median */ + int *fifo[MAX_TS_FILTER_COORDS]; /* samples taken for median */ + int pos; /* where we are in the fifo sample memory */ +}; + +extern struct ts_filter_api ts_filter_median_api; + +#endif |