From 5b74f1393a78742b8883f1fc9d00602ad75869e7 Mon Sep 17 00:00:00 2001 From: Ting Shen Date: Tue, 9 Jul 2019 15:48:02 +0800 Subject: kukui: code cleanup Remove unused clode blocks and includes. BUG=None TEST=make BRANCH=master Change-Id: I66994039e4c215ce652cdef227207a6bbd94b316 Signed-off-by: Ting Shen Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1692364 Reviewed-by: Nicolas Boichat Commit-Queue: Ting Shen Tested-by: Ting Shen --- board/kukui/battery.c | 3 --- board/kukui/board.c | 34 ++-------------------------------- board/kukui/usb_pd_policy.c | 6 ++---- 3 files changed, 4 insertions(+), 39 deletions(-) (limited to 'board') diff --git a/board/kukui/battery.c b/board/kukui/battery.c index 8cf9299f41..62f73bfa34 100644 --- a/board/kukui/battery.c +++ b/board/kukui/battery.c @@ -262,9 +262,6 @@ DECLARE_HOOK(HOOK_BATTERY_SOC_CHANGE, board_charge_termination, HOOK_PRIO_DEFAULT); -/* Customs options controllable by host command. */ -#define PARAM_FASTCHARGE (CS_PARAM_CUSTOM_PROFILE_MIN + 0) - enum ec_status charger_profile_override_get_param(uint32_t param, uint32_t *value) { diff --git a/board/kukui/board.c b/board/kukui/board.c index 322e5a2707..5b44578362 100644 --- a/board/kukui/board.c +++ b/board/kukui/board.c @@ -21,7 +21,6 @@ #include "driver/charger/rt946x.h" #include "driver/sync.h" #include "driver/tcpm/mt6370.h" -#include "driver/temp_sensor/tmp432.h" #include "ec_commands.h" #include "extpower.h" #include "gpio.h" @@ -35,13 +34,9 @@ #include "pwm_chip.h" #include "registers.h" #include "spi.h" -#include "switch.h" #include "system.h" #include "task.h" #include "tcpm.h" -#include "temp_sensor.h" -#include "temp_sensor_chip.h" -#include "thermal.h" #include "timer.h" #include "usb_charge.h" #include "usb_mux.h" @@ -94,30 +89,6 @@ const struct power_signal_info power_signal_list[] = { }; BUILD_ASSERT(ARRAY_SIZE(power_signal_list) == POWER_SIGNAL_COUNT); -#ifdef CONFIG_TEMP_SENSOR_TMP432 -/* Temperature sensors data; must be in same order as enum temp_sensor_id. */ -const struct temp_sensor_t temp_sensors[] = { - {"TMP432_Internal", TEMP_SENSOR_TYPE_BOARD, tmp432_get_val, - TMP432_IDX_LOCAL, 4}, - {"TMP432_Sensor_1", TEMP_SENSOR_TYPE_BOARD, tmp432_get_val, - TMP432_IDX_REMOTE1, 4}, - {"TMP432_Sensor_2", TEMP_SENSOR_TYPE_BOARD, tmp432_get_val, - TMP432_IDX_REMOTE2, 4}, -}; -BUILD_ASSERT(ARRAY_SIZE(temp_sensors) == TEMP_SENSOR_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. - */ -struct ec_thermal_config thermal_params[] = { - {{0, 0, 0}, 0, 0}, /* TMP432_Internal */ - {{0, 0, 0}, 0, 0}, /* TMP432_Sensor_1 */ - {{0, 0, 0}, 0, 0}, /* TMP432_Sensor_2 */ -}; -BUILD_ASSERT(ARRAY_SIZE(thermal_params) == TEMP_SENSOR_COUNT); -#endif - /******************************************************************************/ /* SPI devices */ const struct spi_device_t spi_devices[] = { @@ -314,15 +285,14 @@ DECLARE_HOOK(HOOK_INIT, board_init, HOOK_PRIO_DEFAULT); static void board_rev_init(void) { /* Board revision specific configs. */ -#ifdef BOARD_KUKUI + /* * It's a P1 pin BOOTBLOCK_MUX_OE, also a P2 pin BC12_DET_EN. * Keep this pin defaults to P1 setting since that eMMC enabled with * High-Z stat. */ - if (board_get_version() == 1) + if (IS_ENABLED(BOARD_KUKUI) && board_get_version() == 1) gpio_set_flags(GPIO_BC12_DET_EN, GPIO_ODR_HIGH); -#endif if (board_get_version() >= 2) { /* diff --git a/board/kukui/usb_pd_policy.c b/board/kukui/usb_pd_policy.c index b61664043e..551fa18e1f 100644 --- a/board/kukui/usb_pd_policy.c +++ b/board/kukui/usb_pd_policy.c @@ -3,7 +3,6 @@ * found in the LICENSE file. */ -#include "atomic.h" #include "charger.h" #include "charge_manager.h" #include "common.h" @@ -55,11 +54,10 @@ void pd_transition_voltage(int idx) static int board_get_polarity(int port) { -#ifdef BOARD_KRANE /* Krane's aux mux polarity is reversed. Workaround to flip it back. */ - if (board_get_version() == 3) + if (IS_ENABLED(BOARD_KRANE) && board_get_version() == 3) return !pd_get_polarity(port); -#endif + return pd_get_polarity(port); } -- cgit v1.2.1