summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTristan Honscheid <honscheid@google.com>2021-12-01 15:24:16 -0700
committerCommit Bot <commit-bot@chromium.org>2021-12-08 19:43:16 +0000
commitd8018d1e5fb4fb17289cd06355112fab18227858 (patch)
tree22090de774667c3ea3094841fdbaefbb2cbaf654
parent8246d63871a5bd9e6653d3735dc443cd958ee674 (diff)
downloadchrome-ec-d8018d1e5fb4fb17289cd06355112fab18227858.tar.gz
zephyr: lis2dw12: Remove redundant min data rate clamp
The set_data_rate() function checks if the requested data rate is below the minimum supported by the chip, but this check happens after the odr_to_normalize() and odr_to_reg() have clamped it. So this check is redundant and unreachable. BRANCH=None BUG=b:200046770 TEST=zmake -D configure --test test-drivers; make runhosttests Signed-off-by: Tristan Honscheid <honscheid@google.com> Change-Id: Ib3f85e251ec0a8f15891a7ceec1844695c37278a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3311181 Reviewed-by: Sam Hurst <shurst@google.com>
-rw-r--r--driver/accel_lis2dw12.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/driver/accel_lis2dw12.c b/driver/accel_lis2dw12.c
index d1abd7c03b..6e7053c924 100644
--- a/driver/accel_lis2dw12.c
+++ b/driver/accel_lis2dw12.c
@@ -426,9 +426,6 @@ static int set_data_rate(const struct motion_sensor_t *s, int rate, int rnd)
if (reg_val > LIS2DW12_ODR_1_6kHZ_VAL) {
reg_val = LIS2DW12_ODR_1_6kHZ_VAL;
normalized_rate = LIS2DW12_ODR_MAX_VAL;
- } else if (reg_val < LIS2DW12_ODR_12HZ_VAL) {
- reg_val = LIS2DW12_ODR_12HZ_VAL;
- normalized_rate = LIS2DW12_ODR_MIN_VAL;
}
/* lis2dwl supports 14 bit resolution only at high performance mode,