Commit Graph

17 Commits

Author SHA1 Message Date
Björn Daase ad0d9c0109 hwdb: Relax parsing script to allow 0 and 1 for all ID_* properties 2021-01-08 10:32:40 +01:00
Yu Watanabe 315a3c9ff4 hwdb: add missing Group()
This fixes the following warning:
```
parse_hwdb.py:120: UserWarning: warn_ungrouped_named_tokens_in_collection: setting results name 'SETTINGS*' on And expression collides with 'HZ' on contained expression
  dpi_setting = (Optional('*')('DEFAULT') + INTEGER('DPI') + Suppress('@') + INTEGER('HZ'))('SETTINGS*')
```

Not sure about for the mount_matrix, but LGTM.com warns in that line,
and, adding Group() does not change the parse result.
2020-11-27 06:02:44 +09:00
Yu Watanabe e77fed207a hwdb: enable diagnostic switches 2020-11-27 05:59:56 +09:00
Zbigniew Jędrzejewski-Szmek a21ac934a1 Revert "parse_hwdb: enforce the ":*" suffix"
This reverts commit ad2d8e61ee.
2020-11-03 14:26:51 +01:00
Zbigniew Jędrzejewski-Szmek a136c2cdd8 hwdb: drop quotes from XKB_FIXED_*= properties
The properties are not unquoted by udev, so the quotes effectively became part
of the value.

Even though those properties were added quite a while ago
(086c001e29,
d7d31692bf), they never started being used
(because of issues with having multiple layouts), see
https://gitlab.gnome.org/GNOME/mutter/-/issues/906,
https://bugzilla.gnome.org/show_bug.cgi?id=775681.

Let's remove the quotes while we still can.

From https://bugzilla.gnome.org/show_bug.cgi?id=775681#c7:
> Note to self: the values for XKB_FIXED_LAYOUT and XKB_FIXED_VARIANT are
> quoted, meaning that we need to remove the quotes before passing the values
> from udev_device_get_property_value() to xkb_keymap_new_from_names()
> otherwise the compilation of the keymap fails (please don't ask how I found
> out...)
2020-10-20 08:37:07 +02:00
Zbigniew Jędrzejewski-Szmek ad2d8e61ee parse_hwdb: enforce the ":*" suffix 2020-10-15 18:01:32 +02:00
Zbigniew Jędrzejewski-Szmek 77547d5313 hwdb: check that uppercase digits are used in modalias patterns
This is all confusing as hell, becuase in some places lowercase hexadecimal
digits are used, and in other places uppercase. This adds a check for the
most common case that we and others got wrong.

I tried to extend the general grammar in hwdb_grammar() to include this check,
but it quickly became very complicated and didn't seem to work properly. Doing
initial parsing with more general rules is easier and also seems to give better
error messages:

/home/zbyszek/src/systemd-work/build/../hwdb.d/60-autosuspend.hwdb: 3 match groups, 5 matches, 3 properties
Pattern 'v058fp9540*' is invalid: Expected W:(0123...), found 'f'  (at char 4), (line:1, col:5)
2020-07-17 11:15:58 +02:00
Zbigniew Jędrzejewski-Szmek 457763aa03 hwdb: allow spaces in usb: matches and similar patterns
In the past we didn't have any matches like that, so the parser was stricter
than necessary, but now we have, so allow that.
2020-07-17 07:44:10 +02:00
Zbigniew Jędrzejewski-Szmek aa549ff397 test: also verify the generated autosuspend hwdb file
Hint: meson test -C build parse-hwdb -v
2020-06-22 14:45:20 +02:00
Peter Hutterer 9f50cdd34a hwdb: remove support for MOUSE_WHEEL_TILT_*
This has now been deprecated in libinput, the only known user of this
property. It was never set for any device and weston and mutter, maybe
other compositors, never added the code required to parse it.

The benefit we could get in the UI from handling tilt differently to
wheel is tiny and the lack of support shows that it isn't of interest to
anyone. Let's remove this.

See also
https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/444
2020-05-24 12:24:16 +02:00
Guido Günther 1c5b427f5d
hwdb: 60-sensor.hwdb: Add proximity sensor udev property (#14845)
Devices with proximity sensors can specify a near level that
indicates when an object is considered close to the device.
2020-03-03 14:40:00 +01:00
Zbigniew Jędrzejewski-Szmek 12c7d4d65e hwdb: ignore keys added in kernel 5.5
python-evdev needs to be rebuilt with new kernel headers. Before that
happens, our test would reject those keys as unknown.
2019-12-19 11:48:46 +01:00
Sebastian Wick d7d31692bf hwdb: add XKB_FIXED_MODEL to the keyboard hwdb
Chromebook keyboards have a top row which generates f1-f10 key codes but
the keys have media symbols printed on them. A simple scan code to key
code mapping to the correct media keys makes the f1-f10 inaccessible. To
properly use the keyboard a custom key code to symbol mapping in xbk is
required (a variant of the chromebook xkb model is already upstream).
Other devices have similar problems.
This commit makes it possible to specify which xkb model should be used
for a specific device by setting XKB_FIXED_MODEL.
2019-11-05 10:08:26 +01:00
Zbigniew Jędrzejewski-Szmek 2382a2e32b parse_hwdb: fix compatibility with pyparsing 2.4.*
pyparsing 2.3.1/2.4.0 had some changes to grouping of And matches, and as a
result we'd report 0 properties and 0 matches, and not really do any checks.

With this change we get identical behaviour for pyparsing 2.3.1, 2.4.0, 2.4.2:

$ hwdb/parse_hwdb.py
hwdb/60-evdev.hwdb: 72 match groups, 94 matches, 262 properties
hwdb/60-input-id.hwdb: 3 match groups, 3 matches, 4 properties
hwdb/60-keyboard.hwdb: 173 match groups, 256 matches, 872 properties
Keycode KBD_LCD_MENU1 unknown
Keycode KBD_LCD_MENU4 unknown
Keycode KBD_LCD_MENU2 unknown
Keycode KBD_LCD_MENU3 unknown
hwdb/60-sensor.hwdb: 101 match groups, 120 matches, 105 properties
hwdb/70-joystick.hwdb: 2 match groups, 3 matches, 2 properties
hwdb/70-mouse.hwdb: 104 match groups, 119 matches, 123 properties
hwdb/70-pointingstick.hwdb: 8 match groups, 30 matches, 11 properties
hwdb/70-touchpad.hwdb: 6 match groups, 9 matches, 6 properties
2019-10-10 09:48:23 +02:00
Zbigniew Jędrzejewski-Szmek b32ae3aa7b parse_hwdb: process files in order
Also, make the pattern more general. There are some plans to add more files
there, let's make sure we don't miss them.
2019-10-10 09:48:23 +02:00
Zbigniew Jędrzejewski-Szmek f3c80bc01e parse_hwdb: bail with an error if no matches or groups are detected
pyparsing sometimes changes behaviour and stops giving matches. This should
allow us to detect such scenario. With this change, parse_hwdb fails with
pyparsing 2.4 on F31.
2019-10-10 09:48:23 +02:00
Zbigniew Jędrzejewski-Szmek 4f10b80786 Rename udev's hwdb/ to hwdb.d/
As in the parent commit, this makes the name consistent with the
rest of the source tree and the actuall installation path.
2019-10-10 00:53:09 +01:00
Renamed from hwdb/parse_hwdb.py (Browse further)