All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] Input: elantech - support the Fujitsu H730 laptop
@ 2014-08-30 14:10 Ulrik De Bie
  2014-08-30 14:10 ` [PATCH 1/5] Input: elantech - use elantech_report_trackpoint for hardware v4 too Ulrik De Bie
                   ` (6 more replies)
  0 siblings, 7 replies; 25+ messages in thread
From: Ulrik De Bie @ 2014-08-30 14:10 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: linux-input, Hans de Goede, David Herrmann, ulrik.debie-os

This patch set makes the elantech driver work for the Fujitsu H730 laptop. It
also adds a sysfs knob to allow other laptops that are facing similar
problems as the Fujitsu H730 to have working touchpad.

I'm considering adding a WARN_ONCE when the crc_enabled signature check
fails. The message would then point the user to the crc_enabled sysfs knob,
and kindly ask the user to report the laptop to linux-input mailinglist ?
Any suggestions ?

Two users have tested the combination of this patchset and confirmed that
it makes the H730 touchpad/trackpoint work.

Here an overview of the patchset:

Patch 1/ : Input: elantech - use elantech_report_trackpoint for hardware v4 too
The Fujitsu H730 is the first v4 hardware identified that also sends the
trackpoint packets. This patch enables the trackpoint on v4 hardware.
With this patch the trackpoint will work.

Patch 2/ : Input: elantech - Fix crc_enabled for Fujitsu H730
Uses DMI to detect the H730 and ,if detected, will set crc_enabled to 1. 
With this patch the touchpad and left/right button will start to work.

Patch 3/ : Input: elantech - report the middle button of the touchpad
The Fujitsu H730 is the first laptop listed in the elantech.c file with
3 touchpad buttons. This patch enables the middle button for all elantech
hardware and enables the reporting for v4 hardware.
I want to hear feedback here on what preferences exist for the conditions
to enable the middle button:
- DMI
- enable only for v4
- enable for all/report for v3+v4
...

Patch 4/ : Input: Elantech - provide a sysfs knob for crc_enabled
Probably H730 will not remain the only elantech laptop that has this failing
detection for the crc_enabled. This provides users with a workaround when
the crc_enabled detection fails.

Patch 5/ : Elantech - Update the documentation: trackpoint,v3/v4,crc_enabled
This provides an update of the elantech documentation. 

Patch 4 depends on patch 2, and for consistency, patch 5 depends on patch 1-2-4.

Ulrik De Bie (5):
  Input: elantech - use elantech_report_trackpoint for hardware v4 too
  Input: elantech - Fix crc_enabled for Fujitsu H730
  Input: elantech - report the middle button of the touchpad
  Input: elantech - provide a sysfs knob for crc_enabled
  Input: elantech - Update the documentation:
    trackpoint,v3/v4,crc_enabled

 Documentation/input/elantech.txt |  85 ++++++++++++++++++++++++++--
 drivers/input/mouse/elantech.c   | 119 ++++++++++++++++++++++++++++++++-------
 drivers/input/mouse/elantech.h   |   2 +-
 3 files changed, 179 insertions(+), 27 deletions(-)

Best regards,
Ulrik De Bie
-- 
2.1.0

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [PATCH 1/5] Input: elantech - use elantech_report_trackpoint for hardware v4 too
  2014-08-30 14:10 [PATCH 0/5] Input: elantech - support the Fujitsu H730 laptop Ulrik De Bie
@ 2014-08-30 14:10 ` Ulrik De Bie
  2014-11-08  8:21   ` Dmitry Torokhov
  2014-11-20  6:58   ` Bisected two-finger scrolling regression on Lenovo Y50 (Re: [PATCH 1/5] Input: elantech - use elantech_report_trackpoint for hardware v4 too) Anders Kaseorg
  2014-08-30 14:10 ` [PATCH 2/5] Input: elantech - Fix crc_enabled for Fujitsu H730 Ulrik De Bie
                   ` (5 subsequent siblings)
  6 siblings, 2 replies; 25+ messages in thread
From: Ulrik De Bie @ 2014-08-30 14:10 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: linux-input, Hans de Goede, David Herrmann, ulrik.debie-os

The Fujitsu H730 has hardware v4 with a trackpoint. This enables
the elantech_report_trackpoint for v4.

Reported-by: Stefan Valouch <stefan@valouch.com>
Tested-by: Stefan Valouch <stefan@valouch.com>
Tested-by: Alfredo Gemma <alfredo.gemma@gmail.com>
Signed-off-by: Ulrik De Bie <ulrik.debie-os@e2big.org>
---
 drivers/input/mouse/elantech.c | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c
index da51738..f0a55b4d 100644
--- a/drivers/input/mouse/elantech.c
+++ b/drivers/input/mouse/elantech.c
@@ -792,6 +792,9 @@ static int elantech_packet_check_v4(struct psmouse *psmouse)
 	unsigned char packet_type = packet[3] & 0x03;
 	bool sanity_check;
 
+	if ((packet[3]&0x0f) == 0x06)
+		return PACKET_TRACKPOINT;
+
 	/*
 	 * Sanity check based on the constant bits of a packet.
 	 * The constant bits change depending on the value of
@@ -877,10 +880,19 @@ static psmouse_ret_t elantech_process_byte(struct psmouse *psmouse)
 
 	case 4:
 		packet_type = elantech_packet_check_v4(psmouse);
-		if (packet_type == PACKET_UNKNOWN)
+		switch (packet_type) {
+		case PACKET_UNKNOWN:
 			return PSMOUSE_BAD_DATA;
 
-		elantech_report_absolute_v4(psmouse, packet_type);
+		case PACKET_TRACKPOINT:
+			elantech_report_trackpoint(psmouse, packet_type);
+			break;
+
+		default:
+			elantech_report_absolute_v4(psmouse, packet_type);
+			break;
+		}
+
 		break;
 	}
 
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH 2/5] Input: elantech - Fix crc_enabled for Fujitsu H730
  2014-08-30 14:10 [PATCH 0/5] Input: elantech - support the Fujitsu H730 laptop Ulrik De Bie
  2014-08-30 14:10 ` [PATCH 1/5] Input: elantech - use elantech_report_trackpoint for hardware v4 too Ulrik De Bie
@ 2014-08-30 14:10 ` Ulrik De Bie
  2014-11-08  8:22   ` Dmitry Torokhov
  2014-08-30 14:10 ` [PATCH 3/5] Input: elantech - report the middle button of the touchpad Ulrik De Bie
                   ` (4 subsequent siblings)
  6 siblings, 1 reply; 25+ messages in thread
From: Ulrik De Bie @ 2014-08-30 14:10 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: linux-input, Hans de Goede, David Herrmann, ulrik.debie-os

The Fujitsu H730 does not work with crc_enabled = 0, even though the
crc_enabled bit in the firmware version indicated it would. When switching
this value to crc_enabled to 1, the touchpad works. This patch uses
DMI to detect H730.

Reported-by: Stefan Valouch <stefan@valouch.com>
Tested-by: Stefan Valouch <stefan@valouch.com>
Tested-by: Alfredo Gemma <alfredo.gemma@gmail.com>
Signed-off-by: Ulrik De Bie <ulrik.debie-os@e2big.org>
---
 drivers/input/mouse/elantech.c | 65 ++++++++++++++++++++++++++++++------------
 drivers/input/mouse/elantech.h |  2 +-
 2 files changed, 48 insertions(+), 19 deletions(-)

diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c
index f0a55b4d..67d56c0 100644
--- a/drivers/input/mouse/elantech.c
+++ b/drivers/input/mouse/elantech.c
@@ -1235,6 +1235,52 @@ static int elantech_set_input_params(struct psmouse *psmouse)
 	return 0;
 }
 
+/*
+ * Some hw_version 3 models go into error state when we try to set
+ * bit 3 and/or bit 1 of r10.
+ */
+static const struct dmi_system_id no_hw_res_dmi_table[] = {
+#if defined(CONFIG_DMI) && defined(CONFIG_X86)
+	{
+		/* Gigabyte U2442 */
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "U2442"),
+		},
+	},
+#endif
+	{ }
+};
+
+/*
+ * Some hw_version 4 models do not work with crc_disabled
+ */
+static const struct dmi_system_id elantech_dmi_crc_enabled[] = {
+#if defined(CONFIG_DMI) && defined(CONFIG_X86)
+	{
+		/* Fujitsu H730 does not work with crc_enabled == 0 */
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "CELSIUS H730"),
+		},
+	},
+#endif
+	{ }
+};
+
+/*
+ * Autodetect crc_enabled and verify override DMI table
+ */
+static unsigned char elantech_detect_crc_enabled(struct elantech_data *etd)
+{
+
+#if defined(CONFIG_DMI) && defined(CONFIG_X86)
+	if (dmi_check_system(elantech_dmi_crc_enabled))
+		return 1;
+#endif /* CONFIG_X86 */
+
+	return ((etd->fw_version & 0x4000) == 0x4000);
+}
 struct elantech_attr_data {
 	size_t		field_offset;
 	unsigned char	reg;
@@ -1444,23 +1490,6 @@ static int elantech_reconnect(struct psmouse *psmouse)
 }
 
 /*
- * Some hw_version 3 models go into error state when we try to set
- * bit 3 and/or bit 1 of r10.
- */
-static const struct dmi_system_id no_hw_res_dmi_table[] = {
-#if defined(CONFIG_DMI) && defined(CONFIG_X86)
-	{
-		/* Gigabyte U2442 */
-		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "U2442"),
-		},
-	},
-#endif
-	{ }
-};
-
-/*
  * determine hardware version and set some properties according to it.
  */
 static int elantech_set_properties(struct elantech_data *etd)
@@ -1518,7 +1547,7 @@ static int elantech_set_properties(struct elantech_data *etd)
 	 * The signatures of v3 and v4 packets change depending on the
 	 * value of this hardware flag.
 	 */
-	etd->crc_enabled = ((etd->fw_version & 0x4000) == 0x4000);
+	etd->crc_enabled = elantech_detect_crc_enabled(etd);
 
 	/* Enable real hardware resolution on hw_version 3 ? */
 	etd->set_hw_resolution = !dmi_check_system(no_hw_res_dmi_table);
diff --git a/drivers/input/mouse/elantech.h b/drivers/input/mouse/elantech.h
index 6f3afec..c25127a 100644
--- a/drivers/input/mouse/elantech.h
+++ b/drivers/input/mouse/elantech.h
@@ -128,11 +128,11 @@ struct elantech_data {
 	unsigned char reg_25;
 	unsigned char reg_26;
 	unsigned char debug;
+	unsigned char crc_enabled;
 	unsigned char capabilities[3];
 	bool paritycheck;
 	bool jumpy_cursor;
 	bool reports_pressure;
-	bool crc_enabled;
 	bool set_hw_resolution;
 	unsigned char hw_version;
 	unsigned int fw_version;
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH 3/5] Input: elantech - report the middle button of the touchpad
  2014-08-30 14:10 [PATCH 0/5] Input: elantech - support the Fujitsu H730 laptop Ulrik De Bie
  2014-08-30 14:10 ` [PATCH 1/5] Input: elantech - use elantech_report_trackpoint for hardware v4 too Ulrik De Bie
  2014-08-30 14:10 ` [PATCH 2/5] Input: elantech - Fix crc_enabled for Fujitsu H730 Ulrik De Bie
@ 2014-08-30 14:10 ` Ulrik De Bie
  2014-11-08  8:23   ` Dmitry Torokhov
  2014-08-30 14:10 ` [PATCH 4/5] Input: elantech - provide a sysfs knob for crc_enabled Ulrik De Bie
                   ` (3 subsequent siblings)
  6 siblings, 1 reply; 25+ messages in thread
From: Ulrik De Bie @ 2014-08-30 14:10 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: linux-input, Hans de Goede, David Herrmann, ulrik.debie-os

In the past, no elantech was known with 3 touchpad mouse buttons.
Fujitsu H730 is the first known elantech with a middle button. This commit
enables this middle button.

Reported-by: Stefan Valouch <stefan@valouch.com>
Tested-by: Stefan Valouch <stefan@valouch.com>
Tested-by: Alfredo Gemma <alfredo.gemma@gmail.com>
Signed-off-by: Ulrik De Bie <ulrik.debie-os@e2big.org>
---
 drivers/input/mouse/elantech.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c
index 67d56c0..e86bbd7 100644
--- a/drivers/input/mouse/elantech.c
+++ b/drivers/input/mouse/elantech.c
@@ -563,6 +563,7 @@ static void elantech_input_sync_v4(struct psmouse *psmouse)
 	} else {
 		input_report_key(dev, BTN_LEFT, packet[0] & 0x01);
 		input_report_key(dev, BTN_RIGHT, packet[0] & 0x02);
+		input_report_key(dev, BTN_MIDDLE, packet[0] & 0x04);
 	}
 
 	input_mt_report_pointer_emulation(dev, true);
@@ -1150,6 +1151,7 @@ static int elantech_set_input_params(struct psmouse *psmouse)
 	__clear_bit(EV_REL, dev->evbit);
 
 	__set_bit(BTN_LEFT, dev->keybit);
+	__set_bit(BTN_MIDDLE, dev->keybit);
 	__set_bit(BTN_RIGHT, dev->keybit);
 
 	__set_bit(BTN_TOUCH, dev->keybit);
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH 4/5] Input: elantech - provide a sysfs knob for crc_enabled
  2014-08-30 14:10 [PATCH 0/5] Input: elantech - support the Fujitsu H730 laptop Ulrik De Bie
                   ` (2 preceding siblings ...)
  2014-08-30 14:10 ` [PATCH 3/5] Input: elantech - report the middle button of the touchpad Ulrik De Bie
@ 2014-08-30 14:10 ` Ulrik De Bie
  2014-11-08  8:25   ` Dmitry Torokhov
  2014-08-30 14:10 ` [PATCH 5/5] Input: elantech - Update the documentation: trackpoint,v3/v4,crc_enabled Ulrik De Bie
                   ` (2 subsequent siblings)
  6 siblings, 1 reply; 25+ messages in thread
From: Ulrik De Bie @ 2014-08-30 14:10 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: linux-input, Hans de Goede, David Herrmann, ulrik.debie-os

The detection of crc_enabled is known to fail for Fujitsu H730. A DMI
blacklist is added for that, but it can be expected that other laptops
will pop up with this.

Here a sysfs knob is provided to alter the behaviour of crc_enabled.
Writing 0 or 1 to it sets the variable to 0 or 1.
Writing 2 to it will perform the detection and set the variable to 0
or 1 according to the result of the detection.
Reading it will show the crc_enabled variable (0 or 1).

Reported-by: Stefan Valouch <stefan@valouch.com>
Tested-by: Stefan Valouch <stefan@valouch.com>
Tested-by: Alfredo Gemma <alfredo.gemma@gmail.com>
Signed-off-by: Ulrik De Bie <ulrik.debie-os@e2big.org>
---
 drivers/input/mouse/elantech.c | 36 ++++++++++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)

diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c
index e86bbd7..c2fb961 100644
--- a/drivers/input/mouse/elantech.c
+++ b/drivers/input/mouse/elantech.c
@@ -1305,6 +1305,28 @@ static ssize_t elantech_show_int_attr(struct psmouse *psmouse, void *data,
 	return sprintf(buf, "0x%02x\n", (attr->reg && rc) ? -1 : *reg);
 }
 
+
+/*
+ * Write a register value for crc_enabled.
+ * If "2" is given, perform detect again.
+ */
+static ssize_t elantech_set_int_attr_crc_enabled(struct psmouse *psmouse,
+				     void *data, const char *buf, size_t count)
+{
+	struct elantech_data *etd = psmouse->private;
+	unsigned char value;
+	int err;
+
+	err = kstrtou8(buf, 16, &value);
+	if (err)
+		return err;
+
+	etd->crc_enabled = (value == 2) ? elantech_detect_crc_enabled(etd) :
+		value;
+
+	return count;
+}
+
 /*
  * Write a register value by writing a sysfs entry
  */
@@ -1360,6 +1382,19 @@ ELANTECH_INT_ATTR(reg_26, 0x26);
 ELANTECH_INT_ATTR(debug, 0);
 ELANTECH_INT_ATTR(paritycheck, 0);
 
+#define ELANTECH_INT_ATTR_SETFUNCTION(_name, _register, _setfunction)	\
+	static struct elantech_attr_data elantech_attr_##_name = {	\
+		.field_offset = offsetof(struct elantech_data, _name),	\
+		.reg = _register,					\
+	};								\
+	PSMOUSE_DEFINE_ATTR(_name, S_IWUSR | S_IRUGO,			\
+			    &elantech_attr_##_name,			\
+			    elantech_show_int_attr,			\
+			    _setfunction)
+
+ELANTECH_INT_ATTR_SETFUNCTION(crc_enabled, 0,
+	elantech_set_int_attr_crc_enabled);
+
 static struct attribute *elantech_attrs[] = {
 	&psmouse_attr_reg_07.dattr.attr,
 	&psmouse_attr_reg_10.dattr.attr,
@@ -1373,6 +1408,7 @@ static struct attribute *elantech_attrs[] = {
 	&psmouse_attr_reg_26.dattr.attr,
 	&psmouse_attr_debug.dattr.attr,
 	&psmouse_attr_paritycheck.dattr.attr,
+	&psmouse_attr_crc_enabled.dattr.attr,
 	NULL
 };
 
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH 5/5] Input: elantech - Update the documentation: trackpoint,v3/v4,crc_enabled
  2014-08-30 14:10 [PATCH 0/5] Input: elantech - support the Fujitsu H730 laptop Ulrik De Bie
                   ` (3 preceding siblings ...)
  2014-08-30 14:10 ` [PATCH 4/5] Input: elantech - provide a sysfs knob for crc_enabled Ulrik De Bie
@ 2014-08-30 14:10 ` Ulrik De Bie
  2014-08-31  9:54 ` [PATCH 0/5] Input: elantech - support the Fujitsu H730 laptop Hans de Goede
  2014-10-04  9:33 ` Jan Kiszka
  6 siblings, 0 replies; 25+ messages in thread
From: Ulrik De Bie @ 2014-08-30 14:10 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: linux-input, Hans de Goede, David Herrmann, ulrik.debie-os

A chapter is added to describe the trackpoint packets.

A section is added to describe the behaviour of the knob crc_enabled in
sysfs.

The introduction of the documentation only mentioned v1/v2, but in the
last part it already contains explanation of v3 and v4. The introduction
is updated.

Signed-off-by: Ulrik De Bie <ulrik.debie-os@e2big.org>
---
 Documentation/input/elantech.txt | 85 +++++++++++++++++++++++++++++++++++++---
 1 file changed, 79 insertions(+), 6 deletions(-)

diff --git a/Documentation/input/elantech.txt b/Documentation/input/elantech.txt
index e1ae127..1ec228a 100644
--- a/Documentation/input/elantech.txt
+++ b/Documentation/input/elantech.txt
@@ -38,22 +38,38 @@ Contents
         7.2.1 Status packet
         7.2.2 Head packet
         7.2.3 Motion packet
+ 8. Trackpoint (for Hardware version 3 and 4)
+    8.1 Registers
+    8.2 Native relative mode 6 byte packet format
+        8.2.1 Status Packet
 
 
 
 1. Introduction
    ~~~~~~~~~~~~
 
-Currently the Linux Elantech touchpad driver is aware of two different
-hardware versions unimaginatively called version 1 and version 2. Version 1
-is found in "older" laptops and uses 4 bytes per packet. Version 2 seems to
-be introduced with the EeePC and uses 6 bytes per packet, and provides
-additional features such as position of two fingers, and width of the touch.
+Currently the Linux Elantech touchpad driver is aware of four different
+hardware versions unimaginatively called version 1,version 2, version 3
+and version 4. Version 1 is found in "older" laptops and uses 4 bytes per
+packet. Version 2 seems to be introduced with the EeePC and uses 6 bytes
+per packet, and provides additional features such as position of two fingers,
+and width of the touch.  Hardware version 3 uses 6 bytes per packet (and
+for 2 fingers the concatenation of two 6 bytes packets) and allows tracking
+of up to 3 fingers. Hardware version 4 uses 6 bytes per packet, and can
+combine a status packet with multiple head or motion packets. Hardware version
+4 allows tracking up to 5 fingers.
+
+Some Hardware version 3 and version 4 also have a trackpoint which uses a
+separate packet format. It is also 6 bytes per packet.
 
 The driver tries to support both hardware versions and should be compatible
 with the Xorg Synaptics touchpad driver and its graphical configuration
 utilities.
 
+Note that a mouse button is also associated with either the touchpad or the
+trackpoint when a trackpoint is available.  Disabling the Touchpad in xorg
+(TouchPadOff=0) will also disable the buttons associated with the touchpad.
+
 Additionally the operation of the touchpad can be altered by adjusting the
 contents of some of its internal registers. These registers are represented
 by the driver as sysfs entries under /sys/bus/serio/drivers/psmouse/serio?
@@ -78,7 +94,7 @@ completeness sake.
 2. Extra knobs
    ~~~~~~~~~~~
 
-Currently the Linux Elantech touchpad driver provides two extra knobs under
+Currently the Linux Elantech touchpad driver provides three extra knobs under
 /sys/bus/serio/drivers/psmouse/serio? for the user.
 
 * debug
@@ -112,6 +128,23 @@ Currently the Linux Elantech touchpad driver provides two extra knobs under
    data consistency checking can be done. For now checking is disabled by
    default. Currently even turning it on will do nothing.
 
+* crc_enabled
+
+   Sets crc_enabled to 0/1 or autodetect the crc_enabled. The name
+   "crc_enabled" is the official name of this integrity check, even though
+   it is not an actual cyclic redundancy check.
+
+   Depending on the state of crc_enabled, certain basic data integrity
+   verification is done by the driver on hardware version 3 and 4. The
+   driver will reject any packet that appears corrupted. Using this knob,
+   The state of crc_enabled can be altered with this knob.
+
+   Reading the crc_enabled value will show the active value. Echoing
+   "0" or "1" to this file will set the state to "0" or "1".
+   When echoing "2" to this file, the elantech driver will perform an auto
+   detect again (similar as during startup of the driver) of the value and
+   sets the state "0" or "1" depending on the result of the auto detect.
+
 /////////////////////////////////////////////////////////////////////////////
 
 3. Differentiating hardware versions
@@ -746,3 +779,43 @@ byte 5:
 
         byte 0 ~ 2 for one finger
         byte 3 ~ 5 for another
+
+
+8. Trackpoint (for Hardware version 3 and 4)
+   =========================================
+8.1 Registers
+    ~~~~~~~~~
+No special registers have been identified.
+
+8.2 Native relative mode 6 byte packet format
+    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+8.2.1 Status Packet
+      ~~~~~~~~~~~~~
+
+byte 0:
+   bit   7   6   5   4   3   2   1   0
+         0   0  sx  sy   0   M   R   L
+byte 1:
+   bit   7   6   5   4   3   2   1   0
+       ~sx   0   0   0   0   0   0   0
+byte 2:
+   bit   7   6   5   4   3   2   1   0
+       ~sy   0   0   0   0   0   0   0
+byte 3:
+   bit   7   6   5   4   3   2   1   0
+         0   0 ~sy ~sx   0   1   1   0
+byte 4:
+   bit   7   6   5   4   3   2   1   0
+        x7  x6  x5  x4  x3  x2  x1  x0
+byte 5:
+   bit   7   6   5   4   3   2   1   0
+        y7  y6  y5  y4  y3  y2  y1  y0
+
+
+         x and y are written in two's complement spread
+             over 9 bits with sx/sy the relative top bit and
+             x7..x0 and y7..y0 the lower bits.
+	 ~sx is the inverse of sx, ~sy is the inverse of sy.
+         The sign of y is opposite to what the input driver
+             expects for a relative movement
+
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 25+ messages in thread

* Re: [PATCH 0/5] Input: elantech - support the Fujitsu H730 laptop
  2014-08-30 14:10 [PATCH 0/5] Input: elantech - support the Fujitsu H730 laptop Ulrik De Bie
                   ` (4 preceding siblings ...)
  2014-08-30 14:10 ` [PATCH 5/5] Input: elantech - Update the documentation: trackpoint,v3/v4,crc_enabled Ulrik De Bie
@ 2014-08-31  9:54 ` Hans de Goede
  2014-08-31 15:14   ` ulrik.debie-os
  2014-10-04  9:33 ` Jan Kiszka
  6 siblings, 1 reply; 25+ messages in thread
From: Hans de Goede @ 2014-08-31  9:54 UTC (permalink / raw)
  To: Ulrik De Bie, Dmitry Torokhov; +Cc: linux-input, David Herrmann

Hi,

On 08/30/2014 04:10 PM, Ulrik De Bie wrote:
> This patch set makes the elantech driver work for the Fujitsu H730 laptop. It
> also adds a sysfs knob to allow other laptops that are facing similar
> problems as the Fujitsu H730 to have working touchpad.
> 
> I'm considering adding a WARN_ONCE when the crc_enabled signature check
> fails. The message would then point the user to the crc_enabled sysfs knob,
> and kindly ask the user to report the laptop to linux-input mailinglist ?
> Any suggestions ?

WARN_ONCE includes a backtrace, which will just scare users, simply use a
function static variable to build your own warn_once, which really only does
warn. Other then that I think having a warning pointing to to the sysfs knob is
a good idea. Although maybe it should only trigger on 2 consecutive crc errors
to avoid false positives?

> Two users have tested the combination of this patchset and confirmed that
> it makes the H730 touchpad/trackpoint work.
> 
> Here an overview of the patchset:
> 
> Patch 1/ : Input: elantech - use elantech_report_trackpoint for hardware v4 too
> The Fujitsu H730 is the first v4 hardware identified that also sends the
> trackpoint packets. This patch enables the trackpoint on v4 hardware.
> With this patch the trackpoint will work.
> 
> Patch 2/ : Input: elantech - Fix crc_enabled for Fujitsu H730
> Uses DMI to detect the H730 and ,if detected, will set crc_enabled to 1. 
> With this patch the touchpad and left/right button will start to work.
> 
> Patch 3/ : Input: elantech - report the middle button of the touchpad
> The Fujitsu H730 is the first laptop listed in the elantech.c file with
> 3 touchpad buttons. This patch enables the middle button for all elantech
> hardware and enables the reporting for v4 hardware.
> I want to hear feedback here on what preferences exist for the conditions
> to enable the middle button:
> - DMI
> - enable only for v4
> - enable for all/report for v3+v4

I assume you've tested this on a v4 model without a middle button ? Assuming
that that is the case I think that always enabling it on v4 is fine. I see no
reason to also enable it on v3 as long as we've no reports of v3 models with
3 buttons.

> ...
> 
> Patch 4/ : Input: Elantech - provide a sysfs knob for crc_enabled
> Probably H730 will not remain the only elantech laptop that has this failing
> detection for the crc_enabled. This provides users with a workaround when
> the crc_enabled detection fails.
> 
> Patch 5/ : Elantech - Update the documentation: trackpoint,v3/v4,crc_enabled
> This provides an update of the elantech documentation. 
> 
> Patch 4 depends on patch 2, and for consistency, patch 5 depends on patch 1-2-4.
> 
> Ulrik De Bie (5):
>   Input: elantech - use elantech_report_trackpoint for hardware v4 too
>   Input: elantech - Fix crc_enabled for Fujitsu H730
>   Input: elantech - report the middle button of the touchpad
>   Input: elantech - provide a sysfs knob for crc_enabled
>   Input: elantech - Update the documentation:
>     trackpoint,v3/v4,crc_enabled

The entire series looks good to me (the adding of the warning can be done in a follow
up patch), and is:

Acked-by: Hans de Goede <hdegoede@redhat.com>

Regards,

Hans

> 
>  Documentation/input/elantech.txt |  85 ++++++++++++++++++++++++++--
>  drivers/input/mouse/elantech.c   | 119 ++++++++++++++++++++++++++++++++-------
>  drivers/input/mouse/elantech.h   |   2 +-
>  3 files changed, 179 insertions(+), 27 deletions(-)
> 
> Best regards,
> Ulrik De Bie
> 

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH 0/5] Input: elantech - support the Fujitsu H730 laptop
  2014-08-31  9:54 ` [PATCH 0/5] Input: elantech - support the Fujitsu H730 laptop Hans de Goede
@ 2014-08-31 15:14   ` ulrik.debie-os
  2014-09-01  7:13     ` Hans de Goede
  0 siblings, 1 reply; 25+ messages in thread
From: ulrik.debie-os @ 2014-08-31 15:14 UTC (permalink / raw)
  To: Hans de Goede; +Cc: Dmitry Torokhov, linux-input, David Herrmann

Hi
On Sun, Aug 31, 2014 at 11:54:25AM +0200, Hans de Goede wrote:
> Date:	Sun, 31 Aug 2014 11:54:25 +0200
> From: Hans de Goede <hdegoede@redhat.com>
> To: Ulrik De Bie <ulrik.debie-os@e2big.org>, Dmitry Torokhov
>  <dmitry.torokhov@gmail.com>
> CC: linux-input@vger.kernel.org, David Herrmann <dh.herrmann@gmail.com>
> Subject: Re: [PATCH 0/5] Input: elantech - support the Fujitsu H730 laptop
> X-Mailing-List:	linux-input@vger.kernel.org
> 
> Hi,
> 
> On 08/30/2014 04:10 PM, Ulrik De Bie wrote:
> > This patch set makes the elantech driver work for the Fujitsu H730 laptop. It
> > also adds a sysfs knob to allow other laptops that are facing similar
> > problems as the Fujitsu H730 to have working touchpad.
> > 
> > I'm considering adding a WARN_ONCE when the crc_enabled signature check
> > fails. The message would then point the user to the crc_enabled sysfs knob,
> > and kindly ask the user to report the laptop to linux-input mailinglist ?
> > Any suggestions ?
> 
> WARN_ONCE includes a backtrace, which will just scare users, simply use a
> function static variable to build your own warn_once, which really only does
> warn. Other then that I think having a warning pointing to to the sysfs knob is
> a good idea. Although maybe it should only trigger on 2 consecutive crc errors
> to avoid false positives?

The static variable variant exists as printk_once. But of course, that one
will not allow easy check on 2 consecutive.
 
> > Two users have tested the combination of this patchset and confirmed that
> > it makes the H730 touchpad/trackpoint work.
> > 
> > Here an overview of the patchset:
> > 
> > Patch 1/ : Input: elantech - use elantech_report_trackpoint for hardware v4 too
> > The Fujitsu H730 is the first v4 hardware identified that also sends the
> > trackpoint packets. This patch enables the trackpoint on v4 hardware.
> > With this patch the trackpoint will work.
> > 
> > Patch 2/ : Input: elantech - Fix crc_enabled for Fujitsu H730
> > Uses DMI to detect the H730 and ,if detected, will set crc_enabled to 1. 
> > With this patch the touchpad and left/right button will start to work.
> > 
> > Patch 3/ : Input: elantech - report the middle button of the touchpad
> > The Fujitsu H730 is the first laptop listed in the elantech.c file with
> > 3 touchpad buttons. This patch enables the middle button for all elantech
> > hardware and enables the reporting for v4 hardware.
> > I want to hear feedback here on what preferences exist for the conditions
> > to enable the middle button:
> > - DMI
> > - enable only for v4
> > - enable for all/report for v3+v4
> 
> I assume you've tested this on a v4 model without a middle button ? Assuming
> that that is the case I think that always enabling it on v4 is fine. I see no
> reason to also enable it on v3 as long as we've no reports of v3 models with
> 3 buttons.

No I have only tested myself on L530 (v3 with 2 touchpad buttons) and the two
testers have tested on Fujitsu H730 (v4 with 3 touchpad buttons).

Looking at the list in elantech, that would preferably be a test on Asus
G46VW or G750JX. Since you were able to come up with the list, do you
happen also to know contact details of some with such a laptop ?

> > ...
> > 
> > Patch 4/ : Input: Elantech - provide a sysfs knob for crc_enabled
> > Probably H730 will not remain the only elantech laptop that has this failing
> > detection for the crc_enabled. This provides users with a workaround when
> > the crc_enabled detection fails.
> > 
> > Patch 5/ : Elantech - Update the documentation: trackpoint,v3/v4,crc_enabled
> > This provides an update of the elantech documentation. 
> > 
> > Patch 4 depends on patch 2, and for consistency, patch 5 depends on patch 1-2-4.
> > 
> > Ulrik De Bie (5):
> >   Input: elantech - use elantech_report_trackpoint for hardware v4 too
> >   Input: elantech - Fix crc_enabled for Fujitsu H730
> >   Input: elantech - report the middle button of the touchpad
> >   Input: elantech - provide a sysfs knob for crc_enabled
> >   Input: elantech - Update the documentation:
> >     trackpoint,v3/v4,crc_enabled
> 
> The entire series looks good to me (the adding of the warning can be done in a follow
> up patch), and is:
> 
> Acked-by: Hans de Goede <hdegoede@redhat.com>
> 
> Regards,
> 
> Hans

Thanks for your feedback !

Regards,
Ulrik

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH 0/5] Input: elantech - support the Fujitsu H730 laptop
  2014-08-31 15:14   ` ulrik.debie-os
@ 2014-09-01  7:13     ` Hans de Goede
  0 siblings, 0 replies; 25+ messages in thread
From: Hans de Goede @ 2014-09-01  7:13 UTC (permalink / raw)
  To: ulrik.debie-os; +Cc: Dmitry Torokhov, linux-input, David Herrmann

Hi,

On 08/31/2014 05:14 PM, ulrik.debie-os@e2big.org wrote:
> Hi
> On Sun, Aug 31, 2014 at 11:54:25AM +0200, Hans de Goede wrote:
>> Date:	Sun, 31 Aug 2014 11:54:25 +0200
>> From: Hans de Goede <hdegoede@redhat.com>
>> To: Ulrik De Bie <ulrik.debie-os@e2big.org>, Dmitry Torokhov
>>  <dmitry.torokhov@gmail.com>
>> CC: linux-input@vger.kernel.org, David Herrmann <dh.herrmann@gmail.com>
>> Subject: Re: [PATCH 0/5] Input: elantech - support the Fujitsu H730 laptop
>> X-Mailing-List:	linux-input@vger.kernel.org
>>
>> Hi,
>>
>> On 08/30/2014 04:10 PM, Ulrik De Bie wrote:
>>> This patch set makes the elantech driver work for the Fujitsu H730 laptop. It
>>> also adds a sysfs knob to allow other laptops that are facing similar
>>> problems as the Fujitsu H730 to have working touchpad.
>>>
>>> I'm considering adding a WARN_ONCE when the crc_enabled signature check
>>> fails. The message would then point the user to the crc_enabled sysfs knob,
>>> and kindly ask the user to report the laptop to linux-input mailinglist ?
>>> Any suggestions ?
>>
>> WARN_ONCE includes a backtrace, which will just scare users, simply use a
>> function static variable to build your own warn_once, which really only does
>> warn. Other then that I think having a warning pointing to to the sysfs knob is
>> a good idea. Although maybe it should only trigger on 2 consecutive crc errors
>> to avoid false positives?
> 
> The static variable variant exists as printk_once. But of course, that one
> will not allow easy check on 2 consecutive.

Right, still spurious triggering is rather unlikely to actually happen, so lets
just go with printk_once.

>  
>>> Two users have tested the combination of this patchset and confirmed that
>>> it makes the H730 touchpad/trackpoint work.
>>>
>>> Here an overview of the patchset:
>>>
>>> Patch 1/ : Input: elantech - use elantech_report_trackpoint for hardware v4 too
>>> The Fujitsu H730 is the first v4 hardware identified that also sends the
>>> trackpoint packets. This patch enables the trackpoint on v4 hardware.
>>> With this patch the trackpoint will work.
>>>
>>> Patch 2/ : Input: elantech - Fix crc_enabled for Fujitsu H730
>>> Uses DMI to detect the H730 and ,if detected, will set crc_enabled to 1. 
>>> With this patch the touchpad and left/right button will start to work.
>>>
>>> Patch 3/ : Input: elantech - report the middle button of the touchpad
>>> The Fujitsu H730 is the first laptop listed in the elantech.c file with
>>> 3 touchpad buttons. This patch enables the middle button for all elantech
>>> hardware and enables the reporting for v4 hardware.
>>> I want to hear feedback here on what preferences exist for the conditions
>>> to enable the middle button:
>>> - DMI
>>> - enable only for v4
>>> - enable for all/report for v3+v4
>>
>> I assume you've tested this on a v4 model without a middle button ? Assuming
>> that that is the case I think that always enabling it on v4 is fine. I see no
>> reason to also enable it on v3 as long as we've no reports of v3 models with
>> 3 buttons.
> 
> No I have only tested myself on L530 (v3 with 2 touchpad buttons) and the two
> testers have tested on Fujitsu H730 (v4 with 3 touchpad buttons).
> 
> Looking at the list in elantech, that would preferably be a test on Asus
> G46VW or G750JX. Since you were able to come up with the list, do you
> happen also to know contact details of some with such a laptop ?

I made that list by manual scraping info from forum and bug tracker posts,
so I'm afraid I've no contact info. All the other touchpad drivers sofar
are able to test for a middle button press without getting spurious
presses on laptops which don't have a middle button. So lets just move forward
with your patch as is, we can always go the dmi quirk route if it turns out
to cause troubles.

> 
>>> ...
>>>
>>> Patch 4/ : Input: Elantech - provide a sysfs knob for crc_enabled
>>> Probably H730 will not remain the only elantech laptop that has this failing
>>> detection for the crc_enabled. This provides users with a workaround when
>>> the crc_enabled detection fails.
>>>
>>> Patch 5/ : Elantech - Update the documentation: trackpoint,v3/v4,crc_enabled
>>> This provides an update of the elantech documentation. 
>>>
>>> Patch 4 depends on patch 2, and for consistency, patch 5 depends on patch 1-2-4.
>>>
>>> Ulrik De Bie (5):
>>>   Input: elantech - use elantech_report_trackpoint for hardware v4 too
>>>   Input: elantech - Fix crc_enabled for Fujitsu H730
>>>   Input: elantech - report the middle button of the touchpad
>>>   Input: elantech - provide a sysfs knob for crc_enabled
>>>   Input: elantech - Update the documentation:
>>>     trackpoint,v3/v4,crc_enabled
>>
>> The entire series looks good to me (the adding of the warning can be done in a follow
>> up patch), and is:
>>
>> Acked-by: Hans de Goede <hdegoede@redhat.com>
>>
>> Regards,
>>
>> Hans
> 
> Thanks for your feedback !
> 
> Regards,
> Ulrik
> 

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH 0/5] Input: elantech - support the Fujitsu H730 laptop
  2014-08-30 14:10 [PATCH 0/5] Input: elantech - support the Fujitsu H730 laptop Ulrik De Bie
                   ` (5 preceding siblings ...)
  2014-08-31  9:54 ` [PATCH 0/5] Input: elantech - support the Fujitsu H730 laptop Hans de Goede
@ 2014-10-04  9:33 ` Jan Kiszka
  2014-10-04  9:36   ` Hans de Goede
  6 siblings, 1 reply; 25+ messages in thread
From: Jan Kiszka @ 2014-10-04  9:33 UTC (permalink / raw)
  To: Ulrik De Bie, Dmitry Torokhov; +Cc: linux-input, Hans de Goede, David Herrmann

[-- Attachment #1: Type: text/plain, Size: 3009 bytes --]

On 2014-08-30 16:10, Ulrik De Bie wrote:
> This patch set makes the elantech driver work for the Fujitsu H730 laptop. It
> also adds a sysfs knob to allow other laptops that are facing similar
> problems as the Fujitsu H730 to have working touchpad.
> 
> I'm considering adding a WARN_ONCE when the crc_enabled signature check
> fails. The message would then point the user to the crc_enabled sysfs knob,
> and kindly ask the user to report the laptop to linux-input mailinglist ?
> Any suggestions ?
> 
> Two users have tested the combination of this patchset and confirmed that
> it makes the H730 touchpad/trackpoint work.
> 
> Here an overview of the patchset:
> 
> Patch 1/ : Input: elantech - use elantech_report_trackpoint for hardware v4 too
> The Fujitsu H730 is the first v4 hardware identified that also sends the
> trackpoint packets. This patch enables the trackpoint on v4 hardware.
> With this patch the trackpoint will work.
> 
> Patch 2/ : Input: elantech - Fix crc_enabled for Fujitsu H730
> Uses DMI to detect the H730 and ,if detected, will set crc_enabled to 1. 
> With this patch the touchpad and left/right button will start to work.
> 
> Patch 3/ : Input: elantech - report the middle button of the touchpad
> The Fujitsu H730 is the first laptop listed in the elantech.c file with
> 3 touchpad buttons. This patch enables the middle button for all elantech
> hardware and enables the reporting for v4 hardware.
> I want to hear feedback here on what preferences exist for the conditions
> to enable the middle button:
> - DMI
> - enable only for v4
> - enable for all/report for v3+v4
> ...
> 
> Patch 4/ : Input: Elantech - provide a sysfs knob for crc_enabled
> Probably H730 will not remain the only elantech laptop that has this failing
> detection for the crc_enabled. This provides users with a workaround when
> the crc_enabled detection fails.
> 
> Patch 5/ : Elantech - Update the documentation: trackpoint,v3/v4,crc_enabled
> This provides an update of the elantech documentation. 
> 
> Patch 4 depends on patch 2, and for consistency, patch 5 depends on patch 1-2-4.
> 
> Ulrik De Bie (5):
>   Input: elantech - use elantech_report_trackpoint for hardware v4 too
>   Input: elantech - Fix crc_enabled for Fujitsu H730
>   Input: elantech - report the middle button of the touchpad
>   Input: elantech - provide a sysfs knob for crc_enabled
>   Input: elantech - Update the documentation:
>     trackpoint,v3/v4,crc_enabled
> 
>  Documentation/input/elantech.txt |  85 ++++++++++++++++++++++++++--
>  drivers/input/mouse/elantech.c   | 119 ++++++++++++++++++++++++++++++++-------
>  drivers/input/mouse/elantech.h   |   2 +-
>  3 files changed, 179 insertions(+), 27 deletions(-)
> 
> Best regards,
> Ulrik De Bie
> 

What's the status of this series? Is it queued for 3.18 already?

I'm on H730, and these patches work nicely here. Would be great being
able to use a distro kernel at some point...

Jan


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH 0/5] Input: elantech - support the Fujitsu H730 laptop
  2014-10-04  9:33 ` Jan Kiszka
@ 2014-10-04  9:36   ` Hans de Goede
  2014-10-23 18:36     ` ulrik.debie-os
  0 siblings, 1 reply; 25+ messages in thread
From: Hans de Goede @ 2014-10-04  9:36 UTC (permalink / raw)
  To: Jan Kiszka, Ulrik De Bie, Dmitry Torokhov; +Cc: linux-input, David Herrmann

Hi,

On 10/04/2014 11:33 AM, Jan Kiszka wrote:
> On 2014-08-30 16:10, Ulrik De Bie wrote:
>> This patch set makes the elantech driver work for the Fujitsu H730 laptop. It
>> also adds a sysfs knob to allow other laptops that are facing similar
>> problems as the Fujitsu H730 to have working touchpad.
>>
>> I'm considering adding a WARN_ONCE when the crc_enabled signature check
>> fails. The message would then point the user to the crc_enabled sysfs knob,
>> and kindly ask the user to report the laptop to linux-input mailinglist ?
>> Any suggestions ?
>>
>> Two users have tested the combination of this patchset and confirmed that
>> it makes the H730 touchpad/trackpoint work.
>>
>> Here an overview of the patchset:
>>
>> Patch 1/ : Input: elantech - use elantech_report_trackpoint for hardware v4 too
>> The Fujitsu H730 is the first v4 hardware identified that also sends the
>> trackpoint packets. This patch enables the trackpoint on v4 hardware.
>> With this patch the trackpoint will work.
>>
>> Patch 2/ : Input: elantech - Fix crc_enabled for Fujitsu H730
>> Uses DMI to detect the H730 and ,if detected, will set crc_enabled to 1. 
>> With this patch the touchpad and left/right button will start to work.
>>
>> Patch 3/ : Input: elantech - report the middle button of the touchpad
>> The Fujitsu H730 is the first laptop listed in the elantech.c file with
>> 3 touchpad buttons. This patch enables the middle button for all elantech
>> hardware and enables the reporting for v4 hardware.
>> I want to hear feedback here on what preferences exist for the conditions
>> to enable the middle button:
>> - DMI
>> - enable only for v4
>> - enable for all/report for v3+v4
>> ...
>>
>> Patch 4/ : Input: Elantech - provide a sysfs knob for crc_enabled
>> Probably H730 will not remain the only elantech laptop that has this failing
>> detection for the crc_enabled. This provides users with a workaround when
>> the crc_enabled detection fails.
>>
>> Patch 5/ : Elantech - Update the documentation: trackpoint,v3/v4,crc_enabled
>> This provides an update of the elantech documentation. 
>>
>> Patch 4 depends on patch 2, and for consistency, patch 5 depends on patch 1-2-4.
>>
>> Ulrik De Bie (5):
>>   Input: elantech - use elantech_report_trackpoint for hardware v4 too
>>   Input: elantech - Fix crc_enabled for Fujitsu H730
>>   Input: elantech - report the middle button of the touchpad
>>   Input: elantech - provide a sysfs knob for crc_enabled
>>   Input: elantech - Update the documentation:
>>     trackpoint,v3/v4,crc_enabled
>>
>>  Documentation/input/elantech.txt |  85 ++++++++++++++++++++++++++--
>>  drivers/input/mouse/elantech.c   | 119 ++++++++++++++++++++++++++++++++-------
>>  drivers/input/mouse/elantech.h   |   2 +-
>>  3 files changed, 179 insertions(+), 27 deletions(-)
>>
>> Best regards,
>> Ulrik De Bie
>>
> 
> What's the status of this series? Is it queued for 3.18 already?

I don't see them in next yet:

http://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/log/drivers/input/mouse/elantech.c

I agree it would be nice to get these into 3.18.

Dmitry, what is the plan here ?

Regards,

Hans

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH 0/5] Input: elantech - support the Fujitsu H730 laptop
  2014-10-04  9:36   ` Hans de Goede
@ 2014-10-23 18:36     ` ulrik.debie-os
  2014-10-23 18:39       ` Dmitry Torokhov
  0 siblings, 1 reply; 25+ messages in thread
From: ulrik.debie-os @ 2014-10-23 18:36 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: Jan Kiszka, Hans de Goede, linux-input, David Herrmann

Hi Dmitry,

On Sat, Oct 04, 2014 at 11:36:26AM +0200, Hans de Goede wrote:
> Hi,
> 
> On 10/04/2014 11:33 AM, Jan Kiszka wrote:
> > On 2014-08-30 16:10, Ulrik De Bie wrote:
> >> This patch set makes the elantech driver work for the Fujitsu H730 laptop. It
> >> also adds a sysfs knob to allow other laptops that are facing similar
> >> problems as the Fujitsu H730 to have working touchpad.
> >>
> >> I'm considering adding a WARN_ONCE when the crc_enabled signature check
> >> fails. The message would then point the user to the crc_enabled sysfs knob,
> >> and kindly ask the user to report the laptop to linux-input mailinglist ?
> >> Any suggestions ?
> >>
> >> Two users have tested the combination of this patchset and confirmed that
> >> it makes the H730 touchpad/trackpoint work.
> >>
> >> Here an overview of the patchset:
> >>
> >> Patch 1/ : Input: elantech - use elantech_report_trackpoint for hardware v4 too
> >> The Fujitsu H730 is the first v4 hardware identified that also sends the
> >> trackpoint packets. This patch enables the trackpoint on v4 hardware.
> >> With this patch the trackpoint will work.
> >>
> >> Patch 2/ : Input: elantech - Fix crc_enabled for Fujitsu H730
> >> Uses DMI to detect the H730 and ,if detected, will set crc_enabled to 1. 
> >> With this patch the touchpad and left/right button will start to work.
> >>
> >> Patch 3/ : Input: elantech - report the middle button of the touchpad
> >> The Fujitsu H730 is the first laptop listed in the elantech.c file with
> >> 3 touchpad buttons. This patch enables the middle button for all elantech
> >> hardware and enables the reporting for v4 hardware.
> >> I want to hear feedback here on what preferences exist for the conditions
> >> to enable the middle button:
> >> - DMI
> >> - enable only for v4
> >> - enable for all/report for v3+v4
> >> ...
> >>
> >> Patch 4/ : Input: Elantech - provide a sysfs knob for crc_enabled
> >> Probably H730 will not remain the only elantech laptop that has this failing
> >> detection for the crc_enabled. This provides users with a workaround when
> >> the crc_enabled detection fails.
> >>
> >> Patch 5/ : Elantech - Update the documentation: trackpoint,v3/v4,crc_enabled
> >> This provides an update of the elantech documentation. 
> >>
> >> Patch 4 depends on patch 2, and for consistency, patch 5 depends on patch 1-2-4.
> >>
> >> Ulrik De Bie (5):
> >>   Input: elantech - use elantech_report_trackpoint for hardware v4 too
> >>   Input: elantech - Fix crc_enabled for Fujitsu H730
> >>   Input: elantech - report the middle button of the touchpad
> >>   Input: elantech - provide a sysfs knob for crc_enabled
> >>   Input: elantech - Update the documentation:
> >>     trackpoint,v3/v4,crc_enabled
> >>
> >>  Documentation/input/elantech.txt |  85 ++++++++++++++++++++++++++--
> >>  drivers/input/mouse/elantech.c   | 119 ++++++++++++++++++++++++++++++++-------
> >>  drivers/input/mouse/elantech.h   |   2 +-
> >>  3 files changed, 179 insertions(+), 27 deletions(-)
> >>
> >> Best regards,
> >> Ulrik De Bie
> >>
> > 
> > What's the status of this series? Is it queued for 3.18 already?
> 
> I don't see them in next yet:
> 
> http://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/log/drivers/input/mouse/elantech.c
> 
> I agree it would be nice to get these into 3.18.
> 
> Dmitry, what is the plan here ?

Ping Dmitry ?

Do you want me to resend the patch ?

Kind regards,
Ulrik

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH 0/5] Input: elantech - support the Fujitsu H730 laptop
  2014-10-23 18:36     ` ulrik.debie-os
@ 2014-10-23 18:39       ` Dmitry Torokhov
  2014-11-06 19:20         ` ulrik.debie-os
  0 siblings, 1 reply; 25+ messages in thread
From: Dmitry Torokhov @ 2014-10-23 18:39 UTC (permalink / raw)
  To: ulrik.debie-os; +Cc: Jan Kiszka, Hans de Goede, linux-input, David Herrmann

On Thursday, October 23, 2014 08:36:19 PM ulrik.debie-os@e2big.org wrote:
> Hi Dmitry,
> 
> On Sat, Oct 04, 2014 at 11:36:26AM +0200, Hans de Goede wrote:
> > Hi,
> > 
> > On 10/04/2014 11:33 AM, Jan Kiszka wrote:
> > > On 2014-08-30 16:10, Ulrik De Bie wrote:
> > >> This patch set makes the elantech driver work for the Fujitsu H730
> > >> laptop. It also adds a sysfs knob to allow other laptops that are
> > >> facing similar problems as the Fujitsu H730 to have working touchpad.
> > >> 
> > >> I'm considering adding a WARN_ONCE when the crc_enabled signature check
> > >> fails. The message would then point the user to the crc_enabled sysfs
> > >> knob,
> > >> and kindly ask the user to report the laptop to linux-input mailinglist
> > >> ?
> > >> Any suggestions ?
> > >> 
> > >> Two users have tested the combination of this patchset and confirmed
> > >> that
> > >> it makes the H730 touchpad/trackpoint work.
> > >> 
> > >> Here an overview of the patchset:
> > >> 
> > >> Patch 1/ : Input: elantech - use elantech_report_trackpoint for
> > >> hardware v4 too The Fujitsu H730 is the first v4 hardware identified
> > >> that also sends the trackpoint packets. This patch enables the
> > >> trackpoint on v4 hardware. With this patch the trackpoint will work.
> > >> 
> > >> Patch 2/ : Input: elantech - Fix crc_enabled for Fujitsu H730
> > >> Uses DMI to detect the H730 and ,if detected, will set crc_enabled to
> > >> 1.
> > >> With this patch the touchpad and left/right button will start to work.
> > >> 
> > >> Patch 3/ : Input: elantech - report the middle button of the touchpad
> > >> The Fujitsu H730 is the first laptop listed in the elantech.c file with
> > >> 3 touchpad buttons. This patch enables the middle button for all
> > >> elantech
> > >> hardware and enables the reporting for v4 hardware.
> > >> I want to hear feedback here on what preferences exist for the
> > >> conditions
> > >> to enable the middle button:
> > >> - DMI
> > >> - enable only for v4
> > >> - enable for all/report for v3+v4
> > >> ...
> > >> 
> > >> Patch 4/ : Input: Elantech - provide a sysfs knob for crc_enabled
> > >> Probably H730 will not remain the only elantech laptop that has this
> > >> failing detection for the crc_enabled. This provides users with a
> > >> workaround when the crc_enabled detection fails.
> > >> 
> > >> Patch 5/ : Elantech - Update the documentation:
> > >> trackpoint,v3/v4,crc_enabled This provides an update of the elantech
> > >> documentation.
> > >> 
> > >> Patch 4 depends on patch 2, and for consistency, patch 5 depends on
> > >> patch 1-2-4.> >> 
> > >> Ulrik De Bie (5):
> > >>   Input: elantech - use elantech_report_trackpoint for hardware v4 too
> > >>   Input: elantech - Fix crc_enabled for Fujitsu H730
> > >>   Input: elantech - report the middle button of the touchpad
> > >>   Input: elantech - provide a sysfs knob for crc_enabled
> > >>   
> > >>   Input: elantech - Update the documentation:
> > >>     trackpoint,v3/v4,crc_enabled
> > >>  
> > >>  Documentation/input/elantech.txt |  85 ++++++++++++++++++++++++++--
> > >>  drivers/input/mouse/elantech.c   | 119
> > >>  ++++++++++++++++++++++++++++++++-------
> > >>  drivers/input/mouse/elantech.h   |   2 +-
> > >>  3 files changed, 179 insertions(+), 27 deletions(-)
> > >> 
> > >> Best regards,
> > >> Ulrik De Bie
> > > 
> > > What's the status of this series? Is it queued for 3.18 already?
> > 
> > I don't see them in next yet:
> > 
> > http://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/log/driver
> > s/input/mouse/elantech.c
> > 
> > I agree it would be nice to get these into 3.18.
> > 
> > Dmitry, what is the plan here ?
> 
> Ping Dmitry ?
> 
> Do you want me to resend the patch ?

Hi Ulrik,

No, I have it, didn't have a chance to look at it though. Give me a day or so
please.

Thanks.

-- 
Dmitry

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH 0/5] Input: elantech - support the Fujitsu H730 laptop
  2014-10-23 18:39       ` Dmitry Torokhov
@ 2014-11-06 19:20         ` ulrik.debie-os
  0 siblings, 0 replies; 25+ messages in thread
From: ulrik.debie-os @ 2014-11-06 19:20 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: Jan Kiszka, Hans de Goede, linux-input, David Herrmann

Ping.

I hope the mux regression problem has settled down a bit in the mean time.

On Thu, Oct 23, 2014 at 11:39:43AM -0700, Dmitry Torokhov wrote:
> Date: Thu, 23 Oct 2014 11:39:43 -0700
> From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> To: ulrik.debie-os@e2big.org
> Cc: Jan Kiszka <jan.kiszka@web.de>, Hans de Goede <hdegoede@redhat.com>,
>  linux-input@vger.kernel.org, David Herrmann <dh.herrmann@gmail.com>
> Subject: Re: [PATCH 0/5] Input: elantech - support the Fujitsu H730 laptop
> 
> On Thursday, October 23, 2014 08:36:19 PM ulrik.debie-os@e2big.org wrote:
> > Hi Dmitry,
> > 
> > On Sat, Oct 04, 2014 at 11:36:26AM +0200, Hans de Goede wrote:
> > > Hi,
> > > 
> > > On 10/04/2014 11:33 AM, Jan Kiszka wrote:
> > > > On 2014-08-30 16:10, Ulrik De Bie wrote:
> > > >> This patch set makes the elantech driver work for the Fujitsu H730
> > > >> laptop. It also adds a sysfs knob to allow other laptops that are
> > > >> facing similar problems as the Fujitsu H730 to have working touchpad.
> > > >> 
> > > >> I'm considering adding a WARN_ONCE when the crc_enabled signature check
> > > >> fails. The message would then point the user to the crc_enabled sysfs
> > > >> knob,
> > > >> and kindly ask the user to report the laptop to linux-input mailinglist
> > > >> ?
> > > >> Any suggestions ?
> > > >> 
> > > >> Two users have tested the combination of this patchset and confirmed
> > > >> that
> > > >> it makes the H730 touchpad/trackpoint work.
> > > >> 
> > > >> Here an overview of the patchset:
> > > >> 
> > > >> Patch 1/ : Input: elantech - use elantech_report_trackpoint for
> > > >> hardware v4 too The Fujitsu H730 is the first v4 hardware identified
> > > >> that also sends the trackpoint packets. This patch enables the
> > > >> trackpoint on v4 hardware. With this patch the trackpoint will work.
> > > >> 
> > > >> Patch 2/ : Input: elantech - Fix crc_enabled for Fujitsu H730
> > > >> Uses DMI to detect the H730 and ,if detected, will set crc_enabled to
> > > >> 1.
> > > >> With this patch the touchpad and left/right button will start to work.
> > > >> 
> > > >> Patch 3/ : Input: elantech - report the middle button of the touchpad
> > > >> The Fujitsu H730 is the first laptop listed in the elantech.c file with
> > > >> 3 touchpad buttons. This patch enables the middle button for all
> > > >> elantech
> > > >> hardware and enables the reporting for v4 hardware.
> > > >> I want to hear feedback here on what preferences exist for the
> > > >> conditions
> > > >> to enable the middle button:
> > > >> - DMI
> > > >> - enable only for v4
> > > >> - enable for all/report for v3+v4
> > > >> ...
> > > >> 
> > > >> Patch 4/ : Input: Elantech - provide a sysfs knob for crc_enabled
> > > >> Probably H730 will not remain the only elantech laptop that has this
> > > >> failing detection for the crc_enabled. This provides users with a
> > > >> workaround when the crc_enabled detection fails.
> > > >> 
> > > >> Patch 5/ : Elantech - Update the documentation:
> > > >> trackpoint,v3/v4,crc_enabled This provides an update of the elantech
> > > >> documentation.
> > > >> 
> > > >> Patch 4 depends on patch 2, and for consistency, patch 5 depends on
> > > >> patch 1-2-4.> >> 
> > > >> Ulrik De Bie (5):
> > > >>   Input: elantech - use elantech_report_trackpoint for hardware v4 too
> > > >>   Input: elantech - Fix crc_enabled for Fujitsu H730
> > > >>   Input: elantech - report the middle button of the touchpad
> > > >>   Input: elantech - provide a sysfs knob for crc_enabled
> > > >>   
> > > >>   Input: elantech - Update the documentation:
> > > >>     trackpoint,v3/v4,crc_enabled
> > > >>  
> > > >>  Documentation/input/elantech.txt |  85 ++++++++++++++++++++++++++--
> > > >>  drivers/input/mouse/elantech.c   | 119
> > > >>  ++++++++++++++++++++++++++++++++-------
> > > >>  drivers/input/mouse/elantech.h   |   2 +-
> > > >>  3 files changed, 179 insertions(+), 27 deletions(-)
> > > >> 
> > > >> Best regards,
> > > >> Ulrik De Bie
> > > > 
> > > > What's the status of this series? Is it queued for 3.18 already?
> > > 
> > > I don't see them in next yet:
> > > 
> > > http://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/log/driver
> > > s/input/mouse/elantech.c
> > > 
> > > I agree it would be nice to get these into 3.18.
> > > 
> > > Dmitry, what is the plan here ?
> > 
> > Ping Dmitry ?
> > 
> > Do you want me to resend the patch ?
> 
> Hi Ulrik,
> 
> No, I have it, didn't have a chance to look at it though. Give me a day or so
> please.
> 
> Thanks.
> 
> -- 
> Dmitry

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH 1/5] Input: elantech - use elantech_report_trackpoint for hardware v4 too
  2014-08-30 14:10 ` [PATCH 1/5] Input: elantech - use elantech_report_trackpoint for hardware v4 too Ulrik De Bie
@ 2014-11-08  8:21   ` Dmitry Torokhov
  2014-11-20  6:58   ` Bisected two-finger scrolling regression on Lenovo Y50 (Re: [PATCH 1/5] Input: elantech - use elantech_report_trackpoint for hardware v4 too) Anders Kaseorg
  1 sibling, 0 replies; 25+ messages in thread
From: Dmitry Torokhov @ 2014-11-08  8:21 UTC (permalink / raw)
  To: Ulrik De Bie; +Cc: linux-input, Hans de Goede, David Herrmann

On Sat, Aug 30, 2014 at 04:10:42PM +0200, Ulrik De Bie wrote:
> The Fujitsu H730 has hardware v4 with a trackpoint. This enables
> the elantech_report_trackpoint for v4.
> 
> Reported-by: Stefan Valouch <stefan@valouch.com>
> Tested-by: Stefan Valouch <stefan@valouch.com>
> Tested-by: Alfredo Gemma <alfredo.gemma@gmail.com>
> Signed-off-by: Ulrik De Bie <ulrik.debie-os@e2big.org>

Applied, thank you.

> ---
>  drivers/input/mouse/elantech.c | 16 ++++++++++++++--
>  1 file changed, 14 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c
> index da51738..f0a55b4d 100644
> --- a/drivers/input/mouse/elantech.c
> +++ b/drivers/input/mouse/elantech.c
> @@ -792,6 +792,9 @@ static int elantech_packet_check_v4(struct psmouse *psmouse)
>  	unsigned char packet_type = packet[3] & 0x03;
>  	bool sanity_check;
>  
> +	if ((packet[3]&0x0f) == 0x06)
> +		return PACKET_TRACKPOINT;
> +
>  	/*
>  	 * Sanity check based on the constant bits of a packet.
>  	 * The constant bits change depending on the value of
> @@ -877,10 +880,19 @@ static psmouse_ret_t elantech_process_byte(struct psmouse *psmouse)
>  
>  	case 4:
>  		packet_type = elantech_packet_check_v4(psmouse);
> -		if (packet_type == PACKET_UNKNOWN)
> +		switch (packet_type) {
> +		case PACKET_UNKNOWN:
>  			return PSMOUSE_BAD_DATA;
>  
> -		elantech_report_absolute_v4(psmouse, packet_type);
> +		case PACKET_TRACKPOINT:
> +			elantech_report_trackpoint(psmouse, packet_type);
> +			break;
> +
> +		default:
> +			elantech_report_absolute_v4(psmouse, packet_type);
> +			break;
> +		}
> +
>  		break;
>  	}
>  
> -- 
> 2.1.0
> 

-- 
Dmitry

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH 2/5] Input: elantech - Fix crc_enabled for Fujitsu H730
  2014-08-30 14:10 ` [PATCH 2/5] Input: elantech - Fix crc_enabled for Fujitsu H730 Ulrik De Bie
@ 2014-11-08  8:22   ` Dmitry Torokhov
  0 siblings, 0 replies; 25+ messages in thread
From: Dmitry Torokhov @ 2014-11-08  8:22 UTC (permalink / raw)
  To: Ulrik De Bie; +Cc: linux-input, Hans de Goede, David Herrmann

On Sat, Aug 30, 2014 at 04:10:43PM +0200, Ulrik De Bie wrote:
> The Fujitsu H730 does not work with crc_enabled = 0, even though the
> crc_enabled bit in the firmware version indicated it would. When switching
> this value to crc_enabled to 1, the touchpad works. This patch uses
> DMI to detect H730.
> 
> Reported-by: Stefan Valouch <stefan@valouch.com>
> Tested-by: Stefan Valouch <stefan@valouch.com>
> Tested-by: Alfredo Gemma <alfredo.gemma@gmail.com>
> Signed-off-by: Ulrik De Bie <ulrik.debie-os@e2big.org>

Applied with some edits to minimize patch size, thank you.

> ---
>  drivers/input/mouse/elantech.c | 65 ++++++++++++++++++++++++++++++------------
>  drivers/input/mouse/elantech.h |  2 +-
>  2 files changed, 48 insertions(+), 19 deletions(-)
> 
> diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c
> index f0a55b4d..67d56c0 100644
> --- a/drivers/input/mouse/elantech.c
> +++ b/drivers/input/mouse/elantech.c
> @@ -1235,6 +1235,52 @@ static int elantech_set_input_params(struct psmouse *psmouse)
>  	return 0;
>  }
>  
> +/*
> + * Some hw_version 3 models go into error state when we try to set
> + * bit 3 and/or bit 1 of r10.
> + */
> +static const struct dmi_system_id no_hw_res_dmi_table[] = {
> +#if defined(CONFIG_DMI) && defined(CONFIG_X86)
> +	{
> +		/* Gigabyte U2442 */
> +		.matches = {
> +			DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
> +			DMI_MATCH(DMI_PRODUCT_NAME, "U2442"),
> +		},
> +	},
> +#endif
> +	{ }
> +};
> +
> +/*
> + * Some hw_version 4 models do not work with crc_disabled
> + */
> +static const struct dmi_system_id elantech_dmi_crc_enabled[] = {
> +#if defined(CONFIG_DMI) && defined(CONFIG_X86)
> +	{
> +		/* Fujitsu H730 does not work with crc_enabled == 0 */
> +		.matches = {
> +			DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
> +			DMI_MATCH(DMI_PRODUCT_NAME, "CELSIUS H730"),
> +		},
> +	},
> +#endif
> +	{ }
> +};
> +
> +/*
> + * Autodetect crc_enabled and verify override DMI table
> + */
> +static unsigned char elantech_detect_crc_enabled(struct elantech_data *etd)
> +{
> +
> +#if defined(CONFIG_DMI) && defined(CONFIG_X86)
> +	if (dmi_check_system(elantech_dmi_crc_enabled))
> +		return 1;
> +#endif /* CONFIG_X86 */
> +
> +	return ((etd->fw_version & 0x4000) == 0x4000);
> +}
>  struct elantech_attr_data {
>  	size_t		field_offset;
>  	unsigned char	reg;
> @@ -1444,23 +1490,6 @@ static int elantech_reconnect(struct psmouse *psmouse)
>  }
>  
>  /*
> - * Some hw_version 3 models go into error state when we try to set
> - * bit 3 and/or bit 1 of r10.
> - */
> -static const struct dmi_system_id no_hw_res_dmi_table[] = {
> -#if defined(CONFIG_DMI) && defined(CONFIG_X86)
> -	{
> -		/* Gigabyte U2442 */
> -		.matches = {
> -			DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
> -			DMI_MATCH(DMI_PRODUCT_NAME, "U2442"),
> -		},
> -	},
> -#endif
> -	{ }
> -};
> -
> -/*
>   * determine hardware version and set some properties according to it.
>   */
>  static int elantech_set_properties(struct elantech_data *etd)
> @@ -1518,7 +1547,7 @@ static int elantech_set_properties(struct elantech_data *etd)
>  	 * The signatures of v3 and v4 packets change depending on the
>  	 * value of this hardware flag.
>  	 */
> -	etd->crc_enabled = ((etd->fw_version & 0x4000) == 0x4000);
> +	etd->crc_enabled = elantech_detect_crc_enabled(etd);
>  
>  	/* Enable real hardware resolution on hw_version 3 ? */
>  	etd->set_hw_resolution = !dmi_check_system(no_hw_res_dmi_table);
> diff --git a/drivers/input/mouse/elantech.h b/drivers/input/mouse/elantech.h
> index 6f3afec..c25127a 100644
> --- a/drivers/input/mouse/elantech.h
> +++ b/drivers/input/mouse/elantech.h
> @@ -128,11 +128,11 @@ struct elantech_data {
>  	unsigned char reg_25;
>  	unsigned char reg_26;
>  	unsigned char debug;
> +	unsigned char crc_enabled;
>  	unsigned char capabilities[3];
>  	bool paritycheck;
>  	bool jumpy_cursor;
>  	bool reports_pressure;
> -	bool crc_enabled;
>  	bool set_hw_resolution;
>  	unsigned char hw_version;
>  	unsigned int fw_version;
> -- 
> 2.1.0
> 

-- 
Dmitry

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH 3/5] Input: elantech - report the middle button of the touchpad
  2014-08-30 14:10 ` [PATCH 3/5] Input: elantech - report the middle button of the touchpad Ulrik De Bie
@ 2014-11-08  8:23   ` Dmitry Torokhov
  2014-11-09 21:38     ` [PATCH v2 0/3] support for the Fujitsu H730 laptop (update) Ulrik De Bie
  0 siblings, 1 reply; 25+ messages in thread
From: Dmitry Torokhov @ 2014-11-08  8:23 UTC (permalink / raw)
  To: Ulrik De Bie; +Cc: linux-input, Hans de Goede, David Herrmann

On Sat, Aug 30, 2014 at 04:10:44PM +0200, Ulrik De Bie wrote:
> In the past, no elantech was known with 3 touchpad mouse buttons.
> Fujitsu H730 is the first known elantech with a middle button. This commit
> enables this middle button.
> 
> Reported-by: Stefan Valouch <stefan@valouch.com>
> Tested-by: Stefan Valouch <stefan@valouch.com>
> Tested-by: Alfredo Gemma <alfredo.gemma@gmail.com>
> Signed-off-by: Ulrik De Bie <ulrik.debie-os@e2big.org>
> ---
>  drivers/input/mouse/elantech.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c
> index 67d56c0..e86bbd7 100644
> --- a/drivers/input/mouse/elantech.c
> +++ b/drivers/input/mouse/elantech.c
> @@ -563,6 +563,7 @@ static void elantech_input_sync_v4(struct psmouse *psmouse)
>  	} else {
>  		input_report_key(dev, BTN_LEFT, packet[0] & 0x01);
>  		input_report_key(dev, BTN_RIGHT, packet[0] & 0x02);
> +		input_report_key(dev, BTN_MIDDLE, packet[0] & 0x04);
>  	}
>  
>  	input_mt_report_pointer_emulation(dev, true);
> @@ -1150,6 +1151,7 @@ static int elantech_set_input_params(struct psmouse *psmouse)
>  	__clear_bit(EV_REL, dev->evbit);
>  
>  	__set_bit(BTN_LEFT, dev->keybit);
> +	__set_bit(BTN_MIDDLE, dev->keybit);

No, we should not advertise presence of middle button unconditionally. I
guess we need another DMI, at least for now.

>  	__set_bit(BTN_RIGHT, dev->keybit);
>  
>  	__set_bit(BTN_TOUCH, dev->keybit);
> -- 
> 2.1.0
> 

Thanks.

-- 
Dmitry

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH 4/5] Input: elantech - provide a sysfs knob for crc_enabled
  2014-08-30 14:10 ` [PATCH 4/5] Input: elantech - provide a sysfs knob for crc_enabled Ulrik De Bie
@ 2014-11-08  8:25   ` Dmitry Torokhov
  0 siblings, 0 replies; 25+ messages in thread
From: Dmitry Torokhov @ 2014-11-08  8:25 UTC (permalink / raw)
  To: Ulrik De Bie; +Cc: linux-input, Hans de Goede, David Herrmann

On Sat, Aug 30, 2014 at 04:10:45PM +0200, Ulrik De Bie wrote:
> The detection of crc_enabled is known to fail for Fujitsu H730. A DMI
> blacklist is added for that, but it can be expected that other laptops
> will pop up with this.
> 
> Here a sysfs knob is provided to alter the behaviour of crc_enabled.
> Writing 0 or 1 to it sets the variable to 0 or 1.
> Writing 2 to it will perform the detection and set the variable to 0
> or 1 according to the result of the detection.
> Reading it will show the crc_enabled variable (0 or 1).
> 

This is over-complicated, please make it straight bool (0/1). If one
wants to redetect it can be done by unbinding and rebinding driver
through sysfs (either at driver level or serio - drvctl attribute -
level).

Thanks.

-- 
Dmitry

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [PATCH v2  0/3] support for the Fujitsu H730 laptop (update)
  2014-11-08  8:23   ` Dmitry Torokhov
@ 2014-11-09 21:38     ` Ulrik De Bie
  2014-11-09 21:38       ` [PATCH v2 1/3] Input: elantech - report the middle button of the touchpad Ulrik De Bie
                         ` (2 more replies)
  0 siblings, 3 replies; 25+ messages in thread
From: Ulrik De Bie @ 2014-11-09 21:38 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: linux-input, Hans de Goede, David Herrmann, ulrik.debie-os

This is an update of patch 3/5,4/5,5/5 of my previous submission.
If content looks good, I'll ask the testers to retest this modification.

The patch "report the middle button of the touchpad" is now made conditional
on the dmi check for the announcement of the middle button.

The patch "provide a sysfs knob for crc_enabled" is now simply 0/1, the autodetect is removed.

The patch "Update the documentation: trackpoint,v3/v4,crc_enabled" is now
updated according to those changes


Ulrik De Bie (3):
  Input: elantech - report the middle button of the touchpad
  Input: elantech - provide a sysfs knob for crc_enabled
  Input: elantech - Update the documentation:
    trackpoint,v3/v4,crc_enabled

 Documentation/input/elantech.txt | 82 +++++++++++++++++++++++++++++++++++++---
 drivers/input/mouse/elantech.c   | 21 ++++++++++
 2 files changed, 97 insertions(+), 6 deletions(-)

-- 
2.1.1


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [PATCH v2  1/3] Input: elantech - report the middle button of the touchpad
  2014-11-09 21:38     ` [PATCH v2 0/3] support for the Fujitsu H730 laptop (update) Ulrik De Bie
@ 2014-11-09 21:38       ` Ulrik De Bie
  2014-11-09 21:38       ` [PATCH v2 2/3] Input: elantech - provide a sysfs knob for crc_enabled Ulrik De Bie
  2014-11-09 21:38       ` [PATCH v2 3/3] Input: elantech - Update the documentation: trackpoint,v3/v4,crc_enabled Ulrik De Bie
  2 siblings, 0 replies; 25+ messages in thread
From: Ulrik De Bie @ 2014-11-09 21:38 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: linux-input, Hans de Goede, David Herrmann, ulrik.debie-os

In the past, no elantech was known with 3 touchpad mouse buttons.
Fujitsu H730 is the first known elantech with a middle button. This commit
enables this middle button. For backwards compatibility, the Fujitsu is
detected via DMI, and only for this one 3 buttons will be announced.

Reported-by: Stefan Valouch <stefan@valouch.com>
Signed-off-by: Ulrik De Bie <ulrik.debie-os@e2big.org>
---
 drivers/input/mouse/elantech.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c
index ce699eb..8b04b71 100644
--- a/drivers/input/mouse/elantech.c
+++ b/drivers/input/mouse/elantech.c
@@ -563,6 +563,7 @@ static void elantech_input_sync_v4(struct psmouse *psmouse)
 	} else {
 		input_report_key(dev, BTN_LEFT, packet[0] & 0x01);
 		input_report_key(dev, BTN_RIGHT, packet[0] & 0x02);
+		input_report_key(dev, BTN_MIDDLE, packet[0] & 0x04);
 	}
 
 	input_mt_report_pointer_emulation(dev, true);
@@ -1132,6 +1133,22 @@ static void elantech_set_buttonpad_prop(struct psmouse *psmouse)
 }
 
 /*
+ * Some hw_version 4 models do have a middle button
+ */
+static const struct dmi_system_id elantech_dmi_has_middle_button[] = {
+#if defined(CONFIG_DMI) && defined(CONFIG_X86)
+	{
+		/* Fujitsu H730 has a middle button */
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "CELSIUS H730"),
+		},
+	},
+#endif
+	{ }
+};
+
+/*
  * Set the appropriate event bits for the input subsystem
  */
 static int elantech_set_input_params(struct psmouse *psmouse)
@@ -1150,6 +1167,8 @@ static int elantech_set_input_params(struct psmouse *psmouse)
 	__clear_bit(EV_REL, dev->evbit);
 
 	__set_bit(BTN_LEFT, dev->keybit);
+	if (dmi_check_system(elantech_dmi_has_middle_button))
+		__set_bit(BTN_MIDDLE, dev->keybit);
 	__set_bit(BTN_RIGHT, dev->keybit);
 
 	__set_bit(BTN_TOUCH, dev->keybit);
@@ -1466,6 +1485,7 @@ static const struct dmi_system_id elantech_dmi_force_crc_enabled[] = {
 	{ }
 };
 
+
 /*
  * Some hw_version 3 models go into error state when we try to set
  * bit 3 and/or bit 1 of r10.
-- 
2.1.1


^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH v2  2/3] Input: elantech - provide a sysfs knob for crc_enabled
  2014-11-09 21:38     ` [PATCH v2 0/3] support for the Fujitsu H730 laptop (update) Ulrik De Bie
  2014-11-09 21:38       ` [PATCH v2 1/3] Input: elantech - report the middle button of the touchpad Ulrik De Bie
@ 2014-11-09 21:38       ` Ulrik De Bie
  2014-11-09 21:38       ` [PATCH v2 3/3] Input: elantech - Update the documentation: trackpoint,v3/v4,crc_enabled Ulrik De Bie
  2 siblings, 0 replies; 25+ messages in thread
From: Ulrik De Bie @ 2014-11-09 21:38 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: linux-input, Hans de Goede, David Herrmann, ulrik.debie-os

The detection of crc_enabled is known to fail for Fujitsu H730. A DMI
blacklist is added for that, but it can be expected that other laptops
will pop up with this.

Here a sysfs knob is provided to alter the behaviour of crc_enabled.
Writing 0 or 1 to it sets the variable to 0 or 1.
Reading it will show the crc_enabled variable (0 or 1).

Reported-by: Stefan Valouch <stefan@valouch.com>
Signed-off-by: Ulrik De Bie <ulrik.debie-os@e2big.org>
---
 drivers/input/mouse/elantech.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c
index 8b04b71..3fcb6b3 100644
--- a/drivers/input/mouse/elantech.c
+++ b/drivers/input/mouse/elantech.c
@@ -1330,6 +1330,7 @@ ELANTECH_INT_ATTR(reg_25, 0x25);
 ELANTECH_INT_ATTR(reg_26, 0x26);
 ELANTECH_INT_ATTR(debug, 0);
 ELANTECH_INT_ATTR(paritycheck, 0);
+ELANTECH_INT_ATTR(crc_enabled, 0);
 
 static struct attribute *elantech_attrs[] = {
 	&psmouse_attr_reg_07.dattr.attr,
@@ -1344,6 +1345,7 @@ static struct attribute *elantech_attrs[] = {
 	&psmouse_attr_reg_26.dattr.attr,
 	&psmouse_attr_debug.dattr.attr,
 	&psmouse_attr_paritycheck.dattr.attr,
+	&psmouse_attr_crc_enabled.dattr.attr,
 	NULL
 };
 
@@ -1485,7 +1487,6 @@ static const struct dmi_system_id elantech_dmi_force_crc_enabled[] = {
 	{ }
 };
 
-
 /*
  * Some hw_version 3 models go into error state when we try to set
  * bit 3 and/or bit 1 of r10.
-- 
2.1.1


^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH v2  3/3] Input: elantech - Update the documentation: trackpoint,v3/v4,crc_enabled
  2014-11-09 21:38     ` [PATCH v2 0/3] support for the Fujitsu H730 laptop (update) Ulrik De Bie
  2014-11-09 21:38       ` [PATCH v2 1/3] Input: elantech - report the middle button of the touchpad Ulrik De Bie
  2014-11-09 21:38       ` [PATCH v2 2/3] Input: elantech - provide a sysfs knob for crc_enabled Ulrik De Bie
@ 2014-11-09 21:38       ` Ulrik De Bie
  2 siblings, 0 replies; 25+ messages in thread
From: Ulrik De Bie @ 2014-11-09 21:38 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: linux-input, Hans de Goede, David Herrmann, ulrik.debie-os

A chapter is added to describe the trackpoint packets.

A section is added to describe the behaviour of the knob crc_enabled in
sysfs.

The introduction of the documentation only mentioned v1/v2, but in the
last part it already contains explanation of v3 and v4. The introduction
is updated.

Signed-off-by: Ulrik De Bie <ulrik.debie-os@e2big.org>
---
 Documentation/input/elantech.txt | 82 +++++++++++++++++++++++++++++++++++++---
 1 file changed, 76 insertions(+), 6 deletions(-)

diff --git a/Documentation/input/elantech.txt b/Documentation/input/elantech.txt
index e1ae127..9e74a4e 100644
--- a/Documentation/input/elantech.txt
+++ b/Documentation/input/elantech.txt
@@ -38,22 +38,38 @@ Contents
         7.2.1 Status packet
         7.2.2 Head packet
         7.2.3 Motion packet
+ 8. Trackpoint (for Hardware version 3 and 4)
+    8.1 Registers
+    8.2 Native relative mode 6 byte packet format
+        8.2.1 Status Packet
 
 
 
 1. Introduction
    ~~~~~~~~~~~~
 
-Currently the Linux Elantech touchpad driver is aware of two different
-hardware versions unimaginatively called version 1 and version 2. Version 1
-is found in "older" laptops and uses 4 bytes per packet. Version 2 seems to
-be introduced with the EeePC and uses 6 bytes per packet, and provides
-additional features such as position of two fingers, and width of the touch.
+Currently the Linux Elantech touchpad driver is aware of four different
+hardware versions unimaginatively called version 1,version 2, version 3
+and version 4. Version 1 is found in "older" laptops and uses 4 bytes per
+packet. Version 2 seems to be introduced with the EeePC and uses 6 bytes
+per packet, and provides additional features such as position of two fingers,
+and width of the touch.  Hardware version 3 uses 6 bytes per packet (and
+for 2 fingers the concatenation of two 6 bytes packets) and allows tracking
+of up to 3 fingers. Hardware version 4 uses 6 bytes per packet, and can
+combine a status packet with multiple head or motion packets. Hardware version
+4 allows tracking up to 5 fingers.
+
+Some Hardware version 3 and version 4 also have a trackpoint which uses a
+separate packet format. It is also 6 bytes per packet.
 
 The driver tries to support both hardware versions and should be compatible
 with the Xorg Synaptics touchpad driver and its graphical configuration
 utilities.
 
+Note that a mouse button is also associated with either the touchpad or the
+trackpoint when a trackpoint is available.  Disabling the Touchpad in xorg
+(TouchPadOff=0) will also disable the buttons associated with the touchpad.
+
 Additionally the operation of the touchpad can be altered by adjusting the
 contents of some of its internal registers. These registers are represented
 by the driver as sysfs entries under /sys/bus/serio/drivers/psmouse/serio?
@@ -78,7 +94,7 @@ completeness sake.
 2. Extra knobs
    ~~~~~~~~~~~
 
-Currently the Linux Elantech touchpad driver provides two extra knobs under
+Currently the Linux Elantech touchpad driver provides three extra knobs under
 /sys/bus/serio/drivers/psmouse/serio? for the user.
 
 * debug
@@ -112,6 +128,20 @@ Currently the Linux Elantech touchpad driver provides two extra knobs under
    data consistency checking can be done. For now checking is disabled by
    default. Currently even turning it on will do nothing.
 
+* crc_enabled
+
+   Sets crc_enabled to 0/1. The name "crc_enabled" is the official name of
+   this integrity check, even though it is not an actual cyclic redundancy
+   check.
+
+   Depending on the state of crc_enabled, certain basic data integrity
+   verification is done by the driver on hardware version 3 and 4. The
+   driver will reject any packet that appears corrupted. Using this knob,
+   The state of crc_enabled can be altered with this knob.
+
+   Reading the crc_enabled value will show the active value. Echoing
+   "0" or "1" to this file will set the state to "0" or "1".
+
 /////////////////////////////////////////////////////////////////////////////
 
 3. Differentiating hardware versions
@@ -746,3 +776,43 @@ byte 5:
 
         byte 0 ~ 2 for one finger
         byte 3 ~ 5 for another
+
+
+8. Trackpoint (for Hardware version 3 and 4)
+   =========================================
+8.1 Registers
+    ~~~~~~~~~
+No special registers have been identified.
+
+8.2 Native relative mode 6 byte packet format
+    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+8.2.1 Status Packet
+      ~~~~~~~~~~~~~
+
+byte 0:
+   bit   7   6   5   4   3   2   1   0
+         0   0  sx  sy   0   M   R   L
+byte 1:
+   bit   7   6   5   4   3   2   1   0
+       ~sx   0   0   0   0   0   0   0
+byte 2:
+   bit   7   6   5   4   3   2   1   0
+       ~sy   0   0   0   0   0   0   0
+byte 3:
+   bit   7   6   5   4   3   2   1   0
+         0   0 ~sy ~sx   0   1   1   0
+byte 4:
+   bit   7   6   5   4   3   2   1   0
+        x7  x6  x5  x4  x3  x2  x1  x0
+byte 5:
+   bit   7   6   5   4   3   2   1   0
+        y7  y6  y5  y4  y3  y2  y1  y0
+
+
+         x and y are written in two's complement spread
+             over 9 bits with sx/sy the relative top bit and
+             x7..x0 and y7..y0 the lower bits.
+	 ~sx is the inverse of sx, ~sy is the inverse of sy.
+         The sign of y is opposite to what the input driver
+             expects for a relative movement
+
-- 
2.1.1


^ permalink raw reply related	[flat|nested] 25+ messages in thread

* Bisected two-finger scrolling regression on Lenovo Y50 (Re: [PATCH 1/5] Input: elantech - use elantech_report_trackpoint for hardware v4 too)
  2014-08-30 14:10 ` [PATCH 1/5] Input: elantech - use elantech_report_trackpoint for hardware v4 too Ulrik De Bie
  2014-11-08  8:21   ` Dmitry Torokhov
@ 2014-11-20  6:58   ` Anders Kaseorg
  2014-11-20  7:42     ` Dmitry Torokhov
  1 sibling, 1 reply; 25+ messages in thread
From: Anders Kaseorg @ 2014-11-20  6:58 UTC (permalink / raw)
  To: Ulrik De Bie, Dmitry Torokhov; +Cc: linux-input, Hans de Goede, David Herrmann

On 08/30/2014 10:10 AM, Ulrik De Bie wrote:
> The Fujitsu H730 has hardware v4 with a trackpoint. This enables
> the elantech_report_trackpoint for v4.

Kernel 3.18-rc5 has made two-finger scrolling unusably glitchy on my 
Lenovo Y50-70 Touch, and caused an associated kernel warning.  I 
bisected the regression to this commit (caeb0d37).

This may be the same as https://bugzilla.redhat.com/1165390, although 
that only reports the warning, not the glitchy scrolling.

Anders

psmouse serio1: elantech: assuming hardware version 4 (with firmware 
version 0x495f01)
psmouse serio1: elantech: Synaptics capabilities query result 0x70, 
0x15, 0x0e.
input: ETPS/2 Elantech Touchpad as 
/devices/platform/i8042/serio1/input/input6

[…]

------------[ cut here ]------------
WARNING: CPU: 0 PID: 0 at drivers/input/mouse/elantech.c:433 
elantech_report_trackpoint.isra.5+0x199/0x1b0 [psmouse]()
psmouse serio1: elantech: Unexpected trackpoint message
Modules linked in: xt_CHECKSUM iptable_mangle ipt_MASQUERADE iptable_nat 
nf_nat_ipv4 nf_nat nf_conntrack_ipv4 nf_defrag_ipv4 xt_conntrack 
nf_conntrack ipt_REJECT xt_tcpudp iptable_filter ip_tables x_tables 
bridge stp llc ctr ccm binfmt_misc bbswitch(OE) arc4 nls_iso8859_1 
iwlmvm snd_hda_codec_hdmi mac80211 snd_hda_codec_realtek 
snd_hda_codec_generic snd_hda_intel snd_hda_controller snd_hda_codec 
intel_rapl uvcvideo snd_hwdep x86_pkg_temp_thermal videobuf2_vmalloc 
intel_powerclamp snd_pcm videobuf2_memops videobuf2_core coretemp 
v4l2_common snd_seq_midi videodev kvm_intel snd_seq_midi_event iwlwifi 
media kvm joydev btusb snd_rawmidi serio_raw bluetooth cfg80211 
hid_multitouch rtsx_pci_ms memstick snd_seq snd_seq_device snd_timer 
ideapad_laptop mei_me sparse_keymap mei snd ie31200_edac
  lpc_ich mac_hid edac_core soundcore shpchp parport_pc ppdev lp parport 
autofs4 btrfs xor raid6_pq dm_crypt hid_generic usbhid hid 
rtsx_pci_sdmmc crct10dif_pclmul crc32_pclmul ghash_clmulni_intel 
aesni_intel i915 aes_x86_64 lrw gf128mul i2c_algo_bit glue_helper 
ablk_helper drm_kms_helper cryptd psmouse ahci r8169 drm rtsx_pci 
libahci mii wmi video
CPU: 0 PID: 0 Comm: swapper/0 Tainted: G           OE  3.17.0+ #2
Hardware name: LENOVO 20349/Lenovo Y50-70 Touch, BIOS 9ECN30WW(V1.13) 
07/16/2014
  0000000000000009 ffff88045f203cb0 ffffffff8277a436 ffff88045f203cf8
  ffff88045f203ce8 ffffffff8207144d ffff88044352ea00 ffff880448b044f0
  ffff880035da6400 0000000000000002 ffff88044352ea00 ffff88045f203d48
Call Trace:
  <IRQ>  [<ffffffff8277a436>] dump_stack+0x45/0x56
  [<ffffffff8207144d>] warn_slowpath_common+0x7d/0xa0
  [<ffffffff820714bc>] warn_slowpath_fmt+0x4c/0x50
  [<ffffffffc0185309>] elantech_report_trackpoint.isra.5+0x199/0x1b0 
[psmouse]
  [<ffffffffc0185af8>] elantech_process_byte+0x6e8/0xf90 [psmouse]
  [<ffffffffc017bd45>] psmouse_handle_byte+0x15/0x150 [psmouse]
  [<ffffffffc017bf1f>] psmouse_interrupt+0x9f/0x360 [psmouse]
  [<ffffffff825c2d06>] serio_interrupt+0x46/0x90
  [<ffffffff825c44f7>] i8042_interrupt+0x197/0x3a0
  [<ffffffff820c8477>] handle_irq_event_percpu+0x77/0x1a0
  [<ffffffff820c85dd>] handle_irq_event+0x3d/0x60
  [<ffffffff820cb316>] handle_edge_irq+0x66/0x130
  [<ffffffff8201576e>] handle_irq+0x1e/0x40
  [<ffffffff8278522d>] do_IRQ+0x4d/0xe0
  [<ffffffff827830ad>] common_interrupt+0x6d/0x6d
  <EOI>  [<ffffffff82614965>] ? cpuidle_enter_state+0x65/0x160
  [<ffffffff82614b47>] cpuidle_enter+0x17/0x20
  [<ffffffff820b1dc7>] cpu_startup_entry+0x387/0x3c0
  [<ffffffff8276f5f7>] rest_init+0x77/0x80
  [<ffffffff82d45f9b>] start_kernel+0x461/0x46e
  [<ffffffff82d45120>] ? early_idt_handlers+0x120/0x120
  [<ffffffff82d454d7>] x86_64_start_reservations+0x2a/0x2c
  [<ffffffff82d4561c>] x86_64_start_kernel+0x143/0x152
---[ end trace b67972f4dffebd79 ]---
psmouse serio1: elantech: PS/2 packet [
  0x44 , 0x06 , 0xe3 , 0x26 , 0x01 , 0xf3 ]
psmouse serio1: elantech: PS/2 packet [
  0x44 , 0x09 , 0xbd , 0x26 , 0x00 , 0xe5 ]
psmouse serio1: elantech: PS/2 packet [
  0x40 , 0x0b , 0x90 , 0x36 , 0xfb , 0xb7 ]
psmouse serio1: elantech: PS/2 packet [
  0x40 , 0x0c , 0x84 , 0x36 , 0xfe , 0x9e ]
psmouse serio1: elantech: PS/2 packet [
  0x44 , 0x0c , 0x94 , 0x26 , 0x00 , 0x99 ]
psmouse serio1: elantech: PS/2 packet [
  0x44 , 0x05 , 0x98 , 0x26 , 0x00 , 0x99 ]
psmouse serio1: elantech: PS/2 packet [
  0x40 , 0x0d , 0xba , 0x36 , 0xfd , 0xb3 ]
psmouse serio1: elantech: PS/2 packet [
  0x50 , 0x00 , 0x19 , 0x26 , 0x00 , 0x1c ]
psmouse serio1: elantech: PS/2 packet [
  0x50 , 0x04 , 0x1b , 0x26 , 0x00 , 0x19 ]
psmouse serio1: elantech: PS/2 packet [
  0x40 , 0x11 , 0x46 , 0x36 , 0x01 , 0x53 ]
psmouse serio1: elantech: PS/2 packet [
  0x40 , 0x09 , 0x48 , 0x36 , 0x0d , 0x39 ]
psmouse serio1: elantech: PS/2 packet [
  0x40 , 0x0b , 0x30 , 0x36 , 0x06 , 0x30 ]
psmouse serio1: elantech: PS/2 packet [
  0x40 , 0x0d , 0x2e , 0x36 , 0x06 , 0x2c ]
psmouse serio1: elantech: PS/2 packet [
  0x40 , 0x0a , 0x1c , 0x36 , 0x01 , 0x18 ]
psmouse serio1: elantech: PS/2 packet [
  0x40 , 0x07 , 0x17 , 0x36 , 0x06 , 0x11 ]
psmouse serio1: elantech: PS/2 packet [
  0x40 , 0x01 , 0x0b , 0x36 , 0x04 , 0x07 ]
psmouse serio1: elantech: PS/2 packet [
  0x40 , 0x02 , 0x03 , 0x36 , 0x02 , 0x02 ]
psmouse serio1: elantech: PS/2 packet [
  0x44 , 0x03 , 0xfe , 0x26 , 0x02 , 0xfd ]
psmouse serio1: elantech: PS/2 packet [
  0x44 , 0x00 , 0xf8 , 0x26 , 0x01 , 0xfb ]
psmouse serio1: elantech: PS/2 packet [
  0x40 , 0x00 , 0x02 , 0x36 , 0x00 , 0x01 ]
psmouse serio1: elantech: PS/2 packet [
  0x44 , 0x01 , 0x09 , 0x26 , 0xff , 0x02 ]
psmouse serio1: elantech: PS/2 packet [
  0x40 , 0x07 , 0x18 , 0x36 , 0x00 , 0x07 ]
psmouse serio1: elantech: PS/2 packet [
  0x40 , 0x0e , 0x3d , 0x36 , 0x0b , 0x29 ]
psmouse serio1: elantech: PS/2 packet [
  0x40 , 0x1d , 0x6f , 0x36 , 0x19 , 0x5f ]
psmouse serio1: elantech: PS/2 packet [
  0x50 , 0x06 , 0x19 , 0x26 , 0x05 , 0x1a ]
psmouse serio1: elantech: PS/2 packet [
  0x50 , 0x07 , 0x1a , 0x26 , 0x06 , 0x18 ]
psmouse serio1: elantech: PS/2 packet [
  0x40 , 0x26 , 0x6d , 0x36 , 0x1e , 0x6f ]
psmouse serio1: elantech: PS/2 packet [
  0x40 , 0x27 , 0x5f , 0x36 , 0x1f , 0x62 ]
psmouse serio1: elantech: PS/2 packet [
  0x40 , 0x18 , 0x36 , 0x36 , 0x1c , 0x38 ]
psmouse serio1: elantech: PS/2 packet [
  0x40 , 0x19 , 0x2a , 0x36 , 0x1b , 0x27 ]
psmouse serio1: elantech: PS/2 packet [
  0x40 , 0x13 , 0x19 , 0x36 , 0x11 , 0x14 ]
psmouse serio1: elantech: PS/2 packet [
  0x40 , 0x09 , 0x06 , 0x36 , 0x09 , 0x06 ]
psmouse serio1: elantech: PS/2 packet [
  0x44 , 0x01 , 0xfd , 0x26 , 0x07 , 0xf5 ]
psmouse serio1: elantech: PS/2 packet [
  0x44 , 0x00 , 0xf9 , 0x26 , 0x0a , 0xf1 ]
psmouse serio1: elantech: PS/2 packet [
  0x44 , 0x03 , 0xd1 , 0x26 , 0x07 , 0xd0 ]
psmouse serio1: elantech: PS/2 packet [
  0x44 , 0x06 , 0xe5 , 0x26 , 0x08 , 0xd6 ]
psmouse serio1: elantech: PS/2 packet [
  0x44 , 0x04 , 0xf6 , 0x26 , 0x06 , 0xe8 ]
psmouse serio1: elantech: PS/2 packet [
  0x44 , 0x02 , 0xfd , 0x26 , 0x04 , 0xf1 ]
psmouse serio1: elantech: PS/2 packet [
  0x40 , 0x11 , 0x1d , 0x36 , 0x0e , 0x0b ]
psmouse serio1: elantech: PS/2 packet [
  0x40 , 0x16 , 0x2b , 0x36 , 0x18 , 0x18 ]
psmouse serio1: elantech: PS/2 packet [
  0x40 , 0x24 , 0x5a , 0x36 , 0x25 , 0x3c ]
psmouse serio1: elantech: PS/2 packet [
  0x40 , 0x28 , 0x53 , 0x36 , 0x1d , 0x4e ]

> Reported-by: Stefan Valouch <stefan@valouch.com>
> Tested-by: Stefan Valouch <stefan@valouch.com>
> Tested-by: Alfredo Gemma <alfredo.gemma@gmail.com>
> Signed-off-by: Ulrik De Bie <ulrik.debie-os@e2big.org>
> ---
>   drivers/input/mouse/elantech.c | 16 ++++++++++++++--
>   1 file changed, 14 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c
> index da51738..f0a55b4d 100644
> --- a/drivers/input/mouse/elantech.c
> +++ b/drivers/input/mouse/elantech.c
> @@ -792,6 +792,9 @@ static int elantech_packet_check_v4(struct psmouse *psmouse)
>   	unsigned char packet_type = packet[3] & 0x03;
>   	bool sanity_check;
>
> +	if ((packet[3]&0x0f) == 0x06)
> +		return PACKET_TRACKPOINT;
> +
>   	/*
>   	 * Sanity check based on the constant bits of a packet.
>   	 * The constant bits change depending on the value of
> @@ -877,10 +880,19 @@ static psmouse_ret_t elantech_process_byte(struct psmouse *psmouse)
>
>   	case 4:
>   		packet_type = elantech_packet_check_v4(psmouse);
> -		if (packet_type == PACKET_UNKNOWN)
> +		switch (packet_type) {
> +		case PACKET_UNKNOWN:
>   			return PSMOUSE_BAD_DATA;
>
> -		elantech_report_absolute_v4(psmouse, packet_type);
> +		case PACKET_TRACKPOINT:
> +			elantech_report_trackpoint(psmouse, packet_type);
> +			break;
> +
> +		default:
> +			elantech_report_absolute_v4(psmouse, packet_type);
> +			break;
> +		}
> +
>   		break;
>   	}
>
>

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Bisected two-finger scrolling regression on Lenovo Y50 (Re: [PATCH 1/5] Input: elantech - use elantech_report_trackpoint for hardware v4 too)
  2014-11-20  6:58   ` Bisected two-finger scrolling regression on Lenovo Y50 (Re: [PATCH 1/5] Input: elantech - use elantech_report_trackpoint for hardware v4 too) Anders Kaseorg
@ 2014-11-20  7:42     ` Dmitry Torokhov
  2014-11-20  8:21       ` Anders Kaseorg
  0 siblings, 1 reply; 25+ messages in thread
From: Dmitry Torokhov @ 2014-11-20  7:42 UTC (permalink / raw)
  To: Anders Kaseorg
  Cc: Ulrik De Bie, linux-input, Hans de Goede, David Herrmann,
	Marcus Overhagen

Hi Anders,

On Thu, Nov 20, 2014 at 01:58:40AM -0500, Anders Kaseorg wrote:
> On 08/30/2014 10:10 AM, Ulrik De Bie wrote:
> >The Fujitsu H730 has hardware v4 with a trackpoint. This enables
> >the elantech_report_trackpoint for v4.
> 
> Kernel 3.18-rc5 has made two-finger scrolling unusably glitchy on my
> Lenovo Y50-70 Touch, and caused an associated kernel warning.  I
> bisected the regression to this commit (caeb0d37).
> 
> This may be the same as https://bugzilla.redhat.com/1165390,
> although that only reports the warning, not the glitchy scrolling.
> 

Thank you for your report. Please try the patch below.

Markus, I put you as tested-by since you tried basically the same patch
earlier.

-- 
Dmitry


Input: elantech - trust firmware about trackpoint presence

From: Dmitry Torokhov <dmitry.torokhov@gmail.com>

Only try to parse data as coming from trackpoint if firmware told us that
trackpoint is present.

Fixes commit caeb0d37fa3e387eb0dd22e5d497523c002033d1

Reported-and-tested-by: Marcus Overhagen <marcus.overhagen@gmail.com>
Reported-by: Anders Kaseorg <andersk@mit.edu>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
 drivers/input/mouse/elantech.c |   10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c
index 3fcb6b3..f2b9780 100644
--- a/drivers/input/mouse/elantech.c
+++ b/drivers/input/mouse/elantech.c
@@ -428,14 +428,6 @@ static void elantech_report_trackpoint(struct psmouse *psmouse,
 	int x, y;
 	u32 t;
 
-	if (dev_WARN_ONCE(&psmouse->ps2dev.serio->dev,
-			  !tp_dev,
-			  psmouse_fmt("Unexpected trackpoint message\n"))) {
-		if (etd->debug == 1)
-			elantech_packet_dump(psmouse);
-		return;
-	}
-
 	t = get_unaligned_le32(&packet[0]);
 
 	switch (t & ~7U) {
@@ -793,7 +785,7 @@ static int elantech_packet_check_v4(struct psmouse *psmouse)
 	unsigned char packet_type = packet[3] & 0x03;
 	bool sanity_check;
 
-	if ((packet[3] & 0x0f) == 0x06)
+	if (etd->tp_dev && (packet[3] & 0x0f) == 0x06)
 		return PACKET_TRACKPOINT;
 
 	/*

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* Re: Bisected two-finger scrolling regression on Lenovo Y50 (Re: [PATCH 1/5] Input: elantech - use elantech_report_trackpoint for hardware v4 too)
  2014-11-20  7:42     ` Dmitry Torokhov
@ 2014-11-20  8:21       ` Anders Kaseorg
  0 siblings, 0 replies; 25+ messages in thread
From: Anders Kaseorg @ 2014-11-20  8:21 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Ulrik De Bie, linux-input, Hans de Goede, David Herrmann,
	Marcus Overhagen

On Thu, 20 Nov 2014, Dmitry Torokhov wrote:
> Thank you for your report. Please try the patch below.
> 
> […]
> 
> Input: elantech - trust firmware about trackpoint presence
> 
> From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> 
> Only try to parse data as coming from trackpoint if firmware told us that
> trackpoint is present.
> 
> Fixes commit caeb0d37fa3e387eb0dd22e5d497523c002033d1
> 
> Reported-and-tested-by: Marcus Overhagen <marcus.overhagen@gmail.com>
> Reported-by: Anders Kaseorg <andersk@mit.edu>
> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

That fixes it for me too, thanks.

Anders
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2014-11-20  8:21 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-30 14:10 [PATCH 0/5] Input: elantech - support the Fujitsu H730 laptop Ulrik De Bie
2014-08-30 14:10 ` [PATCH 1/5] Input: elantech - use elantech_report_trackpoint for hardware v4 too Ulrik De Bie
2014-11-08  8:21   ` Dmitry Torokhov
2014-11-20  6:58   ` Bisected two-finger scrolling regression on Lenovo Y50 (Re: [PATCH 1/5] Input: elantech - use elantech_report_trackpoint for hardware v4 too) Anders Kaseorg
2014-11-20  7:42     ` Dmitry Torokhov
2014-11-20  8:21       ` Anders Kaseorg
2014-08-30 14:10 ` [PATCH 2/5] Input: elantech - Fix crc_enabled for Fujitsu H730 Ulrik De Bie
2014-11-08  8:22   ` Dmitry Torokhov
2014-08-30 14:10 ` [PATCH 3/5] Input: elantech - report the middle button of the touchpad Ulrik De Bie
2014-11-08  8:23   ` Dmitry Torokhov
2014-11-09 21:38     ` [PATCH v2 0/3] support for the Fujitsu H730 laptop (update) Ulrik De Bie
2014-11-09 21:38       ` [PATCH v2 1/3] Input: elantech - report the middle button of the touchpad Ulrik De Bie
2014-11-09 21:38       ` [PATCH v2 2/3] Input: elantech - provide a sysfs knob for crc_enabled Ulrik De Bie
2014-11-09 21:38       ` [PATCH v2 3/3] Input: elantech - Update the documentation: trackpoint,v3/v4,crc_enabled Ulrik De Bie
2014-08-30 14:10 ` [PATCH 4/5] Input: elantech - provide a sysfs knob for crc_enabled Ulrik De Bie
2014-11-08  8:25   ` Dmitry Torokhov
2014-08-30 14:10 ` [PATCH 5/5] Input: elantech - Update the documentation: trackpoint,v3/v4,crc_enabled Ulrik De Bie
2014-08-31  9:54 ` [PATCH 0/5] Input: elantech - support the Fujitsu H730 laptop Hans de Goede
2014-08-31 15:14   ` ulrik.debie-os
2014-09-01  7:13     ` Hans de Goede
2014-10-04  9:33 ` Jan Kiszka
2014-10-04  9:36   ` Hans de Goede
2014-10-23 18:36     ` ulrik.debie-os
2014-10-23 18:39       ` Dmitry Torokhov
2014-11-06 19:20         ` ulrik.debie-os

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.