iio: accel: mxc4005: Read orientation matrix from ACPI ROTM method
authorHans de Goede <hdegoede@redhat.com>
Thu, 25 Apr 2024 12:57:54 +0000 (14:57 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Mon, 29 Apr 2024 19:53:25 +0000 (20:53 +0100)
commit4a8e1e020a38009d3a352b1e4738f5c4dce70654
tree860472290c2fbb0dedf3da7702ef80ab3105c42b
parentdd3f40b53957541c04a9dceed178df38ddbe3447
iio: accel: mxc4005: Read orientation matrix from ACPI ROTM method

Some devices use the semi-standard ACPI "ROTM" method to store
the accelerometers orientation matrix.

Add support for this using the new iio_read_acpi_mount_matrix() helper, if
the helper fails to read the matrix fall back to iio_read_mount_matrix()
which will try to get it from device-properties (devicetree) and if
that fails it will fill the matrix with the identity matrix.

Link: https://bugzilla.kernel.org/show_bug.cgi?id=218578
Acked-by: Rafael J. Wysocki <rafael@kernel.org>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20240425125754.76010-5-hdegoede@redhat.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/accel/mxc4005.c