1 #ifndef __TS_FILTER_H__
2 #define __TS_FILTER_H__
7 * (c) 2008 Andy Green <andy@openmoko.com>
10 #include <linux/platform_device.h>
12 #define MAX_TS_FILTER_CHAIN 8 /* Max. filters we can chain up. */
13 #define MAX_TS_FILTER_COORDS 3 /* X, Y and Z (pressure). */
17 /* Operations that a filter can perform. */
19 struct ts_filter_api
{
20 struct ts_filter
* (*create
)(struct platform_device
*pdev
, void *config
,
22 void (*destroy
)(struct platform_device
*pdev
, struct ts_filter
*filter
);
23 void (*clear
)(struct ts_filter
*filter
);
24 int (*process
)(struct ts_filter
*filter
, int *coords
);
25 void (*scale
)(struct ts_filter
*filter
, int *coords
);
29 * This is the common part of all filters.
30 * We use this type as an otherwise opaque handle on to
31 * the actual filter. Therefore you need one of these
32 * at the start of your actual filter struct.
36 struct ts_filter
*next
; /* Next in chain. */
37 struct ts_filter_api
*api
; /* Operations to use for this object. */
39 int coords
[MAX_TS_FILTER_COORDS
];
43 * Helper to create a filter chain from an array of API pointers and
44 * array of config ints. Leaves pointers to created filters in arr
45 * array and fills in ->next pointers to create the chain.
48 #ifdef CONFIG_TOUCHSCREEN_FILTER
49 extern int ts_filter_create_chain(struct platform_device
*pdev
,
50 struct ts_filter_api
**api
, void **config
,
51 struct ts_filter
**arr
, int count_coords
);
53 /* Helper to destroy a whole chain from the list of filter pointers. */
55 extern void ts_filter_destroy_chain(struct platform_device
*pdev
,
56 struct ts_filter
**arr
);
58 #define ts_filter_create_chain(pdev, api, config, arr, count_coords) (0)
59 #define ts_filter_destroy_chain(pdev, arr) do { } while (0)