mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-08 00:21:46 +00:00
driver: bmi160 Add code for calibration
Add code for set/getting calibration data on bmi160 Add code to perform FOC (Fast Online Calibration) on bmi160. Add delay after getting out of suspend to be sure sensor is available. BRANCH=smaug TEST=Check sensors are properly calibrated on Smaug: Perform calibration: echo 1 > /sys/bus/iio/devices/iio:device1/calibrate Read calibration values: cat /sys/bus/iio/devices/iio:device1/*_calibbias Check the values are translated properly. Write calibration values and check it affects the sensor output. BUG=chromium:506101,chrome-os-partner:39900 Change-Id: Ib9aad9bbd90b4249625641d68febf94b69aa4987 Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/283165 Reviewed-by: Alec Berg <alecaberg@chromium.org>
This commit is contained in:
committed by
ChromeOS Commit Bot
parent
c0f78b4c0a
commit
e095bad64e
@@ -91,6 +91,7 @@ struct accelgyro_drv {
|
||||
int (*get_offset)(const struct motion_sensor_t *s,
|
||||
int16_t *offset,
|
||||
int16_t *temp);
|
||||
int (*perform_calib)(const struct motion_sensor_t *s);
|
||||
#ifdef CONFIG_ACCEL_INTERRUPTS
|
||||
/**
|
||||
* Setup a one-time accel interrupt. If the threshold is low enough, the
|
||||
|
||||
@@ -1907,14 +1907,13 @@ struct ec_response_motion_sense {
|
||||
struct {
|
||||
/* Current value of the parameter queried. */
|
||||
int32_t ret;
|
||||
} ec_rate, sensor_odr, sensor_range, kb_wake_angle,
|
||||
perform_calib;
|
||||
} ec_rate, sensor_odr, sensor_range, kb_wake_angle;
|
||||
|
||||
/* Used for MOTIONSENSE_CMD_SENSOR_OFFSET */
|
||||
struct {
|
||||
int16_t temp;
|
||||
int16_t offset[3];
|
||||
} sensor_offset;
|
||||
} sensor_offset, perform_calib;
|
||||
|
||||
struct ec_response_motion_sense_fifo_info fifo_info, fifo_flush;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user