1 #ifndef __TS_FILTER_H__
2 #define __TS_FILTER_H__
7 * (c) 2008,2009 Andy Green <andy@openmoko.com>
10 #include <linux/platform_device.h>
12 #define MAX_TS_FILTER_COORDS 3 /* X, Y and Z (pressure). */
15 struct ts_filter_configuration
;
17 /* Operations that a filter can perform. */
19 struct ts_filter_api
{
20 /* Create the filter - mandatory. */
21 struct ts_filter
* (*create
)(
22 struct platform_device
*pdev
,
23 const struct ts_filter_configuration
*config
,
25 /* Destroy the filter - mandatory. */
26 void (*destroy
)(struct ts_filter
*filter
);
27 /* Clear the filter - optional. */
28 void (*clear
)(struct ts_filter
*filter
);
32 * The next three API functions only make sense if all of them are
33 * set for a filter. If a filter has the next three methods then
34 * it can propagate coordinates in the chain.
39 * It returns non-zero if the filter reaches an error.
41 int (*process
)(struct ts_filter
*filter
, int *coords
);
43 * Is the filter ready to return a point?
44 * Please do not code side effects in this function.
46 int (*haspoint
)(struct ts_filter
*filter
);
49 * Do not call unless the filter actually has a point to deliver.
51 void (*getpoint
)(struct ts_filter
*filter
, int *coords
);
54 * Scale the points - optional.
55 * A filter could only scale coordinates.
57 void (*scale
)(struct ts_filter
*filter
, int *coords
);
61 * Generic filter configuration. Actual configurations have this structure
64 struct ts_filter_configuration
{
68 /* Operations for this filter. */
69 const struct ts_filter_api
*api
;
70 /* Number of coordinates to process. */