diff options
author | Wai-Hong Tam <waihong@google.com> | 2020-05-13 15:32:10 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-05-16 08:33:33 +0000 |
commit | d3f7940da1510b6dc9726556ce483aff01833c38 (patch) | |
tree | afedd89c1b3f4bb9a73d7659fa6fc00c6c936ed8 | |
parent | 08f2e2f5ea3b06c6a8a952e0c643532ed4abe58e (diff) | |
download | chrome-ec-d3f7940da1510b6dc9726556ce483aff01833c38.tar.gz |
Lazor: Change the lid accel sensor driver
Change the driver from KX022 to BMA253.
BRANCH=None
BUG=b:155853349
TEST=Build the lazor image and check the lid accel sensor info.
Change-Id: I945173dfa0592adbfc4ff16ebe203a92515c5f29
Signed-off-by: Wai-Hong Tam <waihong@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2200067
Reviewed-by: Philip Chen <philipchen@chromium.org>
Reviewed-by: Alexandru M Stan <amstan@chromium.org>
-rw-r--r-- | board/lazor/board.c | 16 | ||||
-rw-r--r-- | board/lazor/board.h | 4 |
2 files changed, 10 insertions, 10 deletions
diff --git a/board/lazor/board.c b/board/lazor/board.c index 5ee56cd13e..71d07b1c62 100644 --- a/board/lazor/board.c +++ b/board/lazor/board.c @@ -10,7 +10,7 @@ #include "charge_manager.h" #include "charge_state.h" #include "extpower.h" -#include "driver/accel_kionix.h" +#include "driver/accel_bma2x2.h" #include "driver/accelgyro_bmi_common.h" #include "driver/ppc/sn5s330.h" #include "driver/tcpm/ps8xxx.h" @@ -420,7 +420,7 @@ static struct mutex g_base_mutex; static struct mutex g_lid_mutex; static struct bmi_drv_data_t g_bmi160_data; -static struct kionix_accel_data g_kx022_data; +static struct accelgyro_saved_data_t g_bma255_data; /* Matrix to rotate accelerometer into standard reference frame */ const mat33_fp_t base_standard_ref = { @@ -439,18 +439,18 @@ struct motion_sensor_t motion_sensors[] = { [LID_ACCEL] = { .name = "Lid Accel", .active_mask = SENSOR_ACTIVE_S0_S3, - .chip = MOTIONSENSE_CHIP_KX022, + .chip = MOTIONSENSE_CHIP_BMA255, .type = MOTIONSENSE_TYPE_ACCEL, .location = MOTIONSENSE_LOC_LID, - .drv = &kionix_accel_drv, + .drv = &bma2x2_accel_drv, .mutex = &g_lid_mutex, - .drv_data = &g_kx022_data, + .drv_data = &g_bma255_data, .port = I2C_PORT_SENSOR, - .i2c_spi_addr_flags = KX022_ADDR1_FLAGS, + .i2c_spi_addr_flags = BMA2x2_I2C_ADDR1_FLAGS, .rot_standard_ref = &lid_standard_ref, .default_range = 2, /* g, to support lid angle calculation. */ - .min_frequency = KX022_ACCEL_MIN_FREQ, - .max_frequency = KX022_ACCEL_MAX_FREQ, + .min_frequency = BMA255_ACCEL_MIN_FREQ, + .max_frequency = BMA255_ACCEL_MAX_FREQ, .config = { /* EC use accel for angle detection */ [SENSOR_CONFIG_EC_S0] = { diff --git a/board/lazor/board.h b/board/lazor/board.h index 34397497fd..4868448187 100644 --- a/board/lazor/board.h +++ b/board/lazor/board.h @@ -42,8 +42,8 @@ TASK_EVENT_MOTION_SENSOR_INTERRUPT(BASE_ACCEL) #define OPT3001_I2C_ADDR_FLAGS OPT3001_I2C_ADDR1_FLAGS -/* KX022 lid accel */ -#define CONFIG_ACCEL_KX022 +/* BMA253 lid accel */ +#define CONFIG_ACCEL_BMA255 #define CONFIG_ACCEL_FORCE_MODE_MASK BIT(LID_ACCEL) #define CONFIG_LID_ANGLE |