diff options
author | Nelson Castillo <arhuaco@freaks-unidos.net> | 2009-03-10 12:04:16 +0000 |
---|---|---|
committer | Andy Green <agreen@octopus.localdomain> | 2009-03-10 12:04:16 +0000 |
commit | 9e58a18567ec1ef306ea7b973749e5cd9902702c (patch) | |
tree | dbb5cbc62e0d91c6b185faad5bf93acf6b2733a6 /arch/arm/mach-s3c2442 | |
parent | bd88fa696f505a8a71484341e4fcde581b2d12a6 (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-s3c2442')
-rw-r--r-- | arch/arm/mach-s3c2442/mach-gta02.c | 58 |
1 files changed, 27 insertions, 31 deletions
diff --git a/arch/arm/mach-s3c2442/mach-gta02.c b/arch/arm/mach-s3c2442/mach-gta02.c index 5745195db05..49cf09ee124 100644 --- a/arch/arm/mach-s3c2442/mach-gta02.c +++ b/arch/arm/mach-s3c2442/mach-gta02.c @@ -949,56 +949,52 @@ static struct s3c2410_udc_mach_info gta02_udc_cfg = { }; -/* touchscreen configuration */ -#ifdef CONFIG_TOUCHSCREEN_FILTER -static struct ts_filter_linear_configuration gta02_ts_linear_config = { - .constants = {1, 0, 0, 0, 1, 0, 1}, /* don't modify coords */ - .coord0 = 0, - .coord1 = 1, -}; +/* Touchscreen configuration. */ -static struct ts_filter_group_configuration gta02_ts_group_config = { - .extent = 12, +#ifdef CONFIG_TOUCHSCREEN_FILTER +static struct ts_filter_group_configuration gta02_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 gta02_ts_median_config = { +static struct ts_filter_median_configuration gta02_ts_median = { .extent = 20, .decimation_below = 3, .decimation_threshold = 8 * 3, .decimation_above = 4, }; -static struct ts_filter_mean_configuration gta02_ts_mean_config = { +static struct ts_filter_mean_configuration gta02_ts_mean = { .length = 4, }; -static struct s3c2410_ts_mach_info gta02_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] = >a02_ts_group_config, - [1] = >a02_ts_median_config, - [2] = >a02_ts_mean_config, - [3] = >a02_ts_linear_config, - }, +static struct ts_filter_linear_configuration gta02_ts_linear = { + .constants = {1, 0, 0, 0, 1, 0, 1}, /* Don't modify coords. */ + .coord0 = 0, + .coord1 = 1, }; -#else /* !CONFIG_TOUCHSCREEN_FILTER */ +#endif + +struct ts_filter_configuration filter_configuration[] = +{ +#ifdef CONFIG_TOUCHSCREEN_FILTER + {&ts_filter_group_api, >a02_ts_group.config}, + {&ts_filter_median_api, >a02_ts_median.config}, + {&ts_filter_mean_api, >a02_ts_mean.config}, + {&ts_filter_linear_api, >a02_ts_linear.config}, +#endif + {NULL, NULL}, +}; + static struct s3c2410_ts_mach_info gta02_ts_cfg = { .delay = 10000, .presc = 0xff, /* slow as we can go */ - .filter_sequence = { NULL }, - .filter_config = { NULL }, + .filter_config = filter_configuration, }; -#endif + + static void gta02_bl_set_intensity(int intensity) { |