iio_read_acpi_mount_matrix(9)
π iio_read_acpi_mount_matrix(9) π
okay so bestie, welcome to the Kernel API Manual β¨ β today's main character is iio_read_acpi_mount_matrix, and no cap, it's lowkey iconic: it goes digging through ACPI firmware to find out which way your accelerometer is literally facing. π§π¦
β¨ NAME β¨
iio_read_acpi_mount_matrix β read accelerometer mount matrix info from ACPI π
πΈ SYNOPSIS πΈ
bool iio_read_acpi_mount_matrix (struct device *dev , struct
iio_mount_matrix *orientation , char *acpi_method );
π ARGUMENTS π
devβ the device structure, obvs. the thing we're asking about π«Άorientationβ aniio_mount_matrixstruct that this function fills in for you. it's giving "empty cup, hand me the facts" ββ¨acpi_methodβ the ACPI method name we read the matrix from, usually"ROTM"π
π₯ DESCRIPTION π₯
So the whole vibe: this function tries to read the mount-matrix by calling the method you named on the device's ACPI firmware-node. That's it, that's the mission. π
Now the dramatic part π β if the device has no ACPI firmware-node, or the method doesn't exist, then this will fail silently. no error, no drama, just vibes and a quiet false. not me finding out the hard way π
It expects the method to hand back data in the ACPI "ROTM" format defined by Microsoft: https://learn.microsoft.com/en-us/windows-hardware/drivers/sensors/sensors-acpi-entries
β οΈ heads up bestie: this is a Microsoft extension and it is not part of the official ACPI spec. so like, it's real, it works, but it's not canon. π
And why is acpi_method a parameter instead of just hardcoding it, you ask? because some dual-accel setups define 2 mount matrices inside a single ACPI device, using separate "ROMK" and "ROMS" methods. so yeah, configurable on purpose. slay for flexibility π
β RETURN β
true if the matrix was read successfully, false otherwise. that's the whole tea π΅
π¦ SEE ALSO π¦
- Kernel file
./drivers/iio/industrialio-acpi.c iio_get_acpi_device_name_and_data(9)
π okay that's the page!! this one lives under ./drivers/iio, dated October 2026, and it's part of the Kernel API Manual β ty for reading bestie, you ate that, periodt πππ§ββοΈ
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms