[systemd-commits] 4 commits - hwdb/70-pointingstick.hwdb src/udev

Peter Hutterer whot at kemper.freedesktop.org
Mon Apr 20 18:15:09 PDT 2015


 hwdb/70-pointingstick.hwdb       |   99 +++++++++++++++++++++++++++++++++++++++
 src/udev/udev-builtin-keyboard.c |   28 +++++++++++
 2 files changed, 127 insertions(+)

New commits:
commit 1f845120ec0e1921ccf924aa5b001721c561c540
Author: Hans de Goede <hdegoede at redhat.com>
Date:   Fri Apr 17 16:48:09 2015 +0200

    hwdb: Add entries for the pointingstick on 2 Dell Latitudes
    
    The pointingstick of the Dell Latitude E6400 is somewhat slow by default,
    whereas the pointingstick of the Dell Latitude D620 is much too fast by
    default, set POINTINGSTICK_CONST_ACCEL for both of them to adjust for this.

diff --git a/hwdb/70-pointingstick.hwdb b/hwdb/70-pointingstick.hwdb
index 2561129..8d210f9 100644
--- a/hwdb/70-pointingstick.hwdb
+++ b/hwdb/70-pointingstick.hwdb
@@ -70,6 +70,18 @@
 # Sort by by brand, model
 
 #########################################
+# Dell
+#########################################
+
+# Latitude D620
+evdev:name:*DualPoint Stick:dmi:bvn*:bvr*:bd*:svnDellInc.:pnLatitudeD620*:pvr*
+  POINTINGSTICK_CONST_ACCEL=0.5
+
+# Latitude E6400
+evdev:name:*DualPoint Stick:dmi:bvn*:bvr*:bd*:svnDellInc.:pnLatitudeE6400*:pvr*
+  POINTINGSTICK_CONST_ACCEL=1.5
+
+#########################################
 # Lenovo
 #########################################
 

commit 70a5703bd4bb8697392ebc65fc7c711357bfde9b
Author: Hans de Goede <hdegoede at redhat.com>
Date:   Fri Apr 17 16:48:08 2015 +0200

    hwdb: Add entries for the trackpoint on 2 Thinkpads
    
    Lenovo has changed the sensitivity of the trackpoint on the x240 / T440s / T540
    generation of Thinkpads, making them somewhat insensitive by default, add a
    hwdb entry to tweak the sensitivity setting.
    
    The ThinkPad X200s is way way too slow by default and unless you push the
    trackpoint quite hard only sends delta events in the 1-2 range, tweak the
    sensitivity to make it send a wider range of deltas and apply a const accel
    factor to make it have a more reasonable speed by default.

diff --git a/hwdb/70-pointingstick.hwdb b/hwdb/70-pointingstick.hwdb
index e87d753..2561129 100644
--- a/hwdb/70-pointingstick.hwdb
+++ b/hwdb/70-pointingstick.hwdb
@@ -68,3 +68,20 @@
 
 #
 # Sort by by brand, model
+
+#########################################
+# Lenovo
+#########################################
+
+# Lenovo Thinkpad X200s / X201s
+# Note these come with 2 revisions of keyboard, with the trackpoints having a
+# different sensitivity in the different revisions. 1.25 is a bit slow for the
+# least sensitive revision, but it is better to be a bit slow than too fast.
+evdev:name:TPPS/2 IBM TrackPoint:dmi:bvn*:bvr*:bd*:svnLENOVO:pn*:pvrThinkPadX20?s:*
+  POINTINGSTICK_SENSITIVITY=200
+  POINTINGSTICK_CONST_ACCEL=1.25
+
+# Lenovo Thinkpad T440s
+evdev:name:TPPS/2 IBM TrackPoint:dmi:bvn*:bvr*:bd*:svnLENOVO:pn*:pvrThinkPadT440s:*
+  POINTINGSTICK_SENSITIVITY=200
+  POINTINGSTICK_CONST_ACCEL=1.0

commit 5defbb5ff664f141293f800c486bc5b723f985ce
Author: Hans de Goede <hdegoede at redhat.com>
Date:   Fri Apr 17 16:48:07 2015 +0200

    udev: keyboard-builtin: Add support for setting IBM trackpoint sensitivity
    
    IBM / Lenovo trackpoints allow specifying a sensitivity setting through a
    ps/2 command, which changes the range of the deltas sent when using the
    trackpoint.
    
    On some models with normal usage only deltas of 1 or 2 are send, resulting in
    there only being 2 mouse cursor movement speeds, rather than the expected fluid
    scale. Changing the sensitivity to a higher level than the bootup default fixes
    this.
    
    This commit adds support for setting a POINTINGSTICK_SENSITIVITY value
    in hwdb to allow changing the sensitivity on boot through udev / hwdb.

diff --git a/hwdb/70-pointingstick.hwdb b/hwdb/70-pointingstick.hwdb
index 9fd5fb8..e87d753 100644
--- a/hwdb/70-pointingstick.hwdb
+++ b/hwdb/70-pointingstick.hwdb
@@ -41,6 +41,7 @@
 #
 # Allowed properties are:
 #   POINTINGSTICK_CONST_ACCEL
+#   POINTINGSTICK_SENSITIVITY
 #
 #########################################
 #      POINTINGSTICK_CONST_ACCEL        #
@@ -53,6 +54,17 @@
 # by how much to multiply deltas generated by the pointingstick to get
 # normalized deltas.
 #
+#########################################
+#      POINTINGSTICK_SENSITIVITY        #
+#########################################
+#
+# TPPS/2 IBM TrackPoint driver sensitivity sysfs setting
+#    POINTINGSTICK_SENSITIVITY=<sensitivity>
+#
+# Where <sensitivity> is a number between 0 and 255, note this property
+# only applies to TPPS/2 IBM TrackPoint devices, see
+# drivers/input/mouse/trackpoint.c in the Linux kernel sources.
+#
 
 #
 # Sort by by brand, model
diff --git a/src/udev/udev-builtin-keyboard.c b/src/udev/udev-builtin-keyboard.c
index c7f7f84..b6da734 100644
--- a/src/udev/udev-builtin-keyboard.c
+++ b/src/udev/udev-builtin-keyboard.c
@@ -146,6 +146,32 @@ static void override_abs(int fd, const char *devnode,
                 log_error_errno(errno, "Unable to EVIOCSABS device \"%s\"", devnode);
 }
 
+static void set_trackpoint_sensitivity(struct udev_device *dev, const char *value)
+{
+        struct udev_device *pdev;
+        char val_s[DECIMAL_STR_MAX(int)];
+        int r, val_i;
+
+        /* The sensitivity sysfs attr belongs to the serio parent device */
+        pdev = udev_device_get_parent_with_subsystem_devtype(dev, "serio", NULL);
+        if (!pdev) {
+                log_warning("Failed to get serio parent for '%s'", udev_device_get_devnode(dev));
+                return;
+        }
+
+        r = safe_atoi(value, &val_i);
+        if (r < 0) {
+                log_error("Unable to parse POINTINGSTICK_SENSITIVITY '%s' for '%s'", value, udev_device_get_devnode(dev));
+                return;
+        }
+
+        xsprintf(val_s, "%d", val_i);
+
+        r = udev_device_set_sysattr_value(pdev, "sensitivity", val_s);
+        if (r < 0)
+                log_error_errno(r, "Failed to write 'sensitivity' attribute for '%s': %m", udev_device_get_devnode(pdev));
+}
+
 static int open_device(const char *devnode) {
         int fd;
 
@@ -223,6 +249,8 @@ static int builtin_keyboard(struct udev_device *dev, int argc, char *argv[], boo
                         }
 
                         override_abs(fd, node, evcode, udev_list_entry_get_value(entry));
+                } else if (streq(key, "POINTINGSTICK_SENSITIVITY")) {
+                        set_trackpoint_sensitivity(dev, udev_list_entry_get_value(entry));
                 }
         }
 

commit f29378b4437e0d50e738641de24ec19d41396284
Author: Hans de Goede <hdegoede at redhat.com>
Date:   Fri Apr 17 16:48:06 2015 +0200

    udev: Add hwdb file for setting pointingstick properties
    
    There is quite a wide spread in the delta events generated by pointingsticks,
    some generate deltas of 1-2 under normal use, while others generate deltas
    from 1-20.
    
    This commit adds a hwdb file which allows specifying a per model
    POINTINGSTICK_CONST_ACCEL value which can be used by the userspace input stack
    to normalize the deltas so that all pointingsticks get the same feeling ootb.
    
    The hwdb matching re-uses the existing 60-evdev.rules.

diff --git a/hwdb/70-pointingstick.hwdb b/hwdb/70-pointingstick.hwdb
new file mode 100644
index 0000000..9fd5fb8
--- /dev/null
+++ b/hwdb/70-pointingstick.hwdb
@@ -0,0 +1,58 @@
+# This file is part of systemd.
+#
+# Pointingstick const-accel configuration, to make different brand / model
+# laptop pointingsticks have the same speed / feel, and per model adjustment
+# of the IBM TrackPoint driver's sensitivity setting
+#
+# The lookup keys are composed in:
+#   60-evdev.rules
+#
+# Note: The format of the "evdev:" prefix match key is a contract between the
+# rules file and the hardware data, it might change in later revisions to
+# support more or better matches, it is not necessarily a stable ABI.
+#
+# Supported hardware matches are:
+#  - Generic input devices match:
+#      evdev:input:bZZZZvYYYYpXXXXeWWWW-VVVV
+#    This matches on the kernel modalias of the input-device, mainly:
+#    ZZZZ is the bus-id (see /usr/include/linux/input.h BUS_*), YYYY, XXXX and
+#    WWW are the 4-digit hex uppercase vendor, product and version ID and VVVV
+#    is an arbitrary length input-modalias describing the device capabilities.
+#
+#  - Input driver device name and DMI data match:
+#      evdev:name:<input device name>:dmi:bvn*:bvr*:bd*:svn<vendor>:pn*
+#    <input device name> is the name device specified by the driver,
+#    <vendor> is the firmware-provided string from the kernel DMI modalias.
+#
+# To add local entries, create a new file
+#   /etc/udev/hwdb.d/71-pointingstick-local.hwdb
+# and add your rules there. To load the new rules execute (as root):
+#   udevadm hwdb --update
+#   udevadm trigger /dev/input/eventXX
+# where /dev/input/eventXX is the pointingstick in question. If in
+# doubt, simply use /dev/input/event* to reload all input rules.
+#
+# If your changes are generally applicable, open a bug report on
+#   http://bugs.freedesktop.org/enter_bug.cgi?product=systemd
+# and include your new rules, a description of the device, and the
+# output of
+#   udevadm info /dev/input/eventXX
+# (or /dev/input/event*).
+#
+# Allowed properties are:
+#   POINTINGSTICK_CONST_ACCEL
+#
+#########################################
+#      POINTINGSTICK_CONST_ACCEL        #
+#########################################
+#
+# Trackpoint const accel settings are specified as
+#    POINTINGSTICK_CONST_ACCEL=<accel>
+#
+# Where <accel> is a floating point number, using a '.' seperator, specifying
+# by how much to multiply deltas generated by the pointingstick to get
+# normalized deltas.
+#
+
+#
+# Sort by by brand, model



More information about the systemd-commits mailing list