--- v9
+++ v1
@@ -1,29 +1,55 @@
-1. check if chip is really present and don't succeed if it isn't.
-2. if it succeeds, power down the chip until accessed
+this should reduce unnecessary input events.
-Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com>
+Signed-off-by: H. Nikolaus Schaller <hns-xXXSsgcRVICgSpxsJD1C4w@public.gmane.org>
---
- drivers/input/touchscreen/tsc2007.c | 8 ++++++++
- 1 file changed, 8 insertions(+)
+ drivers/input/touchscreen/tsc2007.c | 16 ++++++++++++----
+ 1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/drivers/input/touchscreen/tsc2007.c b/drivers/input/touchscreen/tsc2007.c
-index c1d9593..76b462b 100644
+index e0c7173..1a8a79d 100644
--- a/drivers/input/touchscreen/tsc2007.c
+++ b/drivers/input/touchscreen/tsc2007.c
-@@ -529,6 +529,14 @@ static int tsc2007_probe(struct i2c_client *client,
+@@ -94,6 +94,7 @@ struct tsc2007 {
- tsc2007_stop(ts);
+ wait_queue_head_t wait;
+ bool stopped;
++ bool pendown;
-+ /* power down the chip (TSC2007_SETUP does not ACK on I2C) */
-+ err = tsc2007_xfer(ts, PWRDOWN);
-+ if (err < 0) {
-+ dev_err(&client->dev,
-+ "Failed to setup chip: %d\n", err);
-+ return err; /* usually, chip does not respond */
+ int (*get_pendown_state)(struct device *);
+ void (*clear_penirq)(void);
+@@ -251,7 +252,10 @@ static irqreturn_t tsc2007_soft_irq(int irq, void *handle)
+ dev_dbg(&ts->client->dev,
+ "shaped point(%4d,%4d), pressure (%4u)\n",
+ tc.x, tc.y, rt);
+- input_report_key(input, BTN_TOUCH, 1);
++ if (!ts->pendown) {
++ input_report_key(input, BTN_TOUCH, 1);
++ ts->pendown = true;
++ }
+ input_report_abs(input, ABS_X, tc.x);
+ input_report_abs(input, ABS_Y, tc.y);
+ input_report_abs(input, ABS_PRESSURE, rt);
+@@ -272,9 +276,13 @@ static irqreturn_t tsc2007_soft_irq(int irq, void *handle)
+
+ dev_dbg(&ts->client->dev, "UP\n");
+
+- input_report_key(input, BTN_TOUCH, 0);
+- input_report_abs(input, ABS_PRESSURE, 0);
+- input_sync(input);
++ if (ts->pendown) {
++ input_report_key(input, BTN_TOUCH, 0);
++ input_report_abs(input, ABS_PRESSURE, 0);
++ input_sync(input);
++
++ ts->pendown = false;
+ }
-+
- err = input_register_device(input_dev);
- if (err) {
- dev_err(&client->dev,
+
+ if (ts->clear_penirq)
+ ts->clear_penirq();
--
-2.7.3
+2.5.1
+
+--
+To unsubscribe from this list: send the line "unsubscribe devicetree" in
+the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
+More majordomo info at http://vger.kernel.org/majordomo-info.html