linux-stable/drivers/iio/imu
Nuno Sa 39c024b51b iio: adis16475: improve sync scale mode handling
With this patch, we don't force users to define the IMU scaled internal
sampling rate once in the devicetree. Now it's dynamically calculated
at runtime depending on the desired output rate given by users.

Calculating the sync_scale dynamically gives us better chances of
achieving a perfect/integer value for DEC_RATE (thus giving more
flexibility). The math is:
 1. lcm of the input clock and the desired output rate.
 2. get the highest multiple of the previous result lower than the adis
    max rate.
 3. The last result becomes the IMU sample rate. Use that to calculate
    SYNC_SCALE and DEC_RATE (to get the user output rate).

Signed-off-by: Nuno Sa <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20210218114039.216091-3-nuno.sa@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2021-03-11 20:47:12 +00:00
..
bmi160 iio:imu:bmi160: Fix alignment and data leak issues 2020-12-03 19:40:28 +00:00
inv_icm42600 iio: make use of devm_iio_kfifo_buffer_setup() helper 2021-03-11 20:47:01 +00:00
inv_mpu6050 iio: imu: inv_mpu6050: Add support for MPU-6880 2021-01-09 14:25:30 +00:00
st_lsm6dsx iio: make use of devm_iio_kfifo_buffer_setup() helper 2021-03-11 20:47:01 +00:00
adis.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
adis16400.c iio: adis16400: Drop adis_burst usage 2020-09-21 20:01:45 +01:00
adis16460.c iio: adis16460: Use Managed device functions 2020-09-16 19:06:09 +01:00
adis16475.c iio: adis16475: improve sync scale mode handling 2021-03-11 20:47:12 +00:00
adis16480.c iio: adis16480: fix pps mode sampling frequency math 2021-03-11 20:47:11 +00:00
adis_buffer.c iio: adis: Move burst mode into adis_data 2020-09-21 20:01:45 +01:00
adis_trigger.c iio: adis: Drop non Managed device functions 2020-09-16 19:06:10 +01:00
fxos8700.h
fxos8700_core.c iio: remove explicit IIO device parent assignment 2020-06-14 11:49:59 +01:00
fxos8700_i2c.c
fxos8700_spi.c
Kconfig iio: imu: add Kconfig and Makefile for inv_icm42600 driver 2020-06-27 14:20:25 +01:00
kmx61.c iio:trigger: rename try_reenable() to reenable() plus return void 2020-12-03 19:40:26 +00:00
Makefile iio: imu: add Kconfig and Makefile for inv_icm42600 driver 2020-06-27 14:20:25 +01:00