aboutsummaryrefslogtreecommitdiff
path: root/drivers/input/touchscreen/ts_filter.h
diff options
context:
space:
mode:
authorNelson Castillo <arhuaco@freaks-unidos.net>2009-03-10 12:04:16 +0000
committerAndy Green <agreen@octopus.localdomain>2009-03-10 12:04:16 +0000
commit9e58a18567ec1ef306ea7b973749e5cd9902702c (patch)
treedbb5cbc62e0d91c6b185faad5bf93acf6b2733a6 /drivers/input/touchscreen/ts_filter.h
parentbd88fa696f505a8a71484341e4fcde581b2d12a6 (diff)
Use non-void configurations
This patch defines a ts_filter_configuration structure to avoid using void* in the filter initialization, fixing another upstream correction. This also makes the initialization more readable. Tested in GTA02/rev6. Other changes: ~ Comment filter configuration structures. ~ ts_filter.c:ts_filter_chain_create improved. ~ Small cleanups. ~ More TODOs/FIXMEs. ~ Updated GTA02 filter configuration. ~ Updated GTA01 filter configuration. ~ Updated mach-s3c2410/include/mach/ts.h for the new ts. configuration structure. ~ Updated all the filters to use the new configuration structure. ~ Removed MAX_TS_FILTER_CHAIN constant that is no longer needed. No more evil casts left it seems. Signed-off-by: Nelson Castillo <arhuaco@freaks-unidos.net>
Diffstat (limited to 'drivers/input/touchscreen/ts_filter.h')
-rw-r--r--drivers/input/touchscreen/ts_filter.h30
1 files changed, 19 insertions, 11 deletions
diff --git a/drivers/input/touchscreen/ts_filter.h b/drivers/input/touchscreen/ts_filter.h
index b5e8c7c3845..630ea51aa78 100644
--- a/drivers/input/touchscreen/ts_filter.h
+++ b/drivers/input/touchscreen/ts_filter.h
@@ -9,16 +9,17 @@
#include <linux/platform_device.h>
-#define MAX_TS_FILTER_CHAIN 8 /* Max. filters we can chain up. */
#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, void *config,
+ struct ts_filter * (*create)(struct platform_device *pdev,
+ struct ts_filter_configuration *config,
int count_coords);
/* Destroy the filter - mandatory. */
void (*destroy)(struct ts_filter *filter);
@@ -56,15 +57,21 @@ struct ts_filter_api {
};
/*
- * This is the common part of all filters.
- * We use this type as an otherwise opaque handle on to
- * the actual filter. Therefore you need one of these
- * at the start of your actual filter struct.
+ * Generic filter configuration. Actual configurations have this structure
+ * as a member.
*/
+struct ts_filter_configuration {
+ /* API to use */
+ struct ts_filter_api *api;
+ /* Generic filter configuration. Different for each filter. */
+ struct ts_filter_configuration *config;
+};
+
struct ts_filter {
- struct ts_filter_api *api; /* operations for this filter */
- int count_coords; /* how many coordinates to process */
- int coords[MAX_TS_FILTER_COORDS]; /* count_coords coordinates */
+ /* Operations for this filter. */
+ struct ts_filter_api *api;
+ /* Number of coordinates to process. */
+ int count_coords;
};
#ifdef CONFIG_TOUCHSCREEN_FILTER
@@ -75,7 +82,8 @@ struct ts_filter {
*/
extern struct ts_filter **ts_filter_chain_create(
struct platform_device *pdev,
- struct ts_filter_api **api, void **config, int count_coords);
+ struct ts_filter_configuration conf[],
+ int count_coords);
/* Helper to destroy a whole chain from the list of filter pointers. */
extern void ts_filter_chain_destroy(struct ts_filter **arr);
@@ -94,7 +102,7 @@ extern void ts_filter_chain_clear(struct ts_filter **arr);
int ts_filter_chain_feed(struct ts_filter **arr, int *coords);
#else /* !CONFIG_TOUCHSCREEN_FILTER */
-#define ts_filter_chain_create(pdev, api, config, arr, count_coords) (0)
+#define ts_filter_chain_create(pdev, config, count_coords) (0) /*TODO:fail!*/
#define ts_filter_chain_destroy(pdev, arr) do { } while (0)
#define ts_filter_chain_clear(arr) do { } while (0)
#define ts_filter_chain_feed(arr, coords) (1)