Skip to contentSkip to conversation

Input: elantech - Add the pattern for firmware into elantech_device_info structure

PATCH Dave.Wang 2 participants 2 messages Dec 6, 2019 – Dec 7, 2019

Subsystems (2)
lore
Share & tools
lore

Dave.Wang

author
#0 lore raw

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

---
 drivers/input/mouse/elantech.c | 11 +++++++++++
drivers/input/mouse/elantech.h |  1 +
 2 files changed, 12 insertions(+)
drivers/input/mouse/elantech.c +0 -0
index 2d8434b7b623..1f0d914acd78 100644
@@ -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;

drivers/input/mouse/elantech.h +1 -0
index e0a3e59d4f1b..0aae6a9de8f0 100644
@@ -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

maintainer
#1 lore raw

Hi Dave,

Quoted 2 lines · Dave.Wang

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

Your patches came in as line-wrapped by your mailer. Could you try resending with "git send-email" please?

And could you please also add Kai-Heng Feng <[email protected]> to the CC as they were looking at the bunch of laptops with Elan parts.

Thanks!

Quoted 46 lines
---
 drivers/input/mouse/elantech.c | 11 +++++++++++
drivers/input/mouse/elantech.h |  1 +
 2 files changed, 12 insertions(+)
drivers/input/mouse/elantech.c +11 -0
index 2d8434b7b623..1f0d914acd78 100644
@@ -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 :
drivers/input/mouse/elantech.c +0 -0
 						 synaptics_send_cmd;
drivers/input/mouse/elantech.h +1 -1
index e0a3e59d4f1b..0aae6a9de8f0 100644
@@ -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

Signature · 1 line
Dmitry