aboutsummaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorAndy Green <andy@openmoko.com>2008-11-19 17:11:06 +0000
committerAndy Green <agreen@pads.home.warmcat.com>2008-11-19 17:11:06 +0000
commitd082ca932a9d03105fe26881ee860e7ff7025a9d (patch)
tree04253fc0920a760167d873d1c850bdbe0863bbb2 /arch
parent4c1c1b07611390857b93f515a284dae2de3115d7 (diff)
test-touchscreen-median.patch
Signed-off-by: Andy Green <andy@openmoko.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-s3c2410/include/mach/ts.h15
-rw-r--r--arch/arm/mach-s3c2410/mach-gta01.c34
-rw-r--r--arch/arm/mach-s3c2440/mach-gta02.c37
3 files changed, 62 insertions, 24 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] = &gta01_ts_median_config,
+ [1] = &gta01_ts_mean_config,
+ },
};
+
/* SPI */
static void gta01_jbt6k74_reset(int devidx, int level)
diff --git a/arch/arm/mach-s3c2440/mach-gta02.c b/arch/arm/mach-s3c2440/mach-gta02.c
index 0ccb7fba850..6b44f1731b6 100644
--- a/arch/arm/mach-s3c2440/mach-gta02.c
+++ b/arch/arm/mach-s3c2440/mach-gta02.c
@@ -92,6 +92,9 @@
#include "../plat-s3c24xx/neo1973_pm_gps.h"
+#include <linux/ts_filter_mean.h>
+#include <linux/ts_filter_median.h>
+
/* arbitrates which sensor IRQ owns the shared SPI bus */
static spinlock_t motion_irq_lock;
@@ -939,20 +942,34 @@ static struct s3c2410_udc_mach_info gta02_udc_cfg = {
};
+
+/* touchscreen configuration */
+
+static struct ts_filter_median_configuration gta02_ts_median_config = {
+ .extent = 31,
+ .decimation_below = 28,
+ .decimation_threshold = 8 * 3,
+ .decimation_above = 12,
+};
+
+static struct ts_filter_mean_configuration gta02_ts_mean_config = {
+ .bits_filter_length = 3,
+ .averaging_threshold = 6 * 3,
+};
+
static struct s3c2410_ts_mach_info gta02_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] = &gta02_ts_median_config,
+ [1] = &gta02_ts_mean_config,
+ },
};
-
/* SPI: LCM control interface attached to Glamo3362 */
static void gta02_jbt6k74_reset(int devidx, int level)