diff options
author | Gwendal Grignou <gwendal@chromium.org> | 2017-11-13 12:33:24 -0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2017-11-17 20:18:30 -0800 |
commit | f587852570770564e8a94b2c3f7ad7d97883c49a (patch) | |
tree | a7d78650875c700c3449268ed05330a11bea5eb6 /driver/accel_kionix.c | |
parent | ab2ce0a0ef38a701a9cc6622ccb41ba55d6b4984 (diff) | |
download | chrome-ec-f587852570770564e8a94b2c3f7ad7d97883c49a.tar.gz |
motion_sense: Put set_range in common code
At the end of the sensor initialization, all _init sensor routines set
the range to the default value from board.c file.
Put all the code in a single place, move it from sensor_common.c to
motion_sense.c.
BUG=none
BRANCH=none
TEST=compile
Change-Id: If89cf27c6438e0f215c193d68a480e027110174c
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/767610
Reviewed-by: Shawn N <shawnn@chromium.org>
Diffstat (limited to 'driver/accel_kionix.c')
-rw-r--r-- | driver/accel_kionix.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/driver/accel_kionix.c b/driver/accel_kionix.c index 8697a17d66..062a3896fd 100644 --- a/driver/accel_kionix.c +++ b/driver/accel_kionix.c @@ -575,10 +575,6 @@ static int init(const struct motion_sensor_t *s) mutex_unlock(s->mutex); /* Initialize with the desired parameters. */ - ret = set_range(s, s->default_range, 1); - if (ret != EC_SUCCESS) - return ret; - if (V(s)) ret = set_resolution(s, 12, 1); else @@ -586,10 +582,7 @@ static int init(const struct motion_sensor_t *s) if (ret != EC_SUCCESS) return ret; - sensor_init_done(s, get_range(s)); - - mutex_unlock(s->mutex); - return ret; + return sensor_init_done(s); } const struct accelgyro_drv kionix_accel_drv = { |