]> 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)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Mon, 27 Oct 2025 13:29:12 +0000 (13:29 +0000)
commit8abbf45fcda028c2c05ba38eb14ede9fa9e7341b
treedad74c2d8d6609f60456b56f5786f0d4552e2857
parentcb372b4f46d4285e5d2c07ba734374151b8e34e7
iio: st_lsm6dsx: Fixed calibrated timestamp calculation

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>
drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h
drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c