* [PATCH 2/6] Input: elantech - Add the function to get more bytes from register
@ 2019-12-06 3:27 Dave.Wang
0 siblings, 0 replies; 2+ messages in thread
From: Dave.Wang @ 2019-12-06 3:27 UTC (permalink / raw)
To: Linux-kernel, Linux-input, 'Benjamin Tissoires',
Dmitry.torokhov
Cc: 'Josh.Chen', jingle.wu, 'phoenix'
Send an Elantech style special command to read three bytes from
register.
Signed-off-by: Dave Wang <dave.wang@emc.com.tw>
---
drivers/input/mouse/elantech.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c
index 1f0d914acd78..afb87122b766 100644
--- a/drivers/input/mouse/elantech.c
+++ b/drivers/input/mouse/elantech.c
@@ -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
*/
--
2.17.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH 2/6] Input: elantech - Add the function to get more bytes from register
@ 2019-12-09 3:14 Dave Wang
0 siblings, 0 replies; 2+ messages in thread
From: Dave Wang @ 2019-12-09 3:14 UTC (permalink / raw)
To: Linux-input, Linux-kernel, Dmitry.torokhov
Cc: phoenix, josh.chen, jingle.wu, kai.heng.feng, Dave.Wang
From: "Dave.Wang" <dave.wang@emc.com.tw>
Send an Elantech style special command to read three bytes from
register.
Signed-off-by: Dave Wang <dave.wang@emc.com.tw>
---
drivers/input/mouse/elantech.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c
index 1f0d914acd78..afb87122b766 100644
--- a/drivers/input/mouse/elantech.c
+++ b/drivers/input/mouse/elantech.c
@@ -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
*/
--
2.17.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-12-09 3:14 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-12-06 3:27 [PATCH 2/6] Input: elantech - Add the function to get more bytes from register Dave.Wang
-- strict thread matches above, loose matches on Subject: below --
2019-12-09 3:14 Dave Wang
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).