]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
iio: st_lsm6dsx: Fixed calibrated timestamp calculation
authorMario Tesi <martepisa@gmail.com>
Wed, 15 Oct 2025 16:16:19 +0000 (18:16 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 6 Dec 2025 21:24:56 +0000 (06:24 +0900)
commit051e941285b2df964ecbd40aaa1248df3cdec29d
tree1221f2b805118190552e78f3021f1ea673b9d3fd
parent4c6c2cf74053282e42e285c9b440cd9785d9b56a
iio: st_lsm6dsx: Fixed calibrated timestamp calculation

[ Upstream commit 8abbf45fcda028c2c05ba38eb14ede9fa9e7341b ]

The calibrated timestamp is calculated from the nominal value using the
formula:
  ts_gain[ns] ≈ ts_sensitivity - (ts_trim_coeff * val) / 1000.

The values of ts_sensitivity and ts_trim_coeff are not the same for all
devices, so it is necessary to differentiate them based on the part name.
For the correct values please consult the relevant AN.

Fixes: cb3b6b8e1bc0 ("iio: imu: st_lsm6dsx: add odr calibration feature")
Signed-off-by: Mario Tesi <mario.tesi@st.com>
Acked-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h
drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c