diff options
author | Sue Chen <sue.chen@quanta.corp-partner.google.com> | 2021-07-30 10:14:11 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-08-02 08:29:21 +0000 |
commit | 1cbae5e8a9ff1a39e753b4ba58851fff71bba156 (patch) | |
tree | 3a89cf1ce02997787dec30e4536fe2e32f5db409 /board/pico/board.h | |
parent | 5fced4898423ff6b4bceeb73fd8da51b4f83b923 (diff) | |
download | chrome-ec-1cbae5e8a9ff1a39e753b4ba58851fff71bba156.tar.gz |
Pico: Support motion sensors
Lid Accel: KX022
BASE Accelgyro: BMI160
BUG=none
BRANCH=icarus
TEST=EC can read sensors' data and lig angle is correct.
Signed-off-by: Sue Chen <sue.chen@quanta.corp-partner.google.com>
Change-Id: I07743c86a3d133dd96e499f23150fd4f20340470
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3062062
Reviewed-by: Ting Shen <phoenixshen@chromium.org>
Diffstat (limited to 'board/pico/board.h')
-rw-r--r-- | board/pico/board.h | 32 |
1 files changed, 24 insertions, 8 deletions
diff --git a/board/pico/board.h b/board/pico/board.h index e70fc7113d..ff02019f42 100644 --- a/board/pico/board.h +++ b/board/pico/board.h @@ -13,6 +13,10 @@ #define VARIANT_KUKUI_CHARGER_ISL9238 #define VARIANT_KUKUI_EC_IT81202 +#ifndef SECTION_IS_RW +#define VARIANT_KUKUI_NO_SENSORS +#endif /* SECTION_IS_RW */ + #include "baseboard.h" /* TODO: remove me once we fix IT83XX_ILM_BLOCK_SIZE out of space issue */ @@ -43,9 +47,26 @@ #define CONFIG_USB_MUX_IT5205 -#undef CONFIG_ACCEL_FIFO -#undef CONFIG_ACCEL_FIFO_SIZE -#undef CONFIG_ACCEL_FIFO_THRES +/* Motion Sensors */ +#ifndef VARIANT_KUKUI_NO_SENSORS +#define CONFIG_DYNAMIC_MOTION_SENSOR_COUNT +#define CONFIG_ACCEL_KX022 /* Lid accel */ +#define CONFIG_ACCELGYRO_BMI160 /* Base accel */ +#define CONFIG_ACCEL_INTERRUPTS +#define CONFIG_ACCELGYRO_BMI160_INT_EVENT \ + TASK_EVENT_MOTION_SENSOR_INTERRUPT(BASE_ACCEL) +#define CONFIG_ALS +#define CONFIG_CMD_ACCEL_INFO + +#define CONFIG_LID_ANGLE +#define CONFIG_LID_ANGLE_UPDATE +#define CONFIG_LID_ANGLE_SENSOR_BASE BASE_ACCEL +#define CONFIG_LID_ANGLE_SENSOR_LID LID_ACCEL + +#define CONFIG_ACCEL_FORCE_MODE_MASK BIT(LID_ACCEL) + +#define CONFIG_GMR_TABLET_MODE_CUSTOM +#endif /* !VARIANT_KUKUI_NO_SENSORS */ /* I2C ports */ #define I2C_PORT_BC12 IT83XX_I2C_CH_C @@ -63,11 +84,6 @@ #define CONFIG_LED_ONOFF_STATES -#undef CONFIG_GMR_TABLET_MODE -#undef GMR_TABLET_MODE_GPIO_L -#undef CONFIG_TABLET_MODE -#undef CONFIG_TABLET_MODE_SWITCH - #ifndef __ASSEMBLER__ enum adc_channel { |