1 #ifndef __TS_FILTER_CHAIN_H__
2 #define __TS_FILTER_CHAIN_H__
5 * Touchscreen filter chains.
7 * (c) 2008,2009 Andy Green <andy@openmoko.com>
10 #include "ts_filter.h"
12 #include <linux/err.h>
14 struct ts_filter_chain_configuration
{
16 const struct ts_filter_api
*api
;
17 /* Generic filter configuration. Different for each filter. */
18 const struct ts_filter_configuration
*config
;
21 struct ts_filter_chain
;
23 #ifdef CONFIG_TOUCHSCREEN_FILTER
26 * Create a filter chain. It will allocate an array of
27 * null-terminated pointers to filters. On error it will return
28 * an error you can check with IS_ERR.
30 extern struct ts_filter_chain
*ts_filter_chain_create(
31 struct platform_device
*pdev
,
32 const struct ts_filter_chain_configuration conf
[],
35 /* Destroy the chain. */
36 extern void ts_filter_chain_destroy(struct ts_filter_chain
*c
);
38 /* Clear the filter chain. */
39 extern void ts_filter_chain_clear(struct ts_filter_chain
*c
);
42 * Try to get one point. Returns 0 if no points are available.
43 * coords will be used as temporal space, thus you supply a point
44 * using coords but you shouldn't rely on its value on return unless
45 * it returns a nonzero value that is not -1.
46 * If one of the filters find an error then this function will
49 int ts_filter_chain_feed(struct ts_filter_chain
*c
, int *coords
);
51 #else /* !CONFIG_TOUCHSCREEN_FILTER */
52 #define ts_filter_chain_create(pdev, config, count_coords) (NULL)
53 #define ts_filter_chain_destroy(c) do { } while (0)
54 #define ts_filter_chain_clear(c) do { } while (0)
55 #define ts_filter_chain_feed(c, coords) (1)