Modified the input_set_abs_params() for ABS_X and ABS_Y to introduce
+/-4 units of fuzz on input.  Given that the input tool for a touchscreen
is a non-precise finger, a typical press is met with a lot of input jitter.

The fuzz change improves this input scenario so that upper layer
toolkits can work correctly.

While making the above change, the patch also switches from doing direct
bit-banging on the input_dev structure to using the input_set_capability()
functions.

Signed-off-by: James Ketrenos <jketr...@linux.intel.com>
---
 drivers/input/touchscreen/cy8ctmg110_ts.c |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/input/touchscreen/cy8ctmg110_ts.c b/drivers/input/touchscreen/cy8ctmg110_ts.c
index 1337371..e8c499a 100644
--- a/drivers/input/touchscreen/cy8ctmg110_ts.c
+++ b/drivers/input/touchscreen/cy8ctmg110_ts.c
@@ -301,15 +301,15 @@ static int cy8ctmg110_probe(struct i2c_client *client,

     spin_lock_init(&ts->lock);

-    input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS);
-    input_dev->keybit[BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH);
-
     input_set_capability(input_dev, EV_KEY, BTN_TOUCH);
-
-    input_set_abs_params(input_dev, ABS_X,
-            CY8CTMG110_X_MIN, CY8CTMG110_X_MAX, 0, 0);
-    input_set_abs_params(input_dev, ABS_Y,
-            CY8CTMG110_Y_MIN, CY8CTMG110_Y_MAX, 0, 0);
+    input_set_capability(input_dev, EV_ABS, ABS_X);
+    input_set_capability(input_dev, EV_ABS, ABS_Y);
+
+    /* Initialize these with 4 fuzz for jitter... */
+    input_set_abs_params(input_dev, ABS_X, CY8CTMG110_X_MIN,
+                 CY8CTMG110_X_MAX, 4, 0);
+    input_set_abs_params(input_dev, ABS_Y, CY8CTMG110_Y_MIN,
+                 CY8CTMG110_Y_MAX, 4, 0);

     err = gpio_request(CY8CTMG110_RESET_PIN_GPIO, NULL);

--
1.7.1

_______________________________________________
MeeGo-dev mailing list
MeeGo-dev@meego.com
http://lists.meego.com/listinfo/meego-dev

Reply via email to