mirror of
https://github.com/torvalds/linux.git
synced 2026-09-23 22:14:03 +02:00
iio: imu: st_lsm6dsx: Update enable mask when using sensor fusion
The enable_mask struct member keeps track of which sensors are enabled in
the IMU. When enabling and disabling the sensor fusion functionality, the
driver does not properly update this struct member. This prevents a correct
calculation of the number of samples that should be read from the hardware
FIFO; as a result, reads from the FIFO can be unnecessarily split into
multiple transactions, some of which can read past the FIFO length.
Fixes: cd4e1141bf ("iio: imu: st_lsm6dsx: Add support for rotation sensor")
Signed-off-by: Francesco Lavra <flavra@baylibre.com>
Acked-by: Lorenzo Bianconi <lorenzo@kernel.org>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
This commit is contained in:
parent
8756acd309
commit
4a56c646e1
|
|
@ -112,6 +112,11 @@ int st_lsm6dsx_fusion_set_enable(struct st_lsm6dsx_sensor *sensor, bool enable)
|
|||
return err;
|
||||
}
|
||||
|
||||
if (enable)
|
||||
hw->enable_mask |= BIT(ST_LSM6DSX_ID_FUSION);
|
||||
else
|
||||
hw->enable_mask &= ~BIT(ST_LSM6DSX_ID_FUSION);
|
||||
|
||||
return st_lsm6dsx_fusion_page_disable(hw);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user