]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
iio: accel: adxl372: Add support for FIFO peak mode
authorStefan Popa <stefan.popa@analog.com>
Mon, 10 Aug 2020 09:32:56 +0000 (12:32 +0300)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Thu, 3 Sep 2020 18:40:56 +0000 (19:40 +0100)
commitb0fc6783d4ae58f796fb183c40dbc7fa3199d51d
treec7949aab0ebc7f11042ead77afbdc54a63a65ef8
parent50677d2882e1844763f455b314fa2225d9da5e56
iio: accel: adxl372: Add support for FIFO peak mode

By default, if all three channels (x, y, z) are enabled, sample sets of
concurrent 3-axis data is stored in the FIFO. This patch adds the option
to configure the FIFO to store peak acceleration (x, y and z) of every
over-threshold event. When pushing to iio buffer we push only enabled
axis data.

Currently the driver configures adxl372 to work in loop mode.
The inactivity and activity timings  decide how fast the chip
will loop through the awake and waiting states and the
thresholds on x,y,z axis decide when activity or inactivity
will be detected.

This patch adds standard events sysfs entries for the inactivity
and activity timings: thresh_falling_period/thresh_rising_period
and for the in_accel_x_thresh_falling/rising_value.

Signed-off-by: Stefan Popa <stefan.popa@analog.com>
Signed-off-by: Alexandru Tachici <alexandru.tachici@analog.com>
Link: https://lore.kernel.org/r/20200810093257.65929-2-alexandru.tachici@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/accel/adxl372.c