diff options
author | Ted Kuo <tedkuo@ami.com.tw> | 2015-11-13 18:38:45 +0800 |
---|---|---|
committer | ChromeOS bot <3su6n15k.default@developer.gserviceaccount.com> | 2015-11-17 01:15:41 +0000 |
commit | a9fce8bd207310108a5d5806128c480f1a3124be (patch) | |
tree | d405245b2eda3c2f3310b74576790384e89f3748 | |
parent | d2ac89d58c34d7cc0a2a3fb591fcdcddbe2e9feb (diff) | |
download | chrome-ec-a9fce8bd207310108a5d5806128c480f1a3124be.tar.gz |
Edgar: remove unused devices
Remove ALS, remove motion sensors, USB PD,
Type C USB/DP MUX and volume up/down buttons.
BUG=None
BRANCH=firmware-strago-7287.B
TEST=make buildall -j
Signed-off-by: Ted Kuo <tedkuo@ami.com.tw>
Change-Id: Idbb124e15aae3726ac25a2f1f7161bff6b3a3b8b
Reviewed-on: https://chromium-review.googlesource.com/312436
Reviewed-by: Shawn N <shawnn@chromium.org>
Commit-Queue: Ted Kuo <tedkuo@ami.com.tw>
Tested-by: Ted Kuo <tedkuo@ami.com.tw>
-rw-r--r-- | board/edgar/board.c | 142 | ||||
-rw-r--r-- | board/edgar/board.h | 25 | ||||
-rw-r--r-- | board/edgar/ec.tasklist | 1 | ||||
-rw-r--r-- | board/edgar/gpio.inc | 22 |
4 files changed, 11 insertions, 179 deletions
diff --git a/board/edgar/board.c b/board/edgar/board.c index d3643f869a..bc607618cf 100644 --- a/board/edgar/board.c +++ b/board/edgar/board.c @@ -9,9 +9,6 @@ #include "button.h" #include "charger.h" #include "charge_state.h" -#include "driver/accel_kxcj9.h" -#include "driver/als_isl29035.h" -#include "driver/gyro_l3gd20h.h" #include "driver/temp_sensor/tmp432.h" #include "extpower.h" #include "gpio.h" @@ -20,8 +17,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" @@ -60,12 +55,6 @@ BUILD_ASSERT(ARRAY_SIZE(power_signal_list) == POWER_SIGNAL_COUNT); const struct i2c_port_t i2c_ports[] = { {"batt_chg", MEC1322_I2C0_0, 100, GPIO_I2C_PORT0_0_SCL, GPIO_I2C_PORT0_0_SDA}, - {"muxes", MEC1322_I2C0_1, 100, - GPIO_I2C_PORT0_1_SCL, GPIO_I2C_PORT0_1_SDA}, - {"pd_mcu", MEC1322_I2C1, 1000, - GPIO_I2C_PORT1_SCL, GPIO_I2C_PORT1_SDA}, - {"sensors", MEC1322_I2C2, 100, - GPIO_I2C_PORT2_SCL, GPIO_I2C_PORT2_SDA}, {"thermal", MEC1322_I2C3, 100, GPIO_I2C_PORT3_SCL, GPIO_I2C_PORT3_SDA} }; @@ -94,12 +83,6 @@ const struct temp_sensor_t temp_sensors[] = { }; BUILD_ASSERT(ARRAY_SIZE(temp_sensors) == TEMP_SENSOR_COUNT); -/* ALS instances. Must be in same order as enum als_id. */ -struct als_t als[] = { - {"ISL", isl29035_read_lux, 5}, -}; -BUILD_ASSERT(ARRAY_SIZE(als) == ALS_COUNT); - /* Thermal limits for each temp sensor. All temps are in degrees K. Must be in * same order as enum temp_sensor_id. To always ignore any temp, use 0. */ @@ -111,131 +94,6 @@ struct ec_thermal_config thermal_params[] = { }; BUILD_ASSERT(ARRAY_SIZE(thermal_params) == TEMP_SENSOR_COUNT); -const struct button_config buttons[] = { - {"Volume Down", KEYBOARD_BUTTON_VOLUME_DOWN, GPIO_VOLUME_DOWN, - 30 * MSEC, 0}, - {"Volume Up", KEYBOARD_BUTTON_VOLUME_UP, GPIO_VOLUME_UP, - 30 * MSEC, 0}, -}; -BUILD_ASSERT(ARRAY_SIZE(buttons) == CONFIG_BUTTON_COUNT); - -/* Four Motion sensors */ -/* kxcj9 mutex and local/private data*/ -static struct mutex g_kxcj9_mutex[2]; -struct kxcj9_data g_kxcj9_data[2]; - -#ifdef CONFIG_GYRO_L3GD20H -/* Gyro sensor */ -/* l3gd20h mutex and local/private data*/ -static struct mutex g_l3gd20h_mutex; -struct l3gd20_data g_l3gd20h_data; -#endif - -/* 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, - } - }, -#ifdef CONFIG_GYRO_L3GD20H - {.name = "Lid Gyro", - .active_mask = SENSOR_ACTIVE_S0, - .chip = MOTIONSENSE_CHIP_L3GD20H, - .type = MOTIONSENSE_TYPE_GYRO, - .location = MOTIONSENSE_LOC_LID, - .drv = &l3gd20h_drv, - .mutex = &g_l3gd20h_mutex, - .drv_data = &g_l3gd20h_data, - .i2c_addr = L3GD20_ADDR1, - .rot_standard_ref = NULL, - .default_config = { - .odr = 190000, - .range = 2000, - .ec_rate = SUSPEND_SAMPLING_INTERVAL, - } - }, -#endif -}; -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/edgar/board.h b/board/edgar/board.h index 4b61cbdcf9..3bc1d35bc1 100644 --- a/board/edgar/board.h +++ b/board/edgar/board.h @@ -47,8 +47,6 @@ #define CONFIG_PMIC -#define CONFIG_ALS -#define CONFIG_ALS_ISL29035 #define CONFIG_BATTERY_CUT_OFF #define CONFIG_BATTERY_PRESENT_GPIO GPIO_BAT_PRESENT_L #define CONFIG_BATTERY_SMART @@ -66,20 +64,9 @@ #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 - /* Wireless signals */ #define WIRELESS_GPIO_WLAN GPIO_WLAN_OFF_L -/* Number of buttons */ -#define CONFIG_BUTTON_COUNT 2 - /* Modules we want to exclude */ #undef CONFIG_EEPROM #undef CONFIG_EOPTION @@ -95,11 +82,6 @@ /* I2C ports */ #define I2C_PORT_BATTERY MEC1322_I2C0_0 #define I2C_PORT_CHARGER MEC1322_I2C0_0 -#define I2C_PORT_PD_MCU MEC1322_I2C1 -#define I2C_PORT_TCPC MEC1322_I2C1 -#define I2C_PORT_ACCEL MEC1322_I2C2 -#define I2C_PORT_GYRO MEC1322_I2C2 -#define I2C_PORT_ALS MEC1322_I2C2 #define I2C_PORT_THERMAL MEC1322_I2C3 /* ADC signal */ @@ -139,13 +121,6 @@ enum temp_sensor_id { TEMP_SENSOR_COUNT }; -/* Light sensors */ -enum als_id { - ALS_ISL29035 = 0, - - ALS_COUNT, -}; - #endif /* !__ASSEMBLER__ */ #endif /* __CROS_EC_BOARD_H */ diff --git a/board/edgar/ec.tasklist b/board/edgar/ec.tasklist index b39a927961..4ae02b5d86 100644 --- a/board/edgar/ec.tasklist +++ b/board/edgar/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) \ diff --git a/board/edgar/gpio.inc b/board/edgar/gpio.inc index 43b3060c26..9e6e8cd3a1 100644 --- a/board/edgar/gpio.inc +++ b/board/edgar/gpio.inc @@ -29,12 +29,12 @@ GPIO(NC_USBPD_BOOT0, PIN(12), GPIO_INPUT | GPIO_PULL_DOWN) /* NC */ GPIO(USB_ILIM_SEL, PIN(13), GPIO_OUT_HIGH) /* USB current control */ GPIO(I2C_PORT0_0_SCL, PIN(15), GPIO_INPUT) GPIO(I2C_PORT0_0_SDA, PIN(16), GPIO_INPUT) -GPIO(I2C_PORT0_1_SCL, PIN(134), GPIO_INPUT) -GPIO(I2C_PORT0_1_SDA, PIN(17), GPIO_INPUT) +GPIO(NC_GPIO134, PIN(134), GPIO_INPUT | GPIO_PULL_UP) +GPIO(NC_GPIO17, PIN(17), GPIO_INPUT | GPIO_PULL_UP) GPIO(I2C_PORT1_SCL, PIN(22), GPIO_INPUT) GPIO(I2C_PORT1_SDA, PIN(23), GPIO_INPUT) -GPIO(I2C_PORT2_SCL, PIN(20), GPIO_INPUT) -GPIO(I2C_PORT2_SDA, PIN(21), GPIO_INPUT) +GPIO(NC_GPIO20, PIN(20), GPIO_INPUT | GPIO_PULL_UP) +GPIO(NC_GPIO21, PIN(21), GPIO_INPUT | GPIO_PULL_UP) GPIO(I2C_PORT3_SCL, PIN(24), GPIO_INPUT) GPIO(I2C_PORT3_SDA, PIN(25), GPIO_INPUT) GPIO(PCH_SCI_L, PIN(26), GPIO_ODR_HIGH) /* SCI output */ @@ -53,7 +53,7 @@ GPIO(PCH_SMI_L, PIN(44), GPIO_ODR_HIGH) /* SMI output */ GPIO(USB_OC1_L, PIN(45), GPIO_INT_FALLING) /* DB2 BC1.2 over current signal to EC */ GPIO(DP_USB_C_HPD_Q, PIN(46), GPIO_OUT_HIGH) /* DP hot plug detect from EC to SOC */ -GPIO(OTG_SW_EN, PIN(50), GPIO_OUT_LOW) /* */ +GPIO(NC_GPIO50, PIN(50), GPIO_INPUT | GPIO_PULL_UP) /* NC */ GPIO(PCH_SUS_STAT_L, PIN(51), GPIO_INT_FALLING) /* Signal to inform EC that SOC is entering low power state */ GPIO(EC_ACDET_CTRL, PIN(52), GPIO_INPUT | GPIO_PULL_UP) GPIO(TRACKPAD_PWREN, PIN(53), GPIO_OUT_HIGH) /* Enable power for Track Pad */ @@ -76,16 +76,16 @@ GPIO(NC_115, PIN(115), GPIO_INPUT | GPIO_PULL_UP) /* NC */ GPIO(EC_VNN_VCLK, PIN(122), GPIO_INPUT | GPIO_PULL_UP) /* Interrupt from USB PD Controller to EC */ GPIO(STRAP_L, PIN(123), GPIO_OUT_LOW) GPIO(EC_VNN_ALERT_L, PIN(124), GPIO_INPUT | GPIO_PULL_UP) -GPIO(GYRO_INT2, PIN(127), GPIO_INPUT | GPIO_PULL_DOWN) /* Gyro sensor interrupt 2 to EC */ +GPIO(NC_GPIO127, PIN(127), GPIO_INPUT | GPIO_PULL_UP) /* NC */ GPIO(EC_PLUG_DETECT, PIN(132), GPIO_INT_BOTH | GPIO_PULL_UP | GPIO_PULL_DOWN) GPIO(PD_RST_L, PIN(135), GPIO_ODR_HIGH) /* USB PD MCU reset */ GPIO(THERMAL_PROBE_EN_L,PIN(140), GPIO_OUT_HIGH) GPIO(PCH_RSMRST_L, PIN(143), GPIO_OUT_LOW) /* RSMRST_N to PCH */ -GPIO(EC_KBD_ALERT, PIN(145), GPIO_OUT_LOW) /* EC_KBD_ALERT */ +GPIO(EC_KBD_ALERT, PIN(145), GPIO_OUT_LOW) /* EC_KBD_ALERT */ GPIO(PVT_CS0, PIN(146), GPIO_ODR_HIGH) /* SPI PVT Chip select */ -GPIO(ALS_INT, PIN(147), GPIO_INPUT | GPIO_PULL_UP) /* ALS sensor interrupt to EC */ +GPIO(NC_GPIO147, PIN(147), GPIO_INPUT | GPIO_PULL_UP) /* NC */ GPIO(WLAN_OFF_L, PIN(150), GPIO_ODR_HIGH) /* Wireless LAN */ GPIO(CPU_PROCHOT, PIN(151), GPIO_OUT_LOW) @@ -96,13 +96,13 @@ GPIO(PWR_BTN_SELECT, PIN(156), GPIO_ODR_HIGH) /* HIGH in clam GPIO(PCH_SUSPWRDNACK, PIN(157), GPIO_INT_FALLING) /* PMC SUSPWRDNACK signal from SOC to EC */ GPIO(PCH_PWRBTN_L, PIN(160), GPIO_OUT_HIGH) /* Power button output to PCH */ -GPIO(GYRO_INT1, PIN(161), GPIO_INPUT | GPIO_PULL_DOWN) /* Gyro sensor interrupt 1 to EC */ +GPIO(NC_GPIO161, PIN(161), GPIO_INPUT | GPIO_PULL_UP) /* NC */ GPIO(VP9_CODEC_RESET_L, PIN(163), GPIO_OUT_LOW) /* VP9_CODEC_RESET_L, OUTPUT, ACTIVE LOW */ -GPIO(STARTUP_LATCH_SET, PIN(201), GPIO_INPUT) /* Not used in BCRD2. Programmed as Input to fix EC power leakage in S3*/ +GPIO(STARTUP_LATCH_SET, PIN(201), GPIO_INPUT) /* Not used in BCRD2. Programmed as Input to fix EC power leakage in S3*/ GPIO(EC_BL_DISABLE_L, PIN(202), GPIO_OUT_HIGH) /* EDP backligh disable signal from EC */ GPIO(SMC_SHUTDOWN, PIN(203), GPIO_OUT_LOW) /* Shutdown signal from EC to power sequencing PLD */ -GPIO(USBPD_BST_OFF, PIN(204), GPIO_OUT_LOW) +GPIO(NC_GPIO204, PIN(204), GPIO_INPUT | GPIO_PULL_UP) /* NC */ GPIO(BAT_PRESENT_L, PIN(210), GPIO_INPUT) /* HW detection signal from battery to EC */ GPIO(GPIO_3_EC, PIN(211), GPIO_OUT_LOW) /* Sleep SOIX signal from SOC to EC */ |