diff options
author | Gwendal Grignou <gwendal@chromium.org> | 2015-11-17 10:54:47 -0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2015-11-18 13:33:26 -0800 |
commit | cfae64d5ded2b51fd6892dbd1084abda7f503c20 (patch) | |
tree | e0d7d25a0cb04c5fd2d9583ab98ff9c156e4fb51 /driver/als_si114x.h | |
parent | bea9bfc15db4b58e22d0b39a3590bb16b3c51d4f (diff) | |
download | chrome-ec-cfae64d5ded2b51fd6892dbd1084abda7f503c20.tar.gz |
driver: si114x: Do not read light when proximty is low
If the proximity sensor indicates there is an object very close
(<= 5cm), ignore light sensor readings.
Otherwise, when someone put their finger on the sensor, the light
sensor would most likely report dark condition and the screen brightness
will be lowered unexpectedly.
BUG=b:25573958
BRANCH=smaug
TEST=check light report does not change when proximity sensor reports
< 5cm, using androsensor apps.
Change-Id: I16db40766a71a7925e28372ebb54ae43f60a4989
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/312982
Diffstat (limited to 'driver/als_si114x.h')
-rw-r--r-- | driver/als_si114x.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/driver/als_si114x.h b/driver/als_si114x.h index 2e068eb50c..c044a8bddf 100644 --- a/driver/als_si114x.h +++ b/driver/als_si114x.h @@ -204,6 +204,9 @@ #define SI114X_SEQ_REV_A10 0x08 #define SI114X_SEQ_REV_A11 0x09 +/* Proximity sensor finds an object within 5 cm, disable light sensor */ +#define SI114X_COVERED_THRESHOLD 5 + extern const struct accelgyro_drv si114x_drv; enum si114x_state { @@ -232,6 +235,7 @@ struct si114x_typed_data_t { struct si114x_drv_data_t { enum si114x_state state; + uint8_t covered; struct si114x_typed_data_t type_data[2]; }; |