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.

Co-developed-by: Luke D. Jones <luke@ljones.dev>
Co-developed-by: Jonathan LoBue <jlobue10@gmail.com>
Signed-off-by: Denis Benato <benato.denis96@gmail.com>
Link: https://lore.kernel.org/r/20240523174736.16692-2-benato.denis96@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
This commit is contained in:
Denis Benato
2024-05-23 19:47:36 +02:00
committed by Jonathan Cameron
parent 33c33a961b
commit 5c3266385e

View File

@@ -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;