summaryrefslogtreecommitdiff
path: root/driver/accel_lis2dh.c
diff options
context:
space:
mode:
authorGwendal Grignou <gwendal@chromium.org>2018-12-26 10:38:55 -0800
committerchrome-bot <chrome-bot@chromium.org>2019-02-28 11:01:45 -0800
commitf3931a6cd7a0c69e64caf87aa6ff3d9a4fdabf50 (patch)
tree5b9c2e8ab7a8ec75e1c0deedb6d239220ba0e429 /driver/accel_lis2dh.c
parentd77a5fc3f718c5ffa7e1149264342e5d5eb7a7b0 (diff)
downloadchrome-ec-f3931a6cd7a0c69e64caf87aa6ff3d9a4fdabf50.tar.gz
FIXUP: sensor: Adjust max_frequency based on EC performance
Remove unnecessary code, sensor maximal ODR is guaranteed to be smaller than EC support maximial ODR. BUG=b:118205424,b:118851581,chromium:615059 BRANCH=none TEST=Check the limits have not change and an error is reported when frequency is set to high in sysfs. Change-Id: Ia10bf2cc58c5609c4fded16a0bff3018916a2346 Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1390937 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Diffstat (limited to 'driver/accel_lis2dh.c')
-rw-r--r--driver/accel_lis2dh.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/driver/accel_lis2dh.c b/driver/accel_lis2dh.c
index 26a2bca8d4..762ccaf4a5 100644
--- a/driver/accel_lis2dh.c
+++ b/driver/accel_lis2dh.c
@@ -98,8 +98,7 @@ static int set_data_rate(const struct motion_sensor_t *s, int rate, int rnd)
normalized_rate = LIS2DH_REG_TO_NORMALIZE(reg_val);
}
- if (normalized_rate > MIN(LIS2DH_ODR_MAX_VAL,
- CONFIG_EC_MAX_SENSOR_FREQ_MILLIHZ) ||
+ if (normalized_rate > LIS2DH_ODR_MAX_VAL ||
normalized_rate < LIS2DH_ODR_MIN_VAL)
return EC_RES_INVALID_PARAM;