From 8091b5449fa9284be4b80f5e5f30b0f839bb9cc6 Mon Sep 17 00:00:00 2001 From: Sue Chen Date: Mon, 11 Apr 2022 10:18:36 +0800 Subject: Scout: delay 1s to initialize ambient light sensor Let sensor only active in S0 and set CONFIG_MOTION_SENSE_RESUME_DELAY_US 1000 msec for ALS sensor is powered by PP3300_S. BUG=b:228772482 BRANCH=puff TEST=ALS sensor function pass Signed-off-by: Sue Chen Change-Id: I52120834d60d3786789f893edea65522f7b5c20b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3581360 Reviewed-by: Joe Tessler Commit-Queue: Joe Tessler (cherry picked from commit 42a726797086af9f2f51cb8ae58afbb7f9b40114) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3581817 --- board/scout/board.c | 4 ++-- board/scout/board.h | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/board/scout/board.c b/board/scout/board.c index a11cb4cb05..6758828ae0 100644 --- a/board/scout/board.c +++ b/board/scout/board.c @@ -100,7 +100,7 @@ static struct tcs3400_rgb_drv_data_t g_tcs3400_rgb_data = { struct motion_sensor_t motion_sensors[] = { [CLEAR_ALS] = { .name = "Clear Light", - .active_mask = SENSOR_ACTIVE_S0_S3, + .active_mask = SENSOR_ACTIVE_S0, .chip = MOTIONSENSE_CHIP_TCS3400, .type = MOTIONSENSE_TYPE_LIGHT, .location = MOTIONSENSE_LOC_BASE, @@ -121,7 +121,7 @@ struct motion_sensor_t motion_sensors[] = { }, [RGB_ALS] = { .name = "RGB Light", - .active_mask = SENSOR_ACTIVE_S0_S3, + .active_mask = SENSOR_ACTIVE_S0, .chip = MOTIONSENSE_CHIP_TCS3400, .type = MOTIONSENSE_TYPE_LIGHT_RGB, .location = MOTIONSENSE_LOC_BASE, diff --git a/board/scout/board.h b/board/scout/board.h index 154e271579..802a4a3b1f 100644 --- a/board/scout/board.h +++ b/board/scout/board.h @@ -53,6 +53,8 @@ EC_CMD_CONSOLE_SNAPSHOT, EC_CMD_CONSOLE_READ, EC_CMD_PD_GET_LOG_ENTRY /* Sensor */ +#undef CONFIG_MOTION_SENSE_RESUME_DELAY_US +#define CONFIG_MOTION_SENSE_RESUME_DELAY_US (1000 * MSEC) #define CONFIG_ACCEL_INTERRUPTS #define CONFIG_CMD_ACCEL_INFO /* Enable sensor fifo, must also define the _SIZE and _THRES */ -- cgit v1.2.1