summaryrefslogtreecommitdiff
path: root/driver/accelgyro_lsm6dsm.c
diff options
context:
space:
mode:
authorGwendal Grignou <gwendal@chromium.org>2021-09-08 11:04:09 -0700
committerCommit Bot <commit-bot@chromium.org>2021-09-23 17:13:56 +0000
commitda30d626148052f116da26301569f2897c70e66f (patch)
tree5ff1a1e87a95d0e980e35c581fbd14580ed7f80c /driver/accelgyro_lsm6dsm.c
parentb5f74864dbcf3d7980f9d5d5bc7edb9dc2513d88 (diff)
downloadchrome-ec-da30d626148052f116da26301569f2897c70e66f.tar.gz
driver: lsm6dsm: remove load_fifo_sensor_state_t
Remove load_fifo_sensor_state_t since timestamp spreading is done in common code. Fixes: 4e6d315948 ("common: motion_sense: Spread timestamps in motion sense fifo") BUG=b:172342141 BRANCH=none TEST=buildall Change-Id: If47fdd5dc800e6b75bdea4fcef80cf6874debdaa Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3150052 Reviewed-by: Yuval Peress <peress@google.com>
Diffstat (limited to 'driver/accelgyro_lsm6dsm.c')
-rw-r--r--driver/accelgyro_lsm6dsm.c26
1 files changed, 0 insertions, 26 deletions
diff --git a/driver/accelgyro_lsm6dsm.c b/driver/accelgyro_lsm6dsm.c
index 457c664095..72bc4dea2e 100644
--- a/driver/accelgyro_lsm6dsm.c
+++ b/driver/accelgyro_lsm6dsm.c
@@ -37,26 +37,6 @@
static volatile uint32_t last_interrupt_timestamp;
/**
- * Resets the lsm6dsm load fifo sensor states to the given timestamp. This
- * should be called at the start of the fifo read sequence.
- *
- * @param s Pointer to the first sensor in the lsm6dsm (accelerometer).
- * @param ts The timestamp to use for the interrupt timestamp.
- */
-__maybe_unused static void reset_load_fifo_sensor_state(
- struct motion_sensor_t *s, uint32_t ts)
-{
- int i;
- struct lsm6dsm_accel_fifo_state *fifo_state =
- LSM6DSM_GET_DATA(s)->accel_fifo_state;
-
- for (i = 0; i < FIFO_DEV_NUM; i++) {
- fifo_state->load_fifo_sensor_state[i].int_timestamp = ts;
- fifo_state->load_fifo_sensor_state[i].sample_count = 0;
- }
-}
-
-/**
* Gets the dev_fifo enum value for a given sensor.
*
* @param s Pointer to the sensor in question.
@@ -379,9 +359,6 @@ static int load_fifo(struct motion_sensor_t *s, const struct fstatus *fsts,
int err, left, length;
uint8_t fifo[FIFO_READ_LEN];
- /* Reset the load_fifo_sensor_state so we can start a new read. */
- reset_load_fifo_sensor_state(s, interrupt_timestamp);
-
/*
* DIFF[11:0] are number of unread uint16 in FIFO
* mask DIFF and compute total byte len to read from FIFO.
@@ -629,9 +606,6 @@ int lsm6dsm_set_data_rate(const struct motion_sensor_t *s, int rate, int rnd)
private->accel_fifo_state;
fifo_state->samples_to_discard[s->type] =
LSM6DSM_DISCARD_SAMPLES;
- fifo_state->load_fifo_sensor_state[get_fifo_type(s)]
- .sample_rate = normalized_rate == 0
- ? 0 : SECOND * 1000 / normalized_rate;
ret = fifo_enable(accel);
if (ret != EC_SUCCESS)
CPRINTS("Failed to enable FIFO. Error: %d",