Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1584743

[PATCH 3/3] Input: tsc2007 - add a property "ti,report-resistance" to restore the old pressure reporting state if needed.

From "H. Nikolaus Schaller" <hns@goldelico.com>
Newsgroups linux.kernel
Subject [PATCH 3/3] Input: tsc2007 - add a property "ti,report-resistance" to restore the old pressure reporting state if needed.
Date 2017-02-20 18:00 +0100
Message-ID <tcZtE-7aS-31@gated-at.bofh.it> (permalink)
References <tcZtE-7aS-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com>
---
 Documentation/devicetree/bindings/input/touchscreen/tsc2007.txt | 2 ++
 drivers/input/touchscreen/tsc2007.h                             | 1 +
 drivers/input/touchscreen/tsc2007_core.c                        | 6 +++++-
 3 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/input/touchscreen/tsc2007.txt b/Documentation/devicetree/bindings/input/touchscreen/tsc2007.txt
index ec365e1..9b686af 100644
--- a/Documentation/devicetree/bindings/input/touchscreen/tsc2007.txt
+++ b/Documentation/devicetree/bindings/input/touchscreen/tsc2007.txt
@@ -14,6 +14,8 @@ Optional properties:
 - interrupts: (gpio) interrupt to which the chip is connected
   (see interrupt binding[0]).
 - ti,max-rt: maximum pressure.
+- ti,report-resistance: report resistance (no pressure = max_rt) instead
+  of pressure (no pressure = 0).
 - ti,fuzzx: specifies the absolute input fuzz x value.
   If set, it will permit noise in the data up to +- the value given to the fuzz
   parameter, that is used to filter noise from the event stream.
diff --git a/drivers/input/touchscreen/tsc2007.h b/drivers/input/touchscreen/tsc2007.h
index 474bd29..81baabb 100644
--- a/drivers/input/touchscreen/tsc2007.h
+++ b/drivers/input/touchscreen/tsc2007.h
@@ -66,6 +66,7 @@ struct tsc2007 {
 
 	u16			model;
 	u16			x_plate_ohms;
+	bool			report_resistance;
 	u16			max_rt;
 	unsigned long		poll_period; /* in jiffies */
 	int			fuzzx;
diff --git a/drivers/input/touchscreen/tsc2007_core.c b/drivers/input/touchscreen/tsc2007_core.c
index fc73849..984710f 100644
--- a/drivers/input/touchscreen/tsc2007_core.c
+++ b/drivers/input/touchscreen/tsc2007_core.c
@@ -141,7 +141,8 @@ static irqreturn_t tsc2007_soft_irq(int irq, void *handle)
 				"DOWN point(%4d,%4d), resistance (%4u)\n",
 				tc.x, tc.y, rt);
 
-			rt = ts->max_rt - rt;
+			if (!ts->report_resistance)
+				rt = ts->max_rt - rt;
 
 			input_report_key(input, BTN_TOUCH, 1);
 			input_report_abs(input, ABS_X, tc.x);
@@ -248,6 +249,9 @@ static int tsc2007_probe_dt(struct i2c_client *client, struct tsc2007 *ts)
 	else
 		ts->max_rt = MAX_12BIT;
 
+	ts->report_resistance =
+		of_property_read_bool(np, "ti,report-resistance");
+
 	if (!of_property_read_u32(np, "ti,fuzzx", &val32))
 		ts->fuzzx = val32;
 
-- 
2.7.3

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/3] Fix tsc2007 to report ABS_PRESSURE correctly "H. Nikolaus Schaller" <hns@goldelico.com> - 2017-02-20 18:00 +0100
  [PATCH 3/3] Input: tsc2007 - add a property "ti,report-resistance" to restore the old pressure reporting state if needed. "H. Nikolaus Schaller" <hns@goldelico.com> - 2017-02-20 18:00 +0100
    Re: [PATCH 3/3] Input: tsc2007 - add a property  "ti,report-resistance" to restore the old pressure reporting state if  needed. Pavel Machek <pavel@ucw.cz> - 2017-02-21 12:10 +0100
      Re: [PATCH 3/3] Input: tsc2007 - add a property "ti,report-resistance" to restore the old pressure reporting state if needed. "H. Nikolaus Schaller" <hns@goldelico.com> - 2017-02-21 12:50 +0100
        Re: [PATCH 3/3] Input: tsc2007 - add a property  "ti,report-resistance" to restore the old pressure reporting state if  needed. Sebastian Reichel <sre@kernel.org> - 2017-02-21 18:30 +0100
  [PATCH 1/3] Input: tsc2007 - rename function tsc2007_calculate_pressure to tsc2007_calculate_resistance because that is what it does "H. Nikolaus Schaller" <hns@goldelico.com> - 2017-02-20 18:00 +0100
    Re: [PATCH 1/3] Input: tsc2007 - rename function  tsc2007_calculate_pressure to tsc2007_calculate_resistance because that is  what it does Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2017-02-23 09:50 +0100

csiph-web