]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
iio: accel: adxl345: add coupling detection for activity/inactivity
authorLothar Rubusch <l.rubusch@gmail.com>
Sun, 27 Jul 2025 21:00:11 +0000 (21:00 +0000)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 16 Aug 2025 10:57:07 +0000 (11:57 +0100)
commit31f7679bb69abfd3a0175608f8b0ee721cea8544
treec4241b4bb0823f5c376791e4b0e42eb2a184427a
parent8a1536cc4a1c8cf83d9f49a5cafa6cec62d9ff7b
iio: accel: adxl345: add coupling detection for activity/inactivity

Enable AC/DC coupling configuration for activity and inactivity detection
by setting the AC/DC bit. Extend existing magnitude-based detection with
adaptive AC-coupled mode.

Use DC-coupled mode to compare acceleration samples directly against
configured thresholds. Use AC-coupled mode to compare samples against a
reference taken at the start of activity detection. Implement DC-coupled
events using MAG, and AC-coupled events using MAG_ADAPTIVE.

Expose configuration of thresholds and periods via separate sysfs handles.
Note that both coupling modes share the same sensor registers, so activity
or inactivity detection cannot be configured for both AC and DC
simultaneously. Apply the most recently configured mode.

Simplify event handling and support adaptive AC-coupling.

Signed-off-by: Lothar Rubusch <l.rubusch@gmail.com>
Link: https://patch.msgid.link/20250727210014.27766-5-l.rubusch@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/accel/adxl345_core.c