diff options
author | Andy Green <andy@openmoko.com> | 2008-11-19 17:11:06 +0000 |
---|---|---|
committer | Andy Green <agreen@pads.home.warmcat.com> | 2008-11-19 17:11:06 +0000 |
commit | d082ca932a9d03105fe26881ee860e7ff7025a9d (patch) | |
tree | 04253fc0920a760167d873d1c850bdbe0863bbb2 /arch/arm/mach-s3c2410 | |
parent | 4c1c1b07611390857b93f515a284dae2de3115d7 (diff) |
test-touchscreen-median.patch
Signed-off-by: Andy Green <andy@openmoko.com>
Diffstat (limited to 'arch/arm/mach-s3c2410')
-rw-r--r-- | arch/arm/mach-s3c2410/include/mach/ts.h | 15 | ||||
-rw-r--r-- | arch/arm/mach-s3c2410/mach-gta01.c | 34 |
2 files changed, 35 insertions, 14 deletions
diff --git a/arch/arm/mach-s3c2410/include/mach/ts.h b/arch/arm/mach-s3c2410/include/mach/ts.h index 6fa75f6c0ab..ab4433f10bd 100644 --- a/arch/arm/mach-s3c2410/include/mach/ts.h +++ b/arch/arm/mach-s3c2410/include/mach/ts.h @@ -16,12 +16,17 @@ #ifndef __ASM_ARM_TS_H #define __ASM_ARM_TS_H +#include <linux/ts_filter.h> + struct s3c2410_ts_mach_info { - int delay; - int presc; - int oversampling_shift; - int excursion_filter_len_bits; - int reject_threshold_vs_avg; + 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]; }; void set_s3c2410ts_info(struct s3c2410_ts_mach_info *hard_s3c2410ts_info); diff --git a/arch/arm/mach-s3c2410/mach-gta01.c b/arch/arm/mach-s3c2410/mach-gta01.c index 47377bd3da0..e718a810f42 100644 --- a/arch/arm/mach-s3c2410/mach-gta01.c +++ b/arch/arm/mach-s3c2410/mach-gta01.c @@ -505,19 +505,35 @@ static struct s3c2410_udc_mach_info gta01_udc_cfg = { .vbus_draw = gta01_udc_vbus_draw, }; + +/* touchscreen configuration */ + +static struct ts_filter_median_configuration gta01_ts_median_config = { + .extent = 31, + .decimation_below = 24, + .decimation_threshold = 8 * 3, + .decimation_above = 12, +}; + +static struct ts_filter_mean_configuration gta01_ts_mean_config = { + .bits_filter_length = 5, + .averaging_threshold = 12 +}; + static struct s3c2410_ts_mach_info gta01_ts_cfg = { .delay = 10000, - .presc = 50000000 / 1000000, /* 50 MHz PCLK / 1MHz */ - /* simple averaging, 2^n samples */ - .oversampling_shift = 5, - /* averaging filter length, 2^n */ - .excursion_filter_len_bits = 5, - /* flagged for beauty contest on next sample if differs from - * average more than this - */ - .reject_threshold_vs_avg = 2, + .presc = 0xff, /* slow as we can go */ + .filter_sequence = { + [0] = &ts_filter_median_api, + [1] = &ts_filter_mean_api, + }, + .filter_config = { + [0] = >a01_ts_median_config, + [1] = >a01_ts_mean_config, + }, }; + /* SPI */ static void gta01_jbt6k74_reset(int devidx, int level) |