diff options
author | Gwendal Grignou <gwendal@chromium.org> | 2020-05-17 16:43:02 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-11-12 03:23:26 +0000 |
commit | d28c10498cdbf007b97b5c0a9a951373574d4eea (patch) | |
tree | 3d66ca06837aae98ff747fff85b439976e563045 /driver/mag_bmm150.h | |
parent | 9676f9291f60efdfb31373aeb77385ebb6e9f6e5 (diff) | |
download | chrome-ec-d28c10498cdbf007b97b5c0a9a951373574d4eea.tar.gz |
motion_sense: Make change in range permanent
When AP changes range, unlike offset or ODR, it was not surviving init()
call. If the sensor is powered off in S3, at resume the range would be
back to the default.
To make it consistent with other attributes, remember range change until
EC powers down.
- remove get_range
- add current_range to store the range currently used.
This is modifiable by the AP
- when the AP shutdown, revert current_range to default_range
- Remove const attribute for sensor structure when init and set_range is
called.
BUG=chromium:1083791
BRANCH=none
TEST=One eve branch, check range is preserved even after 'shutdown -h 0'
Change-Id: Ia7126ac0cc9c3fef60b4464d95d6dd15e64b0fc4
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2215751
Reviewed-by: Yuval Peress <peress@chromium.org>
Diffstat (limited to 'driver/mag_bmm150.h')
-rw-r--r-- | driver/mag_bmm150.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/driver/mag_bmm150.h b/driver/mag_bmm150.h index cf80950b8d..9f517f8097 100644 --- a/driver/mag_bmm150.h +++ b/driver/mag_bmm150.h @@ -134,7 +134,7 @@ struct bmm150_private_data { #endif /* Specific initialization of BMM150 when behing BMI160 */ -int bmm150_init(const struct motion_sensor_t *s); +int bmm150_init(struct motion_sensor_t *s); /* Command to normalize and apply temperature compensation */ void bmm150_normalize(const struct motion_sensor_t *s, |