summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Collyer <scollyer@google.com>2017-10-10 17:07:42 -0700
committerchrome-bot <chrome-bot@chromium.org>2017-10-13 14:45:19 -0700
commitc36e313a20b59bbe89c598725e401bf4273593a8 (patch)
tree2d806c7ca79ba19c39768588740ac28064ae8ac3
parent7f472114fb3c0c2cc48ec4490ec9cc3d5b41eeef (diff)
downloadchrome-ec-c36e313a20b59bbe89c598725e401bf4273593a8.tar.gz
coral: Remove support for ALS since coral devices don't have it
No Coral configurations will contain the ambient light sensor (ALS). Therefore, no reason to have support for this in the board.c/.h files. BUG=b:38271876 BRANCH=eve TEST=make -j BOARD=coral and verify no errors. Change-Id: Ib8f6c546d5fb4d0bb8d37e84a62c4725e37be6f5 Signed-off-by: Scott Collyer <scollyer@google.com> Reviewed-on: https://chromium-review.googlesource.com/711196 Commit-Ready: Scott Collyer <scollyer@chromium.org> Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org>
-rw-r--r--board/coral/board.c52
-rw-r--r--board/coral/board.h14
2 files changed, 1 insertions, 65 deletions
diff --git a/board/coral/board.c b/board/coral/board.c
index ff4ce97698..e12b7543f6 100644
--- a/board/coral/board.c
+++ b/board/coral/board.c
@@ -225,14 +225,6 @@ struct i2c_stress_test i2c_stress_tests[] = {
},
#endif
-#ifdef CONFIG_CMD_I2C_STRESS_TEST_ALS
- {
- .port = I2C_PORT_ALS,
- .addr = OPT3001_I2C_ADDR1,
- .i2c_test = &opt3001_i2c_stress_test_dev,
- },
-#endif
-
/* NPCX_I2C_PORT3 */
#ifdef CONFIG_CMD_I2C_STRESS_TEST_BATTERY
{
@@ -837,9 +829,6 @@ const matrix_3x3_t mag_standard_ref = {
/* sensor private data */
static struct kionix_accel_data g_kx022_data;
static struct bmi160_drv_data_t g_bmi160_data;
-static struct opt3001_drv_data_t g_opt3001_data = {
- .attenuation = 5,
-};
/* FIXME(dhendrix): Copied from Amenia, probably need to tweak for Coral */
struct motion_sensor_t motion_sensors[] = {
@@ -952,50 +941,9 @@ struct motion_sensor_t motion_sensors[] = {
},
},
},
-
- [LID_ALS] = {
- .name = "Light",
- .active_mask = SENSOR_ACTIVE_S0_S3,
- .chip = MOTIONSENSE_CHIP_OPT3001,
- .type = MOTIONSENSE_TYPE_LIGHT,
- .location = MOTIONSENSE_LOC_LID,
- .drv = &opt3001_drv,
- .drv_data = &g_opt3001_data,
- .port = I2C_PORT_ALS,
- .addr = OPT3001_I2C_ADDR1,
- .rot_standard_ref = NULL,
- .default_range = OPT3001_RANGE_AUTOMATIC_FULL_SCALE,
- .config = {
- /* AP: by default shutdown all sensors */
- [SENSOR_CONFIG_AP] = {
- .odr = 0,
- .ec_rate = 0,
- },
- [SENSOR_CONFIG_EC_S0] = {
- .odr = 1000,
- .ec_rate = 0,
- },
- /* Sensor off in S3/S5 */
- [SENSOR_CONFIG_EC_S3] = {
- .odr = 0,
- .ec_rate = 0,
- },
- /* Sensor off in S3/S5 */
- [SENSOR_CONFIG_EC_S5] = {
- .odr = 0,
- .ec_rate = 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[LID_ALS],
-};
-BUILD_ASSERT(ARRAY_SIZE(motion_als_sensors) == ALS_COUNT);
-
void board_hibernate(void)
{
/*
diff --git a/board/coral/board.h b/board/coral/board.h
index 4fadb6728a..72245bfea9 100644
--- a/board/coral/board.h
+++ b/board/coral/board.h
@@ -189,7 +189,6 @@
/* I2C ports */
#define I2C_PORT_GYRO NPCX_I2C_PORT1
#define I2C_PORT_LID_ACCEL NPCX_I2C_PORT2
-#define I2C_PORT_ALS NPCX_I2C_PORT2
#define I2C_PORT_BATTERY NPCX_I2C_PORT3
#define I2C_PORT_CHARGER NPCX_I2C_PORT3
/* Accelerometer and Gyroscope are the same device. */
@@ -203,7 +202,6 @@
#define CONFIG_ACCELGYRO_BMI160_INT_EVENT TASK_EVENT_CUSTOM(4)
#define CONFIG_MAG_CALIBRATE
#define CONFIG_ACCEL_KX022
-#define CONFIG_ALS_OPT3001
#define CONFIG_LID_ANGLE
#define CONFIG_LID_ANGLE_UPDATE
#define CONFIG_LID_ANGLE_SENSOR_BASE BASE_ACCEL
@@ -265,14 +263,6 @@ enum temp_sensor_id {
};
/*
- * For backward compatibility, to report ALS via ACPI,
- * Define the number of ALS sensors: motion_sensor copy the data to the ALS
- * memmap region.
- */
-#define CONFIG_ALS
-#define ALS_COUNT 1
-
-/*
* Motion sensors:
* When reading through IO memory is set up for sensors (LPC is used),
* the first 2 entries must be accelerometers, then gyroscope.
@@ -282,7 +272,6 @@ enum sensor_id {
LID_ACCEL,
BASE_ACCEL,
BASE_GYRO,
- LID_ALS,
};
#define CONFIG_HOSTCMD_SKUID
@@ -334,8 +323,7 @@ void board_set_tcpc_power_mode(int port, int mode);
void board_tcpc_init(void);
/* Sensors without hardware FIFO are in forced mode */
-#define CONFIG_ACCEL_FORCE_MODE_MASK \
- ((1 << LID_ACCEL) | (1 << LID_ALS))
+#define CONFIG_ACCEL_FORCE_MODE_MASK (1 << LID_ACCEL)
#endif /* !__ASSEMBLER__ */