summaryrefslogtreecommitdiff
path: root/board/drawcia/board.c
diff options
context:
space:
mode:
authorDevin Lu <Devin.Lu@quantatw.com>2020-07-27 15:50:37 +0800
committerCommit Bot <commit-bot@chromium.org>2020-07-31 04:25:37 +0000
commit7e36bc92e96b9bf7a64f1b0abb51c67cf967ad54 (patch)
treed12c3852886044f59f49dcc05085586bd7a01e18 /board/drawcia/board.c
parenta806f260be783c888d582b91f3b02a01ce03bdee (diff)
downloadchrome-ec-7e36bc92e96b9bf7a64f1b0abb51c67cf967ad54.tar.gz
drawcia: enable accelerometers
Drawcia is using lsm6dsl on base, bma 253 on lid. This patch is enabling sensors. BUG=none BRANCH=none TEST=ectool motionsense Motion sensing active Sensor 0: -3408 14368 -6240 Sensor 1: -89 -213 8341 Sensor 2: 0 0 0 Sensor 3: 0 0 0 Signed-off-by: Devin Lu <Devin.Lu@quantatw.com> Change-Id: I0234ba7ba5f211c213ff8ee0b2eab58be6bd28ba Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2325490 Reviewed-by: Diana Z <dzigterman@chromium.org>
Diffstat (limited to 'board/drawcia/board.c')
-rw-r--r--board/drawcia/board.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/board/drawcia/board.c b/board/drawcia/board.c
index 03c55da24d..797f0ddce3 100644
--- a/board/drawcia/board.c
+++ b/board/drawcia/board.c
@@ -11,7 +11,7 @@
#include "charge_manager.h"
#include "charge_state_v2.h"
#include "charger.h"
-#include "driver/accel_lis2dh.h"
+#include "driver/accel_bma2x2.h"
#include "driver/accelgyro_lsm6dsm.h"
#include "driver/bc12/pi3usb9201.h"
#include "driver/charger/sm5803.h"
@@ -443,7 +443,7 @@ static struct mutex g_lid_mutex;
static struct mutex g_base_mutex;
/* Sensor Data */
-static struct stprivate_data g_lis2dh_data;
+static struct accelgyro_saved_data_t g_bma253_data;
static struct lsm6dsm_data lsm6dsm_data = LSM6DSM_DATA;
/* Drivers */
@@ -451,19 +451,18 @@ struct motion_sensor_t motion_sensors[] = {
[LID_ACCEL] = {
.name = "Lid Accel",
.active_mask = SENSOR_ACTIVE_S0_S3,
- .chip = MOTIONSENSE_CHIP_LIS2DE,
+ .chip = MOTIONSENSE_CHIP_BMA255,
.type = MOTIONSENSE_TYPE_ACCEL,
.location = MOTIONSENSE_LOC_LID,
- .drv = &lis2dh_drv,
+ .drv = &bma2x2_accel_drv,
.mutex = &g_lid_mutex,
- .drv_data = &g_lis2dh_data,
+ .drv_data = &g_bma253_data,
.port = I2C_PORT_SENSOR,
- .i2c_spi_addr_flags = LIS2DH_ADDR1_FLAGS,
+ .i2c_spi_addr_flags = BMA2x2_I2C_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,
+ .default_range = 2,
+ .min_frequency = BMA255_ACCEL_MIN_FREQ,
+ .max_frequency = BMA255_ACCEL_MAX_FREQ,
.config = {
[SENSOR_CONFIG_EC_S0] = {
.odr = 10000 | ROUND_UP_FLAG,