aboutsummaryrefslogtreecommitdiff
path: root/drivers/input/touchscreen/ts_filter_mean.h
diff options
context:
space:
mode:
authorNelson Castillo <arhuaco@freaks-unidos.net>2009-03-10 12:04:05 +0000
committerAndy Green <agreen@octopus.localdomain>2009-03-10 12:04:05 +0000
commitbd88fa696f505a8a71484341e4fcde581b2d12a6 (patch)
treebca483a0c57848ca6d122907c42a0c7c04fbeb4a /drivers/input/touchscreen/ts_filter_mean.h
parent45aeeebf673b03329c423c2382a836ca878dd851 (diff)
Improve filter API and update filters
This patch turns upstream feedback into API modifications and code improvements. There will be more patches implementing upstream corrections but this one is the that will make most of the invasive changes and make the most important improvements to the API. Tested in a GTA02/rev06. The goals of this patch are: * Replace recursive calls with iteration. * General code improvements. * Make ts_filter_mean.c a reference for the rest of the filters. * Make the (almost)minimum number of changes to the other filters so that they compile and work, patches for cleaning these up will come next. * Filters should do what they were doing before. Some important changes: * Move "struct ts_filter tsf" in the private structures to force a crash (or break things) if we forget to remove an open-coded cast. * ts_filter.c/ts_filter.h ~ API modifications. * s3c2410_ts.c: ~ Use the new API. ~ Cleanups. * ts_filter_mean.c ~ Replace with a simple mean. ~ Use as a reference for the new API. ~ Move private structure from the .h to the .c. * ts_filter_group.c ~ Update to use the new API. * ts_filter_median.c ~ Update to use the new API. * ts_filter_linear.c ~ Remove functions that are no longer needed. Note: I might leave some TODOs and FIXMEs with this patch. Most of them will be removed shortly. Signed-off-by: Nelson Castillo <arhuaco@freaks-unidos.net>
Diffstat (limited to 'drivers/input/touchscreen/ts_filter_mean.h')
-rw-r--r--drivers/input/touchscreen/ts_filter_mean.h25
1 files changed, 8 insertions, 17 deletions
diff --git a/drivers/input/touchscreen/ts_filter_mean.h b/drivers/input/touchscreen/ts_filter_mean.h
index 44c506c99c0..5677ed89019 100644
--- a/drivers/input/touchscreen/ts_filter_mean.h
+++ b/drivers/input/touchscreen/ts_filter_mean.h
@@ -8,27 +8,18 @@
*
* mean
*
- * (c) 2008 Andy Green <andy@openmoko.com>
+ * (c) 2008,2009
+ * Andy Green <andy@openmoko.com>
+ * Nelson Castillo <arhuaco@freaks-unidos.net>
*/
+/* Configuration for this filter. */
struct ts_filter_mean_configuration {
- int bits_filter_length;
- int averaging_threshold;
-
- int extent;
-};
-
-struct ts_filter_mean {
- struct ts_filter tsf;
- struct ts_filter_mean_configuration *config;
-
- int reported[MAX_TS_FILTER_COORDS];
- int lowpass[MAX_TS_FILTER_COORDS];
- int *fifo[MAX_TS_FILTER_COORDS];
- int fhead[MAX_TS_FILTER_COORDS];
- int ftail[MAX_TS_FILTER_COORDS];
+ /* Number of points for the mean. */
+ int length;
};
+/* API functions for the mean filter */
extern struct ts_filter_api ts_filter_mean_api;
-#endif
+#endif /* __TS_FILTER_MEAN_H__ */