Hi Johnny, please make sure to keep [email protected]
always in the Cc (I've attached your patch to this mail for the
reference of other readers of that list).
I've also explicitly Cc'ed the author of the original 2410 touchscreen
driver, Arnaud Patard.
I'm not entirely sure if that patch really belongs into kernel space.
The kernel touchscreen driver has the task of passing on raw touchscreen
X/Y samples to the userspace, where tslib will take care of all the
post-processing.
Can you please explain exactly what you are trying to do in your code?
I can read it, but it is not entirely obvious to me what you're trying
to do. Basically you only want to report a touchscreen press after 30
consecutive samples have indicated that it was pressed?
Is this something specific about the touchscreen that hxd8 uses? Is it
particularly sensitive?
Once I know more about this, we can decide if the same can be achieved
by either a different tslib configuration, or a tslib module.
Thanks.
--
- Harald Welte <[EMAIL PROTECTED]> http://openmoko.org/
============================================================================
Software for the world's first truly open Free Software mobile phone
Index: linux-2.6.21/drivers/input/touchscreen/Kconfig
===================================================================
--- linux-2.6.21.orig/drivers/input/touchscreen/Kconfig 2007-05-26 16:04:41.000000000 +0800
+++ linux-2.6.21/drivers/input/touchscreen/Kconfig 2007-05-26 16:07:15.000000000 +0800
@@ -66,6 +66,12 @@
To compile this driver as a module, choose M here: the
module will be called s3c2410_ts.
+config TOUCHSCREEN_S3C2410_SMOOTH
+ boolean "Samsung S3C2410 touchscreen smoothing"
+ depends on TOUCHSCREEN_S3C2410
+ help
+ Select this if you want smooth the touchscreen
+
config TOUCHSCREEN_S3C2410_DEBUG
boolean "Samsung S3C2410 touchscreen debug messages"
depends on TOUCHSCREEN_S3C2410
Index: linux-2.6.21/drivers/input/touchscreen/s3c2410_ts.c
===================================================================
--- linux-2.6.21.orig/drivers/input/touchscreen/s3c2410_ts.c 2007-05-26 16:04:41.000000000 +0800
+++ linux-2.6.21/drivers/input/touchscreen/s3c2410_ts.c 2007-05-26 16:10:32.000000000 +0800
@@ -94,7 +94,9 @@
static struct s3c2410ts ts;
static void __iomem *base_addr;
-
+#ifdef CONFIG_TOUCHSCREEN_S3C2410_SMOOTH
+static int unexp_touch = 0; /* prevent unexpected touching and smooth the touching*/
+#endif
static inline void s3c2410_ts_connect(void)
{
s3c2410_gpio_cfgpin(S3C2410_GPG12, S3C2410_GPG12_XMON);
@@ -172,7 +174,10 @@
if (updown)
touch_timer_fire(0);
-
+#ifdef CONFIG_TOUCHSCREEN_S3C2410_SMOOTH
+ else
+ unexp_touch = 0;
+#endif
return IRQ_HANDLED;
}
@@ -181,7 +186,15 @@
{
unsigned long data0;
unsigned long data1;
-
+#ifdef CONFIG_TOUCHSCREEN_S3C2410_SMOOTH
+ if (unexp_touch < 30)
+ {
+ unexp_touch++;
+ writel(S3C2410_ADCTSC_PULL_UP_DISABLE | AUTOPST, base_addr+S3C2410_ADCTSC);
+ writel(readl(base_addr+S3C2410_ADCCON) | S3C2410_ADCCON_ENABLE_START, base_addr+S3C2410_ADCCON);
+ return IRQ_HANDLED;
+ }
+#endif
data0 = readl(base_addr+S3C2410_ADCDAT0);
data1 = readl(base_addr+S3C2410_ADCDAT1);
Index: linux-2.6.21/arch/arm/mach-s3c2440/mach-hxd8.c
===================================================================
--- linux-2.6.21.orig/arch/arm/mach-s3c2440/mach-hxd8.c 2007-05-26 16:17:11.000000000 +0800
+++ linux-2.6.21/arch/arm/mach-s3c2440/mach-hxd8.c 2007-05-26 16:17:19.000000000 +0800
@@ -343,7 +343,7 @@
static struct s3c2410_ts_mach_info hxd8_ts_cfg = {
.delay = 10000,
.presc = 49,
- .oversampling_shift = 2,
+ .oversampling_shift = 4,
};
static struct platform_device *hxd8_devices[] __initdata = {