summaryrefslogtreecommitdiff
path: root/driver/als_si114x.h
diff options
context:
space:
mode:
authorGwendal Grignou <gwendal@chromium.org>2015-11-24 12:21:44 -0800
committerchrome-bot <chrome-bot@chromium.org>2015-12-01 03:46:34 -0800
commit53fa1d1f0938f7021727880207631f2c9b82e115 (patch)
treea11d2cdabb180945178f920564bdfa30274b5d53 /driver/als_si114x.h
parente803e811147212bfea43ad62bfe9d9ed293c8f8b (diff)
downloadchrome-ec-53fa1d1f0938f7021727880207631f2c9b82e115.tar.gz
driver: si114x: Unlock the device if stuck
It is possible for the ALS state machine and the chip to not agree: The EC thinks the device is busy making a measurement, while the chip is waiting for the IRQ status register to be written. It is not clear how it happened, an IRQ must have been lost. Reinitiliazed the chip is stuck for 10s. BRANCH=smaug BUG=chrome-os-partner:45627 TEST=With an extra patch that force the IRQ handler to not do anything every 100th, check the device recovers. Use andro sensor to monitor light/proximity outputs. Change-Id: I80d50bf92af127f85f82dc5c0ae318d4cfe06812 Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/313668
Diffstat (limited to 'driver/als_si114x.h')
-rw-r--r--driver/als_si114x.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/driver/als_si114x.h b/driver/als_si114x.h
index 93e9b9a9bc..5fbc3c665f 100644
--- a/driver/als_si114x.h
+++ b/driver/als_si114x.h
@@ -208,6 +208,9 @@
#define SI114X_COVERED_THRESHOLD 5
#define SI114X_OVERFLOW 0xffff
+/* Time to wait before re-initializing the device if access is denied */
+#define SI114X_DENIED_THRESHOLD (10 * SECOND)
+
extern const struct accelgyro_drv si114x_drv;
enum si114x_state {