diff options
author | Michael5 Chen <michael5_chen1@pegatron.corp-partner.google.com> | 2020-11-02 10:05:10 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-11-03 04:43:24 +0000 |
commit | 9c7752544ff0128b63f9ef5067ab2d3fa8c2b418 (patch) | |
tree | 854b01354be1d8b63eaad9e14750635317b52d18 /board | |
parent | 85f55eeb4c8680086241d6b33dc10ee91efaddff (diff) | |
download | chrome-ec-9c7752544ff0128b63f9ef5067ab2d3fa8c2b418.tar.gz |
drobit: Remove ALS function dependent on schematic.
Remove ALS function dependent on schematic.
BUG=b:172129778
BRANCH=firmware-volteer-13521.B
TEST=make BOARD=drobit
Signed-off-by: Michael5 Chen <michael5_chen1@pegatron.corp-partner.google.com>
Change-Id: If24cb9fdc6583417f23c3451c668979c09cafeb3
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2513405
Reviewed-by: Keith Short <keithshort@chromium.org>
Reviewed-by: Zhuohao Lee <zhuohao@chromium.org>
Diffstat (limited to 'board')
-rw-r--r-- | board/drobit/board.c | 1 | ||||
-rw-r--r-- | board/drobit/board.h | 12 | ||||
-rw-r--r-- | board/drobit/gpio.inc | 2 | ||||
-rw-r--r-- | board/drobit/sensors.c | 100 |
4 files changed, 2 insertions, 113 deletions
diff --git a/board/drobit/board.c b/board/drobit/board.c index 1993b241fb..df704b959d 100644 --- a/board/drobit/board.c +++ b/board/drobit/board.c @@ -11,7 +11,6 @@ #include "cbi_ec_fw_config.h" #include "driver/accel_bma2x2.h" #include "driver/accelgyro_bmi260.h" -#include "driver/als_tcs3400.h" #include "driver/bc12/pi3usb9201.h" #include "driver/ppc/sn5s330.h" #include "driver/ppc/syv682x.h" diff --git a/board/drobit/board.h b/board/drobit/board.h index 15e6938562..004e2f28f8 100644 --- a/board/drobit/board.h +++ b/board/drobit/board.h @@ -40,16 +40,8 @@ #define CONFIG_ACCELGYRO_BMI260_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) - /* 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) #define CONFIG_LID_ANGLE #define CONFIG_LID_ANGLE_UPDATE @@ -180,8 +172,6 @@ enum sensor_id { LID_ACCEL = 0, BASE_ACCEL, BASE_GYRO, - CLEAR_ALS, - RGB_ALS, SENSOR_COUNT, }; diff --git a/board/drobit/gpio.inc b/board/drobit/gpio.inc index ab088e81c7..529ad117fc 100644 --- a/board/drobit/gpio.inc +++ b/board/drobit/gpio.inc @@ -26,7 +26,6 @@ GPIO_INT(PG_EC_ALL_SYS_PWRGD, PIN(F, 4), GPIO_INT_BOTH, power_signal_interrupt) /* Sensor Interrupts */ GPIO_INT(EC_IMU_INT_L, PIN(5, 6), GPIO_INT_FALLING | GPIO_SEL_1P8V, bmi260_interrupt) -GPIO_INT(EC_ALS_RGB_INT_L, PIN(D, 4), GPIO_INT_FALLING, tcs3400_interrupt) GPIO_INT(TABLET_MODE_L, PIN(9, 5), GPIO_INT_BOTH, gmr_tablet_switch_isr) /* * Lid g-sensor interrupt unused on Volteer, configure as regular input for @@ -118,6 +117,7 @@ GPIO(UNUSED_GPIO41, PIN(4, 1), GPIO_INPUT | GPIO_PULL_UP) GPIO(UNUSED_GPIOF2, PIN(F, 2), GPIO_INPUT | GPIO_PULL_UP) GPIO(UNUSED_GPIO96, PIN(9, 6), GPIO_INPUT | GPIO_PULL_UP) GPIO(UNUSED_GPIO34, PIN(3, 4), GPIO_INPUT | GPIO_PULL_UP) +GPIO(UNUSED_GPIOD4, PIN(D, 4), GPIO_INPUT | GPIO_PULL_UP) /* Only connected to test points */ GPIO(EC_KB_BL_EN, PIN(8, 6), GPIO_INPUT | GPIO_PULL_UP) GPIO(EC_ESPI_ALERT_L, PIN(5, 7), GPIO_INPUT | GPIO_PULL_UP) diff --git a/board/drobit/sensors.c b/board/drobit/sensors.c index 9e34812131..8e2db059d6 100644 --- a/board/drobit/sensors.c +++ b/board/drobit/sensors.c @@ -9,7 +9,6 @@ #include "driver/accel_bma2x2.h" #include "driver/accelgyro_bmi_common.h" #include "driver/accelgyro_bmi260.h" -#include "driver/als_tcs3400.h" #include "driver/sync.h" #include "keyboard_scan.h" #include "hooks.h" @@ -29,60 +28,6 @@ static struct accelgyro_saved_data_t g_bma253_data; /* BMI260 private data */ static struct bmi_drv_data_t g_bmi260_data; -/* 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/146166425 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(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(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(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, -}; - /* Rotation matrix for the lid accelerometer */ static const mat33_fp_t lid_standard_ref = { { FLOAT_TO_FP(1), 0, 0}, @@ -168,58 +113,13 @@ struct motion_sensor_t motion_sensors[] = { .min_frequency = BMI_GYRO_MIN_FREQ, .max_frequency = BMI_GYRO_MAX_FREQ, }, - [CLEAR_ALS] = { - .name = "Clear Light", - .active_mask = SENSOR_ACTIVE_S0_S3, - .chip = MOTIONSENSE_CHIP_TCS3400, - .type = MOTIONSENSE_TYPE_LIGHT, - .location = MOTIONSENSE_LOC_BASE, - .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_BASE, - .drv = &tcs3400_rgb_drv, - .drv_data = &g_tcs3400_rgb_data, - .rot_standard_ref = NULL, - .default_range = 0x10000, /* scale = 1x, uscale = 0 */ - }, }; 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) { /* Note - BMA253 interrupt unused by EC */ - /* Enable interrupt for the TCS3400 color light sensor */ - gpio_enable_interrupt(GPIO_EC_ALS_RGB_INT_L); /* Enable interrupt for the BMI260 accel/gyro sensor */ gpio_enable_interrupt(GPIO_EC_IMU_INT_L); } |