diff options
author | Gwendal Grignou <gwendal@chromium.org> | 2020-12-02 20:20:40 -0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-12-08 05:41:23 +0000 |
commit | 55c8840ada12f59c46a858bc963761fb6abfe976 (patch) | |
tree | dfb006334079cbc7ad69870df1c089ae6cb6b70b /driver | |
parent | 1c5dbcb07c260ef9437348e31f8377cdf5bea7f4 (diff) | |
download | chrome-ec-55c8840ada12f59c46a858bc963761fb6abfe976.tar.gz |
driver: tcs3400: In calibration mode: always send data
When in calibration mode, send data periodically, even when
measurement is identical to the previous one.
BUG=b:172343923
TEST=On Volteer, check data is coming periodically.
BRANCH=kukui,hatch,volteer
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Change-Id: I31da6edcf5d175812697b99b7e7ef6ec85497770
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2570824
Reviewed-by: Nick Vaccaro <nvaccaro@google.com>
Diffstat (limited to 'driver')
-rw-r--r-- | driver/als_tcs3400.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/driver/als_tcs3400.c b/driver/als_tcs3400.c index 532b42953e..925c192ba1 100644 --- a/driver/als_tcs3400.c +++ b/driver/als_tcs3400.c @@ -429,8 +429,9 @@ static int tcs3400_post_events(struct motion_sensor_t *s, uint32_t last_ts) /* if clear channel data changed, send illuminance upstream */ last_v = s->raw_xyz; - if ((raw_data[CLEAR_CRGB_IDX] != TCS_SATURATION_LEVEL) && - (last_v[X] != lux)) { + if (is_calibration || + ((raw_data[CLEAR_CRGB_IDX] != TCS_SATURATION_LEVEL) && + (last_v[X] != lux))) { if (is_spoof(s)) last_v[X] = s->spoof_xyz[X]; else @@ -451,11 +452,12 @@ static int tcs3400_post_events(struct motion_sensor_t *s, uint32_t last_ts) * send it upstream */ last_v = rgb_s->raw_xyz; - if (((last_v[X] != xyz_data[X]) || (last_v[Y] != xyz_data[Y]) || - (last_v[Z] != xyz_data[Z])) && - ((raw_data[RED_CRGB_IDX] != TCS_SATURATION_LEVEL) && - (raw_data[BLUE_CRGB_IDX] != TCS_SATURATION_LEVEL) && - (raw_data[GREEN_CRGB_IDX] != TCS_SATURATION_LEVEL))) { + if (is_calibration || + (((last_v[X] != xyz_data[X]) || (last_v[Y] != xyz_data[Y]) || + (last_v[Z] != xyz_data[Z])) && + ((raw_data[RED_CRGB_IDX] != TCS_SATURATION_LEVEL) && + (raw_data[BLUE_CRGB_IDX] != TCS_SATURATION_LEVEL) && + (raw_data[GREEN_CRGB_IDX] != TCS_SATURATION_LEVEL)))) { if (is_spoof(rgb_s)) { memcpy(last_v, rgb_s->spoof_xyz, sizeof(rgb_s->spoof_xyz)); |