diff options
| author | Josef Bacik <josef@toxicpanda.com> | 2026-10-27 17:19:08 +0100 |
|---|---|---|
| committer | Jonathan Cameron <jonathan.cameron@oss.qualcomm.com> | 2026-11-02 00:40:25 +0000 |
| commit | 4c56180167ea4d419a0578545bf62110494b563d (patch) | |
| tree | 7bc459dc7330c07bd88c318ead218fe051235318 /kernel/debug/debug_core.c | |
| parent | 905b5d93b795b0e2311a8c855c1cdd97c9cc2989 (diff) | |
iio: accel: adxl380: don't stay in standby on -EINVAL
adxl380_set_act_inact_threshold() puts the sensor into standby, writes the
threshold and switches the measurement on again. A threshold above 8191 is
refused in between, and the sensor stays in standby: no samples and no
events until the next write that succeeds.
adxl380_set_range() has the same problem and a worse one. It rescales both
thresholds for the new range. If one no longer fits it returns -EINVAL
with the sensor in standby, the new range in the chip, the old one in
st->range and rescaled thresholds in the driver's state: from the next
successful write on the samples are reported with the wrong scale.
Switch the measurement on again if the threshold is refused. In
adxl380_set_range() see whether the thresholds fit before anything is
changed.
Fixes: df36de13677a ("iio: accel: add ADXL380 driver")
Cc: stable <stable@kernel.org>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
Diffstat (limited to 'kernel/debug/debug_core.c')
0 files changed, 0 insertions, 0 deletions
