lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:   Thu,  6 May 2021 19:06:01 -0400
From:   Michael John Sakellaropoulos <mjsakellaropoulos@...il.com>
To:     Marek Vasut <marex@...x.de>
Cc:     Dmitry Torokhov <dmitry.torokhov@...il.com>,
        linux-input@...r.kernel.org, linux-kernel@...r.kernel.org,
        Michael John Sakellaropoulos <mjsakellaropoulos@...il.com>,
        Hansem Ro <hansemro@...look.com>
Subject: [PATCH] Fix ili210x touchdata coordinates endianness.

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@...il.com>
Tested-by: Hansem Ro <hansemro@...look.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ