Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a8f9b65c authored by Puneet Yatnal's avatar Puneet Yatnal Committed by Gerrit - the friendly Code Review server
Browse files

drivers: iio: imu: Fixes asm330 slow clock sync with ap time



sync asm330 sensor timer to ap time for every irq irrespecive
of sensor running slowly or fast compared to ap timestamp.

Change-Id: I1a280203ce39d8a9c32771483ac6eabd533dcdba
Signed-off-by: default avatarPuneet Yatnal <puneet@codeaurora.org>
parent eefb00cc
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -332,10 +332,10 @@ static int st_asm330lhh_read_fifo(struct st_asm330lhh_hw *hw)
				}
				memcpy(iio_buf, ptr, ST_ASM330LHH_SAMPLE_SIZE);

				hw->tsample = min_t(s64,
						    hw->ts,
						    hw->tsample);

				if ((i + (3*ST_ASM330LHH_FIFO_SAMPLE_SIZE)) >
						word_len) {
					hw->tsample = hw->ts;
				}
				iio_push_to_buffers_with_timestamp(iio_dev,
								   iio_buf,
								   hw->tsample);