iio:adxl372: Add sampling frequency support
authorStefan Popa <stefan.popa@analog.com>
Mon, 20 Aug 2018 14:54:27 +0000 (17:54 +0300)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 25 Aug 2018 08:18:35 +0000 (09:18 +0100)
commit5e605a4df6f18dc4e2e529f5f2e01f76441cece5
treeacdb1d6951af205fab1fb7a522bbbc967b3bfbcb
parent1c412a321590d4a01698b85710e29b1e575de1a7
iio:adxl372: Add sampling frequency support

This patch adds the option for the user to select the sampling frequency.
Also, the user can read the available frequencies and read the currently
set frequency via the read_raw function. The frequency can be set via the
write_raw function.

When the frequency is set, the bandwidth is also checked and ensured
that it is constrained to at most half of the sampling frequency. Also, the
activity and inactivity timers have to be updated because they depend on
the selected ODR.

Signed-off-by: Stefan Popa <stefan.popa@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/accel/adxl372.c