iio_read_acpi_mount_matrix(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– 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 β€” an iio_mount_matrix struct 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 πŸ¦‹


🌈 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