From d082ca932a9d03105fe26881ee860e7ff7025a9d Mon Sep 17 00:00:00 2001 From: Andy Green Date: Wed, 19 Nov 2008 17:11:06 +0000 Subject: test-touchscreen-median.patch Signed-off-by: Andy Green --- arch/arm/mach-s3c2410/mach-gta01.c | 34 +++++++++++++++++++++++++--------- 1 file changed, 25 insertions(+), 9 deletions(-) (limited to 'arch/arm/mach-s3c2410/mach-gta01.c') 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) -- cgit v1.2.3