diff options
author | Kevin K Wong <kevin.k.wong@intel.com> | 2016-03-07 18:23:39 -0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2016-04-15 21:29:14 -0700 |
commit | afac683448775b4bafad13a60bd3190fee68b6c4 (patch) | |
tree | 5ed3783066fa9600824ea4b3f699d4806bcca5ae | |
parent | b737fe07a3f7feaa1938564583026da7e124f4df (diff) | |
download | chrome-ec-afac683448775b4bafad13a60bd3190fee68b6c4.tar.gz |
amenia: enable BMM150 compass
BUG=none
BRANCH=none
TEST=accelinfo return data from compass
Change-Id: Ib64ca8a06071744294c0bc88bbb18f1445d71780
Signed-off-by: Kevin K Wong <kevin.k.wong@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/331656
Reviewed-by: Shawn N <shawnn@chromium.org>
-rw-r--r-- | board/amenia/board.c | 37 | ||||
-rw-r--r-- | board/amenia/board.h | 5 | ||||
-rw-r--r-- | board/amenia/ec.tasklist | 4 | ||||
-rw-r--r-- | chip/npcx/config_chip.h | 1 |
4 files changed, 45 insertions, 2 deletions
diff --git a/board/amenia/board.c b/board/amenia/board.c index ab0c239124..6121167ebf 100644 --- a/board/amenia/board.c +++ b/board/amenia/board.c @@ -457,6 +457,43 @@ struct motion_sensor_t motion_sensors[] = { }, }, + [LID_MAG] = { + .name = "Lid Mag", + .active_mask = SENSOR_ACTIVE_S0, + .chip = MOTIONSENSE_CHIP_BMI160, + .type = MOTIONSENSE_TYPE_MAG, + .location = MOTIONSENSE_LOC_LID, + .drv = &bmi160_drv, + .mutex = &g_lid_mutex, + .drv_data = &g_bmi160_data, + .port = I2C_PORT_ACCEL, + .addr = BMI160_ADDR0, + .default_range = 1 << 11, /* 16LSB / uT, fixed */ + .rot_standard_ref = NULL, /* Identity Matrix. */ + .config = { + /* AP: by default shutdown all sensors */ + [SENSOR_CONFIG_AP] = { + .odr = 0, + .ec_rate = 0, + }, + /* EC does not need in S0 */ + [SENSOR_CONFIG_EC_S0] = { + .odr = 0, + .ec_rate = 0, + }, + /* Sensor off in S3/S5 */ + [SENSOR_CONFIG_EC_S3] = { + .odr = 0, + .ec_rate = 0, + }, + /* Sensor off in S3/S5 */ + [SENSOR_CONFIG_EC_S5] = { + .odr = 0, + .ec_rate = 0, + }, + }, + }, + [BASE_ACCEL] = { .name = "Base Accel", .active_mask = SENSOR_ACTIVE_S0, diff --git a/board/amenia/board.h b/board/amenia/board.h index cb436246e4..a6c6c3cc5e 100644 --- a/board/amenia/board.h +++ b/board/amenia/board.h @@ -48,6 +48,7 @@ #define CONFIG_CMD_ACCEL_INFO #define CONFIG_CMD_ALS #define CONFIG_EXTPOWER_GPIO +#define CONFIG_FPU #define CONFIG_HOSTCMD_PD #define CONFIG_HOSTCMD_PD_PANIC #define CONFIG_I2C @@ -63,6 +64,9 @@ #define CONFIG_LOW_POWER_IDLE #define CONFIG_LOW_POWER_S0 #define CONFIG_LTO +#define CONFIG_MAG_BMI160_BMM150 +#define BMM150_I2C_ADDRESS BMM150_ADDR0 +#define CONFIG_MAG_CALIBRATE #define CONFIG_POWER_BUTTON #define CONFIG_POWER_BUTTON_X86 #define CONFIG_POWER_COMMON @@ -190,6 +194,7 @@ enum als_id { enum sensor_id { LID_ACCEL = 0, LID_GYRO, + LID_MAG, BASE_ACCEL, }; diff --git a/board/amenia/ec.tasklist b/board/amenia/ec.tasklist index f4b27b5380..2ef0b5d498 100644 --- a/board/amenia/ec.tasklist +++ b/board/amenia/ec.tasklist @@ -22,12 +22,12 @@ TASK_ALWAYS(USB_CHG_P0, usb_charger_task, NULL, TASK_STACK_SIZE) \ TASK_ALWAYS(USB_CHG_P1, usb_charger_task, NULL, TASK_STACK_SIZE) \ TASK_ALWAYS(CHARGER, charger_task, NULL, LARGER_TASK_STACK_SIZE) \ - TASK_NOTEST(MOTIONSENSE, motion_sense_task, NULL, LARGER_TASK_STACK_SIZE) \ + TASK_NOTEST(MOTIONSENSE, motion_sense_task, NULL, VENTI_TASK_STACK_SIZE) \ TASK_NOTEST(CHIPSET, chipset_task, NULL, LARGER_TASK_STACK_SIZE) \ TASK_NOTEST(KEYPROTO, keyboard_protocol_task, NULL, TASK_STACK_SIZE) \ TASK_NOTEST(PDCMD, pd_command_task, NULL, TASK_STACK_SIZE) \ TASK_ALWAYS(HOSTCMD, host_command_task, NULL, TASK_STACK_SIZE) \ - TASK_ALWAYS(CONSOLE, console_task, NULL, LARGER_TASK_STACK_SIZE) \ + TASK_ALWAYS(CONSOLE, console_task, NULL, VENTI_TASK_STACK_SIZE) \ TASK_ALWAYS(POWERBTN, power_button_task, NULL, TASK_STACK_SIZE) \ TASK_NOTEST(KEYSCAN, keyboard_scan_task, NULL, TASK_STACK_SIZE) \ TASK_ALWAYS(PD_C0, pd_task, NULL, LARGER_TASK_STACK_SIZE) \ diff --git a/chip/npcx/config_chip.h b/chip/npcx/config_chip.h index 2910a7347f..f581aaf2bd 100644 --- a/chip/npcx/config_chip.h +++ b/chip/npcx/config_chip.h @@ -71,6 +71,7 @@ /* non-standard task stack sizes */ #define IDLE_TASK_STACK_SIZE 512 #define LARGER_TASK_STACK_SIZE 640 +#define VENTI_TASK_STACK_SIZE 768 #define CHARGER_TASK_STACK_SIZE 640 #define HOOKS_TASK_STACK_SIZE 640 |