From: Hans de Goede <hdegoede@redhat.com>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Maxime Ripard <maxime.ripard@free-electrons.com>,
Chen-Yu Tsai <wens@csie.org>,
linux-input@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
devicetree <devicetree@vger.kernel.org>,
Hans de Goede <hdegoede@redhat.com>
Subject: [PATCH resend 2/4] touchscreen: ft5x06: Add support for axis inversion / swapping
Date: Tue, 29 Mar 2016 10:29:27 +0200 [thread overview]
Message-ID: <1459240169-11531-3-git-send-email-hdegoede@redhat.com> (raw)
In-Reply-To: <1459240169-11531-1-git-send-email-hdegoede@redhat.com>
Add support for axis inversion / swapping using the new
touchscreen_parse_properties and touchscreen_apply_prop_to_x_y
functionality.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
drivers/input/touchscreen/edt-ft5x06.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/input/touchscreen/edt-ft5x06.c b/drivers/input/touchscreen/edt-ft5x06.c
index e8825e5..864a7e0 100644
--- a/drivers/input/touchscreen/edt-ft5x06.c
+++ b/drivers/input/touchscreen/edt-ft5x06.c
@@ -86,6 +86,7 @@ struct edt_reg_addr {
struct edt_ft5x06_ts_data {
struct i2c_client *client;
struct input_dev *input;
+ struct touchscreen_properties prop;
u16 num_x;
u16 num_y;
@@ -173,7 +174,8 @@ static irqreturn_t edt_ft5x06_ts_isr(int irq, void *dev_id)
struct device *dev = &tsdata->client->dev;
u8 cmd;
u8 rdbuf[63];
- int i, type, x, y, id;
+ s16 x, y;
+ int i, type, id;
int offset, tplen, datalen, crclen;
int error;
@@ -246,6 +248,7 @@ static irqreturn_t edt_ft5x06_ts_isr(int irq, void *dev_id)
if (!down)
continue;
+ touchscreen_apply_prop_to_x_y(&tsdata->prop, &x, &y);
input_report_abs(tsdata->input, ABS_MT_POSITION_X, x);
input_report_abs(tsdata->input, ABS_MT_POSITION_Y, y);
}
@@ -972,7 +975,7 @@ static int edt_ft5x06_ts_probe(struct i2c_client *client,
input_set_abs_params(input, ABS_MT_POSITION_Y,
0, tsdata->num_y * 64 - 1, 0, 0);
- touchscreen_parse_properties(input, true, NULL);
+ touchscreen_parse_properties(input, true, &tsdata->prop);
error = input_mt_init_slots(input, tsdata->max_support_points,
INPUT_MT_DIRECT);
--
2.7.3
next prev parent reply other threads:[~2016-03-29 8:29 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-29 8:29 [PATCH resend 0/4] of_touchscreen-helpers: Add support for inverted / swapped axis Hans de Goede
[not found] ` <1459240169-11531-1-git-send-email-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2016-03-29 8:29 ` [PATCH resend 1/4] " Hans de Goede
2016-03-29 8:29 ` Hans de Goede [this message]
2016-03-29 8:29 ` [PATCH resend 3/4] touchscreen: icn8318: Use parse_properties and apply_prop_to_x_y helpers Hans de Goede
2016-03-29 8:29 ` [PATCH resend 4/4] touchscreen: pixcir_ts: Add support for axis inversion / swapping Hans de Goede
-- strict thread matches above, loose matches on Subject: below --
2016-01-27 18:25 [PATCH resend 0/4] of_touchscreen-helpers: Add support for inverted / s Hans de Goede
[not found] ` <1453919124-3840-1-git-send-email-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2016-01-27 18:25 ` [PATCH resend 2/4] touchscreen: ft5x06: Add support for axis inversion / swapping Hans de Goede
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=1459240169-11531-3-git-send-email-hdegoede@redhat.com \
--to=hdegoede@redhat.com \
--cc=devicetree@vger.kernel.org \
--cc=dmitry.torokhov@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-input@vger.kernel.org \
--cc=maxime.ripard@free-electrons.com \
--cc=wens@csie.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).