diff options
author | Nick Vaccaro <nvaccaro@google.com> | 2019-05-07 12:48:56 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2019-05-09 16:05:59 -0700 |
commit | 2d38e7cd712834d763ff59704cd04af2a95b8367 (patch) | |
tree | 25b44b030408b514217b9c91e08fd1fe9696ae88 /include/accelgyro.h | |
parent | d600316362ef86d893d0f65db73e962184d8c3ce (diff) | |
download | chrome-ec-2d38e7cd712834d763ff59704cd04af2a95b8367.tar.gz |
tcs3400: rename tcs3400_drv_data_t to als_drv_data_t
- rename tsc3400_drv_data_t to als_drv_data_t
- change tcs3400 driver to use common als_drv_data_t
- change flapjack config to use common als_drv_data_t
- rename TSC3400_SCALE() macro to ALS_CHANNEL_SCALE()
- create and use new I2C_PORT_ALS definition
- fix a couple nits
BUG=b:124512628
BRANCH=master
TEST=build and flash to flapjack, verify ALS and RGB still work.
Change-Id: I9a45d255ff77794ef34026406c9b702a04e09c11
Signed-off-by: Nick Vaccaro <nvaccaro@google.com>
Reviewed-on: https://chromium-review.googlesource.com/1601052
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Diffstat (limited to 'include/accelgyro.h')
-rw-r--r-- | include/accelgyro.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/accelgyro.h b/include/accelgyro.h index a8724a43ee..8dcc6f5fbb 100644 --- a/include/accelgyro.h +++ b/include/accelgyro.h @@ -177,7 +177,17 @@ struct rgb_calibration_t { int16_t offset; }; +/* als driver data */ +struct als_drv_data_t { + int rate; /* holds current sensor rate */ + int last_value; /* holds last als clear channel value */ + struct als_calibration_t als_cal; /* calibration data */ +}; + #define SENSOR_APPLY_SCALE(_input, _scale) \ (((_input) * (_scale)) / MOTION_SENSE_DEFAULT_SCALE) +/* Individual channel scale value between 0 and 2 represented in 16 bits */ +#define ALS_CHANNEL_SCALE(_x) ((_x) << 15) + #endif /* __CROS_EC_ACCELGYRO_H */ |