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>
This commit is contained in:
Randall Spangler
2013-08-07 09:53:37 -07:00
committed by ChromeBot
parent 0723d65ea3
commit ef8637938e
3 changed files with 2 additions and 47 deletions

View File

@@ -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 */

View File

@@ -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 */

View File

@@ -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