All of lore.kernel.org
 help / color / mirror / Atom feed
From: Leif Middelschulte <leif.middelschulte@klsmartin.com>
To: dmitry.torokhov@gmail.com, devicetree@vger.kernel.org
Cc: linux-input@vger.kernel.org, robh+dt@kernel.org,
	mark.rutland@arm.com,
	Leif Middelschulte <leif.middelschulte@klsmartin.com>
Subject: [PATCH 08/10] Input: stmpe-ts - axes inversion and swapping
Date: Mon, 27 May 2019 18:19:36 +0200	[thread overview]
Message-ID: <20190527161938.31871-4-leif.middelschulte@klsmartin.com> (raw)
In-Reply-To: <20190527161938.31871-1-leif.middelschulte@klsmartin.com>

This implements inversion and swapping of the reported X and Y input
values, configurable via the corresponding devicetree properties binding.

Signed-off-by: Leif Middelschulte <leif.middelschulte@klsmartin.com>
---
 drivers/input/touchscreen/stmpe-ts.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/input/touchscreen/stmpe-ts.c b/drivers/input/touchscreen/stmpe-ts.c
index 152aac8b3ab7..1d114278e7e9 100644
--- a/drivers/input/touchscreen/stmpe-ts.c
+++ b/drivers/input/touchscreen/stmpe-ts.c
@@ -217,8 +217,12 @@ static irqreturn_t stmpe_ts_handler(int irq, void *data)
 		goto _skip_input_events;
 	}
 
-	input_report_abs(ts->idev, ABS_X, x);
-	input_report_abs(ts->idev, ABS_Y, y);
+	if (ts->props.invert_x)
+		x -= ts->min.x;
+	if (ts->props.invert_y)
+		y -= ts->min.y;
+
+	touchscreen_report_pos(ts->idev, &ts->props, x, y, false);
 	if (report_pressure)
 		input_report_abs(ts->idev, ABS_PRESSURE, z);
 	input_report_key(ts->idev, BTN_TOUCH, 1);
-- 
2.21.0

  parent reply	other threads:[~2019-05-27 16:19 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-27 16:07 [PATCH 00/10] input: touchscreen: stmpe: ext. features Leif Middelschulte
2019-05-27 16:07 ` [PATCH 01/10] dt-bindings: input: touchscreen: stmpe: add touch window configuration Leif Middelschulte
2019-06-14 19:48   ` Rob Herring
2019-06-19 11:55     ` Middelschulte, Leif
2019-06-19 13:51       ` Rob Herring
2019-06-24 10:33         ` Middelschulte, Leif
2019-05-27 16:07 ` [PATCH 02/10] Input: stmpe-ts - implement touch window configuration support Leif Middelschulte
2019-05-27 16:07 ` [PATCH 03/10] dt-bindings: input: touchscreen: stmpe: add resolution support Leif Middelschulte
2019-06-14 19:55   ` Rob Herring
2019-06-19 12:33     ` Middelschulte, Leif
2019-05-27 16:07 ` [PATCH 04/10] Input: stmpe-ts - implement " Leif Middelschulte
2019-05-27 16:19 ` [PATCH 05/10] dt-bindings: input: touchscreen: stmpe: add XY mode Leif Middelschulte
2019-05-27 16:19   ` [PATCH 06/10] Input: stmpe-ts - implement XY acquisition mode Leif Middelschulte
2019-05-27 16:19   ` [PATCH 07/10] dt-bindings: input: touchscreen: stmpe: add axes inversion and swap Leif Middelschulte
2019-06-14 19:56     ` Rob Herring
2019-05-27 16:19   ` Leif Middelschulte [this message]
2019-05-27 16:19   ` [PATCH 09/10] dt-bindings: input: touchscreen: stmpe: add tracking index Leif Middelschulte
2019-06-14 19:58     ` Rob Herring
2019-06-19 12:47       ` Middelschulte, Leif
2019-06-19 13:46         ` Rob Herring
2019-06-24 11:44           ` Middelschulte, Leif
2019-06-14 19:55   ` [PATCH 05/10] dt-bindings: input: touchscreen: stmpe: add XY mode Rob Herring
2019-05-27 16:22 ` [PATCH 10/10] Input: stmpe-ts - implement tracking index Leif Middelschulte

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190527161938.31871-4-leif.middelschulte@klsmartin.com \
    --to=leif.middelschulte@klsmartin.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=robh+dt@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.