From 2001c472277570c81826c1d0a8e5d72650160a1b Mon Sep 17 00:00:00 2001 From: Simon Zhou Date: Thu, 22 Oct 2020 22:45:29 +0800 Subject: Coachz: initial g-sensor support update lid accel matrixes modify motion_sensors data struct BUG=b:170288119 TEST=make BOARD=coachz -j flash ec and ectool motionsense return values BRANCH=master Change-Id: Ida746f6885007f7e396953eef9254879a0ee2963 Signed-off-by: Simon Zhou Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2492180 Reviewed-by: Wai-Hong Tam --- board/coachz/board.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'board/coachz') diff --git a/board/coachz/board.c b/board/coachz/board.c index 62c13f5b71..57f3cccc73 100644 --- a/board/coachz/board.c +++ b/board/coachz/board.c @@ -244,9 +244,9 @@ static struct bmi_drv_data_t g_bmi160_data; /* Matrix to rotate accelerometer into standard reference frame */ 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)} + { 0, FLOAT_TO_FP(1), 0}, + { FLOAT_TO_FP(-1), 0, 0}, + { 0, 0, FLOAT_TO_FP(1)} }; struct motion_sensor_t motion_sensors[] = { @@ -260,7 +260,7 @@ struct motion_sensor_t motion_sensors[] = { .active_mask = SENSOR_ACTIVE_S0_S3_S5, .chip = MOTIONSENSE_CHIP_BMI160, .type = MOTIONSENSE_TYPE_ACCEL, - .location = MOTIONSENSE_LOC_BASE, + .location = MOTIONSENSE_LOC_LID, .drv = &bmi160_drv, .mutex = &g_lid_mutex, .drv_data = &g_bmi160_data, @@ -281,7 +281,7 @@ struct motion_sensor_t motion_sensors[] = { .active_mask = SENSOR_ACTIVE_S0_S3_S5, .chip = MOTIONSENSE_CHIP_BMI160, .type = MOTIONSENSE_TYPE_GYRO, - .location = MOTIONSENSE_LOC_BASE, + .location = MOTIONSENSE_LOC_LID, .drv = &bmi160_drv, .mutex = &g_lid_mutex, .drv_data = &g_bmi160_data, @@ -301,6 +301,7 @@ static void board_init(void) /* Enable BC1.2 interrupts */ gpio_enable_interrupt(GPIO_USB_C0_BC12_INT_L); gpio_enable_interrupt(GPIO_USB_C1_BC12_INT_L); + gpio_enable_interrupt(GPIO_ACCEL_GYRO_INT_L); /* * The H1 SBU line for CCD are behind PPC chip. The PPC internal FETs -- cgit v1.2.1