diff options
author | Inno.Park <ih.yoo.park@samsung.corp-partner.google.com> | 2020-03-27 17:09:53 +0900 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-03-27 21:07:09 +0000 |
commit | e3c9d2ab77571008734279986aa9a12b1450e5ab (patch) | |
tree | 7fcb9d7d723f49d7c3f5d35e3cc000a07d4051e7 | |
parent | c721a882e9a6153530c16844714227fceb4de08c (diff) | |
download | chrome-ec-e3c9d2ab77571008734279986aa9a12b1450e5ab.tar.gz |
nightfury: enable lid accelerometer lis2ds12
BUG=b:149226871
BRANCH=none
TEST=make -j BOARD=nightfury
flash ec and run 'ectool motionsense'
Signed-off-by: Inno.Park <ih.yoo.park@samsung.corp-partner.google.com>
Change-Id: I698f8990b3da0970273da59ca95fd4d363723a1a
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2123622
Reviewed-by: Bob Moragues <moragues@chromium.org>
Reviewed-by: Scott Collyer <scollyer@chromium.org>
Tested-by: Bob Moragues <moragues@chromium.org>
Commit-Queue: Bob Moragues <moragues@chromium.org>
-rw-r--r-- | board/nightfury/board.c | 18 | ||||
-rw-r--r-- | board/nightfury/board.h | 6 |
2 files changed, 13 insertions, 11 deletions
diff --git a/board/nightfury/board.c b/board/nightfury/board.c index 4d0eca8cfb..2f67f28974 100644 --- a/board/nightfury/board.c +++ b/board/nightfury/board.c @@ -10,7 +10,7 @@ #include "button.h" #include "common.h" #include "cros_board_info.h" -#include "driver/accel_bma2x2.h" +#include "driver/accel_lis2ds.h" #include "driver/accelgyro_bmi160.h" #include "driver/als_opt3001.h" #include "driver/als_tcs3400.h" @@ -171,8 +171,8 @@ static struct opt3001_drv_data_t g_opt3001_data = { .offset = 0, }; -/* BMA255 private data */ -static struct accelgyro_saved_data_t g_bma255_data; +/* LIS2DS private data */ +static struct stprivate_data g_lis2ds_data; /* Matrix to rotate accelrator into standard reference frame */ static const mat33_fp_t base_standard_ref = { @@ -196,17 +196,17 @@ struct motion_sensor_t motion_sensors[] = { [LID_ACCEL] = { .name = "Lid Accel", .active_mask = SENSOR_ACTIVE_S0_S3, - .chip = MOTIONSENSE_CHIP_BMA255, + .chip = MOTIONSENSE_CHIP_LIS2DS, .type = MOTIONSENSE_TYPE_ACCEL, .location = MOTIONSENSE_LOC_LID, - .drv = &bma2x2_accel_drv, + .drv = &lis2ds_drv, .mutex = &g_lid_mutex, - .drv_data = &g_bma255_data, + .drv_data = &g_lis2ds_data, .port = I2C_PORT_ACCEL, - .i2c_spi_addr_flags = BMA2x2_I2C_ADDR1_FLAGS, + .i2c_spi_addr_flags = LIS2DS_ADDR1_FLAGS, .rot_standard_ref = &lid_standard_ref, - .min_frequency = BMA255_ACCEL_MIN_FREQ, - .max_frequency = BMA255_ACCEL_MAX_FREQ, + .min_frequency = LIS2DS_ODR_MIN_VAL, + .max_frequency = LIS2DS_ODR_MAX_VAL, .default_range = 2, /* g, to support lid angle calculation. */ .config = { /* EC use accel for angle detection */ diff --git a/board/nightfury/board.h b/board/nightfury/board.h index 146d933b62..e0e0cd8d56 100644 --- a/board/nightfury/board.h +++ b/board/nightfury/board.h @@ -36,8 +36,10 @@ #define CONFIG_ACCELGYRO_BMI160_INT_EVENT \ TASK_EVENT_MOTION_SENSOR_INTERRUPT(BASE_ACCEL) #define CONFIG_ACCELGYRO_BMI160_INT2_OUTPUT -/* BMA253 Lid accel */ -#define CONFIG_ACCEL_BMA255 +/* LIS2DS Lid accel */ +#define CONFIG_ACCEL_LIS2DS +#define CONFIG_ACCEL_LIS2DS_INT_EVENT \ + TASK_EVENT_MOTION_SENSOR_INTERRUPT(LID_ACCEL) #define CONFIG_LID_ANGLE #define CONFIG_LID_ANGLE_SENSOR_BASE BASE_ACCEL #define CONFIG_LID_ANGLE_SENSOR_LID LID_ACCEL |