aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c
diff options
context:
space:
mode:
authorMartin Kepplinger <martin.kepplinger@puri.sm>2020-01-13 11:11:40 +0100
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2020-01-18 14:23:53 +0000
commit04e6fedb18f6899453e59a748fb95be56ef73836 (patch)
treee207aad86fa108601e30b8a84062b836045c32df /drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c
parentiio: adc: stm32-adc: don't print an error on probe deferral (diff)
downloadlinux-dev-04e6fedb18f6899453e59a748fb95be56ef73836.tar.xz
linux-dev-04e6fedb18f6899453e59a748fb95be56ef73836.zip
iio: imu: st_lsm6dsx: add mount matrix support
Allow to read the mount-matrix device tree property and provide the mount_matrix file for userspace to read. Signed-off-by: Martin Kepplinger <martin.kepplinger@puri.sm> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to '')
-rw-r--r--drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c
index f3ad5694437a..345fdfc89ed1 100644
--- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c
+++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c
@@ -2337,6 +2337,10 @@ int st_lsm6dsx_probe(struct device *dev, int irq, int hw_id,
return err;
}
+ err = iio_read_mount_matrix(hw->dev, "mount-matrix", &hw->orientation);
+ if (err)
+ return err;
+
for (i = 0; i < ST_LSM6DSX_ID_MAX; i++) {
if (!hw->iio_devs[i])
continue;