iio: imu: bmi323: Use the new shared iio_read_acpi_mount_matrix() helper
Subsystems (2)
cover iio: imu: bmi323: Use the new shared iio_read_acpi_mount_matrix() helper
The default mount matrix (identity matrix) for the Asus RC71L is wrong: the correct one is defined in the ACPI ROTM object.
The introduction of the iio_read_acpi_mount_matrix() helper was originally meant to share a good implementation among two devices:
one of those is the bmc150 device. As pointed out previously the bmi323 is defined in the same way as the bmc150 on the ACPI, where ROTM can also be found.
I have confirmed this patch loads the correct mount matrix on my testing device.
Denis Benato (1):
iio: imu: bmi323: Use iio read_acpi_mount_matrix() helper
drivers/iio/imu/bmi323/bmi323_core.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
Signature · 1 line
2.44.0
PATCH 1/1 iio: imu: bmi323: Use iio read_acpi_mount_matrix() helper
bmi150-accel and bmi323-imu are declared in an almost identical way in the ACPI and in some devices such as the Asus RC71L the "ROTM" property can be found: parse and use the ACPI-defined mount-matrix.
--- drivers/iio/imu/bmi323/bmi323_core.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/iio/imu/bmi323/bmi323_core.c +5 -3
@@ -2083,9 +2083,11 @@ int bmi323_core_probe(struct device *dev)if (ret)return -EINVAL ; - ret =iio_read_mount_matrix (dev, &data->orientation); -if (ret) -return ret; +if (!iio_read_acpi_mount_matrix (dev, &data->orientation,"ROTM" )) { + ret =iio_read_mount_matrix (dev, &data->orientation); +if (ret) +return ret; + } indio_dev->name ="bmi323-imu" ; indio_dev->info = &bmi323_info;
Signature · 1 line
2.44.0
Re: [PATCH 1/1] iio: imu: bmi323: Use iio read_acpi_mount_matrix() helper
Quoted 5 lines · On Thu, 23 May 2024 19:47:36 +0200 Denis Benato <[email protected]>…
bmi150-accel and bmi323-imu are declared in an almost identical way in the ACPI and in some devices such as the Asus RC71L the "ROTM" property can be found: parse and use the ACPI-defined mount-matrix.
Co-developed-by Luke D. Jones <[email protected]>Co-developed-by Jonathan LoBue <[email protected]>Signed-off-by Denis Benato <[email protected]>
Applied.
Thanks,
Jonathan
Quoted 23 lines
--- drivers/iio/imu/bmi323/bmi323_core.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)drivers/iio/imu/bmi323/bmi323_core.c +5
-3@@ -2083,9 +2083,11 @@ int bmi323_core_probe(struct device *dev)if (ret)return -EINVAL ; - ret =iio_read_mount_matrix (dev, &data->orientation); -if (ret) -return ret; +if (!iio_read_acpi_mount_matrix (dev, &data->orientation,"ROTM" )) { + ret =iio_read_mount_matrix (dev, &data->orientation); +if (ret) +return ret; + } indio_dev->name ="bmi323-imu" ; indio_dev->info = &bmi323_info;