diff options
author | Aaron Zhang <zhangjianbo@huaqin.corp-partner.google.com> | 2020-09-19 15:18:37 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-09-24 04:59:37 +0000 |
commit | 19007dd5773dbba6b599c3a01b92b493510af58c (patch) | |
tree | 88388bd03a86d3a7ea76fe8db845ba3525fd4db8 /board/fennel | |
parent | f4fbd68a2664e8d830fb00222023b841f6debac0 (diff) | |
download | chrome-ec-19007dd5773dbba6b599c3a01b92b493510af58c.tar.gz |
Fennel: Change g-sensor setting for fennel
Modify lid accel to LIS2DWL & config g-sensor matrixes.
BUG=b:163109924
BRANCH=master
TEST=make -j BOARD=fennel
Change-Id: I2e3143daf41ea848f0c32778f3d066aa7b0878d6
Signed-off-by: Aaron Zhang <zhangjianbo@huaqin.corp-partner.google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2419733
Reviewed-by: Zhuohao Lee <zhuohao@chromium.org>
Commit-Queue: Zhuohao Lee <zhuohao@chromium.org>
Diffstat (limited to 'board/fennel')
-rw-r--r-- | board/fennel/board.c | 32 | ||||
-rw-r--r-- | board/fennel/board.h | 2 |
2 files changed, 22 insertions, 12 deletions
diff --git a/board/fennel/board.c b/board/fennel/board.c index 7a68dfbb1a..43d3e30bad 100644 --- a/board/fennel/board.c +++ b/board/fennel/board.c @@ -14,7 +14,7 @@ #include "chipset.h" #include "common.h" #include "console.h" -#include "driver/accel_kionix.h" +#include "driver/accel_lis2dw12.h" #include "driver/accelgyro_bmi_common.h" #include "driver/battery/max17055.h" #include "driver/bc12/pi3usb9201.h" @@ -334,35 +334,45 @@ static struct mutex g_base_mutex; /* Rotation matrixes */ static const mat33_fp_t base_standard_ref = { - {FLOAT_TO_FP(1), 0, 0}, {0, FLOAT_TO_FP(1), 0}, + {FLOAT_TO_FP(-1), 0, 0}, {0, 0, FLOAT_TO_FP(1)} }; +static const mat33_fp_t lid_standard_ref = { + {FLOAT_TO_FP(-1), 0, 0}, + {0, FLOAT_TO_FP(1), 0}, + {0, 0, FLOAT_TO_FP(-1) } +}; + /* sensor private data */ -static struct kionix_accel_data g_kx022_data; +/* Lid accel private data */ +static struct stprivate_data g_lis2dwl_data; +/* Base accel private data */ static struct bmi_drv_data_t g_bmi160_data; struct motion_sensor_t motion_sensors[] = { [LID_ACCEL] = { .name = "Lid Accel", .active_mask = SENSOR_ACTIVE_S0_S3, - .chip = MOTIONSENSE_CHIP_KX022, + .chip = MOTIONSENSE_CHIP_LIS2DWL, .type = MOTIONSENSE_TYPE_ACCEL, .location = MOTIONSENSE_LOC_LID, - .drv = &kionix_accel_drv, + .drv = &lis2dw12_drv, .mutex = &g_lid_mutex, - .drv_data = &g_kx022_data, + .drv_data = &g_lis2dwl_data, .port = I2C_PORT_SENSORS, - .i2c_spi_addr_flags = KX022_ADDR1_FLAGS, - .rot_standard_ref = NULL, /* Identity matrix. */ - .default_range = 2, /* g, to meet CDD 7.3.1/C-1-4 reqs */ + .i2c_spi_addr_flags = LIS2DWL_ADDR1_FLAGS, + .rot_standard_ref = &lid_standard_ref, + .default_range = 2, /* g */ + .min_frequency = LIS2DW12_ODR_MIN_VAL, + .max_frequency = LIS2DW12_ODR_MAX_VAL, .config = { /* EC use accel for angle detection */ [SENSOR_CONFIG_EC_S0] = { - .odr = 10000 | ROUND_UP_FLAG, + .odr = 12500 | ROUND_UP_FLAG, }, - /* Sensor on for lid angle detection */ + /* Sensor on for lid angle detection */ [SENSOR_CONFIG_EC_S3] = { .odr = 10000 | ROUND_UP_FLAG, }, diff --git a/board/fennel/board.h b/board/fennel/board.h index 27d6c52bdb..b3e988f0dd 100644 --- a/board/fennel/board.h +++ b/board/fennel/board.h @@ -49,7 +49,7 @@ /* Motion Sensors */ #ifndef VARIANT_KUKUI_NO_SENSORS -#define CONFIG_ACCEL_KX022 /* Lid accel */ +#define CONFIG_ACCEL_LIS2DWL /* Lid accel */ #define CONFIG_ACCELGYRO_BMI160 /* Base accel */ #define CONFIG_ACCEL_INTERRUPTS #define CONFIG_ACCELGYRO_BMI160_INT_EVENT \ |