aboutsummaryrefslogtreecommitdiff
path: root/arch/arm/mach-s3c2410
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 /arch/arm/mach-s3c2410
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 'arch/arm/mach-s3c2410')
-rw-r--r--arch/arm/mach-s3c2410/include/mach/ts.h18
-rw-r--r--arch/arm/mach-s3c2410/mach-gta01.c65
2 files changed, 37 insertions, 46 deletions
diff --git a/arch/arm/mach-s3c2410/include/mach/ts.h b/arch/arm/mach-s3c2410/include/mach/ts.h
index 1b451ea1624..0600b306a34 100644
--- a/arch/arm/mach-s3c2410/include/mach/ts.h
+++ b/arch/arm/mach-s3c2410/include/mach/ts.h
@@ -19,17 +19,17 @@
#include <../drivers/input/touchscreen/ts_filter.h>
struct s3c2410_ts_mach_info {
- int delay;
- int presc;
- /* array of pointers to filter APIs we want to use, in order
- * ends on first NULL, all NULL is OK
- */
- struct ts_filter_api *filter_sequence[MAX_TS_FILTER_CHAIN];
- /* array of configuration ints, one for each filter above */
- void *filter_config[MAX_TS_FILTER_CHAIN];
+ /* Touchscreen delay. */
+ int delay;
+ /* Prescaler value. */
+ int presc;
+ /*
+ * Null-terminated array of pointers to filter APIs and configurations
+ * we want to use. In the same order they will be applied.
+ */
+ struct ts_filter_configuration *filter_config;
};
void set_s3c2410ts_info(struct s3c2410_ts_mach_info *hard_s3c2410ts_info);
#endif /* __ASM_ARM_TS_H */
-
diff --git a/arch/arm/mach-s3c2410/mach-gta01.c b/arch/arm/mach-s3c2410/mach-gta01.c
index df76347a8f0..d40cd838ede 100644
--- a/arch/arm/mach-s3c2410/mach-gta01.c
+++ b/arch/arm/mach-s3c2410/mach-gta01.c
@@ -702,59 +702,50 @@ static struct s3c2410_udc_mach_info gta01_udc_cfg = {
.vbus_draw = gta01_udc_vbus_draw,
};
+/* Touchscreen configuration. */
-/* touchscreen configuration */
#ifdef CONFIG_TOUCHSCREEN_FILTER
-static struct ts_filter_linear_configuration gta01_ts_linear_config = {
- .constants = {1, 0, 0, 0, 1, 0, 1}, /* don't modify coords */
- .coord0 = 0,
- .coord1 = 1,
-};
-
-static struct ts_filter_group_configuration gta01_ts_group_config = {
- .extent = 12,
+static struct ts_filter_group_configuration gta01_ts_group = {
+ .length = 12,
.close_enough = 10,
- .threshold = 6, /* at least half of the points in a group */
+ .threshold = 6, /* At least half of the points in a group. */
.attempts = 10,
};
-static struct ts_filter_median_configuration gta01_ts_median_config = {
- .extent = 31,
- .decimation_below = 24,
+static struct ts_filter_median_configuration gta01_ts_median = {
+ .extent = 20,
+ .decimation_below = 3,
.decimation_threshold = 8 * 3,
- .decimation_above = 12,
+ .decimation_above = 4,
};
-static struct ts_filter_mean_configuration gta01_ts_mean_config = {
- .bits_filter_length = 5,
- .averaging_threshold = 12
+static struct ts_filter_mean_configuration gta01_ts_mean = {
+ .length = 4,
};
-static struct s3c2410_ts_mach_info gta01_ts_cfg = {
- .delay = 10000,
- .presc = 0xff, /* slow as we can go */
- .filter_sequence = {
- [0] = &ts_filter_group_api,
- [1] = &ts_filter_median_api,
- [2] = &ts_filter_mean_api,
- [3] = &ts_filter_linear_api,
- },
- .filter_config = {
- [0] = &gta01_ts_group_config,
- [1] = &gta01_ts_median_config,
- [2] = &gta01_ts_mean_config,
- [3] = &gta01_ts_linear_config,
- },
+static struct ts_filter_linear_configuration gta01_ts_linear = {
+ .constants = {1, 0, 0, 0, 1, 0, 1}, /* Don't modify coords. */
+ .coord0 = 0,
+ .coord1 = 1,
+};
+#endif
+
+struct ts_filter_configuration filter_configuration[] =
+{
+#ifdef CONFIG_TOUCHSCREEN_FILTER
+ {&ts_filter_group_api, &gta01_ts_group.config},
+ {&ts_filter_median_api, &gta01_ts_median.config},
+ {&ts_filter_mean_api, &gta01_ts_mean.config},
+ {&ts_filter_linear_api, &gta01_ts_linear.config},
+#endif
+ {NULL, NULL},
};
-#else /* !CONFIG_TOUCHSCREEN_FILTER */
+
static struct s3c2410_ts_mach_info gta01_ts_cfg = {
.delay = 10000,
.presc = 0xff, /* slow as we can go */
- .filter_sequence = { NULL },
- .filter_config = { NULL },
+ .filter_config = filter_configuration,
};
-#endif
-
/* SPI */