summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGwendal Grignou <gwendal@chromium.org>2017-01-03 14:33:04 -0800
committerchrome-bot <chrome-bot@chromium.org>2017-01-05 13:43:39 -0800
commit0c7b7f222c59726edca80b1a01f8f217cc5cfcf7 (patch)
treedbb85d2e40d7d9404d56a830f04245ebce046bff
parent266b36d54b00de514030b76364cf94977bf02cd0 (diff)
downloadchrome-ec-0c7b7f222c59726edca80b1a01f8f217cc5cfcf7.tar.gz
driver: als: Add error code UNCHANGED
This error code is used to indicates the data has not changed. Motion sense task will therefore not add any entry in the sensor FIFO. BUG=chrome-os-partner:59423 TEST=make -j buildall BRANCH=reef Change-Id: I58b9be5675d8949bd682d8c89dadea1dfff9bf2e Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/424856 Reviewed-by: Randall Spangler <rspangler@chromium.org>
-rw-r--r--driver/als_si114x.c2
-rw-r--r--include/common.h9
2 files changed, 7 insertions, 4 deletions
diff --git a/driver/als_si114x.c b/driver/als_si114x.c
index c4e31ffd76..eda02b5c15 100644
--- a/driver/als_si114x.c
+++ b/driver/als_si114x.c
@@ -141,7 +141,7 @@ static int si114x_read_results(struct motion_sensor_t *s, int nb)
break;
}
if (i == nb)
- return EC_SUCCESS;
+ return EC_ERROR_UNCHANGED;
#ifdef CONFIG_ACCEL_FIFO
vector.flags = 0;
diff --git a/include/common.h b/include/common.h
index 84b9366064..0bdea8965d 100644
--- a/include/common.h
+++ b/include/common.h
@@ -124,9 +124,12 @@ enum ec_error_list {
EC_ERROR_PARAM7 = 17,
EC_ERROR_PARAM8 = 18,
EC_ERROR_PARAM9 = 19,
- EC_ERROR_PARAM_COUNT = 20, /* Wrong number of params */
-
- EC_ERROR_NOT_HANDLED = 21, /* Interrupt event not handled */
+ /* Wrong number of params */
+ EC_ERROR_PARAM_COUNT = 20,
+ /* Interrupt event not handled */
+ EC_ERROR_NOT_HANDLED = 21,
+ /* Data has not changed */
+ EC_ERROR_UNCHANGED = 22,
/* Module-internal error codes may use this range. */
EC_ERROR_INTERNAL_FIRST = 0x10000,