From 25e1ebf671c60f59bb9110b7825c90a67f67692c Mon Sep 17 00:00:00 2001 From: Rong Chang Date: Mon, 30 Jul 2012 20:22:00 +0800 Subject: Revert "Enable snow I2C host auto detection" This reverts commit 024c44cd96bf97e81d4d3af45a0f0cb0ef1425a0. board/snow/board.c board/snow/board.h Signed-off-by: Rong Chang BUG=chrome-os-partner:10622 TEST=build snow ec image without warning Change-Id: I65660383873907722933b41249e17dd1f83d8fde Reviewed-on: https://gerrit.chromium.org/gerrit/28698 Commit-Ready: Rong Chang Tested-by: Rong Chang Reviewed-by: Vincent Palatin --- board/snow/board.c | 35 ----------------------------------- board/snow/board.h | 5 ----- 2 files changed, 40 deletions(-) diff --git a/board/snow/board.c b/board/snow/board.c index d9a3d0cc20..b3fa050ecf 100644 --- a/board/snow/board.c +++ b/board/snow/board.c @@ -80,41 +80,6 @@ const struct gpio_info gpio_list[GPIO_COUNT] = { {"KB_OUT12", GPIO_C, (1<<7), GPIO_KB_OUTPUT, NULL}, }; -#ifdef CONFIG_I2C_HOST_AUTO -static int i2c_host_port = -1; - -/* Detect if tps65090 pmu is present on a i2c bus. - * This hack makes one single ec binary to work on boards with different - * stuffing options. - * - * TODO: Revert i2c host port detection after all dev boards been reworked or - * deprecated. Issue: http://crosbug.com/p/10622 - */ -static int tps65090_is_present(int bus) -{ - const int tps65090_addr = 0x90; - const int charger_ctrl_offset0 = 4; - int rv, reg; - - rv = i2c_read8(bus, tps65090_addr, charger_ctrl_offset0, ®); - - if (rv == EC_SUCCESS) - return 1; - return 0; -} - -int board_i2c_host_port(void) -{ - /* Default I2C host configuration is I2C1(0). - * If PMU doesn't ack on I2C2(1), set the host port to 0. - */ - if (i2c_host_port == -1) - i2c_host_port = tps65090_is_present(1) ? 1 : 0; - - return i2c_host_port; -} -#endif /* CONFIG_I2C_HOST_AUTO */ - void configure_board(void) { uint32_t val; diff --git a/board/snow/board.h b/board/snow/board.h index 3bba2ec48e..983a20738e 100644 --- a/board/snow/board.h +++ b/board/snow/board.h @@ -47,8 +47,6 @@ #define CONFIG_SMART_BATTERY #define CONFIG_PMU_TPS65090 #define CONFIG_PMU_BOARD_INIT -/* #define CONFIG_I2C_HOST_AUTO */ -/* #define I2C_PORT_HOST board_i2c_host_port() */ #define I2C_PORT_HOST 1 #define I2C_PORT_BATTERY I2C_PORT_HOST #define I2C_PORT_CHARGER I2C_PORT_HOST @@ -112,9 +110,6 @@ void matrix_interrupt(enum gpio_signal signal); /* Signal to AP that data is waiting */ void board_interrupt_host(int active); -/* Auto detect EC i2c host port */ -int board_i2c_host_port(void); - /* Initialize PMU registers using board settings */ void board_pmu_init(void); -- cgit v1.2.1