linux-stable/drivers/iio
Hans de Goede 79b8ded9d9 iio: accel: st_accel: Fix invalid mount_matrix on devices without ACPI _ONT method
When apply_acpi_orientation() fails, st_accel_common_probe() will fall back
to iio_read_mount_matrix(), which checks for a mount-matrix device property
and if that is not set falls back to the identity matrix.

But when a sensor has no ACPI companion fwnode, or when the ACPI fwnode
does not have a "_ONT" method apply_acpi_orientation() was returning 0,
causing iio_read_mount_matrix() to never get called resulting in an
invalid mount_matrix:

[root@fedora ~]# cat /sys/bus/iio/devices/iio\:device0/mount_matrix
(null), (null), (null); (null), (null), (null); (null), (null), (null)

Fix this by making apply_acpi_orientation() always return an error when
it did not set the mount_matrix.

Fixes: 3d8ad94bb1 ("iio: accel: st_sensors: Support generic mounting matrix")
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Tested-by: Marius Hoch <mail@mariushoch.de>
Link: https://lore.kernel.org/r/20230416212409.310936-1-hdegoede@redhat.com
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2023-05-13 17:54:57 +01:00
..
accel iio: accel: st_accel: Fix invalid mount_matrix on devices without ACPI _ONT method 2023-05-13 17:54:57 +01:00
adc iio: adc: palmas: fix off by one bugs 2023-05-13 17:54:57 +01:00
addac iio: addac: stx104: Use regmap_read_poll_timeout() for conversion poll 2023-04-10 12:26:34 +01:00
afe
amplifiers
buffer
cdc drivers: iio: cdc: Drop redundant if check 2023-01-08 12:59:44 +00:00
chemical iio: chemical: sps030: Reformat comment in a more readable way 2023-03-11 12:18:27 +00:00
common iio: Rename iio_trigger_poll_chained and add kernel-doc 2023-03-11 12:18:29 +00:00
dac Char/Misc drivers for 6.4-rc1 2023-04-27 12:07:50 -07:00
dummy
filter
frequency iio: frequency: admv1013: Benefit from devm_clk_get_enabled() to simplify 2023-03-18 16:35:26 +00:00
gyro iio: Rename iio_trigger_poll_chained and add kernel-doc 2023-03-11 12:18:29 +00:00
health 4th set of IIO fixes for 6.1 2022-11-27 15:05:05 +01:00
humidity iio: Rename iio_trigger_poll_chained and add kernel-doc 2023-03-11 12:18:29 +00:00
imu Char/Misc drivers for 6.4-rc1 2023-04-27 12:07:50 -07:00
light iio: bu27034: Fix integration time 2023-05-13 17:54:57 +01:00
magnetometer iio: tmag5273: Fix runtime PM leak on measurement error 2023-05-13 17:54:56 +01:00
multiplexer
orientation
position
potentiometer
potentiostat iio: Rename iio_trigger_poll_chained and add kernel-doc 2023-03-11 12:18:29 +00:00
pressure iio: Rename iio_trigger_poll_chained and add kernel-doc 2023-03-11 12:18:29 +00:00
proximity iio: proximity: sx9500: Reference ACPI and OF ID data 2023-03-12 16:18:41 +00:00
resolver
temperature iio: temperature: tmp117: cosmetic alignment cleanup 2023-03-11 12:18:29 +00:00
test
trigger iio: Rename iio_trigger_poll_chained and add kernel-doc 2023-03-11 12:18:29 +00:00
iio_core.h
iio_core_trigger.h
industrialio-buffer.c iio: buffer: make sure O_NONBLOCK is respected 2023-02-18 14:07:58 +00:00
industrialio-configfs.c
industrialio-core.c iio: core: Sort headers 2023-01-21 17:35:23 +00:00
industrialio-event.c 4th set of IIO fixes for 6.1 2022-11-27 15:05:05 +01:00
industrialio-gts-helper.c iio: gts-helpers: fix integration time units 2023-05-13 17:54:57 +01:00
industrialio-sw-device.c
industrialio-sw-trigger.c
industrialio-trigger.c iio: Rename iio_trigger_poll_chained and add kernel-doc 2023-03-11 12:18:29 +00:00
industrialio-triggered-event.c
inkern.c
Kconfig iio: light: Add gain-time-scale helpers 2023-04-10 12:26:34 +01:00
Makefile iio: light: Add gain-time-scale helpers 2023-04-10 12:26:34 +01:00
TODO