i2c: Enable arbitration GPIOs only when active

Only setup the arbitration GPIOs when CONFIG_ARBITRATE_I2C is set.

BUG=chrome-os-partner:13064
BRANCH=snow
TEST=manual
build and boot on snow

On the EC:

> pmu 1000

In U-Boot:

cros_test i2c

See that there are no failures.

Change-Id: I8a7724700ff79406527c3db8708833728eb9a978
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/31305
This commit is contained in:
Simon Glass
2012-08-21 17:26:57 +01:00
committed by Gerrit
parent eb2348d05f
commit 581dd6a531
2 changed files with 9 additions and 4 deletions

View File

@@ -55,11 +55,11 @@ const struct gpio_info gpio_list[GPIO_COUNT] = {
{"KB_IN07", GPIO_D, (1<<2), GPIO_KB_INPUT, matrix_interrupt},
/* Other inputs */
{"AC_PWRBTN_L", GPIO_A, (1<<0), GPIO_INT_BOTH, NULL},
{"SPI1_NSS", GPIO_A, (1<<4), GPIO_PULL_UP, NULL},
{"SPI1_NSS", GPIO_A, (1<<4), GPIO_DEFAULT, NULL},
/* Outputs */
{"AC_STATUS", GPIO_A, (1<<5), GPIO_DEFAULT, NULL},
{"SPI1_MISO", GPIO_A, (1<<6), GPIO_OUT_HIGH, NULL},
{"SPI1_MISO", GPIO_A, (1<<6), GPIO_DEFAULT, NULL},
{"EN_PP1350", GPIO_A, (1<<2), GPIO_OUT_LOW, NULL},
{"EN_PP5000", GPIO_A, (1<<11), GPIO_OUT_LOW, NULL},
{"EN_PP3300", GPIO_A, (1<<8), GPIO_OUT_LOW, NULL},
@@ -149,6 +149,10 @@ void configure_board_late(void)
#ifdef CONFIG_AC_POWER_STATUS
gpio_set_flags(GPIO_AC_STATUS, GPIO_OUT_HIGH);
#endif
#ifdef CONFIG_ARBITRATE_I2C
gpio_set_flags(GPIO_AP_CLAIM, GPIO_PULL_UP);
gpio_set_flags(GPIO_EC_CLAIM, GPIO_OUT_HIGH);
#endif
}
void board_interrupt_host(int active)
@@ -205,8 +209,6 @@ enum {
};
#ifdef CONFIG_ARBITRATE_I2C
#define GPIO_AP_CLAIM GPIO_SPI1_NSS
#define GPIO_EC_CLAIM GPIO_SPI1_MISO
int board_i2c_claim(int port)
{

View File

@@ -54,6 +54,9 @@
#define I2C_PORT_SLAVE 1
#define CONFIG_ARBITRATE_I2C I2C_PORT_HOST
#define GPIO_AP_CLAIM GPIO_SPI1_NSS /* AP claims bus */
#define GPIO_EC_CLAIM GPIO_SPI1_MISO /* EC claims bus */
#define CONFIG_CMD_PMU
/* GPIO signal list */