diff options
author | Gwendal Grignou <gwendal@chromium.org> | 2021-09-08 11:04:09 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-09-23 17:13:56 +0000 |
commit | da30d626148052f116da26301569f2897c70e66f (patch) | |
tree | 5ff1a1e87a95d0e980e35c581fbd14580ed7f80c | |
parent | b5f74864dbcf3d7980f9d5d5bc7edb9dc2513d88 (diff) | |
download | chrome-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>
-rw-r--r-- | driver/accelgyro_lsm6dsm.c | 26 | ||||
-rw-r--r-- | driver/accelgyro_lsm6dsm.h | 12 |
2 files changed, 0 insertions, 38 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", diff --git a/driver/accelgyro_lsm6dsm.h b/driver/accelgyro_lsm6dsm.h index add3104adf..81d44c3239 100644 --- a/driver/accelgyro_lsm6dsm.h +++ b/driver/accelgyro_lsm6dsm.h @@ -293,17 +293,6 @@ struct lsm6dsm_fifo_data { int total_samples_in_pattern; }; -/* - * Structure used to maintain the load state per sensor. This will be used to - * properly spread values in case we have more than one reading for a given - * sensor in a single fifo read pass. - */ -struct load_fifo_sensor_state_t { - uint32_t int_timestamp; - uint8_t sample_count; - int sample_rate; -}; - /** * Structure used to hold fifo state. This struct should only be used if * CONFIG_ACCEL_FIFO is defined. @@ -317,7 +306,6 @@ struct lsm6dsm_accel_fifo_state { * initial samples with incorrect values */ unsigned int samples_to_discard[FIFO_DEV_NUM]; - struct load_fifo_sensor_state_t load_fifo_sensor_state[FIFO_DEV_NUM]; }; /* |