Commit Graph

10756 Commits

Author SHA1 Message Date
Peter Hutterer
94599694d9 udev: input_id: whitespace fixes
Remove whitespaces before opening parentheses, mostly before test_bit.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-05-03 14:34:11 -04:00
Tom Gundersen
d2c243dbd9 libudev: monitor - fix typo in log message
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-05-03 14:27:02 -04:00
Tom Gundersen
591caddeb9 libudev: monitor - clarify log messages
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-05-03 14:26:05 -04:00
Anthony G. Basile
03c9f6028b libudev/libudev-enumerate.c: do not match only on initialized devices by default
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-05-03 14:11:33 -04:00
Anthony G. Basile
372ddd7e0e libudev/libudev-enumerate.c: do not reduce to a thin wrapper around sd-device
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-05-03 14:05:57 -04:00
Adam Goode
ed2fa53c4a rules: Add more firewire properties for sound, to be closer to USB and PCI
USB and PCI soundcards have a nice set of ID_* properties. It would
be handy for firewire soundcards to have the same.

Note that this removes the explicit setting of ID_ID in the firewire
conditional. Because we are now setting ID_SERIAL, ID_ID will come
from later in the file.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-05-03 13:58:03 -04:00
Adam Goode
b743095184 rules: Don't use ALSA card id in ID_ID
The ALSA id sysattr is generated by the sound subsystem and is not
a stable identifier. It is generated though some string manipulation
then made unique if there is a conflict. This means that it is
enumeration-dependent and shouldn't be used for ID_ID.

If ID_ID is supposed to be system-unique, it is not already since
for firewire it is generated from the guid and there are broken
firewire devices that have duplicate guids across devices.

This is tracked for PulseAudio at
https://bugs.freedesktop.org/show_bug.cgi?id=90129.

This is essentially a revert of systemd
ed1b2d9fc7.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-05-03 13:57:26 -04:00
Zbigniew Jędrzejewski-Szmek
ece5474ed4 hwdb: coalesce same pointingstick entries into one
Multiple models in the same hardware series are likely to have similar
specs. We should use organization similar to hwdb/60-evdev.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-05-03 13:54:17 -04:00
Hans de Goede
ab24ad9042 udev: hwdb: Add trackpoint sensitivity settings for Lenovo X240 and 540p
Like the T440s these need the sensitity to be set significantly higher
then the default of 128 for the trackpoint to be usable. Like with the
T440s 200 seems to be a good value to get a reasonable but not too high
sensitivity.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-05-03 13:53:46 -04:00
Peter Hutterer
43bca610f2 hwdb: fix typo - "sort by by..." -> "sort by..."
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-05-03 13:53:13 -04:00
Peter Hutterer
b71f26d8f5 hwdb: add HP X1000 DPI info
Device name is PixArt, but it's sold as a HP brand.

https://bugs.freedesktop.org/show_bug.cgi?id=90142

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-05-03 13:52:32 -04:00
Benjamin Tissoires
b574f77178 hwdb: add Chromebook pixel (2015) resolution fix
The atmel driver sets a default resolution of 20 for each touchpads it
creates. On this model, 10 is more appropriate.

The resolution is not set for the touchscreen by the kernel, so match
the name to both touchpad and touchscreen.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-05-03 13:51:49 -04:00
Benjamin Tissoires
e571fca1c0 hwdb: add evdev entry for the Lenovo X230 series touchpad
The Lenovo X230 advertize a vertical resolution of 136, which gives a true
size of 31 mm. The actual physical size of the touchpad is 40 mm, so
override the resolution to 100.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-05-03 13:51:11 -04:00
Hans de Goede
5983d43fbd 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.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-05-03 13:50:16 -04:00
Hans de Goede
55c5046e38 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.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-05-03 13:49:36 -04:00
Hans de Goede
c17bf40825 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.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-05-03 13:46:48 -04:00
Hans de Goede
eb38f78d79 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.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-05-03 13:45:55 -04:00
Martin Pitt
d199a52892 hwdb: Fix wireless switch on Dell Latitude
It does not generate a release event.

https://launchpad.net/bugs/1441849

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-04-17 19:24:50 -04:00
Ronny Chevalier
38a4db66e7 Ronny Chevalier <chevalier.ronny@gmail.com>shared: add terminal-util.[ch]
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-04-15 16:05:41 -04:00
Anthony G. Basile
5ad9610b49 test: test only udev and libudev. 2015-04-14 19:31:08 -04:00
Ronny Chevalier
9b8066c9e3 shared: add random-util.[ch]
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-04-14 19:21:57 -04:00
Ronny Chevalier
47fefe3040 shared: add process-util.[ch]
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-04-14 18:42:09 -04:00
Lennart Poettering
4b725bd2d3 util: when unescaping C escape sequences support C++11 \u and
\U unicode literals

We simply recode them in utf8.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-04-14 17:31:34 -04:00
Lennart Poettering
119711f4e8 path-util: fix more path_is_mount e792e890f fallout
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-04-12 18:59:02 -04:00
Lennart Poettering
88113c8b3f path-util: don't eat up ENOENT in path_is_mount_point()
There's no reason to eat up ENOENT, it should be OK to simply report the
error back.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-04-12 18:59:02 -04:00
Lennart Poettering
ea18efb8e7 path-util: make sure fd_is_mount_point() returns true for root directory
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-04-12 18:58:57 -04:00
Anthony G. Basile
df768a72b5 src/shared/Makefile.am: fix make dist-check
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-04-12 18:58:54 -04:00
Lennart Poettering
4a891daec0 path-util: if parent can do name_to_handle() but relevant dir not, it's a mount point
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-04-12 18:58:42 -04:00
Lennart Poettering
3df6745c2b path-util.c: changes for rm-rf: never cross mount points
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-04-12 18:45:08 -04:00
David Herrmann
c9853d8cda hashmap: return NULL from destructor
We _always_ return NULL from destructors to allow direct assignments to
the variable holding the object. Especially on hashmaps, which treat NULL
as empty hashmap, this is pretty neat.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-04-12 18:16:35 -04:00
Ronny Chevalier
461300d949 shared: add formats-util.h
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-04-12 18:08:17 -04:00
Lennart Poettering
453b353653 device-nodes: minor simplifications
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-04-12 17:46:37 -04:00
Anthony G. Basile
8b2a897e59 util.c: follow upstream's comments. 2015-04-12 17:44:19 -04:00
Tom Gundersen
4e9414b656 shared: set - make argument to set_remove() const
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-04-12 17:20:13 -04:00
Zbigniew Jędrzejewski-Szmek
6529265de6 shared/mkdir: do not set errno in addition to return value
All callers look at the return value anyway.
2015-04-12 17:03:06 -04:00
David Herrmann
ff1acaf3c4 strv: return NULL from strv_free()
We always return NULL/invalid-object from destructors, fix strv_free() to
do the same.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-04-12 17:01:34 -04:00
Anthony G. Basile
36f74863ad 60-keyboard.hwdb: update comment 2015-04-12 17:00:01 -04:00
Zbigniew Jędrzejewski-Szmek
310868f14a udev-builtin-keyboard: make error messages more standard
- No need to add "Error, " prefix, we already have that as metadata.
- Also use double quotes for path names, as in most other places.
- Remove stray newline at end of message.
- Downgrade error messages after which we continue to warnings.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-04-12 13:19:44 -04:00
Daniel Drake
cdbef8fd5a udevd: fix synchronization with settle when handling inotify events
udev uses inotify to implement a scheme where when the user closes
a writable device node, a change uevent is forcefully generated.
In the case of block devices, it actually requests a partition rescan.

This currently can't be synchronized with "udevadm settle", i.e. this
is not reliable in a script:

 sfdisk --change-id /dev/sda 1 81
 udevadm settle
 mount /dev/sda1 /foo

The settle call doesn't synchronize there, so at the same time we try
to mount the device, udevd is busy removing the partition device nodes and
readding them again. The mount call often happens in that moment where the
partition node has been removed but not readded yet.

This exact issue was fixed long ago:
http://git.kernel.org/cgit/linux/hotplug/udev.git/commit/?id=bb38678e3ccc02bcd970ccde3d8166a40edf92d3

but that fix is no longer valid now that sequence numbers are no longer
used.

Fix this by forcing another mainloop iteration after handling inotify events
before unblocking settle. If the inotify event caused us to generate a
"change" event, we'll pick that up in the following loop iteration, before
we reach the end of the loop where we respond to settle's control message,
unblocking it.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-04-12 13:18:48 -04:00
Nir Soffer
1cd8de00b5 udev: restore udevadm settle timeout
Commit 9ea28c55a2 (udev: remove seqnum API and all assumptions about
seqnums) introduced a regresion, ignoring the timeout option when
waiting until the event queue is empty.

Previously, if the udev event queue was not empty when the timeout was
expired, udevadm settle was returning with exit code 1.  To check if the
queue is empty, you could invoke udevadm settle with timeout=0. This
patch restores the previous behavior.

(David: fixed timeout==0 handling and dropped redundant assignment)

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-04-12 13:18:06 -04:00
Gavin Li
24f869b793 hwdb: add Samsung ATIV Book 6 / 8
This adds support for the keyboard illumination keys and fixes
Fn+F1.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-04-12 13:16:36 -04:00
Peter Hutterer
8282539ff1 hwdb: set the resolution for a couple of bcm5974 touchpads
Verified for the 5,1 Macbook, the others are guesses based on the list of
supported devices of the moshi trackpad protector.
http://www.moshi.com/trackpad-protector-trackguard-macbook-pro#silver

Resolution calculated based on the min/max settings set in the kernel driver,
divided by the physical size. This is probably slightly off, but still better
than no resolution at all.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-04-12 13:15:52 -04:00
Zbigniew Jędrzejewski-Szmek
37668c896a rules: finish incomplete rename
Fixup for 51c0c2869845a058268d54c3111d55d0dd485704.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-04-12 13:14:46 -04:00
Matthew Garrett
32610f8a5f rules: fix tests for removable state
We only care about whether our direct parent is removable, not whether any
further points up the tree are - the kernel will take care of policy for
those itself. This enables autosuspend on devices where the root hub reports
that its removable state is unknown.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-04-12 13:13:28 -04:00
Anthony G. Basile
c5bf58cafc udev: builtin-keyboard: add support for EVDEV_ABS_*
Parse properties in the form
EVDEV_ABS_00="<min>:<max>:<res>:<fuzz>:<flat>"

and apply them to the kernel device. Future processes that open that device
will see the updated EV_ABS range.

This is particularly useful for touchpads that don't provide a resolution in
the kernel driver but can be fixed up through hwdb entries (e.g. bcm5974).

All values in the property are optional, e.g. a string of "::45" is valid to
set the resolution to 45.

The order intentionally orders resolution before fuzz and flat despite it
being the last element in the absinfo struct. The use-case for setting
fuzz/flat is almost non-existent, resolution is probably the most common case
we'll need.

To avoid multiple hwdb invocations for the same device, replace the
hwdb "keyboard:" prefix with "evdev:" and drop the separate 60-keyboard.rules
file. The new 60-evdev.rules is called for all event nodes
anyway, we don't need a separate rules file and second callout to the hwdb
builtin.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-04-12 13:09:45 -04:00
Peter Hutterer
e2e8747652 udev: builtin-keyboard: invert a condition
No functional changes, just to make the next patch easier to review

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-04-12 12:27:47 -04:00
Peter Hutterer
ca9aee0fac udev: builtin-keyboard: move actual key mapping to a helper function
No changes in the mapping, but previously we opened the device only on
successful parsing. Now we open the mapping as soon as we have a value that
looks interesting. Since errors are supposed to be the exception, not the
rule, this is probably fine.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-04-12 12:26:55 -04:00
Peter Hutterer
13d57d7917 udev: builtin-keyboard: immediately EVIOCSKEYCODE when we have a pair
Rather than building a map and looping through the map, immediately call the
ioctl when we have a successfully parsed property.

This has a side-effect: before the maximum number of ioctls was limited to the
size of the map (1024), now it is unlimited.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-04-12 12:26:13 -04:00
Peter Hutterer
accc92a8ad udev: builtin-keyboard: move fetching the device node up
No point parsing the properties if we can't get the devnode to apply them
later. Plus, this makes future additions easier to slot in.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-04-12 12:25:16 -04:00
Anthony G. Basile
206d05759f test-libudev.c: remove deprecated functions. 2015-04-12 12:21:07 -04:00