diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2009-10-24 16:06:05 +0200 |
---|---|---|
committer | Lars-Peter Clausen <lars@metafoo.de> | 2009-12-21 17:15:48 +0100 |
commit | c0be5ad97fb0f722b8afded74256742c008991d9 (patch) | |
tree | 4dc65a604561c5da3e365055623888c58cb6f657 /include/linux/input/touchscreen/ts_filter.h | |
parent | 871c0b38ef349686071b055d012bff712088aa61 (diff) |
ts-filter: Move include files to include/linux/input/touchscreen
Diffstat (limited to 'include/linux/input/touchscreen/ts_filter.h')
-rw-r--r-- | include/linux/input/touchscreen/ts_filter.h | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/include/linux/input/touchscreen/ts_filter.h b/include/linux/input/touchscreen/ts_filter.h new file mode 100644 index 00000000000..632e5fb3f4e --- /dev/null +++ b/include/linux/input/touchscreen/ts_filter.h @@ -0,0 +1,74 @@ +#ifndef __TS_FILTER_H__ +#define __TS_FILTER_H__ + +/* + * Touchscreen filter. + * + * (c) 2008,2009 Andy Green <andy@warmcat.com> + */ + +#include <linux/platform_device.h> + +#define MAX_TS_FILTER_COORDS 3 /* X, Y and Z (pressure). */ + +struct ts_filter; +struct ts_filter_configuration; + +/* Operations that a filter can perform. */ + +struct ts_filter_api { + /* Create the filter - mandatory. */ + struct ts_filter * (*create)( + struct platform_device *pdev, + const struct ts_filter_configuration *config, + int count_coords); + /* Destroy the filter - mandatory. */ + void (*destroy)(struct ts_filter *filter); + /* Clear the filter - optional. */ + void (*clear)(struct ts_filter *filter); + + + /* + * The next three API functions only make sense if all of them are + * set for a filter. If a filter has the next three methods then + * it can propagate coordinates in the chain. + */ + + /* + * Process the filter. + * It returns non-zero if the filter reaches an error. + */ + int (*process)(struct ts_filter *filter, int *coords); + /* + * Is the filter ready to return a point? + * Please do not code side effects in this function. + */ + int (*haspoint)(struct ts_filter *filter); + /* + * Get a point. + * Do not call unless the filter actually has a point to deliver. + */ + void (*getpoint)(struct ts_filter *filter, int *coords); + + /* + * Scale the points - optional. + * A filter could only scale coordinates. + */ + void (*scale)(struct ts_filter *filter, int *coords); +}; + +/* + * Generic filter configuration. Actual configurations have this structure + * as a member. + */ +struct ts_filter_configuration { +}; + +struct ts_filter { + /* Operations for this filter. */ + const struct ts_filter_api *api; + /* Number of coordinates to process. */ + int count_coords; +}; + +#endif |