From fa741e87a874da5c416352252a98d64fce2cd8a1 Mon Sep 17 00:00:00 2001 From: Boian Bonev Date: Thu, 22 Sep 2022 01:17:17 +0300 Subject: [PATCH 1/3] udev: hwdb: Match iio sensors based on their label The IIO subsystem exposes a 'label' sysfs file to help userspace better identify its devices [1]. Standardized labels include the sensor type along with its location, including 'accel-base' and 'accel-display'. Most Chrome OS boards have two accelerometers that are indistinguishable except for this label (or a 'location' sysfs file before Linux v6.0), and need different mounting matrix corrections based on their location. Add a udev rule that matches hwdb entries using this label, so we can correct both accelerometers on these devices with hwdb entries. The existing rules and hwdb entries are not modified to keep potential out-of-tree entries working, but new entries in this form will override existing ones. Also add currently standardized labels to parse-hwdb.py. [1] https://www.kernel.org/doc/Documentation/ABI/testing/sysfs-bus-iio systemd-commit e2f25ae64889ea7fe8a7556ee5fba91bc2a0eab8 Author: Alper Nebi Yasak Date: Thu Aug 18 17:27:22 2022 +0300 --- hwdb/60-sensor.hwdb | 3 +++ rules/60-sensor.rules | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/hwdb/60-sensor.hwdb b/hwdb/60-sensor.hwdb index ea278913b..ecd10f292 100644 --- a/hwdb/60-sensor.hwdb +++ b/hwdb/60-sensor.hwdb @@ -9,10 +9,13 @@ # ABI. # # Match string formats: +# sensor: