summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--board/nightfury/board.c105
-rw-r--r--board/nightfury/board.h14
-rw-r--r--board/nightfury/gpio.inc2
3 files changed, 2 insertions, 119 deletions
diff --git a/board/nightfury/board.c b/board/nightfury/board.c
index b8a4c26698..816623a1b2 100644
--- a/board/nightfury/board.c
+++ b/board/nightfury/board.c
@@ -171,56 +171,6 @@ static struct accelgyro_saved_data_t g_bma255_data;
/* BH1730 private data */
struct bh1730_drv_data_t g_bh1730_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(0.74), /* CT */
- },
-};
-
-static struct tcs3400_rgb_drv_data_t g_tcs3400_rgb_data = {
- .calibration.rgb_cal[X] = {
- .offset = 3, /* 3.0350726 */
- .coeff[TCS_RED_COEFF_IDX] = FLOAT_TO_FP(-0.34710205),
- .coeff[TCS_GREEN_COEFF_IDX] = FLOAT_TO_FP(1.72064361),
- .coeff[TCS_BLUE_COEFF_IDX] = FLOAT_TO_FP(-0.95427326),
- .coeff[TCS_CLEAR_COEFF_IDX] = FLOAT_TO_FP(0.20677441),
- .scale = {
- .k_channel_scale = ALS_CHANNEL_SCALE(1.0), /* kr */
- .cover_scale = ALS_CHANNEL_SCALE(0.5)
- }
- },
- .calibration.rgb_cal[Y] = {
- .offset = 7, /* 6.50411397 */
- .coeff[TCS_RED_COEFF_IDX] = FLOAT_TO_FP(-0.40729596),
- .coeff[TCS_GREEN_COEFF_IDX] = FLOAT_TO_FP(1.82527267),
- .coeff[TCS_BLUE_COEFF_IDX] = FLOAT_TO_FP(-1.01523751),
- .coeff[TCS_CLEAR_COEFF_IDX] = FLOAT_TO_FP(0.20903764),
- .scale = {
- .k_channel_scale = ALS_CHANNEL_SCALE(1.0), /* kg */
- .cover_scale = ALS_CHANNEL_SCALE(1.0)
- },
- },
- .calibration.rgb_cal[Z] = {
- .offset = -4, /* -4.13932233 */
- .coeff[TCS_RED_COEFF_IDX] = FLOAT_TO_FP(-2.35802533),
- .coeff[TCS_GREEN_COEFF_IDX] = FLOAT_TO_FP(-0.19742447),
- .coeff[TCS_BLUE_COEFF_IDX] = FLOAT_TO_FP(0.13837045),
- .coeff[TCS_CLEAR_COEFF_IDX] = FLOAT_TO_FP(1.07436207),
- .scale = {
- .k_channel_scale = ALS_CHANNEL_SCALE(1.0), /* kb */
- .cover_scale = ALS_CHANNEL_SCALE(1.44)
- }
- },
- .calibration.irt = FLOAT_TO_FP(0.35),
- .saturation.again = TCS_DEFAULT_AGAIN,
- .saturation.atime = TCS_DEFAULT_ATIME,
-};
-
/* Matrix to rotate accelrator into standard reference frame */
static const mat33_fp_t base_standard_ref = {
{ 0, FLOAT_TO_FP(1), 0},
@@ -331,63 +281,12 @@ struct motion_sensor_t motion_sensors[] = {
},
},
},
-
- [VSYNC] = {
- .name = "Camera VSYNC",
- .active_mask = SENSOR_ACTIVE_S0,
- .chip = MOTIONSENSE_CHIP_GPIO,
- .type = MOTIONSENSE_TYPE_SYNC,
- .location = MOTIONSENSE_LOC_CAMERA,
- .drv = &sync_drv,
- .default_range = 0,
- .min_frequency = 0,
- .max_frequency = 1,
- },
-
- [CLEAR_ALS] = {
- .name = "Clear Light",
- .active_mask = SENSOR_ACTIVE_S0_S3,
- .chip = MOTIONSENSE_CHIP_TCS3400,
- .type = MOTIONSENSE_TYPE_LIGHT,
- .location = MOTIONSENSE_LOC_LID,
- .drv = &tcs3400_drv,
- .drv_data = &g_tcs3400_data,
- .port = I2C_PORT_ALS,
- .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_LID,
- .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[BASE_ALS],
- &motion_sensors[CLEAR_ALS],
};
BUILD_ASSERT(ARRAY_SIZE(motion_als_sensors) == ALS_COUNT);
@@ -460,10 +359,6 @@ static void board_init(void)
{
/* Enable gpio interrupt for base accelgyro sensor */
gpio_enable_interrupt(GPIO_BASE_SIXAXIS_INT_L);
- /* Enable gpio interrupt for camera vsync */
- gpio_enable_interrupt(GPIO_WFCAM_VSYNC);
- /* Enable interrupt for the TCS3400 color light sensor */
- gpio_enable_interrupt(GPIO_TCS3400_INT_ODL);
}
DECLARE_HOOK(HOOK_INIT, board_init, HOOK_PRIO_DEFAULT);
diff --git a/board/nightfury/board.h b/board/nightfury/board.h
index b274c856cf..9a0a8e6d6e 100644
--- a/board/nightfury/board.h
+++ b/board/nightfury/board.h
@@ -36,10 +36,6 @@
#define CONFIG_ACCELGYRO_BMI160_INT_EVENT \
TASK_EVENT_MOTION_SENSOR_INTERRUPT(BASE_ACCEL)
#define CONFIG_ACCELGYRO_BMI160_INT2_OUTPUT
-/* Camera VSYNC */
-#define CONFIG_SYNC
-#define CONFIG_SYNC_INT_EVENT \
- TASK_EVENT_MOTION_SENSOR_INTERRUPT(VSYNC)
/* BMA253 Lid accel */
#define CONFIG_ACCEL_BMA255
#define CONFIG_LID_ANGLE
@@ -48,16 +44,13 @@
#define CONFIG_LID_ANGLE_UPDATE
/* BH1730 and TCS3400 ALS */
#define CONFIG_ALS
-#define ALS_COUNT 2
+#define ALS_COUNT 1
#define I2C_PORT_ALS I2C_PORT_SENSOR
#define CONFIG_ALS_BH1730
-#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(BASE_ALS) | BIT(CLEAR_ALS))
+ (BIT(LID_ACCEL) | BIT(BASE_ALS))
/* Parameter to calculate LUX on Nightfury */
#define CONFIG_ALS_BH1730_LUXTH_PARAMS
@@ -165,9 +158,6 @@ enum sensor_id {
BASE_ACCEL,
BASE_GYRO,
BASE_ALS,
- VSYNC,
- CLEAR_ALS,
- RGB_ALS,
SENSOR_COUNT,
};
diff --git a/board/nightfury/gpio.inc b/board/nightfury/gpio.inc
index 97f4540f88..4c4b4e9c76 100644
--- a/board/nightfury/gpio.inc
+++ b/board/nightfury/gpio.inc
@@ -28,8 +28,6 @@ GPIO_INT(PP5000_A_PG_OD, PIN(D, 7), GPIO_INT_BOTH, power_signal_interrupt)
/* Sensor Interrupts */
GPIO_INT(BASE_SIXAXIS_INT_L, PIN(5, 6), GPIO_INT_FALLING, bmi160_interrupt)
-GPIO_INT(WFCAM_VSYNC, PIN(B, 7), GPIO_INT_RISING , sync_interrupt)
-GPIO_INT(TCS3400_INT_ODL, PIN(7, 2), GPIO_INT_FALLING, tcs3400_interrupt)
/* USB-C interrupts */
GPIO_INT(USB_C0_PPC_INT_ODL, PIN(E, 0), GPIO_INT_FALLING, ppc_interrupt)