diff options
author | Shawn Nematbakhsh <shawnn@chromium.org> | 2014-07-31 13:44:30 -0700 |
---|---|---|
committer | chrome-internal-fetch <chrome-internal-fetch@google.com> | 2014-08-19 06:59:28 +0000 |
commit | a048d76e0df9244e2deb104201e14afc80e0864c (patch) | |
tree | 236a1dbd34def4b73ced8957c27a450531d98af2 /driver/accelgyro_lsm6ds0.h | |
parent | be060242e310090a421f70caa5917e2808f26433 (diff) | |
download | chrome-ec-a048d76e0df9244e2deb104201e14afc80e0864c.tar.gz |
Refactor accel / gyro driver to accomodate various configurations
Previously our accel / gyro drivers assumed that we had exactly two of
each identical part in the system. Some systems may have different
configurations, so allow this to be specified at the board-level.
Note that our motion_sense algorithm currently assumes that we have one
accelerometer in the lid and one in the base -- we'll need to fix that
in another CL.
BUG=chrome-os-partner:27320
TEST=Compile-only. Tested in future Samus commit.
BRANCH=None.
Change-Id: I1fae1f6c578fedebe78b473a5d66a5794ccaae00
Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/212321
Reviewed-by: Alec Berg <alecaberg@chromium.org>
Diffstat (limited to 'driver/accelgyro_lsm6ds0.h')
-rw-r--r-- | driver/accelgyro_lsm6ds0.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/driver/accelgyro_lsm6ds0.h b/driver/accelgyro_lsm6ds0.h index 6c34570b15..5f1b64ca31 100644 --- a/driver/accelgyro_lsm6ds0.h +++ b/driver/accelgyro_lsm6ds0.h @@ -8,6 +8,8 @@ #ifndef __CROS_EC_ACCEL_LSM6DS0_H #define __CROS_EC_ACCEL_LSM6DS0_H +#include "task.h" + /* * 7-bit address is 110101Xb. Where 'X' is determined * by the voltage on the ADDR pin. @@ -42,4 +44,16 @@ /* Sensor resolution in number of bits. This sensor has fixed resolution. */ #define LSM6DS0_RESOLUTION 16 +struct lsm6ds0_data { + struct mutex accel_mutex; + /* Current range of accelerometer. */ + int sensor_range; + /* Current output data rate of accelerometer. */ + int sensor_datarate; + /* Device address. */ + int accel_addr; +}; + +extern const struct accelgyro_info accel_lsm6ds0; + #endif /* __CROS_EC_ACCEL_LSM6DS0_H */ |