dcavalca / rpms / systemd

Forked from rpms/systemd 3 years ago
Clone
c80094e
From 9fbe7f1bb35150a5ea230179fda2a98206ed7780 Mon Sep 17 00:00:00 2001
c80094e
From: Fedora systemd team <systemd-maint@redhat.com>
c80094e
Date: Thu, 5 Feb 2015 10:08:13 +0100
c80094e
Subject: [PATCH] hwdb: add a touchpad hwdb
c80094e
c80094e
Currently used to tag devices in the new Lenovo *50 series and the X1 Carbon
c80094e
3rd. These laptops re-introduced the physical trackpoint buttons that were
c80094e
missing from the *40 series but those buttons are now wired up to the
c80094e
touchpad.
c80094e
c80094e
The touchpad now sends BTN_0, BTN_1 and BTN_2 for the trackpoint. The same
c80094e
button codes were used in older touchpads that had dedicated scroll up/down
c80094e
buttons. Input drivers need to work around this and thus know what they're
c80094e
dealing with.
c80094e
c80094e
For the previous gen we introduced INPUT_PROP_TOPBUTTONPAD in the kernel, but
c80094e
the resulting mess showed that these per-device quirks should really live in
c80094e
userspace.
c80094e
c80094e
The list currently includes the X1 Carbon 3rd PNPID, others will be added as
c80094e
get to know which PNPID they have.
c80094e
c80094e
(Cherry-picked from 001a247324b44c0e0b8fdba41a6fc66e7465b8b6)
c80094e
---
c80094e
 Makefile.am             |  4 +++-
c80094e
 hwdb/70-touchpad.hwdb   | 39 +++++++++++++++++++++++++++++++++++++++
c80094e
 rules/70-touchpad.rules | 12 ++++++++++++
c80094e
 3 files changed, 54 insertions(+), 1 deletion(-)
c80094e
 create mode 100644 hwdb/70-touchpad.hwdb
c80094e
 create mode 100644 rules/70-touchpad.rules
c80094e
c80094e
diff --git a/Makefile.am b/Makefile.am
c80094e
index d61838e..f44d36b 100644
c80094e
--- a/Makefile.am
c80094e
+++ b/Makefile.am
c80094e
@@ -2241,6 +2241,7 @@ dist_udevrules_DATA += \
c80094e
 	rules/50-udev-default.rules \
c80094e
 	rules/60-drm.rules \
c80094e
 	rules/60-keyboard.rules \
c80094e
+	rules/70-touchpad.rules \
c80094e
 	rules/60-persistent-storage-tape.rules \
c80094e
 	rules/60-persistent-serial.rules \
c80094e
 	rules/60-persistent-input.rules \
c80094e
@@ -2264,7 +2265,8 @@ dist_udevhwdb_DATA = \
c80094e
 	hwdb/20-bluetooth-vendor-product.hwdb \
c80094e
 	hwdb/20-acpi-vendor.hwdb \
c80094e
 	hwdb/20-OUI.hwdb \
c80094e
-	hwdb/60-keyboard.hwdb
c80094e
+	hwdb/60-keyboard.hwdb \
c80094e
+	hwdb/70-touchpad.hwdb
c80094e
 
c80094e
 udevconfdir = $(sysconfdir)/udev
c80094e
 dist_udevconf_DATA = \
c80094e
diff --git a/hwdb/70-touchpad.hwdb b/hwdb/70-touchpad.hwdb
c80094e
new file mode 100644
c80094e
index 0000000..bbf44db
c80094e
--- /dev/null
c80094e
+++ b/hwdb/70-touchpad.hwdb
c80094e
@@ -0,0 +1,39 @@
c80094e
+# This file is part of systemd.
c80094e
+#
c80094e
+# The lookup keys are composed in:
c80094e
+#   70-touchpad.rules
c80094e
+#
c80094e
+# Note: The format of the "touchpad:" prefix match key is a
c80094e
+# contract between the rules file and the hardware data, it might
c80094e
+# change in later revisions to support more or better matches, it
c80094e
+# is not necessarily expected to be a stable ABI.
c80094e
+#
c80094e
+# Match string format:
c80094e
+# touchpad:pnpid:<pnpid>:
c80094e
+#
c80094e
+# To add local entries, create a new file
c80094e
+#   /etc/udev/hwdb.d/71-touchpad-local.hwdb
c80094e
+# and add your rules there. To load the new rules execute (as root):
c80094e
+#   udevadm hwdb --update
c80094e
+#   udevadm trigger /dev/input/eventXX
c80094e
+# where /dev/input/eventXX is the touchpad in question. If in
c80094e
+# doubt, simply use /dev/input/event* to reload all input rules.
c80094e
+#
c80094e
+# If your changes are generally applicable, open a bug report on
c80094e
+#   http://bugs.freedesktop.org/enter_bug.cgi?product=systemd
c80094e
+# and include your new rules, a description of the device, and the
c80094e
+# output of
c80094e
+#   udevadm info /dev/input/eventXX
c80094e
+# (or /dev/input/event*).
c80094e
+#
c80094e
+# Allowed properties are:
c80094e
+#    TOUCHPAD_HAS_TRACKPOINT_BUTTONS=1
c80094e
+#
c80094e
+# If the TOUCHPAD_HAS_TRACKPOINT_BUTTONS property is set, this
c80094e
+# device has # the trackpoint buttons wired up to the touchpad as
c80094e
+# BTN_0, BTN_1 and BTN_2. This affects the Lenovo X1 Carbon 3rd
c80094e
+# and the *50 series (T450, T550, etc.)
c80094e
+
c80094e
+# Lenovo X1 Carbon 3rd
c80094e
+touchpad:pnpid:*LEN0048*:
c80094e
+ TOUCHPAD_HAS_TRACKPOINT_BUTTONS=1
c80094e
diff --git a/rules/70-touchpad.rules b/rules/70-touchpad.rules
c80094e
new file mode 100644
c80094e
index 0000000..88e6fd2
c80094e
--- /dev/null
c80094e
+++ b/rules/70-touchpad.rules
c80094e
@@ -0,0 +1,12 @@
c80094e
+# do not edit this file, it will be overwritten on update
c80094e
+
c80094e
+ACTION=="remove", GOTO="touchpad_end"
c80094e
+KERNEL!="event*", GOTO="touchpad_end"
c80094e
+ENV{ID_INPUT_TOUCHPAD}=="", GOTO="touchpad_end"
c80094e
+
c80094e
+# touchpad:pnpid:<pnpid>:*
c80094e
+KERNELS=="serio1", \
c80094e
+    IMPORT{builtin}="hwdb 'touchpad:pnpid:$attr{firmware_id}:'", \
c80094e
+    GOTO="touchpad_end"
c80094e
+
c80094e
+LABEL="touchpad_end"
c80094e
-- 
c80094e
2.1.0
c80094e