[PATCH libinput 6/9] udev: add ALPS firmware detection and size properties

Peter Hutterer peter.hutterer at who-t.net
Tue Jun 30 23:08:50 PDT 2015


Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 udev/90-libinput-model-quirks.hwdb |  4 ++++
 udev/libinput-model-quirks.c       | 20 ++++++++++++++++++++
 2 files changed, 24 insertions(+)

diff --git a/udev/90-libinput-model-quirks.hwdb b/udev/90-libinput-model-quirks.hwdb
index 3bfffbb..69e28ae 100644
--- a/udev/90-libinput-model-quirks.hwdb
+++ b/udev/90-libinput-model-quirks.hwdb
@@ -22,6 +22,10 @@ libinput:name:*AlpsPS/2 ALPS DualPoint TouchPad:dmi:*
 libinput:name:*AlpsPS/2 ALPS GlidePoint:dmi:*
  LIBINPUT_MODEL_ALPS_TOUCHPAD=1
 
+libinput:name:*AlpsPS/2 ALPS DualPoint TouchPad:fwversion:8
+libinput:name:*AlpsPS/2 ALPS GlidePoint:fwversion:8
+ LIBINPUT_ATTR_SIZE_HINT=100x55
+
 ##########################################
 # Apple
 ##########################################
diff --git a/udev/libinput-model-quirks.c b/udev/libinput-model-quirks.c
index 87c19d4..6140371 100644
--- a/udev/libinput-model-quirks.c
+++ b/udev/libinput-model-quirks.c
@@ -99,6 +99,24 @@ out:
 }
 
 static void
+handle_touchpad_alps(struct udev_device *device)
+{
+	const char *product;
+	int bus, vid, pid, version;
+
+	product = prop_value(device, "PRODUCT");
+	if (!product)
+		return;
+
+	if (sscanf(product, "%x/%x/%x/%x", &bus, &vid, &pid, &version) != 4)
+		return;
+
+	/* ALPS' firmware version is the PID */
+	if (pid)
+		printf("LIBINPUT_MODEL_FIRMWARE_VERSION=%d\n", pid);
+}
+
+static void
 handle_touchpad(struct udev_device *device)
 {
 	const char *name = NULL;
@@ -109,6 +127,8 @@ handle_touchpad(struct udev_device *device)
 
 	if (strstr(name, "ETPS/2 Elantech Touchpad") != NULL)
 		handle_touchpad_elantech(device);
+	else if (strstr(name, "AlpsPS/2 ALPS") != NULL)
+		handle_touchpad_alps(device);
 }
 
 int main(int argc, char **argv)
-- 
2.4.3



More information about the wayland-devel mailing list