Commit 6985bd5e authored by Lorenzo Bianconi's avatar Lorenzo Bianconi Committed by Jonathan Cameron

iio: imu: st_lsm6dsx: fix FIFO_CTRL2 overwrite during watermark configuration

Fixes: 290a6ce1 (iio: imu: add support to lsm6dsx driver)
Signed-off-by: default avatarLorenzo Bianconi <lorenzo.bianconi@st.com>
Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
parent e83bb3e6
...@@ -193,8 +193,8 @@ int st_lsm6dsx_update_watermark(struct st_lsm6dsx_sensor *sensor, u16 watermark) ...@@ -193,8 +193,8 @@ int st_lsm6dsx_update_watermark(struct st_lsm6dsx_sensor *sensor, u16 watermark)
if (err < 0) if (err < 0)
goto out; goto out;
fifo_watermark = ((data & ~ST_LSM6DSX_FIFO_TH_MASK) << 8) | fifo_watermark = ((data << 8) & ~ST_LSM6DSX_FIFO_TH_MASK) |
(fifo_watermark & ST_LSM6DSX_FIFO_TH_MASK); (fifo_watermark & ST_LSM6DSX_FIFO_TH_MASK);
wdata = cpu_to_le16(fifo_watermark); wdata = cpu_to_le16(fifo_watermark);
err = hw->tf->write(hw->dev, ST_LSM6DSX_REG_FIFO_THL_ADDR, err = hw->tf->write(hw->dev, ST_LSM6DSX_REG_FIFO_THL_ADDR,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment