diff options
author | xiong.huang <xiong.huang@bitland.corp-partner.google.com> | 2020-07-07 19:25:56 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-07-08 09:15:08 +0000 |
commit | 8d2511c1cb49ae7de7aaad1f640bb5e32572afae (patch) | |
tree | 2dd2fd1764cf67ea4f016ef0c6f9320f81397c18 /board/boten | |
parent | dc1468ea7ed4b2ae8590433405f0b3cf2957ae90 (diff) | |
download | chrome-ec-8d2511c1cb49ae7de7aaad1f640bb5e32572afae.tar.gz |
boten: add lid sensor
Lid sensor uses lis2dwl.
BUG=b:160671918
BRANCH=none
TEST=make buildall -j
Signed-off-by: xiong.huang <xiong.huang@bitland.corp-partner.google.com>
Change-Id: Ibb3f871ebdae3fbdeb3e78315ea5cacd80a7427d
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2284514
Reviewed-by: Diana Z <dzigterman@chromium.org>
Diffstat (limited to 'board/boten')
-rw-r--r-- | board/boten/board.c | 19 | ||||
-rw-r--r-- | board/boten/board.h | 2 |
2 files changed, 10 insertions, 11 deletions
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) |