summaryrefslogtreecommitdiff
path: root/board/vell/sensors.c
diff options
context:
space:
mode:
Diffstat (limited to 'board/vell/sensors.c')
-rw-r--r--board/vell/sensors.c98
1 files changed, 0 insertions, 98 deletions
diff --git a/board/vell/sensors.c b/board/vell/sensors.c
index b68a2b6d3d..524f07ca1e 100644
--- a/board/vell/sensors.c
+++ b/board/vell/sensors.c
@@ -6,8 +6,6 @@
#include "common.h"
#include "accelgyro.h"
#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"
@@ -48,25 +46,6 @@ struct adc_t adc_channels[] = {
};
BUILD_ASSERT(ARRAY_SIZE(adc_channels) == ADC_CH_COUNT);
-K_MUTEX_DEFINE(g_lid_accel_mutex);
-K_MUTEX_DEFINE(g_base_accel_mutex);
-static struct stprivate_data g_lis2dw12_data;
-static struct lsm6dso_data lsm6dso_data;
-
-/* TODO(b/184779333): calibrate the orientation matrix on later board stage */
-static const mat33_fp_t lid_standard_ref = {
- { 0, FLOAT_TO_FP(1), 0},
- { FLOAT_TO_FP(1), 0, 0},
- { 0, 0, FLOAT_TO_FP(-1)}
-};
-
-/* TODO(b/184779743): verify orientation matrix */
-static const mat33_fp_t base_standard_ref = {
- { FLOAT_TO_FP(1), 0, 0},
- { 0, FLOAT_TO_FP(-1), 0},
- { 0, 0, FLOAT_TO_FP(-1)}
-};
-
/* TCS3400 private data */
static struct als_drv_data_t g_tcs3400_data = {
.als_cal.scale = 1,
@@ -122,79 +101,6 @@ static struct tcs3400_rgb_drv_data_t g_tcs3400_rgb_data = {
};
struct motion_sensor_t motion_sensors[] = {
- [LID_ACCEL] = {
- .name = "Lid Accel",
- .active_mask = SENSOR_ACTIVE_S0_S3,
- .chip = MOTIONSENSE_CHIP_LIS2DW12,
- .type = MOTIONSENSE_TYPE_ACCEL,
- .location = MOTIONSENSE_LOC_LID,
- .drv = &lis2dw12_drv,
- .mutex = &g_lid_accel_mutex,
- .drv_data = &g_lis2dw12_data,
- .port = I2C_PORT_SENSOR,
- .i2c_spi_addr_flags = LIS2DW12_ADDR0,
- .rot_standard_ref = &lid_standard_ref, /* identity matrix */
- .default_range = 2, /* g */
- .min_frequency = LIS2DW12_ODR_MIN_VAL,
- .max_frequency = LIS2DW12_ODR_MAX_VAL,
- .config = {
- /* EC use accel for angle detection */
- [SENSOR_CONFIG_EC_S0] = {
- .odr = 10000 | ROUND_UP_FLAG,
- },
- /* Sensor on for lid angle detection */
- [SENSOR_CONFIG_EC_S3] = {
- .odr = 10000 | ROUND_UP_FLAG,
- },
- },
- },
-
- [BASE_ACCEL] = {
- .name = "Base Accel",
- .active_mask = SENSOR_ACTIVE_S0_S3,
- .chip = MOTIONSENSE_CHIP_LSM6DSO,
- .type = MOTIONSENSE_TYPE_ACCEL,
- .location = MOTIONSENSE_LOC_BASE,
- .drv = &lsm6dso_drv,
- .mutex = &g_base_accel_mutex,
- .drv_data = LSM6DSO_ST_DATA(lsm6dso_data,
- MOTIONSENSE_TYPE_ACCEL),
- .port = I2C_PORT_SENSOR,
- .i2c_spi_addr_flags = LSM6DSO_ADDR0_FLAGS,
- .rot_standard_ref = &base_standard_ref,
- .default_range = 4, /* g */
- .min_frequency = LSM6DSO_ODR_MIN_VAL,
- .max_frequency = LSM6DSO_ODR_MAX_VAL,
- .config = {
- [SENSOR_CONFIG_EC_S0] = {
- .odr = 13000 | ROUND_UP_FLAG,
- .ec_rate = 100 * MSEC,
- },
- [SENSOR_CONFIG_EC_S3] = {
- .odr = 10000 | ROUND_UP_FLAG,
- .ec_rate = 100 * MSEC,
- },
- },
- },
-
- [BASE_GYRO] = {
- .name = "Base Gyro",
- .active_mask = SENSOR_ACTIVE_S0_S3,
- .chip = MOTIONSENSE_CHIP_LSM6DSO,
- .type = MOTIONSENSE_TYPE_GYRO,
- .location = MOTIONSENSE_LOC_BASE,
- .drv = &lsm6dso_drv,
- .mutex = &g_base_accel_mutex,
- .drv_data = LSM6DSO_ST_DATA(lsm6dso_data,
- MOTIONSENSE_TYPE_GYRO),
- .port = I2C_PORT_SENSOR,
- .i2c_spi_addr_flags = LSM6DSO_ADDR0_FLAGS,
- .default_range = 1000 | ROUND_UP_FLAG, /* dps */
- .rot_standard_ref = &base_standard_ref,
- .min_frequency = LSM6DSO_ODR_MIN_VAL,
- .max_frequency = LSM6DSO_ODR_MAX_VAL,
- },
-
[CLEAR_ALS] = {
.name = "Clear Light",
.active_mask = SENSOR_ACTIVE_S0_S3,
@@ -243,12 +149,8 @@ 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);
}
DECLARE_HOOK(HOOK_INIT, baseboard_sensors_init, HOOK_PRIO_INIT_I2C + 1);