diff options
author | Bill Richardson <wfrichar@chromium.org> | 2013-06-06 09:46:29 -0700 |
---|---|---|
committer | ChromeBot <chrome-bot@google.com> | 2013-06-06 14:42:25 -0700 |
commit | 57c7d4103fd1319b9699784d1f08ef36f619a436 (patch) | |
tree | b510a708c00c190fa79ce5752676eb6182c49e01 /chip/lm4/i2c.c | |
parent | 4ff299e29da884c055c23044e307c523fd198b60 (diff) | |
download | chrome-ec-57c7d4103fd1319b9699784d1f08ef36f619a436.tar.gz |
Change i2c port configs to make BDS the special case, not Link.
This matches our reference design for the EC's i2c GPIOs.
BUG=none
BRANCH=none
TEST=none
Change-Id: I8320b6234e2db8d645d0c4d4e982e3817da9f5e7
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/57809
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'chip/lm4/i2c.c')
-rw-r--r-- | chip/lm4/i2c.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/chip/lm4/i2c.c b/chip/lm4/i2c.c index 6b43eb4a29..390e0eef8b 100644 --- a/chip/lm4/i2c.c +++ b/chip/lm4/i2c.c @@ -238,11 +238,18 @@ exit: } /** - * Configure GPIOs for the module. + * Configure I2C GPIOs for the module. */ -static void configure_gpio(void) +static void configure_i2c_gpios(void) { -#ifdef BOARD_link /* HEY: Slippy? */ +#ifdef BOARD_bds + /* PG6:7 = I2C5 SCL/SDA */ + gpio_set_alternate_function(LM4_GPIO_G, 0xc0, 3); + + /* Configure SDA as open-drain. SCL should not be open-drain, + * since it has an internal pull-up. */ + LM4_GPIO_ODR(LM4_GPIO_G) |= 0x80; +#else /* PA6:7 = I2C1 SCL/SDA; PB2:3 = I2C0 SCL/SDA; PB6:7 = I2C5 SCL/SDA */ gpio_set_alternate_function(LM4_GPIO_A, 0xc0, 3); gpio_set_alternate_function(LM4_GPIO_B, 0xcc, 3); @@ -251,13 +258,6 @@ static void configure_gpio(void) * since it has an internal pull-up. */ LM4_GPIO_ODR(LM4_GPIO_A) |= 0x80; LM4_GPIO_ODR(LM4_GPIO_B) |= 0x88; -#else - /* PG6:7 = I2C5 SCL/SDA */ - gpio_set_alternate_function(LM4_GPIO_G, 0xc0, 3); - - /* Configure SDA as open-drain. SCL should not be open-drain, - * since it has an internal pull-up. */ - LM4_GPIO_ODR(LM4_GPIO_G) |= 0x80; #endif } @@ -309,7 +309,7 @@ static void i2c_init(void) clock_wait_cycles(3); /* Configure GPIOs */ - configure_gpio(); + configure_i2c_gpios(); /* No tasks are waiting on ports */ for (i = 0; i < I2C_PORT_COUNT; i++) @@ -420,4 +420,3 @@ DECLARE_CONSOLE_COMMAND(i2cread, command_i2cread, "port addr [count]", "Read from I2C", NULL); - |