summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRandall Spangler <rspangler@chromium.org>2013-08-07 09:53:37 -0700
committerChromeBot <chrome-bot@google.com>2013-08-08 13:51:30 -0700
commitef8637938e2e971ebdc80d8bb16ddddec983624c (patch)
tree1da74bb83c073d2477d100bc6219b5cba9c6bc9e
parent0723d65ea3dc0d743cddb7c4e781428367dc1cf7 (diff)
downloadchrome-ec-ef8637938e2e971ebdc80d8bb16ddddec983624c.tar.gz
daisy: remove I2C port detection
Daisy systems are few and far between, and not actively used for development now that we have pit. Remove the I2C port detection which was used for early systems, and just hard-code the port value to the one on my daisy. BUG=chrome-os-partner:10622 BRANCH=none TEST=boot daisy Change-Id: I981a51448899f75437f35dc2aa84a0556c0018eb Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/64958 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
-rw-r--r--board/daisy/board.c40
-rw-r--r--board/daisy/board.h8
-rw-r--r--include/config.h1
3 files changed, 2 insertions, 47 deletions
diff --git a/board/daisy/board.c b/board/daisy/board.c
index 2a6eb6e3a5..eb1769916d 100644
--- a/board/daisy/board.c
+++ b/board/daisy/board.c
@@ -126,46 +126,6 @@ const struct i2c_port_t i2c_ports[] = {
};
BUILD_ASSERT(ARRAY_SIZE(i2c_ports) == I2C_PORTS_USED);
-/* Auto detect I2C host port
- * Daisy board has two I2C ports, I2C1(0) and I2C2(1), that can be configured
- * as host. PMU chip is connected directly to the EC, and hence can be used
- * for port detection
- */
-#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, &reg);
-
- 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 keyboard_suppress_noise(void)
{
/* notify audio codec of keypress for noise suppression */
diff --git a/board/daisy/board.h b/board/daisy/board.h
index c2af3ef525..f5fbf656a0 100644
--- a/board/daisy/board.h
+++ b/board/daisy/board.h
@@ -18,7 +18,6 @@
#define CONFIG_CHIPSET_GAIA
#endif
#define CONFIG_I2C
-#define CONFIG_I2C_HOST_AUTO
#define CONFIG_KEYBOARD_PROTOCOL_MKBP
#define CONFIG_KEYBOARD_SUPPRESS_NOISE
#define CONFIG_PMU_TPS65090
@@ -51,11 +50,11 @@ enum module_id {
#define KB_OUT_PORT_LIST GPIO_B, GPIO_C
/* Charging */
-#define I2C_PORT_HOST board_i2c_host_port()
+#define I2C_PORT_HOST 0 /* Note: some Daisy systems used port 1 */
#define I2C_PORT_BATTERY I2C_PORT_HOST
#define I2C_PORT_CHARGER I2C_PORT_HOST
#define I2C_PORT_SLAVE 1
-#define I2C_PORTS_USED 2 /* Since host could be on either 0 or 1 */
+#define I2C_PORTS_USED 2
/* Timer selection */
#define TIM_CLOCK_MSB 3
@@ -117,9 +116,6 @@ enum gpio_signal {
GPIO_COUNT
};
-/* Auto detect EC i2c host port */
-int board_i2c_host_port(void);
-
#endif /* !__ASSEMBLER__ */
#endif /* __BOARD_H */
diff --git a/include/config.h b/include/config.h
index 1e9173f164..483a7e16b7 100644
--- a/include/config.h
+++ b/include/config.h
@@ -336,7 +336,6 @@
#undef CONFIG_I2C_ARBITRATION
#undef CONFIG_I2C_DEBUG
#undef CONFIG_I2C_DEBUG_PASSTHRU
-#undef CONFIG_I2C_HOST_AUTO
#undef CONFIG_I2C_PASSTHROUGH
#undef CONFIG_I2C_PASSTHRU_RESTRICTED