summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAseda Aboagye <aaboagye@google.com>2015-09-10 17:18:43 -0700
committerchrome-bot <chrome-bot@chromium.org>2015-09-15 11:02:43 -0700
commit16a18a5e0eeaeebff5f4ab5c9363481f8d1426aa (patch)
treebb62d47ffad8c4f9f80a50c1a8bd3fd06788af4b /include
parent070a82524836efe44dc7e5908b9b0ba019996097 (diff)
downloadchrome-ec-16a18a5e0eeaeebff5f4ab5c9363481f8d1426aa.tar.gz
driver: Refactor Kionix Accelerometer drivers.
This commit adds a new basic driver for the Kionix KX022 Accelerometer. Currently, the driver is capable of reading the sensor data and manipulating its ODR, resolution, and range. This sensor also has integrated support for Directional Tap/Double-Tap(TM), however that functionality is not yet implemented in the driver. Lastly, since this accelerometer is very similar to the previous KXCJ9, this commit tries to combine the drivers. Note, the variant of the Kionix accelerometer MUST be specified in the private data structure. BUG=chrome-os-partner:43494 BRANCH=None TEST=Build GLaDOS EC with driver enabled and verify that valid accelerometer data is read, and that range, resolution, and odr can all be modified. TEST=Build samus EC image and verify that the lid still works. Additionally, verify that I can change the odr, rate, and resolution. TEST=make buildall tests Change-Id: I238ff1dc13f5342a93f8f701a0da85c52f25d214 Signed-off-by: Aseda Aboagye <aaboagye@google.com> Reviewed-on: https://chromium-review.googlesource.com/299013 Commit-Ready: Aseda Aboagye <aaboagye@chromium.org> Tested-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Gwendal Grignou <gwendal@chromium.org>
Diffstat (limited to 'include')
-rw-r--r--include/config.h1
-rw-r--r--include/ec_commands.h1
2 files changed, 2 insertions, 0 deletions
diff --git a/include/config.h b/include/config.h
index 5aed0aac2e..e6d4409a5f 100644
--- a/include/config.h
+++ b/include/config.h
@@ -46,6 +46,7 @@
/* Specify type of accelerometers attached. */
#undef CONFIG_ACCEL_KXCJ9
+#undef CONFIG_ACCEL_KX022
#undef CONFIG_ACCELGYRO_LSM6DS0
#undef CONFIG_ACCELGYRO_BMI160
diff --git a/include/ec_commands.h b/include/ec_commands.h
index 6fb784d5f9..f33b2bf16a 100644
--- a/include/ec_commands.h
+++ b/include/ec_commands.h
@@ -1730,6 +1730,7 @@ enum motionsensor_chip {
MOTIONSENSE_CHIP_SI1141 = 3,
MOTIONSENSE_CHIP_SI1142 = 4,
MOTIONSENSE_CHIP_SI1143 = 5,
+ MOTIONSENSE_CHIP_KX022 = 6,
};
struct ec_response_motion_sensor_data {