Skip to contentSkip to conversation

Input: elantech - Add the function to get more bytes from register

PATCH New Dave Wang 1 participant 1 message Dec 9, 2019

Subsystems (2)
lore
Share & tools
lore

Dave Wang

author
#0 lore raw

PATCH 2/6 Input: elantech - Add the function to get more bytes from register

From: "Dave.Wang" <[email protected]>

Send an Elantech style special command to read three bytes from register.

---
 drivers/input/mouse/elantech.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
drivers/input/mouse/elantech.c +18 -0
index 1f0d914acd78..afb87122b766 100644
@@ -89,6 +89,24 @@ static int elantech_ps2_command(struct psmouse *psmouse,
 	return rc;
 }
 
+/*
+ * Send an Elantech style special command to read 3 bytes from a register
+ */
+static int elantech_read_reg_params(struct psmouse *psmouse, unsigned char reg,
+				unsigned char *param)
+{
+	int rc = 0;
+
+	if (elantech_ps2_command(psmouse, NULL, ETP_PS2_CUSTOM_COMMAND) ||
+	    elantech_ps2_command(psmouse, NULL, ETP_REGISTER_READWRITE) ||
+	    elantech_ps2_command(psmouse, NULL, ETP_PS2_CUSTOM_COMMAND) ||
+	    elantech_ps2_command(psmouse, NULL, reg) ||
+	    elantech_ps2_command(psmouse, param, PSMOUSE_CMD_GETINFO))
+		rc = -1;
+
+	return rc;
+}
+
 /*
  * Send an Elantech style special command to read a value from a register
  */
Signature · 1 line
2.17.1