From 8d2511c1cb49ae7de7aaad1f640bb5e32572afae Mon Sep 17 00:00:00 2001 From: "xiong.huang" Date: Tue, 7 Jul 2020 19:25:56 +0800 Subject: boten: add lid sensor Lid sensor uses lis2dwl. BUG=b:160671918 BRANCH=none TEST=make buildall -j Signed-off-by: xiong.huang Change-Id: Ibb3f871ebdae3fbdeb3e78315ea5cacd80a7427d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2284514 Reviewed-by: Diana Z --- board/boten/board.c | 19 +++++++++---------- board/boten/board.h | 2 +- 2 files changed, 10 insertions(+), 11 deletions(-) (limited to 'board/boten') diff --git a/board/boten/board.c b/board/boten/board.c index c33270a048..29b09ef0d0 100644 --- a/board/boten/board.c +++ b/board/boten/board.c @@ -9,7 +9,7 @@ #include "charge_manager.h" #include "charge_state_v2.h" #include "charger.h" -#include "driver/accel_lis2dh.h" +#include "driver/accel_lis2dw12.h" #include "driver/accelgyro_lsm6dsm.h" #include "driver/bc12/pi3usb9201.h" #include "driver/charger/isl923x.h" @@ -233,7 +233,7 @@ static struct mutex g_lid_mutex; static struct mutex g_base_mutex; /* Sensor Data */ -static struct stprivate_data g_lis2dh_data; +static struct stprivate_data g_lis2dwl_data; static struct lsm6dsm_data lsm6dsm_data = LSM6DSM_DATA; /* Drivers */ @@ -241,22 +241,21 @@ struct motion_sensor_t motion_sensors[] = { [LID_ACCEL] = { .name = "Lid Accel", .active_mask = SENSOR_ACTIVE_S0_S3, - .chip = MOTIONSENSE_CHIP_LIS2DE, + .chip = MOTIONSENSE_CHIP_LIS2DWL, .type = MOTIONSENSE_TYPE_ACCEL, .location = MOTIONSENSE_LOC_LID, - .drv = &lis2dh_drv, + .drv = &lis2dw12_drv, .mutex = &g_lid_mutex, - .drv_data = &g_lis2dh_data, + .drv_data = &g_lis2dwl_data, .port = I2C_PORT_SENSOR, - .i2c_spi_addr_flags = LIS2DH_ADDR1_FLAGS, + .i2c_spi_addr_flags = LIS2DWL_ADDR1_FLAGS, .rot_standard_ref = NULL, .default_range = 2, /* g */ - /* We only use 2g because its resolution is only 8-bits */ - .min_frequency = LIS2DH_ODR_MIN_VAL, - .max_frequency = LIS2DH_ODR_MAX_VAL, + .min_frequency = LIS2DW12_ODR_MIN_VAL, + .max_frequency = LIS2DW12_ODR_MAX_VAL, .config = { [SENSOR_CONFIG_EC_S0] = { - .odr = 10000 | ROUND_UP_FLAG, + .odr = 12500 | ROUND_UP_FLAG, }, [SENSOR_CONFIG_EC_S3] = { .odr = 10000 | ROUND_UP_FLAG, diff --git a/board/boten/board.h b/board/boten/board.h index edc802cbbc..b2f17ba47d 100644 --- a/board/boten/board.h +++ b/board/boten/board.h @@ -32,7 +32,7 @@ #define CONFIG_LED_PWM_COUNT 1 /* Sensors */ -#define CONFIG_ACCEL_LIS2DE /* Lid accel */ +#define CONFIG_ACCEL_LIS2DWL /* Lid accel */ #define CONFIG_ACCELGYRO_LSM6DSM /* Base accel */ /* Sensors without hardware FIFO are in forced mode */ #define CONFIG_ACCEL_FORCE_MODE_MASK BIT(LID_ACCEL) -- cgit v1.2.1