Sample Header Ad - 728x90

Change iio-sensors data via custom ACCEL_MOUNT_MATRIX

6 votes
2 answers
7570 views
I have a tablet with builtin sensors which allow me automatic screen rotation, based on iio-sensors-proxy. However, the screen orientation is off, and I need to fix it. On it's GitHub page (https://github.com/systemd/systemd/blob/master/hwdb/60-sensor.hwdb) is explained how to change this behavior: Create a file /etc/udev/hwdb.d/61-sensor-local.hwdb and write to it sensor:modalias::dmi: and ACCEL_MOUNT_MATRIX=1, 0, 0; 0, 1, 0; 0, 0, 1 (this matrix has to be changed ofc). # Problem : I have no idea how to get the neccessary information for the first line, the sensor-prefix. # Solution : Final file contains: sensor:modalias:acpi:KIOX000A*:dmi:*:svnEVE*:pnEveV:* ACCEL_MOUNT_MATRIX=0, 1, 0; -1, 0, 0; 0, 0, 1 What I've found so far: This gives me device name: udevadm info --export-db | grep iio P: /devices/pci0000:00/0000:00:15.0/i2c_designware.0/i2c-0/i2c-KIOX000A:00/iio:device0 N: iio:device0 E: DEVNAME=/dev/iio:device0 E: DEVPATH=/devices/pci0000:00/0000:00:15.0/i2c_designware.0/i2c-0/i2c-KIOX000A:00/iio:device0 E: DEVTYPE=iio_device E: IIO_SENSOR_PROXY_TYPE=iio-buffer-accel E: SUBSYSTEM=iio E: SYSTEMD_WANTS=iio-sensor-proxy.service This gives me more info about the device: udevadm info -n "/dev/iio:device0" P: /devices/pci0000:00/0000:00:15.0/i2c_designware.0/i2c-0/i2c-KIOX000A:00/iio:device0 N: iio:device0 E: DEVNAME=/dev/iio:device0 E: DEVPATH=/devices/pci0000:00/0000:00:15.0/i2c_designware.0/i2c-0/i2c-KIOX000A:00/iio:device0 E: DEVTYPE=iio_device E: IIO_SENSOR_PROXY_TYPE=iio-buffer-accel E: MAJOR=245 E: MINOR=0 E: SUBSYSTEM=iio E: SYSTEMD_WANTS=iio-sensor-proxy.service E: TAGS=:systemd: E: USEC_INITIALIZED=1959744 And via pci I find the so-called modalias: cat /sys/devices/pci0000:00/0000:00:15.0/modalias pci:v00008086d00009D60sv00008086sd00007270bc11sc80i00 Would really appreciate help from here on! --- My system: Linux jva 4.14.5-1-ARCH #1 SMP PREEMPT Sun Dec 10 14:50:30 UTC 2017 x86_64 GNU/Linux running under GNOME 3.26.2 (Wayland-seesion) Tablet: Eve V i7Y
Asked by vonAlenberg (163 rep)
Dec 14, 2017, 09:18 AM
Last activity: Dec 31, 2022, 07:56 PM