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:   Fri, 6 Dec 2019 11:27:29 +0800
From:   "Dave.Wang" <dave.wang@....com.tw>
To:     <Linux-kernel@...r.kernel.org>, <Linux-input@...r.kernel.org>,
        "'Benjamin Tissoires'" <benjamin.tissoires@...hat.com>,
        <Dmitry.torokhov@...il.com>
Cc:     "'Josh.Chen'" <josh.chen@....com.tw>, <jingle.wu@....com.tw>,
        "'phoenix'" <phoenix@....com.tw>
Subject:  [PATCH 2/6] Input: elantech - Add the function to get more bytes from register

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

Signed-off-by: Dave Wang <dave.wang@....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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ