diff options
author | Tomasz Michalec <tm@semihalf.com> | 2021-07-14 00:44:44 +0200 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-07-14 21:24:55 +0000 |
commit | 0773847d80c8821da2b277c6e007b6948eb350aa (patch) | |
tree | 995136cd3f73c4de6cc94f68af70cfda97fa7de7 /include/driver | |
parent | 1369994e674688cb1d4f045b48b1b4b1836ae01c (diff) | |
download | chrome-ec-0773847d80c8821da2b277c6e007b6948eb350aa.tar.gz |
driver: bmi160: bmi260: Minor driver fixes
Fix three issues with BMI160 and BMI260 drivers:
- get/set acclerometer/gyroscope offset will return error on failed read
of offset register
- BMI160 calibration function returns error when setting range fail
- Invalid temperature is properly recognized by driver
BUG=none
BRANCH=none
TEST=run zmake drivers test
Signed-off-by: Tomasz Michalec <tm@semihalf.com>
Change-Id: I545c0a931227ef7efc000ec97c1f6297a48e6d1a
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3027039
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
Reviewed-by: Keith Short <keithshort@chromium.org>
Diffstat (limited to 'include/driver')
-rw-r--r-- | include/driver/accelgyro_bmi_common.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/include/driver/accelgyro_bmi_common.h b/include/driver/accelgyro_bmi_common.h index 398f04dc42..c403999c5a 100644 --- a/include/driver/accelgyro_bmi_common.h +++ b/include/driver/accelgyro_bmi_common.h @@ -301,16 +301,16 @@ int bmi_get_normalized_rate(const struct motion_sensor_t *s, int rate, int rnd, int *normalized_rate_ptr, uint8_t *reg_val_ptr); /* Get the accelerometer offset */ -void bmi_accel_get_offset(const struct motion_sensor_t *accel, intv3_t v); +int bmi_accel_get_offset(const struct motion_sensor_t *accel, intv3_t v); /* Get the gyroscope offset */ -void bmi_gyro_get_offset(const struct motion_sensor_t *gyro, intv3_t v); +int bmi_gyro_get_offset(const struct motion_sensor_t *gyro, intv3_t v); /* Set the accelerometer offset */ -void bmi_set_accel_offset(const struct motion_sensor_t *accel, intv3_t v); +int bmi_set_accel_offset(const struct motion_sensor_t *accel, intv3_t v); /* Set the gyroscope offset */ -void bmi_set_gyro_offset(const struct motion_sensor_t *gyro, intv3_t v, +int bmi_set_gyro_offset(const struct motion_sensor_t *gyro, intv3_t v, int *val98_ptr); #endif /* __CROS_EC_ACCELGYRO_BMI_COMMON_H */ |