summaryrefslogtreecommitdiff
path: root/udev
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2015-06-30 13:00:10 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2015-07-14 10:12:12 +1000
commita74dcf965a86251aed75420a0308b337e2fdbd7f (patch)
tree1fef19e99a95e0391070d9ca924ab2f5a6733277 /udev
parentb06a1be01322f17e98b69a3633f0efc7b862e429 (diff)
udev: add ALPS firmware detection and size properties
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'udev')
-rw-r--r--udev/90-libinput-model-quirks.hwdb4
-rw-r--r--udev/libinput-model-quirks.c26
2 files changed, 30 insertions, 0 deletions
diff --git a/udev/90-libinput-model-quirks.hwdb b/udev/90-libinput-model-quirks.hwdb
index fd9efa81..129f567f 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 3c51a378..fc3dbe85 100644
--- a/udev/libinput-model-quirks.c
+++ b/udev/libinput-model-quirks.c
@@ -51,8 +51,34 @@ prop_value(struct udev_device *device,
}
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;
+
+ name = prop_value(device, "NAME");
+ if (!name)
+ return;
+
+ if (strstr(name, "AlpsPS/2 ALPS") != NULL)
+ handle_touchpad_alps(device);
}
int main(int argc, char **argv)