diff options
author | Gwendal Grignou <gwendal@chromium.org> | 2015-08-31 11:12:32 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2015-09-01 01:28:00 -0700 |
commit | 1dfaf92f3a440456b4fc796b2f7a134fd4b83a19 (patch) | |
tree | 43149e7127cb11deabeacc4f566020739586e496 /driver/als_si114x.h | |
parent | c2cf0fb198feea043a331e5d2156979d23f1aa46 (diff) | |
download | chrome-ec-1dfaf92f3a440456b4fc796b2f7a134fd4b83a19.tar.gz |
driver: si114x: Convert unit to distance
Instead of returning the amount of light returned,
convert the data into distance (cm). It can be adjust via range.
BRANCH=smaug
BUG=chrome-os-partner:42526
TEST=check the data is usable by HAL.
Change-Id: I97510246ce054af4e61325d7e295ca09cc536457
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/296472
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Diffstat (limited to 'driver/als_si114x.h')
-rw-r--r-- | driver/als_si114x.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/driver/als_si114x.h b/driver/als_si114x.h index de3375b457..4d524aea66 100644 --- a/driver/als_si114x.h +++ b/driver/als_si114x.h @@ -75,6 +75,7 @@ #define SI114X_REG_PS2_DATA1 0x29 #define SI114X_REG_PS3_DATA0 0x2a #define SI114X_REG_PS3_DATA1 0x2b +#define SI114X_PS_INVERSION(_data) ((1 << 16) / (_data)) #define SI114X_REG_AUX_DATA0 0x2c #define SI114X_REG_AUX_DATA1 0x2d #define SI114X_REG_PARAM_RD 0x2e |