aboutsummaryrefslogtreecommitdiff
path: root/drivers/input
diff options
context:
space:
mode:
authormerging other branches <null@invalid>2008-11-26 16:07:01 +0000
committerAndy Green <agreen@pads.home.warmcat.com>2008-11-26 16:07:01 +0000
commit6d2c293d6578048e7b71e0c44897144f15f350ae (patch)
treecba36be2a06ee7bfa0aab1a3c7d36bd67ea37402 /drivers/input
parent524f4a1dfe71a8b353a244140164e09828abb68c (diff)
MERGE-via-balaji-tracking-hist-MERGE-via-stable-tracking-hist-MERGE-via-mokopatches-tracking-via-master-s3c-hsmmc-clean
balaji-tracking-hist top was efb2d57c0e0ed62324d79d6c5793fe797c157266
Diffstat (limited to 'drivers/input')
-rw-r--r--drivers/input/misc/pcf50633-input.c2
-rw-r--r--drivers/input/touchscreen/s3c2410_ts.c38
2 files changed, 25 insertions, 15 deletions
diff --git a/drivers/input/misc/pcf50633-input.c b/drivers/input/misc/pcf50633-input.c
index 6fafd2729cb..a3cc4d680e9 100644
--- a/drivers/input/misc/pcf50633-input.c
+++ b/drivers/input/misc/pcf50633-input.c
@@ -5,7 +5,7 @@
* All rights reserved.
*
* Broken down from monstrous PCF50633 driver mainly by
- * Harald Welte and Andy Green
+ * Harald Welte, Andy Green and Werner Almesberger
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
diff --git a/drivers/input/touchscreen/s3c2410_ts.c b/drivers/input/touchscreen/s3c2410_ts.c
index 8e580a833e5..253dc5b7eac 100644
--- a/drivers/input/touchscreen/s3c2410_ts.c
+++ b/drivers/input/touchscreen/s3c2410_ts.c
@@ -89,6 +89,11 @@ MODULE_LICENSE("GPL");
* Definitions & global arrays.
*/
+#define TOUCH_STANDBY_FLAG 0
+#define TOUCH_PRESSED_FLAG 1
+#define TOUCH_RELEASE_FLAG 2
+
+#define TOUCH_RELEASE_TIMEOUT (HZ >> 4)
static char *s3c2410ts_name = "s3c2410 TouchScreen";
@@ -143,23 +148,31 @@ static void ts_input_report(int event)
}
#endif
}
+
+static void touch_timer_fire(unsigned long data);
+static struct timer_list touch_timer =
+ TIMER_INITIALIZER(touch_timer_fire, 0, 0);
+
static void touch_timer_fire(unsigned long data)
{
if (ts.tsf[0])
(ts.tsf[0]->api->scale)(ts.tsf[0], &ts.coords[0]);
- if (ts.need_to_send_first_touch) {
- ts.need_to_send_first_touch = 0;
- ts_input_report(IE_DOWN);
- if (!ts.is_down) { /* Do we need this? I think so. */
+ if (ts.is_down && ts.need_to_send_first_touch == TOUCH_RELEASE_FLAG)
+ ts.need_to_send_first_touch = TOUCH_PRESSED_FLAG;
+
+ if ( ts.is_down ) {
+ if ( ts.need_to_send_first_touch == TOUCH_STANDBY_FLAG )
+ ts_input_report(IE_DOWN);
+ else
ts_input_report(IE_UPDATE);
- ts_input_report(IE_UP);
- }
- } else if (ts.is_down) {
- ts_input_report(IE_UPDATE);
- } else {
+ ts.need_to_send_first_touch = TOUCH_PRESSED_FLAG;
+ } else if (ts.need_to_send_first_touch == TOUCH_RELEASE_FLAG)
ts_input_report(IE_UP);
- }
+ else {
+ ts.need_to_send_first_touch = TOUCH_RELEASE_FLAG;
+ mod_timer(&touch_timer, jiffies + TOUCH_RELEASE_TIMEOUT);
+ }
if (ts.is_down) {
writel(S3C2410_ADCTSC_PULL_UP_DISABLE | AUTOPST,
@@ -173,9 +186,6 @@ static void touch_timer_fire(unsigned long data)
}
}
-static struct timer_list touch_timer =
- TIMER_INITIALIZER(touch_timer_fire, 0, 0);
-
static irqreturn_t stylus_updown(int irq, void *dev_id)
{
unsigned long data0;
@@ -188,7 +198,6 @@ static irqreturn_t stylus_updown(int irq, void *dev_id)
(!(data1 & S3C2410_ADCDAT0_UPDOWN));
if (ts.is_down) {
- ts.need_to_send_first_touch = 1;
writel(S3C2410_ADCTSC_PULL_UP_DISABLE | AUTOPST,
base_addr+S3C2410_ADCTSC);
writel(readl(base_addr+S3C2410_ADCCON) |
@@ -316,6 +325,7 @@ static int __init s3c2410ts_probe(struct platform_device *pdev)
ts.dev->id.vendor = 0xDEAD;
ts.dev->id.product = 0xBEEF;
ts.dev->id.version = S3C2410TSVERSION;
+ ts.need_to_send_first_touch = TOUCH_STANDBY_FLAG;
/* create the filter chain set up for the 2 coordinates we produce */
ret = ts_filter_create_chain(