From da970e69efb9fd0be0c23ace5bde42d4caf17b40 Mon Sep 17 00:00:00 2001 From: Imre Deak Date: Thu, 18 Jan 2007 00:44:41 -0500 Subject: Input: ads7846 - pluggable filtering logic Some LCDs like the LS041Y3 require a customized filtering logic for reliable readings, so make the filtering function replacable through platform specific hooks. Signed-off-by: Imre Deak Signed-off-by: Juha Yrjola Signed-off-by: David Brownell Signed-off-by: Dmitry Torokhov --- include/linux/spi/ads7846.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'include/linux/spi') diff --git a/include/linux/spi/ads7846.h b/include/linux/spi/ads7846.h index adb3daf..1663f94 100644 --- a/include/linux/spi/ads7846.h +++ b/include/linux/spi/ads7846.h @@ -5,6 +5,12 @@ * * It's OK if the min/max values are zero. */ +enum ads7846_filter { + ADS7846_FILTER_OK, + ADS7846_FILTER_REPEAT, + ADS7846_FILTER_IGNORE, +}; + struct ads7846_platform_data { u16 model; /* 7843, 7845, 7846. */ u16 vref_delay_usecs; /* 0 for external vref; etc */ @@ -21,5 +27,9 @@ struct ads7846_platform_data { u16 debounce_rep; /* additional consecutive good readings * required after the first two */ int (*get_pendown_state)(void); + int (*filter_init) (struct ads7846_platform_data *pdata, + void **filter_data); + int (*filter) (void *filter_data, int data_idx, int *val); + void (*filter_cleanup)(void *filter_data); }; -- cgit v1.1