summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce <Bruce.Wan@quantatw.com>2015-11-04 10:00:05 +0800
committerChromeOS bot <3su6n15k.default@developer.gserviceaccount.com>2015-11-04 03:56:34 +0000
commit7dcab905e0648ff77995d4a2e65864094cc4fe24 (patch)
tree82bcb46a42e815f17eb4c5d37461d6c7d83c1b03
parent88150065ae54839258a063e5af721a9fbf35c510 (diff)
downloadchrome-ec-7dcab905e0648ff77995d4a2e65864094cc4fe24.tar.gz
Reks: Remove motion sensor setting.
Reks don't support motion sensor. BUG=chrome-os-partner:47208 BRANCH=firmware-strago-7287.B TEST=Build/flash the EC and boot Change-Id: I27a76e18b3ce95ab360dbecf345e8e5242c69eae Signed-off-by: Bruce.Wan <Bruce.Wan@quantatw.com> Reviewed-on: https://chromium-review.googlesource.com/310671 Reviewed-by: Shawn N <shawnn@chromium.org>
-rw-r--r--board/reks/board.c95
-rw-r--r--board/reks/board.h9
-rw-r--r--board/reks/ec.tasklist1
3 files changed, 0 insertions, 105 deletions
diff --git a/board/reks/board.c b/board/reks/board.c
index f24ecaebfb..edbc3edd97 100644
--- a/board/reks/board.c
+++ b/board/reks/board.c
@@ -8,7 +8,6 @@
#include "button.h"
#include "charger.h"
#include "charge_state.h"
-#include "driver/accel_kxcj9.h"
#include "driver/temp_sensor/tmp432.h"
#include "extpower.h"
#include "gpio.h"
@@ -17,8 +16,6 @@
#include "i2c.h"
#include "lid_switch.h"
#include "math_util.h"
-#include "motion_lid.h"
-#include "motion_sense.h"
#include "power.h"
#include "power_button.h"
#include "pwm.h"
@@ -98,98 +95,6 @@ struct ec_thermal_config thermal_params[] = {
};
BUILD_ASSERT(ARRAY_SIZE(thermal_params) == TEMP_SENSOR_COUNT);
-/* Four Motion sensors */
-/* kxcj9 mutex and local/private data*/
-static struct mutex g_kxcj9_mutex[2];
-struct kxcj9_data g_kxcj9_data[2];
-
-/* Matrix to rotate accelrator into standard reference frame */
-const matrix_3x3_t base_standard_ref = {
- { 0, FLOAT_TO_FP(1), 0},
- {FLOAT_TO_FP(-1), 0, 0},
- { 0, 0, FLOAT_TO_FP(1)}
-};
-
-const matrix_3x3_t lid_standard_ref = {
- {FLOAT_TO_FP(1), 0, 0},
- { 0, FLOAT_TO_FP(1), 0},
- { 0, 0, FLOAT_TO_FP(1)}
-};
-
-struct motion_sensor_t motion_sensors[] = {
- {.name = "Base Accel",
- .active_mask = SENSOR_ACTIVE_S0,
- .chip = MOTIONSENSE_CHIP_KXCJ9,
- .type = MOTIONSENSE_TYPE_ACCEL,
- .location = MOTIONSENSE_LOC_BASE,
- .drv = &kxcj9_drv,
- .mutex = &g_kxcj9_mutex[0],
- .drv_data = &g_kxcj9_data[0],
- .i2c_addr = KXCJ9_ADDR1,
- .rot_standard_ref = &base_standard_ref,
- .default_config = {
- .odr = 100000,
- .range = 2,
- .ec_rate = SUSPEND_SAMPLING_INTERVAL,
- }
- },
- {.name = "Lid Accel",
- .active_mask = SENSOR_ACTIVE_S0,
- .chip = MOTIONSENSE_CHIP_KXCJ9,
- .type = MOTIONSENSE_TYPE_ACCEL,
- .location = MOTIONSENSE_LOC_LID,
- .drv = &kxcj9_drv,
- .mutex = &g_kxcj9_mutex[1],
- .drv_data = &g_kxcj9_data[1],
- .i2c_addr = KXCJ9_ADDR0,
- .rot_standard_ref = &lid_standard_ref,
- .default_config = {
- .odr = 100000,
- .range = 2,
- .ec_rate = SUSPEND_SAMPLING_INTERVAL,
- }
- },
-};
-const unsigned int motion_sensor_count = ARRAY_SIZE(motion_sensors);
-
-/* Define the accelerometer orientation matrices. */
-const struct accel_orientation acc_orient = {
- /* Hinge aligns with x axis. */
- .rot_hinge_90 = {
- { FLOAT_TO_FP(1), 0, 0},
- { 0, 0, FLOAT_TO_FP(1)},
- { 0, FLOAT_TO_FP(-1), 0}
- },
- .rot_hinge_180 = {
- { FLOAT_TO_FP(1), 0, 0},
- { 0, FLOAT_TO_FP(-1), 0},
- { 0, 0, FLOAT_TO_FP(-1)}
- },
- .hinge_axis = {1, 0, 0},
-};
-
-/*
- * In S3, power rail for sensors (+V3p3S) goes down asynchronous to EC. We need
- * to execute this routine first and set the sensor state to "Not Initialized".
- * This prevents the motion_sense_suspend hook routine from communicating with
- * the sensor.
- */
-static void motion_sensors_pre_init(void)
-{
- struct motion_sensor_t *sensor;
- int i;
-
- for (i = 0; i < motion_sensor_count; ++i) {
- sensor = &motion_sensors[i];
- sensor->state = SENSOR_NOT_INITIALIZED;
-
- sensor->runtime_config.odr = sensor->default_config.odr;
- sensor->runtime_config.range = sensor->default_config.range;
- }
-}
-DECLARE_HOOK(HOOK_CHIPSET_SUSPEND, motion_sensors_pre_init,
- MOTION_SENSE_HOOK_PRIO - 1);
-
/* init ADC ports to avoid floating state due to thermistors */
static void adc_pre_init(void)
{
diff --git a/board/reks/board.h b/board/reks/board.h
index 9de8039db3..72d96e1bcb 100644
--- a/board/reks/board.h
+++ b/board/reks/board.h
@@ -63,14 +63,6 @@
#define CONFIG_I2C
-/* Accelerometer */
-#define CONFIG_ACCEL_KXCJ9
-#define CONFIG_CMD_ACCELS
-#define CONFIG_CMD_ACCEL_INFO
-#define CONFIG_LID_ANGLE
-#define CONFIG_LID_ANGLE_SENSOR_BASE 0
-#define CONFIG_LID_ANGLE_SENSOR_LID 1
-
/* Modules we want to exclude */
#undef CONFIG_EEPROM
#undef CONFIG_EOPTION
@@ -86,7 +78,6 @@
/* I2C ports */
#define I2C_PORT_BATTERY MEC1322_I2C0_0
#define I2C_PORT_CHARGER MEC1322_I2C0_0
-#define I2C_PORT_ACCEL MEC1322_I2C2
#define I2C_PORT_THERMAL MEC1322_I2C3
/* ADC signal */
diff --git a/board/reks/ec.tasklist b/board/reks/ec.tasklist
index 036a6b8764..40f7091744 100644
--- a/board/reks/ec.tasklist
+++ b/board/reks/ec.tasklist
@@ -19,7 +19,6 @@
#define CONFIG_TASK_LIST \
TASK_ALWAYS(HOOKS, hook_task, NULL, LARGER_TASK_STACK_SIZE) \
TASK_ALWAYS(CHARGER, charger_task, NULL, LARGER_TASK_STACK_SIZE) \
- TASK_NOTEST(MOTIONSENSE, motion_sense_task, NULL, LARGER_TASK_STACK_SIZE) \
TASK_NOTEST(CHIPSET, chipset_task, NULL, LARGER_TASK_STACK_SIZE) \
TASK_NOTEST(KEYPROTO, keyboard_protocol_task, NULL, TASK_STACK_SIZE) \
TASK_ALWAYS(HOSTCMD, host_command_task, NULL, LARGER_TASK_STACK_SIZE) \