diff --git a/udev/90-libinput-model-quirks.hwdb b/udev/90-libinput-model-quirks.hwdb index 6b3ca196..8135665e 100644 --- a/udev/90-libinput-model-quirks.hwdb +++ b/udev/90-libinput-model-quirks.hwdb @@ -13,7 +13,6 @@ # libinput:touchpad: # libinput:name::dmi: # libinput:name::dt: -# libinput:name::fwversion: # # Sort by brand, model @@ -45,11 +44,21 @@ 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:800 -libinput:name:*AlpsPS/2 ALPS GlidePoint:fwversion:800 +# ALPS firmware versions: +# V1 = 0x100 +# V2 = 0x200 +# V3 = 0x300 +# V3_RUSHMORE = 0x310 +# V4 = 0x400 +# V5 = 0x500 +# V6 = 0x600 +# V7 = 0x700 /* t3btl t4s */ +# V8 = 0x800 /* SS4btl SS4s */ +# V9 = 0x900 /* ss3btl */ +libinput:touchpad:input:b0011v0002p0008e0800* LIBINPUT_ATTR_SIZE_HINT=100x55 -libinput:name:*AlpsPS/2 ALPS DualPoint Stick:fwversion:800 +libinput:pointingstick:input:b0011v0002p0008e0800* LIBINPUT_ATTR_TRACKPOINT_RANGE=160 ########################################## diff --git a/udev/90-libinput-model-quirks.rules.in b/udev/90-libinput-model-quirks.rules.in index f29cb8a2..cab8dcda 100644 --- a/udev/90-libinput-model-quirks.rules.in +++ b/udev/90-libinput-model-quirks.rules.in @@ -11,23 +11,6 @@ ACTION!="add|change", GOTO="libinput_model_quirks_end" KERNEL!="event*", GOTO="libinput_model_quirks_end" -# Firmware detection, two-stage process. -# First, run the program and import the LIBINPUT_MODEL_FIRMWARE_VERSION -# environment (if any) -KERNELS=="*input*", \ - ENV{ID_INPUT_TOUCHPAD}=="1", \ - ENV{.DETECT_FWVERSION}="1" -KERNELS=="*input*", \ - ENV{ID_INPUT_POINTINGSTICK}=="1", \ - ENV{.DETECT_FWVERSION}="1" -ENV{.DETECT_FWVERSION}!="1", GOTO="skip_fwversion" - -IMPORT{program}="@UDEV_TEST_PATH@libinput-model-quirks %S%p" -ENV{LIBINPUT_MODEL_FIRMWARE_VERSION}!="", \ - IMPORT{builtin}="hwdb 'libinput:name:$attr{name}:fwversion:$env{LIBINPUT_MODEL_FIRMWARE_VERSION}'" -# End of touchpad firmware detection -LABEL="skip_fwversion" - # libinput:touchpad: ENV{ID_INPUT_TOUCHPAD}=="1", \ IMPORT{builtin}="hwdb --subsystem=input --lookup-prefix=libinput:touchpad:" @@ -40,6 +23,10 @@ ENV{ID_INPUT_TABLET}=="1", \ ENV{ID_INPUT_MOUSE}=="1", \ IMPORT{builtin}="hwdb --subsystem=input --lookup-prefix=libinput:mouse:" +# libinput:pointingstick: +ENV{ID_INPUT_POINTINGSTICK}=="1", \ + IMPORT{builtin}="hwdb --subsystem=input --lookup-prefix=libinput:pointingstick:" + # libinput:touchpad: ENV{ID_INPUT_KEYBOARD}=="1", \ IMPORT{builtin}="hwdb --subsystem=input --lookup-prefix=libinput:keyboard:" diff --git a/udev/libinput-model-quirks.c b/udev/libinput-model-quirks.c index 9eb15054..728f182f 100644 --- a/udev/libinput-model-quirks.c +++ b/udev/libinput-model-quirks.c @@ -51,24 +51,6 @@ prop_value(struct udev_device *device, return prop_value; } -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 version */ - if (version) - printf("LIBINPUT_MODEL_FIRMWARE_VERSION=%x\n", version); -} - static void handle_touchpad_synaptics(struct udev_device *device) { @@ -102,25 +84,10 @@ handle_touchpad(struct udev_device *device) if (!name) return; - if (strstr(name, "AlpsPS/2 ALPS") != NULL) - handle_touchpad_alps(device); if (strstr(name, "Synaptics ") != NULL) handle_touchpad_synaptics(device); } -static void -handle_pointingstick(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); -} - /** * For a non-zero fuzz on the x/y axes, print that fuzz as property and * reset the kernel's fuzz to 0. @@ -200,8 +167,6 @@ int main(int argc, char **argv) if (prop_value(device, "ID_INPUT_TOUCHPAD")) handle_touchpad(device); - if (prop_value(device, "ID_INPUT_POINTINGSTICK")) - handle_pointingstick(device); rc = 0; diff --git a/udev/parse_hwdb.py b/udev/parse_hwdb.py index d00bce4c..1d87ecdb 100755 --- a/udev/parse_hwdb.py +++ b/udev/parse_hwdb.py @@ -59,7 +59,7 @@ REAL = Combine((INTEGER + Optional('.' + Optional(INTEGER))) ^ ('.' + INTEGER)) UDEV_TAG = Word(string.ascii_uppercase, alphanums + '_') TYPES = { - 'libinput': ('name', 'touchpad', 'mouse', 'keyboard', 'tablet'), + 'libinput': ('name', 'touchpad', 'mouse', 'keyboard', 'tablet', 'pointingstick'), } @@ -110,8 +110,7 @@ def property_grammar(): ('LIBINPUT_ATTR_PRESSURE_RANGE', Group(crange('SETTINGS*'))), ('LIBINPUT_ATTR_TOUCH_SIZE_RANGE', Group(crange('SETTINGS*'))), ('LIBINPUT_ATTR_TPKBCOMBO_LAYOUT', Or(('below'))), - ('LIBINPUT_ATTR_LID_SWITCH_RELIABILITY', - Or(('reliable', 'write_open'))), + ('LIBINPUT_ATTR_LID_SWITCH_RELIABILITY', Or(('reliable', 'write_open'))), ('LIBINPUT_ATTR_KEYBOARD_INTEGRATION', Or(('internal', 'external'))), ('LIBINPUT_ATTR_TRACKPOINT_RANGE', INTEGER('Y')), ('LIBINPUT_ATTR_THUMB_PRESSURE_THRESHOLD', INTEGER('Y')),