aboutsummaryrefslogtreecommitdiff
path: root/include/asm-arm
diff options
context:
space:
mode:
authorAndy Green <andy@openmoko.com>2008-11-19 17:09:52 +0000
committerAndy Green <agreen@pads.home.warmcat.com>2008-11-19 17:09:52 +0000
commit06978a2e455de33d8222fce251780437a8589bab (patch)
tree054dc204963f33f2e5c4ca4c681d2dc9090ed893 /include/asm-arm
parentf66212923fd6424f06c274184ad6eb2e67f45d2f (diff)
touchscreen-meddling.patch
Touchscreen on GTA01-02 experiences noise on the channel that serves the "tall axis" of the LCM. The sample quality of the other axis is good. The bad samples have a characteristic of one shot excursions that can reach +/- 20% or more of the sample average. Previously, we had a simple averaging scheme going in the touchscreen driver that summed up 32 x and ys and then divided it by 32. This patch first tidies up the existing code for style, then adds a new "running average" concept with a FIFO. The running average is separate from the summing average mentioned above, and is accurate for the last n samples sample-by-sample, where n is set by 1 << excursion_filter_len_bits in the machine / platform stuff. The heuristic the patch implements for the filtering is to accept all samples, but tag the *previous* sample with a flag if it differed from the running average by more than reject_threshold_vs_avg in either axis. The next sample time, a beauty contest is held if the flag was set to decide if we think the previous sample was a one-shot excursion (detected by the new sample being closer to the average than to the flagged previous sample), or if we believe we are moving (detected by the new sample being closer to the flagged previous sample than the average. In the case that we believe the previous sample was an excursion, we simply overwrite it with the new data and adjust the summing average to use the new data instead of the excursion data. I only tested this by eyeballing the output of ts_print_raw, but it seemed to be quite a bit better. Gross movement appeared to be tracked fine too. If folks want to try different heuristics on top of this patch, be my guest; either way feedback on what it looks like with a graphical app would be good. Signed-off-by: Andy Green <andy@openmoko.com>
Diffstat (limited to 'include/asm-arm')
-rw-r--r--include/asm-arm/arch-s3c2410/ts.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/include/asm-arm/arch-s3c2410/ts.h b/include/asm-arm/arch-s3c2410/ts.h
index 593632a43b6..44c1e4b2cf7 100644
--- a/include/asm-arm/arch-s3c2410/ts.h
+++ b/include/asm-arm/arch-s3c2410/ts.h
@@ -17,9 +17,11 @@
#define __ASM_ARM_TS_H
struct s3c2410_ts_mach_info {
- int delay;
- int presc;
- int oversampling_shift;
+ int delay;
+ int presc;
+ int oversampling_shift;
+ int excursion_filter_len_bits;
+ int reject_threshold_vs_avg;
};
void set_s3c2410ts_info(struct s3c2410_ts_mach_info *hard_s3c2410ts_info);