diff options
author | Yu-An Chen <yu-an.chen@quanta.corp-partner.google.com> | 2022-01-12 16:24:59 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2022-01-13 03:38:50 +0000 |
commit | 9c9f781d656227cce0005f6406aa79a09f72b9d8 (patch) | |
tree | 2741131a638161bb9727f1c8910dfbd4960310a6 /board/volmar | |
parent | 0ec28b02d7556d530e820dabeec2d011344e81e3 (diff) | |
download | chrome-ec-9c9f781d656227cce0005f6406aa79a09f72b9d8.tar.gz |
volmar: Remove als tcs4300
Remove als tcs4300 function
BUG=b:211891086
BRANCH=none
TEST=make BOARD=volmar
Signed-off-by: Yu-An Chen <yu-an.chen@quanta.corp-partner.google.com>
Change-Id: I9c3a9426acc1d68cf6ab1d6187783b1e0f4643a1
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3382606
Reviewed-by: caveh jalali <caveh@chromium.org>
Diffstat (limited to 'board/volmar')
-rw-r--r-- | board/volmar/board.c | 1 | ||||
-rw-r--r-- | board/volmar/board.h | 12 | ||||
-rw-r--r-- | board/volmar/build.mk | 2 | ||||
-rw-r--r-- | board/volmar/gpio.inc | 3 | ||||
-rw-r--r-- | board/volmar/sensors.c | 101 |
5 files changed, 3 insertions, 116 deletions
diff --git a/board/volmar/board.c b/board/volmar/board.c index 4ca53ffa48..8c3142b39c 100644 --- a/board/volmar/board.c +++ b/board/volmar/board.c @@ -15,7 +15,6 @@ #include "hooks.h" #include "driver/accel_lis2dw12.h" #include "driver/accelgyro_lsm6dso.h" -#include "driver/als_tcs3400.h" #include "fw_config.h" #include "hooks.h" #include "lid_switch.h" diff --git a/board/volmar/board.h b/board/volmar/board.h index a535838edc..b38189440e 100644 --- a/board/volmar/board.h +++ b/board/volmar/board.h @@ -43,13 +43,6 @@ #define CONFIG_ACCEL_LSM6DSO_INT_EVENT \ TASK_EVENT_MOTION_SENSOR_INTERRUPT(BASE_ACCEL) -/* TCS3400 ALS */ -#define CONFIG_ALS -#define ALS_COUNT 1 -#define CONFIG_ALS_TCS3400 -#define CONFIG_ALS_TCS3400_INT_EVENT \ - TASK_EVENT_MOTION_SENSOR_INTERRUPT(CLEAR_ALS) - /* Enable sensor fifo, must also define the _SIZE and _THRES */ #define CONFIG_ACCEL_FIFO /* FIFO size is in power of 2. */ @@ -58,8 +51,7 @@ #define CONFIG_ACCEL_FIFO_THRES (CONFIG_ACCEL_FIFO_SIZE / 3) /* Sensors without hardware FIFO are in forced mode */ -#define CONFIG_ACCEL_FORCE_MODE_MASK \ - (BIT(LID_ACCEL) | BIT(CLEAR_ALS)) +#define CONFIG_ACCEL_FORCE_MODE_MASK BIT(LID_ACCEL) /* Lid accel */ #define CONFIG_LID_ANGLE @@ -242,8 +234,6 @@ enum sensor_id { LID_ACCEL = 0, BASE_ACCEL, BASE_GYRO, - CLEAR_ALS, - RGB_ALS, SENSOR_COUNT }; diff --git a/board/volmar/build.mk b/board/volmar/build.mk index cd6a38a852..82ffaa9fe2 100644 --- a/board/volmar/build.mk +++ b/board/volmar/build.mk @@ -3,7 +3,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # -# Brya board specific files build +# Volmar board specific files build # CHIP:=npcx diff --git a/board/volmar/gpio.inc b/board/volmar/gpio.inc index 5ab5bd01f2..c929c10c83 100644 --- a/board/volmar/gpio.inc +++ b/board/volmar/gpio.inc @@ -10,7 +10,6 @@ /* INTERRUPT GPIOs: */ GPIO_INT(ACOK_OD, PIN(0, 0), GPIO_INT_BOTH | GPIO_HIB_WAKE_HIGH, extpower_interrupt) GPIO_INT(EC_ACCEL_INT_R_L, PIN(8, 1), GPIO_SEL_1P8V | GPIO_INT_FALLING, lis2dw12_interrupt) -GPIO_INT(EC_ALS_RGB_INT_R_L, PIN(D, 4), GPIO_INT_FALLING, tcs3400_interrupt) GPIO_INT(EC_IMU_INT_R_L, PIN(5, 6), GPIO_SEL_1P8V | GPIO_INT_FALLING, lsm6dso_interrupt) GPIO_INT(EC_PROCHOT_IN_L, PIN(F, 0), GPIO_INT_BOTH, throttle_ap_prochot_input_interrupt) GPIO_INT(EC_VOLDN_BTN_ODL, PIN(9, 3), GPIO_INT_BOTH | GPIO_PULL_UP, button_interrupt) @@ -126,7 +125,7 @@ UNUSED(PIN(3, 2)) /* GPO32/TRIS_L */ UNUSED(PIN(3, 5)) /* GPO35/CR_SOUT4/TEST_L */ UNUSED(PIN(6, 6)) /* GPIO66 */ UNUSED(PIN(5, 7)) /* GPIO57/SER_IRQ/ESPI_ALERT_L */ - +UNUSED(PIN(D, 4)) /* GPIOD4 */ /* Pre-configured PSL balls: J8 K6 */ /* diff --git a/board/volmar/sensors.c b/board/volmar/sensors.c index b355c98123..3b76ebe786 100644 --- a/board/volmar/sensors.c +++ b/board/volmar/sensors.c @@ -8,7 +8,6 @@ #include "adc.h" #include "driver/accel_lis2dw12.h" #include "driver/accelgyro_lsm6dso.h" -#include "driver/als_tcs3400_public.h" #include "hooks.h" #include "motion_sense.h" #include "temp_sensor.h" @@ -67,60 +66,6 @@ static const mat33_fp_t base_standard_ref = { { 0, 0, FLOAT_TO_FP(-1)} }; -/* TCS3400 private data */ -static struct als_drv_data_t g_tcs3400_data = { - .als_cal.scale = 1, - .als_cal.uscale = 0, - .als_cal.offset = 0, - .als_cal.channel_scale = { - .k_channel_scale = ALS_CHANNEL_SCALE(1.0), /* kc from VPD */ - .cover_scale = ALS_CHANNEL_SCALE(1.0), /* CT */ - }, -}; - -/* - * TODO: b/184702900 need to calibrate ALS/RGB sensor. At default settings, - * shining phone flashlight on sensor pegs all readings at 0xFFFF. - */ -static struct tcs3400_rgb_drv_data_t g_tcs3400_rgb_data = { - .calibration.rgb_cal[X] = { - .offset = 0, - .coeff[TCS_RED_COEFF_IDX] = FLOAT_TO_FP(0), - .coeff[TCS_GREEN_COEFF_IDX] = FLOAT_TO_FP(0), - .coeff[TCS_BLUE_COEFF_IDX] = FLOAT_TO_FP(0), - .coeff[TCS_CLEAR_COEFF_IDX] = FLOAT_TO_FP(1.0), - .scale = { - .k_channel_scale = ALS_CHANNEL_SCALE(1.0), /* kr */ - .cover_scale = ALS_CHANNEL_SCALE(1.0) - } - }, - .calibration.rgb_cal[Y] = { - .offset = 0, - .coeff[TCS_RED_COEFF_IDX] = FLOAT_TO_FP(0), - .coeff[TCS_GREEN_COEFF_IDX] = FLOAT_TO_FP(0), - .coeff[TCS_BLUE_COEFF_IDX] = FLOAT_TO_FP(0), - .coeff[TCS_CLEAR_COEFF_IDX] = FLOAT_TO_FP(1.0), - .scale = { - .k_channel_scale = ALS_CHANNEL_SCALE(1.0), /* kg */ - .cover_scale = ALS_CHANNEL_SCALE(1.0) - }, - }, - .calibration.rgb_cal[Z] = { - .offset = 0, - .coeff[TCS_RED_COEFF_IDX] = FLOAT_TO_FP(0), - .coeff[TCS_GREEN_COEFF_IDX] = FLOAT_TO_FP(0), - .coeff[TCS_BLUE_COEFF_IDX] = FLOAT_TO_FP(0), - .coeff[TCS_CLEAR_COEFF_IDX] = FLOAT_TO_FP(1.0), - .scale = { - .k_channel_scale = ALS_CHANNEL_SCALE(1.0), /* kb */ - .cover_scale = ALS_CHANNEL_SCALE(1.0) - } - }, - .calibration.irt = INT_TO_FP(1), - .saturation.again = TCS_DEFAULT_AGAIN, - .saturation.atime = TCS_DEFAULT_ATIME, -}; - struct motion_sensor_t motion_sensors[] = { [LID_ACCEL] = { .name = "Lid Accel", @@ -194,59 +139,13 @@ struct motion_sensor_t motion_sensors[] = { .min_frequency = LSM6DSO_ODR_MIN_VAL, .max_frequency = LSM6DSO_ODR_MAX_VAL, }, - - [CLEAR_ALS] = { - .name = "Clear Light", - .active_mask = SENSOR_ACTIVE_S0_S3, - .chip = MOTIONSENSE_CHIP_TCS3400, - .type = MOTIONSENSE_TYPE_LIGHT, - .location = MOTIONSENSE_LOC_CAMERA, - .drv = &tcs3400_drv, - .drv_data = &g_tcs3400_data, - .port = I2C_PORT_SENSOR, - .i2c_spi_addr_flags = TCS3400_I2C_ADDR_FLAGS, - .rot_standard_ref = NULL, - .default_range = 0x10000, /* scale = 1x, uscale = 0 */ - .min_frequency = TCS3400_LIGHT_MIN_FREQ, - .max_frequency = TCS3400_LIGHT_MAX_FREQ, - .config = { - /* Run ALS sensor in S0 */ - [SENSOR_CONFIG_EC_S0] = { - .odr = 1000, - }, - }, - }, - - [RGB_ALS] = { - /* - * RGB channels read by CLEAR_ALS and so the i2c port and - * address do not need to be defined for RGB_ALS. - */ - .name = "RGB Light", - .active_mask = SENSOR_ACTIVE_S0_S3, - .chip = MOTIONSENSE_CHIP_TCS3400, - .type = MOTIONSENSE_TYPE_LIGHT_RGB, - .location = MOTIONSENSE_LOC_CAMERA, - .drv = &tcs3400_rgb_drv, - .drv_data = &g_tcs3400_rgb_data, - .rot_standard_ref = NULL, - .default_range = 0x10000, /* scale = 1x, uscale = 0 */ - }, }; const unsigned int motion_sensor_count = ARRAY_SIZE(motion_sensors); -/* ALS instances when LPC mapping is needed. Each entry directs to a sensor. */ -const struct motion_sensor_t *motion_als_sensors[] = { - &motion_sensors[CLEAR_ALS], -}; -BUILD_ASSERT(ARRAY_SIZE(motion_als_sensors) == ALS_COUNT); - static void baseboard_sensors_init(void) { /* Enable gpio interrupt for lid accel sensor */ gpio_enable_interrupt(GPIO_EC_ACCEL_INT_R_L); - /* Enable interrupt for the TCS3400 color light sensor */ - gpio_enable_interrupt(GPIO_EC_ALS_RGB_INT_R_L); /* Enable gpio interrupt for base accelgyro sensor */ gpio_enable_interrupt(GPIO_EC_IMU_INT_R_L); } |