From: Yunus Bas <y.bas@phytec.de>
To: dmitry.torokhov@gmail.com, yuehaibing@huawei.com,
linux-input@vger.kernel.org
Cc: u.kleine-koenig@pengutronix.de, linux-kernel@vger.kernel.org
Subject: [PATCH RESEND] Input: tsc200x-core - Add axis inversion and swapping support
Date: Wed, 9 Feb 2022 23:39:33 +0100 [thread overview]
Message-ID: <20220209223933.1672782-1-y.bas@phytec.de> (raw)
Since Commit ed7c9870c9bc ("Input: of_touchscreen - add support for
inverted / swapped axes"), the of_touchscreen interface supports axis
inverting and swapping through Devicetree properties. Make use of this
feature.
Signed-off-by: Yunus Bas <y.bas@phytec.de>
---
drivers/input/touchscreen/tsc200x-core.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/input/touchscreen/tsc200x-core.c b/drivers/input/touchscreen/tsc200x-core.c
index 27810f6c69f6..72c7258b93a5 100644
--- a/drivers/input/touchscreen/tsc200x-core.c
+++ b/drivers/input/touchscreen/tsc200x-core.c
@@ -88,6 +88,8 @@ struct tsc200x {
int in_z1;
int in_z2;
+ struct touchscreen_properties prop;
+
spinlock_t lock;
struct timer_list penup_timer;
@@ -113,8 +115,7 @@ static void tsc200x_update_pen_state(struct tsc200x *ts,
int x, int y, int pressure)
{
if (pressure) {
- input_report_abs(ts->idev, ABS_X, x);
- input_report_abs(ts->idev, ABS_Y, y);
+ touchscreen_report_pos(ts->idev, &ts->prop, x, y, false);
input_report_abs(ts->idev, ABS_PRESSURE, pressure);
if (!ts->pen_down) {
input_report_key(ts->idev, BTN_TOUCH, !!pressure);
@@ -533,7 +534,7 @@ int tsc200x_probe(struct device *dev, int irq, const struct input_id *tsc_id,
input_set_abs_params(input_dev, ABS_PRESSURE,
0, MAX_12BIT, TSC200X_DEF_P_FUZZ, 0);
- touchscreen_parse_properties(input_dev, false, NULL);
+ touchscreen_parse_properties(input_dev, false, &ts->prop);
/* Ensure the touchscreen is off */
tsc200x_stop_scan(ts);
--
2.25.1
next reply other threads:[~2022-02-09 22:39 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-09 22:39 Yunus Bas [this message]
2022-02-10 1:03 ` [PATCH RESEND] Input: tsc200x-core - Add axis inversion and swapping support Dmitry Torokhov
2022-02-10 8:56 ` Yunus Bas
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=20220209223933.1672782-1-y.bas@phytec.de \
--to=y.bas@phytec.de \
--cc=dmitry.torokhov@gmail.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=u.kleine-koenig@pengutronix.de \
--cc=yuehaibing@huawei.com \
/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.