From: Michael John Sakellaropoulos <mjsakellaropoulos@gmail.com>
To: Marek Vasut <marex@denx.de>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>,
linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
Michael John Sakellaropoulos <mjsakellaropoulos@gmail.com>,
Hansem Ro <hansemro@outlook.com>
Subject: [PATCH] Fix ili210x touchdata coordinates endianness.
Date: Thu, 6 May 2021 19:06:01 -0400 [thread overview]
Message-ID: <20210506230601.429756-1-mjsakellaropoulos@gmail.com> (raw)
This fixes how coordinates are parsed from ili210x touchdata. Through observation
and manual probing of the i2c bus, we have confirmed that the values stored in
the registers are Little Endian.
(Tested on Amazon Kindle Fire Gen1 : arch/arm/boot/dts/omap4-kc1.dts)
This patch is a follow-up to the earlier one by Hansem Ro. I am also working on another patch
that queries the touchscreen controller for the active panel resolution (via REG_PANEL_INFO)
so we can report the correct resolution to evdev (right now it's hardcoded).
Signed-off-by: Michael John Sakellaropoulos <mjsakellaropoulos@gmail.com>
Tested-by: Hansem Ro <hansemro@outlook.com>
Fixes: e3559442afd2a ("ili210x - rework the touchscreen sample processing")
---
drivers/input/touchscreen/ili210x.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/input/touchscreen/ili210x.c b/drivers/input/touchscreen/ili210x.c
index d8fccf048bf4..15e68d5a96d8 100644
--- a/drivers/input/touchscreen/ili210x.c
+++ b/drivers/input/touchscreen/ili210x.c
@@ -90,8 +90,8 @@ static bool ili210x_touchdata_to_coords(const u8 *touchdata,
if (touchdata[0] & BIT(finger))
return false;
- *x = get_unaligned_be16(touchdata + 1 + (finger * 4) + 0);
- *y = get_unaligned_be16(touchdata + 1 + (finger * 4) + 2);
+ *x = get_unaligned_le16(touchdata + 1 + (finger * 4) + 0);
+ *y = get_unaligned_le16(touchdata + 1 + (finger * 4) + 2);
return true;
}
--
2.27.0
reply other threads:[~2021-05-06 23:07 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20210506230601.429756-1-mjsakellaropoulos@gmail.com \
--to=mjsakellaropoulos@gmail.com \
--cc=dmitry.torokhov@gmail.com \
--cc=hansemro@outlook.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marex@denx.de \
/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).