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]
Message-Id: <20191209022828.30143-1-dave.wang@emc.com.tw>
Date:   Sun,  8 Dec 2019 21:28:28 -0500
From:   Dave Wang <dave.wang@....com.tw>
To:     Linux-input@...r.kernel.org, Linux-kernel@...r.kernel.org,
        Dmitry.torokhov@...il.com
Cc:     phoenix@....com.tw, josh.chen@....com.tw, jingle.wu@....com.tw,
        kai.heng.feng@...onical.com, "Dave.Wang" <dave.wang@....com.tw>
Subject: [PATCH] Input: elantech - Add pattern for firmware into elantech_device_info structure

From: "Dave.Wang" <dave.wang@....com.tw>

Add the conditional expression to distinguish different patterns
regarding 0, 1, 2. Different patterns have its own location
for device information.

Signed-off-by: Dave Wang <dave.wang@....com.tw>
---
 drivers/input/mouse/elantech.c | 11 +++++++++++
 drivers/input/mouse/elantech.h |  1 +
 2 files changed, 12 insertions(+)

diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c
index 2d8434b7b623..1f0d914acd78 100644
--- a/drivers/input/mouse/elantech.c
+++ b/drivers/input/mouse/elantech.c
@@ -1557,6 +1557,17 @@ static int elantech_set_properties(struct elantech_device_info *info)
 		}
 	}
 
+	/* Get information pattern for hw_version 4 */
+	if (ver == 15) {
+		if ((info->fw_version & 0x0000ff) == 0x01)
+			info->pattern = 0x01;
+		else if ((info->fw_version & 0x0000ff) == 0x02)
+			info->pattern = 0x02;
+		else
+			info->pattern = 0x00;
+	} else
+		info->pattern = 0x00;
+
 	/* decide which send_cmd we're gonna use early */
 	info->send_cmd = info->hw_version >= 3 ? elantech_send_cmd :
 						 synaptics_send_cmd;
diff --git a/drivers/input/mouse/elantech.h b/drivers/input/mouse/elantech.h
index e0a3e59d4f1b..0aae6a9de8f0 100644
--- a/drivers/input/mouse/elantech.h
+++ b/drivers/input/mouse/elantech.h
@@ -140,6 +140,7 @@ struct elantech_device_info {
 	unsigned char samples[3];
 	unsigned char debug;
 	unsigned char hw_version;
+	unsigned char pattern;
 	unsigned int fw_version;
 	unsigned int x_min;
 	unsigned int y_min;
-- 
2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ